deepline 0.3.416 → 0.3.417

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 (111) hide show
  1. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  2. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +18 -0
  3. package/dist/bundling-sources/shared_libs/product-notifications/billing-sales.ts +6 -1
  4. package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +53 -32
  5. package/dist/bundling-sources/shared_libs/product-notifications/default-policy.ts +1 -1
  6. package/dist/bundling-sources/shared_libs/product-notifications/events.ts +14 -0
  7. package/dist/bundling-sources/shared_libs/security/receipt-admission-token.ts +64 -9
  8. package/dist/cli/{auth-FLYZAZ7I.mjs → auth-2WNDS7OY.mjs} +4 -4
  9. package/dist/cli/auth-3NIULVL4.js +40 -0
  10. package/dist/cli/{billing-XZ62L6ZE.mjs → billing-4Z7QGTTO.mjs} +4 -4
  11. package/dist/cli/{billing-SVGZSMBY.js → billing-P26TYS3F.js} +73 -73
  12. package/dist/cli/{chunk-FFEA6KAB.mjs → chunk-2HQOCIFE.mjs} +2 -2
  13. package/dist/cli/{chunk-YK3XHX7G.js → chunk-3FPDXTYQ.js} +16 -16
  14. package/dist/cli/{chunk-G3WJWD4R.mjs → chunk-3U6CYHMT.mjs} +1 -1
  15. package/dist/cli/{chunk-NWPC3FUA.js → chunk-5D477CAK.js} +8 -8
  16. package/dist/cli/{chunk-DT36JAAX.mjs → chunk-723EDOP2.mjs} +2 -2
  17. package/dist/cli/{chunk-WL3MI252.js → chunk-A3G7FZXB.js} +35 -35
  18. package/dist/cli/{chunk-2DRO4YWM.js → chunk-C3YRH3EQ.js} +2 -2
  19. package/dist/cli/{chunk-NPFMAFUC.mjs → chunk-CCRV2MCO.mjs} +1 -1
  20. package/dist/cli/{chunk-PH6OXQC7.mjs → chunk-ECKCIGJC.mjs} +1 -1
  21. package/dist/cli/{chunk-F5KJFBDA.js → chunk-EHGFSE44.js} +1 -1
  22. package/dist/cli/{chunk-ZMQTLPLJ.mjs → chunk-GRIE5VE3.mjs} +1 -1
  23. package/dist/cli/{chunk-2MQJODFQ.mjs → chunk-H25KUAJM.mjs} +1 -1
  24. package/dist/cli/{chunk-ERPU6HBQ.mjs → chunk-H67BP5SQ.mjs} +3 -3
  25. package/dist/cli/{chunk-XUMHZPE3.mjs → chunk-IHHPUALO.mjs} +1 -1
  26. package/dist/cli/{chunk-ESUBIEVT.js → chunk-IX6CRC7R.js} +6 -6
  27. package/dist/cli/{chunk-MRL2OMZY.js → chunk-L5YPTOLF.js} +10 -10
  28. package/dist/cli/{chunk-7OLAGY3W.mjs → chunk-MRBM5H5V.mjs} +4 -4
  29. package/dist/cli/{chunk-XP6LSFCW.mjs → chunk-NATVQHG6.mjs} +5 -5
  30. package/dist/cli/{chunk-UXLXZN2F.js → chunk-OLCY3CTW.js} +2 -2
  31. package/dist/cli/{chunk-UJTWIOQK.js → chunk-OW7VBN4Q.js} +6 -6
  32. package/dist/cli/{chunk-E5FNJE3Y.js → chunk-QLP4Z6JG.js} +4 -4
  33. package/dist/cli/{chunk-TOIDV6Q4.js → chunk-QS7WRPCP.js} +50 -50
  34. package/dist/cli/{chunk-ZCO7R65D.js → chunk-R7HAELOE.js} +52 -52
  35. package/dist/cli/{chunk-Q6MUMX2G.mjs → chunk-RRBYMSN6.mjs} +2 -2
  36. package/dist/cli/{chunk-DBMALDT3.mjs → chunk-TNFYPFMU.mjs} +8 -8
  37. package/dist/cli/{chunk-4R3TJDWD.js → chunk-ULGMHMTD.js} +8 -8
  38. package/dist/cli/{chunk-ENBTCBGT.mjs → chunk-W2DLQJ35.mjs} +3 -3
  39. package/dist/cli/{chunk-MT7VPFMN.mjs → chunk-WRM2OWWT.mjs} +2 -2
  40. package/dist/cli/{chunk-LFUGXKJW.js → chunk-Y2HY7GL3.js} +20 -20
  41. package/dist/cli/{chunk-YCAMTIYM.js → chunk-YGZV4IVP.js} +79 -79
  42. package/dist/cli/{chunk-6GYQG6V3.mjs → chunk-Z7IVSY3A.mjs} +3 -3
  43. package/dist/cli/{chunk-TXLZ6BJC.js → chunk-ZJFUKGDR.js} +26 -26
  44. package/dist/cli/{csv-X72WTTMT.js → csv-PHHEOCRC.js} +12 -12
  45. package/dist/cli/{csv-4TAHSCJO.mjs → csv-UKZDQDD5.mjs} +3 -3
  46. package/dist/cli/{db-3LIMAM2U.js → db-DUMQYDPZ.js} +25 -25
  47. package/dist/cli/{db-CK3WE7QC.mjs → db-K3N4AJHP.mjs} +4 -4
  48. package/dist/cli/{describe-FW6XZCFK.mjs → describe-LYS7YLGP.mjs} +12 -12
  49. package/dist/cli/{describe-H2Z2VKU2.js → describe-RSQAAZWX.js} +16 -16
  50. package/dist/cli/describe-core.d.mts +1 -1
  51. package/dist/cli/describe-core.d.ts +1 -1
  52. package/dist/cli/{executions-VXGO3GSE.mjs → executions-A7OT35MH.mjs} +4 -4
  53. package/dist/cli/{executions-X7SXKMAI.js → executions-FQI2EGXY.js} +6 -6
  54. package/dist/cli/{feedback-KTDQHUNJ.mjs → feedback-E77JS5G4.mjs} +3 -3
  55. package/dist/cli/{feedback-6I3NFUPV.js → feedback-EGTCQ4VW.js} +7 -7
  56. package/dist/cli/git-PHGV243L.js +24 -0
  57. package/dist/cli/{git-ODZASGIK.mjs → git-Y66QSXUA.mjs} +4 -4
  58. package/dist/cli/index.js +131 -131
  59. package/dist/cli/index.mjs +36 -36
  60. package/dist/cli/{legacy-noops-HLVQGZ72.js → legacy-noops-BUEO7ZIG.js} +7 -7
  61. package/dist/cli/{legacy-noops-KNGT6U3L.mjs → legacy-noops-E7NYDS2S.mjs} +4 -4
  62. package/dist/cli/{monitors-3F5EZCMB.js → monitors-IGOA4L5O.js} +84 -84
  63. package/dist/cli/{monitors-JLGADUE5.mjs → monitors-YGX7XZHL.mjs} +4 -4
  64. package/dist/cli/{org-D7AW6LIR.mjs → org-IUCMNFCG.mjs} +4 -4
  65. package/dist/cli/{org-Z4LPCJII.js → org-QOVN4IJE.js} +64 -64
  66. package/dist/cli/{play-MO3SAHDS.mjs → play-BASBWJY7.mjs} +10 -10
  67. package/dist/cli/{play-UBNDV57A.js → play-GCQETZW6.js} +283 -283
  68. package/dist/cli/{providers-QCBNQY4A.mjs → providers-RF7LEMAP.mjs} +4 -4
  69. package/dist/cli/{providers-SL6ZSEDI.js → providers-VC5QBJZ3.js} +7 -7
  70. package/dist/cli/{quickstart-YGFVF6VL.js → quickstart-64EULHRG.js} +5 -5
  71. package/dist/cli/{quickstart-K7J4YOTE.mjs → quickstart-7GAOQSQA.mjs} +3 -3
  72. package/dist/cli/search-7TOXLL4V.js +30 -0
  73. package/dist/cli/{search-DVE6TKQ3.mjs → search-UOMJJUVT.mjs} +5 -5
  74. package/dist/cli/{secrets-G7ZMCH5J.js → secrets-GGXQOSGV.js} +13 -13
  75. package/dist/cli/{secrets-JOVBXCUR.mjs → secrets-MIIKANZ7.mjs} +4 -4
  76. package/dist/cli/{sessions-QQV7FO4Y.js → sessions-L7OMZEPU.js} +5 -5
  77. package/dist/cli/{sessions-NA5POIR5.mjs → sessions-VQENKFWC.mjs} +4 -4
  78. package/dist/cli/{settings-XGFHXFCJ.js → settings-GKI7CZ62.js} +75 -75
  79. package/dist/cli/{settings-AM44HC2C.mjs → settings-JCJPJCKF.mjs} +8 -8
  80. package/dist/cli/{setup-RUBLF452.mjs → setup-BN25RDMT.mjs} +7 -7
  81. package/dist/cli/{setup-DA4TSWCY.js → setup-P4AM7K34.js} +42 -42
  82. package/dist/cli/{skills-TRG55YOF.mjs → skills-3M2OV4EQ.mjs} +5 -5
  83. package/dist/cli/skills-NGE2YPQJ.js +29 -0
  84. package/dist/cli/{tools-CEEA7DU4.mjs → tools-337Y5WWW.mjs} +12 -12
  85. package/dist/cli/tools-ROHOYYLK.js +44 -0
  86. package/dist/cli/update-6ZC2XCW6.js +31 -0
  87. package/dist/cli/{update-Y5GSWR67.mjs → update-A3Y6PY7O.mjs} +7 -7
  88. package/dist/cli/{workflow-74I6RNJR.mjs → workflow-LPO25MX7.mjs} +5 -5
  89. package/dist/cli/{workflow-D2VHQKJB.js → workflow-XQATHEOS.js} +15 -15
  90. package/dist/{client-D2A39edb.d.mts → client-CNfY1AzH.d.mts} +57 -13
  91. package/dist/{client-D6w0_gN1.d.ts → client-CNjtvsqn.d.ts} +57 -13
  92. package/dist/index.d.mts +2 -2
  93. package/dist/index.d.ts +2 -2
  94. package/dist/index.js +6 -6
  95. package/dist/index.mjs +3 -3
  96. package/dist/install-integrity.json +80 -80
  97. package/dist/plays/play-description.d.mts +1 -1
  98. package/dist/plays/play-description.d.ts +1 -1
  99. package/dist/plays/run-request.d.mts +1 -1
  100. package/dist/plays/run-request.d.ts +1 -1
  101. package/dist/release.d.mts +1 -1
  102. package/dist/release.d.ts +1 -1
  103. package/dist/release.js +2 -2
  104. package/dist/release.mjs +1 -1
  105. package/package.json +1 -1
  106. package/dist/cli/auth-BNQP4UYQ.js +0 -40
  107. package/dist/cli/git-LLP4T6XB.js +0 -24
  108. package/dist/cli/search-V4HNFZRE.js +0 -30
  109. package/dist/cli/skills-6AQTCBTF.js +0 -29
  110. package/dist/cli/tools-JLPTH7TF.js +0 -44
  111. package/dist/cli/update-EKEBZDIX.js +0 -31
@@ -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.416',
208
+ version: '0.3.417',
209
209
  updateSummary: {
210
210
  introducedIn: '0.3.90',
211
211
  summary:
@@ -1447,5 +1447,23 @@
1447
1447
  "runTimeoutMs": 300000,
1448
1448
  "failureAlert": "convex_action_wrapper",
1449
1449
  "domainReportRequired": true
1450
+ },
1451
+ {
1452
+ "id": "convex.billing-credit-delivery-watchdog",
1453
+ "name": "Billing credit delivery watchdog",
1454
+ "scheduler": "convex_scheduled_action",
1455
+ "cadence": "runAfter at 30 and 120 seconds per paid invoice",
1456
+ "timezone": "UTC",
1457
+ "source": "packages/convex/scheduledJobsNode.ts",
1458
+ "locator": "checkBillingInvoiceDelivery",
1459
+ "owner": "billing",
1460
+ "criticality": "critical",
1461
+ "purpose": "Observe paid-invoice credit delivery independently of renewal operations and admit the shared direct Slack alert.",
1462
+ "successDefinition": "The invoice is verified delivered, outside scope, or a missing-credit alert is durably admitted.",
1463
+ "failureDefinition": "Payment or credit evidence cannot be verified, or observation/notification admission fails.",
1464
+ "startGraceMs": 120000,
1465
+ "runTimeoutMs": 60000,
1466
+ "failureAlert": "convex_action_wrapper",
1467
+ "domainReportRequired": true
1450
1468
  }
1451
1469
  ]
@@ -4,10 +4,15 @@ export const BILLING_SALES_SLACK_CHANNEL_ID = 'C0AGWVD2TNK';
4
4
  export const BILLING_SALES_CONNECTION_ID = 'platform-reporting-bot';
5
5
  export const BILLING_SALES_CREDIT_PURCHASE_MINIMUM_CENTS = 1;
6
6
  export const BILLING_PURCHASE_LATE_RULE_KEY = 'internal.billing.purchase_late';
7
+ export const BILLING_RENEWAL_LATE_RULE_KEY = 'internal.billing.renewal_late';
8
+ export const BILLING_DELIVERY_LATE_RULE_KEYS: readonly string[] = [
9
+ BILLING_PURCHASE_LATE_RULE_KEY,
10
+ BILLING_RENEWAL_LATE_RULE_KEY,
11
+ ];
7
12
  export const BILLING_SALES_RULE_KEYS: readonly string[] = [
8
13
  'internal.billing.credit_purchase',
9
14
  'internal.billing.paid_plan',
10
- BILLING_PURCHASE_LATE_RULE_KEY,
15
+ ...BILLING_DELIVERY_LATE_RULE_KEYS,
11
16
  ];
12
17
 
13
18
  export function isPlatformNotificationGroup(groupKey: string): boolean {
@@ -15,6 +15,7 @@ import { legacySlackNotificationType } from './legacy-slack';
15
15
  import type { NotificationText } from './content';
16
16
  import {
17
17
  BILLING_PURCHASE_LATE_RULE_KEY,
18
+ BILLING_RENEWAL_LATE_RULE_KEY,
18
19
  BILLING_SALES_CREDIT_PURCHASE_MINIMUM_CENTS,
19
20
  BILLING_SALES_GROUP_KEY,
20
21
  } from './billing-sales';
@@ -273,6 +274,46 @@ const GROWTH_LEARN_MORE_DETAILS: NotificationText[] = [
273
274
  ];
274
275
 
275
276
  /** One canonical registry owns every notification type's runtime and UI metadata. */
277
+ function lateCreditDeliveryRegistration<Id extends string>(
278
+ id: Id,
279
+ eventName: ProductNotificationEventName,
280
+ label: 'Purchase' | 'Renewal',
281
+ identityField: 'operationId' | 'stripeInvoiceId',
282
+ ) {
283
+ return {
284
+ id,
285
+ eventName,
286
+ requiredFilter: {},
287
+ allowedTriggers: ['each_match'],
288
+ catalog: undefined,
289
+ shadow: true,
290
+ rule: {
291
+ default: { ruleKey: id, groupKey: BILLING_SALES_GROUP_KEY },
292
+ create: (_input, base) => ({
293
+ ...base,
294
+ repeatMode: 'every_match',
295
+ trigger: { kind: 'each_match' },
296
+ }),
297
+ present: ({ payload }) => ({
298
+ title: `${label} not completed after ${payload.thresholdSeconds} seconds`,
299
+ summary: [
300
+ `<!channel> ${label} fulfillment in `,
301
+ { workspace: true },
302
+ ' needs investigation. Verify payment and fulfillment independently.',
303
+ ],
304
+ details: [
305
+ `${label === 'Purchase' ? 'Operation' : 'Stripe invoice'}: ${payload[identityField]}`,
306
+ ],
307
+ targetUrl: String(payload.targetUrl),
308
+ subjectKind:
309
+ label === 'Purchase' ? 'billing_operation' : 'billing_invoice',
310
+ subjectId: String(payload[identityField]),
311
+ severity: 'error',
312
+ }),
313
+ },
314
+ } satisfies NotificationTypeRegistration;
315
+ }
316
+
276
317
  const PRODUCT_NOTIFICATION_TYPE_REGISTRY = [
277
318
  {
278
319
  id: 'monitor.disabled.insufficient_credits',
@@ -816,38 +857,18 @@ const PRODUCT_NOTIFICATION_TYPE_REGISTRY = [
816
857
  }),
817
858
  },
818
859
  },
819
- {
820
- id: BILLING_PURCHASE_LATE_RULE_KEY,
821
- eventName: ProductNotificationEvent.BillingPurchaseLate,
822
- requiredFilter: {},
823
- allowedTriggers: ['each_match'],
824
- catalog: undefined,
825
- shadow: true,
826
- rule: {
827
- default: {
828
- ruleKey: BILLING_PURCHASE_LATE_RULE_KEY,
829
- groupKey: BILLING_SALES_GROUP_KEY,
830
- },
831
- create: (_input, base) => ({
832
- ...base,
833
- repeatMode: 'every_match',
834
- trigger: { kind: 'each_match' },
835
- }),
836
- present: ({ payload }) => ({
837
- title: `Purchase not completed after ${payload.thresholdSeconds} seconds`,
838
- summary: [
839
- '<!channel> Purchase fulfillment in ',
840
- { workspace: true },
841
- ' needs investigation. Verify payment and fulfillment independently.',
842
- ],
843
- details: [`Operation: ${payload.operationId}`],
844
- targetUrl: String(payload.targetUrl),
845
- subjectKind: 'billing_operation',
846
- subjectId: String(payload.operationId),
847
- severity: 'error',
848
- }),
849
- },
850
- },
860
+ lateCreditDeliveryRegistration(
861
+ BILLING_PURCHASE_LATE_RULE_KEY,
862
+ ProductNotificationEvent.BillingPurchaseLate,
863
+ 'Purchase',
864
+ 'operationId',
865
+ ),
866
+ lateCreditDeliveryRegistration(
867
+ BILLING_RENEWAL_LATE_RULE_KEY,
868
+ ProductNotificationEvent.BillingRenewalLate,
869
+ 'Renewal',
870
+ 'stripeInvoiceId',
871
+ ),
851
872
  {
852
873
  id: 'play.failed',
853
874
  eventName: ProductNotificationEvent.PlayRunCompleted,
@@ -20,7 +20,7 @@ import {
20
20
  * they create sparse copy-on-write overrides.
21
21
  */
22
22
  export const CURRENT_PRODUCT_NOTIFICATION_DEFAULT_POLICY = {
23
- version: 9,
23
+ version: 10,
24
24
  groups: [
25
25
  {
26
26
  groupKey: 'default',
@@ -21,6 +21,7 @@ export const ProductNotificationEvent = {
21
21
  AutoTopupLimitObserved: 'billing.auto_topup.limit_observed',
22
22
  BillingPlanPurchased: 'billing.plan.purchased',
23
23
  BillingPurchaseLate: 'billing.purchase.late',
24
+ BillingRenewalLate: 'billing.renewal.late',
24
25
  MonitorLifecycleChanged: 'monitor.lifecycle.changed',
25
26
  PlayLifecycleChanged: 'play.lifecycle.changed',
26
27
  PlayRunCompleted: 'play.run.completed',
@@ -64,6 +65,7 @@ export const PRODUCT_NOTIFICATION_EVENT_NAMES = [
64
65
  ProductNotificationEvent.CreditsPurchaseCompleted,
65
66
  ProductNotificationEvent.BillingPlanPurchased,
66
67
  ProductNotificationEvent.BillingPurchaseLate,
68
+ ProductNotificationEvent.BillingRenewalLate,
67
69
  ] as const;
68
70
 
69
71
  export const PRODUCT_NOTIFICATION_COMPATIBILITY_EVENT_NAMES = [
@@ -245,6 +247,18 @@ export const PRODUCT_NOTIFICATION_EVENT_DEFINITIONS: readonly ProductNotificatio
245
247
  orderingSubjectFact: 'operationId',
246
248
  allowedTriggers: ['each_match'],
247
249
  },
250
+ {
251
+ eventName: ProductNotificationEvent.BillingRenewalLate,
252
+ producerKey: ProductNotificationProducerKey.BillingPurchases,
253
+ requiredFacts: {
254
+ accountId: 'string',
255
+ stripeInvoiceId: 'string',
256
+ thresholdSeconds: 'number',
257
+ targetUrl: 'string',
258
+ },
259
+ orderingSubjectFact: 'stripeInvoiceId',
260
+ allowedTriggers: ['each_match'],
261
+ },
248
262
  ...PRODUCT_NOTIFICATION_COMPATIBILITY_EVENT_NAMES.map((eventName) => ({
249
263
  eventName,
250
264
  producerKey: ProductNotificationProducerKey.LegacyProductNotifications,
@@ -100,6 +100,26 @@ export async function verifyCreditReadinessToken(
100
100
  scanId: string;
101
101
  cursor: string | null;
102
102
  }> {
103
+ const claims = await verifyObservationToken(
104
+ token,
105
+ 'deepline.credit_readiness',
106
+ nowMs,
107
+ );
108
+ if (
109
+ typeof claims.scanId !== 'string' ||
110
+ !claims.scanId ||
111
+ (claims.cursor !== null &&
112
+ (typeof claims.cursor !== 'string' || !claims.cursor))
113
+ )
114
+ throw new Error('Invalid credit readiness token.');
115
+ return { scanId: claims.scanId, cursor: claims.cursor as string | null };
116
+ }
117
+
118
+ async function verifyObservationToken(
119
+ token: string,
120
+ audience: string,
121
+ nowMs: number,
122
+ ): Promise<Record<string, unknown>> {
103
123
  const parts = token.split('.');
104
124
  if (parts.length !== 3) throw new Error('Invalid credit readiness token.');
105
125
  const decode = (value: string) =>
@@ -126,11 +146,7 @@ export async function verifyCreditReadinessToken(
126
146
  header.typ !== 'JWT' ||
127
147
  claims.v !== TOKEN_VERSION ||
128
148
  claims.iss !== TOKEN_ISSUER ||
129
- claims.aud !== 'deepline.credit_readiness' ||
130
- typeof claims.scanId !== 'string' ||
131
- !claims.scanId ||
132
- (claims.cursor !== null &&
133
- (typeof claims.cursor !== 'string' || !claims.cursor)) ||
149
+ claims.aud !== audience ||
134
150
  !Number.isSafeInteger(claims.iat) ||
135
151
  !Number.isSafeInteger(claims.exp) ||
136
152
  claims.iat > now + 30 ||
@@ -138,10 +154,7 @@ export async function verifyCreditReadinessToken(
138
154
  claims.exp - claims.iat !== TOKEN_TTL_SECONDS
139
155
  )
140
156
  throw new Error('Invalid credit readiness token.');
141
- return {
142
- scanId: claims.scanId,
143
- cursor: claims.cursor,
144
- };
157
+ return claims as Record<string, unknown>;
145
158
  }
146
159
 
147
160
  /**
@@ -323,3 +336,45 @@ export async function mintSqlListenerDispatchRetryToken(input: {
323
336
  exp: issuedAt + TOKEN_TTL_SECONDS,
324
337
  });
325
338
  }
339
+
340
+ /** Authorizes one invoice/threshold observation, never a payment, grant or fleet scan. */
341
+ export async function mintBillingDeliveryToken(input: {
342
+ stripeInvoiceId: string;
343
+ thresholdSeconds: 30 | 120;
344
+ nowMs?: number;
345
+ }): Promise<string> {
346
+ const issuedAt = Math.floor((input.nowMs ?? Date.now()) / 1000);
347
+ return mint({
348
+ v: TOKEN_VERSION,
349
+ iss: TOKEN_ISSUER,
350
+ aud: 'deepline.billing_delivery',
351
+ stripeInvoiceId: input.stripeInvoiceId,
352
+ thresholdSeconds: input.thresholdSeconds,
353
+ iat: issuedAt,
354
+ exp: issuedAt + TOKEN_TTL_SECONDS,
355
+ });
356
+ }
357
+
358
+ export async function verifyBillingDeliveryToken(
359
+ token: string,
360
+ nowMs = Date.now(),
361
+ ): Promise<{
362
+ stripeInvoiceId: string;
363
+ thresholdSeconds: 30 | 120;
364
+ }> {
365
+ const claims = await verifyObservationToken(
366
+ token,
367
+ 'deepline.billing_delivery',
368
+ nowMs,
369
+ );
370
+ if (
371
+ typeof claims.stripeInvoiceId !== 'string' ||
372
+ !claims.stripeInvoiceId ||
373
+ (claims.thresholdSeconds !== 30 && claims.thresholdSeconds !== 120)
374
+ )
375
+ throw new Error('Invalid billing delivery token.');
376
+ return {
377
+ stripeInvoiceId: claims.stripeInvoiceId,
378
+ thresholdSeconds: claims.thresholdSeconds,
379
+ };
380
+ }
@@ -13,13 +13,13 @@ import {
13
13
  reportSetupCompleted,
14
14
  resolvePendingAuthClaimForResume,
15
15
  statusBannerLine
16
- } from "./chunk-FFEA6KAB.mjs";
17
- import "./chunk-NPFMAFUC.mjs";
18
- import "./chunk-2MQJODFQ.mjs";
16
+ } from "./chunk-2HQOCIFE.mjs";
17
+ import "./chunk-CCRV2MCO.mjs";
18
+ import "./chunk-H25KUAJM.mjs";
19
19
  import "./chunk-MAMVGOSC.mjs";
20
20
  import "./chunk-DLIRSHV6.mjs";
21
21
  import "./chunk-E4IXDAZI.mjs";
22
- import "./chunk-G3WJWD4R.mjs";
22
+ import "./chunk-3U6CYHMT.mjs";
23
23
  import "./chunk-WZYKRD7T.mjs";
24
24
  import "./chunk-KRD6H754.mjs";
25
25
  export {
@@ -0,0 +1,40 @@
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 _chunkQS7WRPCPjs = require('./chunk-QS7WRPCP.js');
17
+ require('./chunk-OW7VBN4Q.js');
18
+ require('./chunk-QLP4Z6JG.js');
19
+ require('./chunk-NPBJI7RE.js');
20
+ require('./chunk-XNYIZMNQ.js');
21
+ require('./chunk-PPDBRJRW.js');
22
+ require('./chunk-EHGFSE44.js');
23
+ require('./chunk-OG64RBAC.js');
24
+ require('./chunk-COGTRVWW.js');
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+ exports.EXIT_WORKSPACE_MISMATCH = _chunkQS7WRPCPjs.EXIT_WORKSPACE_MISMATCH; exports.authStatusLine = _chunkQS7WRPCPjs.authStatusLine; exports.clearPendingClaim = _chunkQS7WRPCPjs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunkQS7WRPCPjs.clearSatisfiedPendingClaim; exports.handleRegister = _chunkQS7WRPCPjs.handleRegister; exports.handleStatus = _chunkQS7WRPCPjs.handleStatus; exports.handleWait = _chunkQS7WRPCPjs.handleWait; exports.httpJson = _chunkQS7WRPCPjs.httpJson; exports.readPendingAuthClaim = _chunkQS7WRPCPjs.readPendingAuthClaim; exports.readStatusBanner = _chunkQS7WRPCPjs.readStatusBanner; exports.registerAuthCommands = _chunkQS7WRPCPjs.registerAuthCommands; exports.reportSetupCompleted = _chunkQS7WRPCPjs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunkQS7WRPCPjs.resolvePendingAuthClaimForResume; exports.statusBannerLine = _chunkQS7WRPCPjs.statusBannerLine;
@@ -2,7 +2,7 @@ import {
2
2
  DeeplineClient,
3
3
  iterateCursorPages,
4
4
  requireBillingIdempotencyKey
5
- } from "./chunk-PH6OXQC7.mjs";
5
+ } from "./chunk-ECKCIGJC.mjs";
6
6
  import "./chunk-L2VKAASU.mjs";
7
7
  import "./chunk-KCC3FKIW.mjs";
8
8
  import "./chunk-EIMG75BT.mjs";
@@ -13,8 +13,8 @@ import {
13
13
  openInBrowser,
14
14
  printCommandEnvelope,
15
15
  shouldEmitJson
16
- } from "./chunk-NPFMAFUC.mjs";
17
- import "./chunk-2MQJODFQ.mjs";
16
+ } from "./chunk-CCRV2MCO.mjs";
17
+ import "./chunk-H25KUAJM.mjs";
18
18
  import {
19
19
  AuthError,
20
20
  ConfigError
@@ -23,7 +23,7 @@ import "./chunk-DLIRSHV6.mjs";
23
23
  import {
24
24
  DeeplineError
25
25
  } from "./chunk-E4IXDAZI.mjs";
26
- import "./chunk-G3WJWD4R.mjs";
26
+ import "./chunk-3U6CYHMT.mjs";
27
27
  import "./chunk-WZYKRD7T.mjs";
28
28
  import "./chunk-KRD6H754.mjs";
29
29