deepline 0.3.304 → 0.3.305

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 (97) hide show
  1. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  2. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-pool.ts +1 -1
  3. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +51 -25
  4. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +10 -0
  5. package/dist/bundling-sources/shared_libs/product-notifications/billing-sales.ts +13 -0
  6. package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +69 -0
  7. package/dist/bundling-sources/shared_libs/product-notifications/default-policy.ts +26 -1
  8. package/dist/bundling-sources/shared_libs/product-notifications/events.ts +9 -1
  9. package/dist/cli/auth-WRUUITRZ.js +31 -0
  10. package/dist/cli/{auth-YKJHKHIQ.mjs → auth-XMYFUM5L.mjs} +4 -4
  11. package/dist/cli/{billing-EOIKAZES.js → billing-NDUDRJ7T.js} +70 -70
  12. package/dist/cli/{billing-XEEW5SV2.mjs → billing-RXT6NYAU.mjs} +4 -4
  13. package/dist/cli/{chunk-AOUGAM72.mjs → chunk-445RPDOQ.mjs} +2 -2
  14. package/dist/cli/{chunk-7HYH533G.mjs → chunk-44GHROVJ.mjs} +1 -1
  15. package/dist/cli/{chunk-DNBJRKVE.js → chunk-5UZQ75HD.js} +57 -57
  16. package/dist/cli/{chunk-7QV545D7.mjs → chunk-6C4SD4U3.mjs} +1 -1
  17. package/dist/cli/{chunk-JKY2QANB.mjs → chunk-AEMR2R5H.mjs} +4 -4
  18. package/dist/cli/{chunk-DOCDA2YP.js → chunk-B7PAZBJX.js} +4 -4
  19. package/dist/cli/{chunk-BBXO7APG.js → chunk-COMHSM6F.js} +6 -6
  20. package/dist/cli/{chunk-ZQSQCHG3.js → chunk-DNSTXIU4.js} +1 -1
  21. package/dist/cli/{chunk-NJS3RHQO.js → chunk-DY72E7K2.js} +6 -6
  22. package/dist/cli/{chunk-NC4JXVVS.js → chunk-E4YSOJ2H.js} +2 -2
  23. package/dist/cli/{chunk-TABL2Q6H.mjs → chunk-HELHRPU6.mjs} +2 -2
  24. package/dist/cli/{chunk-FDEU7UY7.js → chunk-KNHD6J3X.js} +6 -6
  25. package/dist/cli/{chunk-7OXXCRGZ.mjs → chunk-KNK42P4M.mjs} +1 -1
  26. package/dist/cli/{chunk-INOSSTSG.js → chunk-LUBEGHJC.js} +15 -15
  27. package/dist/cli/{chunk-YJ2QYYB5.mjs → chunk-LYPASDJJ.mjs} +1 -1
  28. package/dist/cli/{chunk-35SCWK4Y.mjs → chunk-QFSISXKO.mjs} +1 -1
  29. package/dist/cli/{chunk-JZWC4ES6.mjs → chunk-S3HPQWZ3.mjs} +1 -1
  30. package/dist/cli/{chunk-IHT6XITB.mjs → chunk-SCX2AZFY.mjs} +2 -2
  31. package/dist/cli/{chunk-NW7I3LDU.mjs → chunk-TGOAQTY3.mjs} +3 -3
  32. package/dist/cli/{chunk-USJBSNRI.js → chunk-UWDFJXBQ.js} +26 -26
  33. package/dist/cli/{chunk-7NQJDQPH.js → chunk-XZD3NYOL.js} +48 -48
  34. package/dist/cli/{chunk-KP5TOAI4.js → chunk-ZQOFBLJN.js} +6 -6
  35. package/dist/cli/client-KBAPBERE.js +20 -0
  36. package/dist/cli/{client-FZPHVNWV.mjs → client-WOHHEX5X.mjs} +3 -3
  37. package/dist/cli/{csv-CCHVZPRD.mjs → csv-WNPLDGFR.mjs} +3 -3
  38. package/dist/cli/{csv-ANJ4KSHF.js → csv-WZ5BOOT7.js} +12 -12
  39. package/dist/cli/{db-AE3MLMRF.js → db-GBK4QSIU.js} +20 -20
  40. package/dist/cli/{db-JFVR6STL.mjs → db-GCQJHGME.mjs} +4 -4
  41. package/dist/cli/{executions-DGX53UEW.js → executions-BAS6T2BN.js} +6 -6
  42. package/dist/cli/{executions-WNXCURLN.mjs → executions-MSB6FRNL.mjs} +4 -4
  43. package/dist/cli/{feedback-DGEFG6JI.js → feedback-UHOHIOPV.js} +6 -6
  44. package/dist/cli/{feedback-L4A66OA2.mjs → feedback-VREMIXAX.mjs} +3 -3
  45. package/dist/cli/git-6QYO4FQH.js +23 -0
  46. package/dist/cli/{git-LIZ3FGVR.mjs → git-GQKD556H.mjs} +4 -4
  47. package/dist/cli/index.js +73 -73
  48. package/dist/cli/index.mjs +30 -30
  49. package/dist/cli/{legacy-noops-L7GGGAOR.js → legacy-noops-PIL4KNVA.js} +7 -7
  50. package/dist/cli/{legacy-noops-UCKGOSJA.mjs → legacy-noops-RI2ROZ6U.mjs} +4 -4
  51. package/dist/cli/{monitors-NLMFDD4C.mjs → monitors-QHLEULAZ.mjs} +4 -4
  52. package/dist/cli/{monitors-NGACMMWV.js → monitors-UVQLZDIO.js} +85 -85
  53. package/dist/cli/{org-2OW6TPHF.mjs → org-BYWI4VI3.mjs} +4 -4
  54. package/dist/cli/{org-FJSCZ6S3.js → org-KXJJZOSK.js} +60 -60
  55. package/dist/cli/{play-GJC4AIAX.js → play-3XR54PQY.js} +200 -200
  56. package/dist/cli/{play-ZZ4AQLL5.mjs → play-WF7AJJ7J.mjs} +6 -6
  57. package/dist/cli/{providers-D7KLXB4S.js → providers-4FYRPS4E.js} +7 -7
  58. package/dist/cli/{providers-6BJNJUSG.mjs → providers-FG67H5N5.mjs} +4 -4
  59. package/dist/cli/{quickstart-6WYRYZJZ.js → quickstart-3YCFHVKY.js} +5 -5
  60. package/dist/cli/{quickstart-FH4NGHEJ.mjs → quickstart-IBWIR4LX.mjs} +3 -3
  61. package/dist/cli/{search-KOSJMN3U.js → search-6PQ4QBMC.js} +6 -6
  62. package/dist/cli/{search-SUT5XFI6.mjs → search-OZRXENTS.mjs} +5 -5
  63. package/dist/cli/{secrets-Y2OI2P7O.js → secrets-2JW5HCHH.js} +13 -13
  64. package/dist/cli/{secrets-QK5QP4YU.mjs → secrets-S3GIROJA.mjs} +4 -4
  65. package/dist/cli/{sessions-VQKZHOQJ.mjs → sessions-6HNVWH3C.mjs} +4 -4
  66. package/dist/cli/{sessions-MLDROWXY.js → sessions-AQQ6WHMK.js} +5 -5
  67. package/dist/cli/{settings-SPUINZYG.mjs → settings-6FINI54L.mjs} +7 -7
  68. package/dist/cli/{settings-6WOSPHBC.js → settings-HSHA2FO5.js} +74 -74
  69. package/dist/cli/{setup-E2UJV6PW.js → setup-O7FZ5EUD.js} +41 -41
  70. package/dist/cli/{setup-ZE2SDMC4.mjs → setup-XHIBSXCC.mjs} +6 -6
  71. package/dist/cli/skills-3ASRSEF2.js +28 -0
  72. package/dist/cli/{skills-OJYRPY2N.mjs → skills-ZFIIWR5G.mjs} +4 -4
  73. package/dist/cli/{tools-BNHRVKLA.js → tools-4B4NLVOJ.js} +50 -50
  74. package/dist/cli/{tools-O6EIDEKW.mjs → tools-WURPIECI.mjs} +5 -5
  75. package/dist/cli/{update-NWESWMYF.mjs → update-2THOPAUS.mjs} +6 -6
  76. package/dist/cli/update-7ZPTMO6H.js +28 -0
  77. package/dist/cli/{workflow-YJHXDD57.mjs → workflow-S2G453ZX.mjs} +5 -5
  78. package/dist/cli/{workflow-SAJAOPYE.js → workflow-XS5JSKED.js} +15 -15
  79. package/dist/{client-DjJfoW8r.d.ts → client-5Nsl0O0v.d.ts} +85 -0
  80. package/dist/{client-Me88eH3z.d.mts → client-BT11xxG8.d.mts} +85 -0
  81. package/dist/index.d.mts +2 -2
  82. package/dist/index.d.ts +2 -2
  83. package/dist/index.js +6 -6
  84. package/dist/index.mjs +3 -3
  85. package/dist/install-integrity.json +71 -70
  86. package/dist/plays/run-request.d.mts +1 -1
  87. package/dist/plays/run-request.d.ts +1 -1
  88. package/dist/release.d.mts +1 -1
  89. package/dist/release.d.ts +1 -1
  90. package/dist/release.js +2 -2
  91. package/dist/release.mjs +1 -1
  92. package/package.json +1 -1
  93. package/dist/cli/auth-UBWZC26A.js +0 -31
  94. package/dist/cli/client-IMFLPCD7.js +0 -20
  95. package/dist/cli/git-6QWUB6CR.js +0 -23
  96. package/dist/cli/skills-J3QIHO5L.js +0 -28
  97. package/dist/cli/update-TDOIF3C4.js +0 -28
@@ -200,7 +200,7 @@ export const SDK_RELEASE = {
200
200
  // getters keep their established compatibility behavior.
201
201
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
202
202
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
203
- version: '0.3.304',
203
+ version: '0.3.305',
204
204
  updateSummary:
205
205
  'Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.',
206
206
  packageCapabilities: {
@@ -1070,7 +1070,7 @@ export async function withRuntimeSchedulerClient<T>(
1070
1070
  let queryCount = 0;
1071
1071
  let queryMs = 0;
1072
1072
  try {
1073
- if (!entry.databasePoolAttached) {
1073
+ if (process.env.VERCEL?.trim() && !entry.databasePoolAttached) {
1074
1074
  attachDatabasePool(entry.pool);
1075
1075
  entry.databasePoolAttached = true;
1076
1076
  }
@@ -14701,8 +14701,10 @@ function terminalLogProjectionForOutbox(
14701
14701
  metadata: PlayLogMetadata | null;
14702
14702
  entryId: string | null;
14703
14703
  } => entry !== null,
14704
- )
14705
- .slice(-LOG_TAIL_LIMIT);
14704
+ );
14705
+ // This carrier is consumed into the paginated log store by the terminal
14706
+ // statement. The runner already bounds its envelope by bytes; applying the
14707
+ // status tail here loses retained lines when live delivery was interrupted.
14706
14708
  return {
14707
14709
  lines: entries.map((entry) => entry.line),
14708
14710
  lineContexts: entries.map((entry) => entry.context),
@@ -18091,10 +18093,10 @@ async function claimPostgresSchedulerOutboxPrefix(
18091
18093
  ? `owned_run AS MATERIALIZED (
18092
18094
  SELECT run_id FROM ${tableName('runs', options)}
18093
18095
  WHERE run_id = $2
18094
- -- This dispatcher already owns the head. A producer holding the run
18095
- -- lock is not a lost delivery lease: wait for its short transaction,
18096
- -- then revalidate the head below. New-run selection still skips locks.
18097
- FOR UPDATE
18096
+ -- The head is already owned. Wait for the producer, then revalidate
18097
+ -- its lease below; initial selection still skips unrelated busy runs.
18098
+ -- Child-row foreign-key share locks can coexist with this fence.
18099
+ FOR NO KEY UPDATE
18098
18100
  ),`
18099
18101
  : ''
18100
18102
  } head AS MATERIALIZED (
@@ -18117,7 +18119,7 @@ async function claimPostgresSchedulerOutboxPrefix(
18117
18119
  ${
18118
18120
  input.extendOwnedHead
18119
18121
  ? `AND candidate.event_id = $5
18120
- AND candidate.lease_owner = $3 AND candidate.lease_expires_at > now()`
18122
+ AND candidate.lease_owner = $3 AND candidate.lease_expires_at > clock_timestamp()`
18121
18123
  : ''
18122
18124
  }
18123
18125
  AND candidate.failed_at IS NULL
@@ -20340,23 +20342,47 @@ async function dispatchRunLedgerOutboxBatchWithScope(
20340
20342
  events.length === 1 &&
20341
20343
  first.eventType === RUN_SCHEDULER_OUTBOX_EVENT_TYPE.runEvents
20342
20344
  ) {
20343
- const widened = await withClient((client) =>
20344
- readPendingPostgresSchedulerOutboxEvents(
20345
- client,
20346
- {
20347
- runId: first.runId,
20348
- leaseOwner,
20349
- leaseSeconds: input.leaseSeconds ?? 120,
20350
- limit: Math.min(
20351
- RUN_LEDGER_PROJECTION_PREFIX_MAX_FACTS,
20352
- remainingEvents ?? RUN_LEDGER_PROJECTION_PREFIX_MAX_FACTS,
20353
- ),
20354
- allowIngressPrefix: true,
20355
- extendOwnedHead: first.eventId,
20356
- },
20357
- options,
20358
- ),
20359
- );
20345
+ const widened = await withClient(async (client) => {
20346
+ await client.query('BEGIN');
20347
+ try {
20348
+ await client.query(
20349
+ `SELECT set_config('lock_timeout', $1, true),
20350
+ set_config('statement_timeout', $2, true)`,
20351
+ [
20352
+ `${RUNTIME_SCHEDULER_CANCEL_LOCK_TIMEOUT_MS}ms`,
20353
+ `${RUNTIME_SCHEDULER_CANCEL_STATEMENT_TIMEOUT_MS}ms`,
20354
+ ],
20355
+ );
20356
+ // An owned head must extend from a fresh snapshot after the producer
20357
+ // commits. Keep the wait inside the existing SQL budget and permit
20358
+ // child-row foreign-key share locks under the ingress fence.
20359
+ await client.query(
20360
+ `SELECT run_id FROM ${tableName('runs', options)} WHERE run_id = $1 FOR NO KEY UPDATE`,
20361
+ [first.runId],
20362
+ );
20363
+ const prefix = await readPendingPostgresSchedulerOutboxEvents(
20364
+ client,
20365
+ {
20366
+ runId: first.runId,
20367
+ leaseOwner,
20368
+ leaseSeconds: input.leaseSeconds ?? 120,
20369
+ limit: Math.min(
20370
+ RUN_LEDGER_PROJECTION_PREFIX_MAX_FACTS,
20371
+ remainingEvents ?? RUN_LEDGER_PROJECTION_PREFIX_MAX_FACTS,
20372
+ ),
20373
+ allowIngressPrefix: true,
20374
+ extendOwnedHead: first.eventId,
20375
+ inTransaction: true,
20376
+ },
20377
+ options,
20378
+ );
20379
+ await client.query('COMMIT');
20380
+ return prefix;
20381
+ } catch (error) {
20382
+ await client.query('ROLLBACK');
20383
+ throw error;
20384
+ }
20385
+ });
20360
20386
  if (widened[0]?.eventId !== first.eventId) {
20361
20387
  throw new RunLedgerProjectionLeaseLostError(
20362
20388
  'head_lease_owner_mismatch',
@@ -20729,7 +20755,7 @@ async function dispatchRunLedgerOutboxBatchWithScope(
20729
20755
  }
20730
20756
  const failure = runLedgerDeliveryFailure({ error });
20731
20757
  console.warn('[run-ledger-outbox.batch_dispatch_failed]', {
20732
- runId: input.runId ?? null,
20758
+ runId: input.runId ?? events[0]?.runId ?? null,
20733
20759
  eventIds: events.map((event) => event.eventId),
20734
20760
  error: error instanceof Error ? error.message : String(error),
20735
20761
  code: failure.code,
@@ -2793,6 +2793,16 @@ export async function hasRuntimeEventLogPositionIndex(
2793
2793
  return true;
2794
2794
  }
2795
2795
 
2796
+ /** Deployment-only check for all supported legacy and current log reads. */
2797
+ export async function hasRuntimeEventQueryIndexes(
2798
+ client: PostgresSchedulerQueryClient,
2799
+ ): Promise<boolean> {
2800
+ for (const expected of RUNTIME_EVENT_QUERY_INDEXES) {
2801
+ if (!(await hasRuntimeEventQueryIndex(client, expected))) return false;
2802
+ }
2803
+ return true;
2804
+ }
2805
+
2796
2806
  /** Prepare old and new position indexes before replacing the projection body. */
2797
2807
  export async function prepareRuntimeEventLogPositionIndex(
2798
2808
  client: PostgresSchedulerQueryClient,
@@ -0,0 +1,13 @@
1
+ export const BILLING_SALES_GROUP_KEY = 'shadow.billing-sales';
2
+ export const BILLING_SALES_DESTINATION_KEY = 'shadow.billing-sales.slack';
3
+ export const BILLING_SALES_SLACK_CHANNEL_ID = 'C0AGWVD2TNK';
4
+ export const BILLING_SALES_CONNECTION_ID = 'platform-reporting-bot';
5
+ export const BILLING_SALES_CREDIT_PURCHASE_MINIMUM_CENTS = 15_000;
6
+ export const BILLING_SALES_RULE_KEYS: readonly string[] = [
7
+ 'internal.billing.credit_purchase',
8
+ 'internal.billing.paid_plan',
9
+ ];
10
+
11
+ export function isPlatformNotificationGroup(groupKey: string): boolean {
12
+ return groupKey === 'shadow' || groupKey === BILLING_SALES_GROUP_KEY;
13
+ }
@@ -13,6 +13,10 @@ import {
13
13
  } from './events';
14
14
  import { legacySlackNotificationType } from './legacy-slack';
15
15
  import type { NotificationText } from './content';
16
+ import {
17
+ BILLING_SALES_CREDIT_PURCHASE_MINIMUM_CENTS,
18
+ BILLING_SALES_GROUP_KEY,
19
+ } from './billing-sales';
16
20
 
17
21
  type NotificationTypeDefinition = {
18
22
  id: string;
@@ -734,6 +738,71 @@ const PRODUCT_NOTIFICATION_TYPE_REGISTRY = [
734
738
  }),
735
739
  },
736
740
  },
741
+ {
742
+ id: 'internal.billing.credit_purchase',
743
+ eventName: ProductNotificationEvent.CreditsPurchaseCompleted,
744
+ requiredFilter: { currency: 'usd' },
745
+ allowedTriggers: ['threshold_crossing'],
746
+ catalog: undefined,
747
+ shadow: true,
748
+ rule: {
749
+ default: {
750
+ ruleKey: 'internal.billing.credit_purchase',
751
+ groupKey: BILLING_SALES_GROUP_KEY,
752
+ },
753
+ create: (_input, base) => ({
754
+ ...base,
755
+ repeatMode: 'every_match',
756
+ trigger: {
757
+ kind: 'threshold_crossing',
758
+ direction: 'at_or_above',
759
+ threshold: BILLING_SALES_CREDIT_PURCHASE_MINIMUM_CENTS,
760
+ unit: 'usd_cents',
761
+ },
762
+ }),
763
+ present: ({ payload }) => ({
764
+ title: `Credit purchase: $${(Number(payload.amountPaidCents) / 100).toFixed(2)}`,
765
+ summary: [
766
+ { workspace: true },
767
+ ` purchased ${formatCredits(Number(payload.credits))} credits.`,
768
+ ],
769
+ details: [],
770
+ targetUrl: String(payload.targetUrl),
771
+ subjectKind: 'workspace',
772
+ subjectId: String(payload.accountId),
773
+ }),
774
+ },
775
+ },
776
+ {
777
+ id: 'internal.billing.paid_plan',
778
+ eventName: ProductNotificationEvent.BillingPlanPurchased,
779
+ requiredFilter: {},
780
+ allowedTriggers: ['each_match'],
781
+ catalog: undefined,
782
+ shadow: true,
783
+ rule: {
784
+ default: {
785
+ ruleKey: 'internal.billing.paid_plan',
786
+ groupKey: BILLING_SALES_GROUP_KEY,
787
+ },
788
+ create: (_input, base) => ({
789
+ ...base,
790
+ repeatMode: 'every_match',
791
+ trigger: { kind: 'each_match' },
792
+ }),
793
+ present: ({ payload }) => ({
794
+ title: 'New paid plan signup',
795
+ summary: [
796
+ { workspace: true },
797
+ ` signed up for the ${payload.planName} plan.`,
798
+ ],
799
+ details: [],
800
+ targetUrl: String(payload.targetUrl),
801
+ subjectKind: 'workspace',
802
+ subjectId: String(payload.accountId),
803
+ }),
804
+ },
805
+ },
737
806
  {
738
807
  id: 'play.failed',
739
808
  eventName: ProductNotificationEvent.PlayRunCompleted,
@@ -8,13 +8,19 @@ import {
8
8
  validateProductNotificationDeliveryTiming,
9
9
  type ProductNotificationDefaultPolicy,
10
10
  } from './configuration';
11
+ import {
12
+ BILLING_SALES_CONNECTION_ID,
13
+ BILLING_SALES_DESTINATION_KEY,
14
+ BILLING_SALES_GROUP_KEY,
15
+ BILLING_SALES_SLACK_CHANNEL_ID,
16
+ } from './billing-sales';
11
17
 
12
18
  /**
13
19
  * Product defaults stay in code. Workspaces see these rows synthetically until
14
20
  * they create sparse copy-on-write overrides.
15
21
  */
16
22
  export const CURRENT_PRODUCT_NOTIFICATION_DEFAULT_POLICY = {
17
- version: 8,
23
+ version: 9,
18
24
  groups: [
19
25
  {
20
26
  groupKey: 'default',
@@ -32,6 +38,12 @@ export const CURRENT_PRODUCT_NOTIFICATION_DEFAULT_POLICY = {
32
38
  enabled: true,
33
39
  deliveryTiming: DEFAULT_PRODUCT_NOTIFICATION_DELIVERY_TIMING,
34
40
  },
41
+ {
42
+ groupKey: BILLING_SALES_GROUP_KEY,
43
+ name: 'Billing sales alerts',
44
+ enabled: true,
45
+ deliveryTiming: { mode: 'immediate' },
46
+ },
35
47
  ],
36
48
  destinations: [
37
49
  {
@@ -48,6 +60,19 @@ export const CURRENT_PRODUCT_NOTIFICATION_DEFAULT_POLICY = {
48
60
  enabled: true,
49
61
  settings: { kind: 'email_roles', roles: ['owner'] },
50
62
  },
63
+ {
64
+ destinationKey: BILLING_SALES_DESTINATION_KEY,
65
+ groupKey: BILLING_SALES_GROUP_KEY,
66
+ name: 'Deepline signup channel',
67
+ enabled: true,
68
+ settings: {
69
+ kind: 'slack',
70
+ targetKind: 'channel',
71
+ targetId: BILLING_SALES_SLACK_CHANNEL_ID,
72
+ targetName: 'Deepline signup channel',
73
+ oauthConnectionId: BILLING_SALES_CONNECTION_ID,
74
+ },
75
+ },
51
76
  ],
52
77
  rules: PRODUCT_NOTIFICATION_DEFAULT_RULES,
53
78
  } satisfies ProductNotificationDefaultPolicy;
@@ -206,9 +206,10 @@ export const PRODUCT_NOTIFICATION_EVENT_DEFINITIONS: readonly ProductNotificatio
206
206
  credits: 'number',
207
207
  targetUrl: 'string',
208
208
  },
209
+ optionalFacts: { amountPaidCents: 'number', currency: 'string' },
209
210
  orderingSubjectFact: 'accountId',
210
211
  allowedTriggers: ['threshold_crossing'],
211
- allowedThresholdUnits: ['credits'],
212
+ allowedThresholdUnits: ['credits', 'usd_cents'],
212
213
  },
213
214
  {
214
215
  // The workspace moved onto a paid acquisition offer.
@@ -451,6 +452,13 @@ export function adaptProductNotificationObservation(input: {
451
452
  };
452
453
  }
453
454
  if (event.eventName === ProductNotificationEvent.CreditsPurchaseCompleted) {
455
+ if (trigger.kind === 'threshold_crossing' && trigger.unit === 'usd_cents') {
456
+ return {
457
+ kind: 'threshold_state',
458
+ currentValue: Number(event.payload.amountPaidCents ?? 0),
459
+ unit: 'usd_cents',
460
+ };
461
+ }
454
462
  return {
455
463
  kind: 'threshold_state',
456
464
  currentValue: Number(event.payload.credits),
@@ -0,0 +1,31 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+ var _chunkXZD3NYOLjs = require('./chunk-XZD3NYOL.js');
13
+ require('./chunk-COMHSM6F.js');
14
+ require('./chunk-B7PAZBJX.js');
15
+ require('./chunk-XNYIZMNQ.js');
16
+ require('./chunk-DNSTXIU4.js');
17
+ require('./chunk-7P5AA3SN.js');
18
+ require('./chunk-OG64RBAC.js');
19
+ require('./chunk-COGTRVWW.js');
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+ exports.EXIT_WORKSPACE_MISMATCH = _chunkXZD3NYOLjs.EXIT_WORKSPACE_MISMATCH; exports.clearPendingClaim = _chunkXZD3NYOLjs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunkXZD3NYOLjs.clearSatisfiedPendingClaim; exports.handleRegister = _chunkXZD3NYOLjs.handleRegister; exports.handleStatus = _chunkXZD3NYOLjs.handleStatus; exports.handleWait = _chunkXZD3NYOLjs.handleWait; exports.readPendingAuthClaim = _chunkXZD3NYOLjs.readPendingAuthClaim; exports.registerAuthCommands = _chunkXZD3NYOLjs.registerAuthCommands; exports.reportSetupCompleted = _chunkXZD3NYOLjs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunkXZD3NYOLjs.resolvePendingAuthClaimForResume;
@@ -9,11 +9,11 @@ import {
9
9
  registerAuthCommands,
10
10
  reportSetupCompleted,
11
11
  resolvePendingAuthClaimForResume
12
- } from "./chunk-IHT6XITB.mjs";
13
- import "./chunk-35SCWK4Y.mjs";
14
- import "./chunk-7QV545D7.mjs";
12
+ } from "./chunk-SCX2AZFY.mjs";
13
+ import "./chunk-QFSISXKO.mjs";
14
+ import "./chunk-6C4SD4U3.mjs";
15
15
  import "./chunk-DLIRSHV6.mjs";
16
- import "./chunk-7OXXCRGZ.mjs";
16
+ import "./chunk-KNK42P4M.mjs";
17
17
  import "./chunk-NXGCO4JB.mjs";
18
18
  import "./chunk-WZYKRD7T.mjs";
19
19
  import "./chunk-KRD6H754.mjs";