deepline 0.3.192 → 0.3.194

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.
@@ -2029,6 +2029,28 @@ export type BillingTopUpResult = {
2029
2029
  payment_method?: BillingPaymentMethodSummary | null;
2030
2030
  };
2031
2031
 
2032
+ /** Operation receipt for a top-up that may still be awaiting payment. */
2033
+ export type BillingTopUpReceipt =
2034
+ | (BillingTopUpResult & { status?: undefined })
2035
+ | {
2036
+ status: 'pending';
2037
+ operation_id: string;
2038
+ operation_state: 'payment_pending';
2039
+ requested_credits: number;
2040
+ amount_cents: number;
2041
+ currency: string;
2042
+ }
2043
+ | {
2044
+ status: 'applied';
2045
+ operation_id: string;
2046
+ operation_state: 'applied';
2047
+ applied_credits: number;
2048
+ amount_cents: number;
2049
+ currency: string;
2050
+ balance?: number;
2051
+ stripe_payment_intent_id?: string;
2052
+ };
2053
+
2032
2054
  /** One published plan from `GET /api/v2/billing/catalog/current`. */
2033
2055
  export type BillingPlanEntry = {
2034
2056
  plan_family_id: string;
@@ -2203,6 +2225,11 @@ export type BillingNamespace = {
2203
2225
  credits: number;
2204
2226
  idempotencyKey?: string;
2205
2227
  }) => Promise<BillingTopUpResult>;
2228
+ /** Request a durable pending or applied receipt for a saved-card top-up. */
2229
+ topUpWithReceipt: (options: {
2230
+ credits: number;
2231
+ idempotencyKey?: string;
2232
+ }) => Promise<BillingTopUpReceipt>;
2206
2233
  /** Published plans plus the plan you are on ("what plans exist and what am I on"). */
2207
2234
  plans: () => Promise<BillingPlansResult>;
2208
2235
  subscription: {
@@ -2827,6 +2854,8 @@ export class DeeplineClient {
2827
2854
  };
2828
2855
  this.billing = {
2829
2856
  topUp: (options) => this.topUpBillingBalance(options),
2857
+ topUpWithReceipt: (options) =>
2858
+ this.topUpBillingBalanceWithReceipt(options),
2830
2859
  plans: () => this.getBillingPlans(),
2831
2860
  subscription: {
2832
2861
  status: () => this.getBillingSubscriptionStatus(),
@@ -6354,6 +6383,28 @@ export class DeeplineClient {
6354
6383
  );
6355
6384
  }
6356
6385
 
6386
+ /**
6387
+ * Request a durable top-up operation receipt. A pending receipt does not
6388
+ * imply that payment or credit activation has completed. Prefer
6389
+ * `client.billing.topUpWithReceipt(...)`.
6390
+ */
6391
+ async topUpBillingBalanceWithReceipt(options: {
6392
+ credits: number;
6393
+ idempotencyKey?: string;
6394
+ }): Promise<BillingTopUpReceipt> {
6395
+ return this.http.post<BillingTopUpReceipt>(
6396
+ '/api/v2/billing/top-up',
6397
+ {
6398
+ credits: options.credits,
6399
+ ...(options.idempotencyKey
6400
+ ? { idempotency_key: options.idempotencyKey }
6401
+ : {}),
6402
+ },
6403
+ { 'x-deepline-top-up-receipt': 'operation-v1' },
6404
+ { maxRetries: 0, exactUrlOnly: true },
6405
+ );
6406
+ }
6407
+
6357
6408
  /**
6358
6409
  * Subscription state for the active workspace: active plan, whether a
6359
6410
  * Stripe subscription backs it, renewal/cancellation facts, and remaining
@@ -74,6 +74,7 @@ export type {
74
74
  BillingSubscriptionCancelResult,
75
75
  BillingSubscriptionStatus,
76
76
  BillingTopUpResult,
77
+ BillingTopUpReceipt,
77
78
  BillingUsageEvent,
78
79
  BillingUsageOptions,
79
80
  BillingUsageResult,
@@ -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.192',
203
+ version: '0.3.194',
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: {
package/dist/cli/index.js CHANGED
@@ -3051,7 +3051,7 @@ var SDK_RELEASE = {
3051
3051
  // getters keep their established compatibility behavior.
3052
3052
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
3053
3053
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
3054
- version: "0.3.192",
3054
+ version: "0.3.194",
3055
3055
  updateSummary: "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.",
3056
3056
  packageCapabilities: {
3057
3057
  updatePreferences: 1
@@ -7207,6 +7207,7 @@ var DeeplineClient = class _DeeplineClient {
7207
7207
  };
7208
7208
  this.billing = {
7209
7209
  topUp: (options2) => this.topUpBillingBalance(options2),
7210
+ topUpWithReceipt: (options2) => this.topUpBillingBalanceWithReceipt(options2),
7210
7211
  plans: () => this.getBillingPlans(),
7211
7212
  subscription: {
7212
7213
  status: () => this.getBillingSubscriptionStatus(),
@@ -9837,6 +9838,22 @@ var DeeplineClient = class _DeeplineClient {
9837
9838
  { maxRetries: 0, exactUrlOnly: true }
9838
9839
  );
9839
9840
  }
9841
+ /**
9842
+ * Request a durable top-up operation receipt. A pending receipt does not
9843
+ * imply that payment or credit activation has completed. Prefer
9844
+ * `client.billing.topUpWithReceipt(...)`.
9845
+ */
9846
+ async topUpBillingBalanceWithReceipt(options) {
9847
+ return this.http.post(
9848
+ "/api/v2/billing/top-up",
9849
+ {
9850
+ credits: options.credits,
9851
+ ...options.idempotencyKey ? { idempotency_key: options.idempotencyKey } : {}
9852
+ },
9853
+ { "x-deepline-top-up-receipt": "operation-v1" },
9854
+ { maxRetries: 0, exactUrlOnly: true }
9855
+ );
9856
+ }
9840
9857
  /**
9841
9858
  * Subscription state for the active workspace: active plan, whether a
9842
9859
  * Stripe subscription backs it, renewal/cancellation facts, and remaining
@@ -13294,7 +13311,10 @@ async function handleTopUp(creditsRaw, options) {
13294
13311
  const client2 = new DeeplineClient();
13295
13312
  let payload;
13296
13313
  try {
13297
- payload = await client2.billing.topUp({ credits, idempotencyKey });
13314
+ payload = await client2.billing.topUpWithReceipt({
13315
+ credits,
13316
+ idempotencyKey
13317
+ });
13298
13318
  } catch (error) {
13299
13319
  const failure = billingTopUpFailureFromError(error, {
13300
13320
  credits,
@@ -13304,31 +13324,65 @@ async function handleTopUp(creditsRaw, options) {
13304
13324
  reportBillingFailure(failure, options);
13305
13325
  return;
13306
13326
  }
13327
+ if (payload.status === "pending") {
13328
+ printCommandEnvelope(
13329
+ {
13330
+ ok: true,
13331
+ ...payload,
13332
+ idempotency_key: idempotencyKey,
13333
+ next: topUpRetryCommand(credits, idempotencyKey),
13334
+ render: {
13335
+ sections: [
13336
+ {
13337
+ title: "billing top-up pending",
13338
+ lines: [
13339
+ `Requested: ${payload.requested_credits} Deepline Credits`,
13340
+ "Payment is still being confirmed. Credits have not been reported as added.",
13341
+ `Operation: ${payload.operation_id}`,
13342
+ `Retry with the same key: ${topUpRetryCommand(credits, idempotencyKey)}`
13343
+ ]
13344
+ }
13345
+ ]
13346
+ }
13347
+ },
13348
+ { json: options.json }
13349
+ );
13350
+ return;
13351
+ }
13307
13352
  const amountText = invoiceAmountText(payload.amount_cents, payload.currency);
13308
- const paymentLabel = payload.payment_method?.label ?? [
13309
- payload.payment_method?.brand ? humanize(payload.payment_method.brand) : null,
13310
- payload.payment_method?.last4 ? `ending in ${payload.payment_method.last4}` : null
13353
+ const appliedCredits = "applied_credits" in payload ? payload.applied_credits : payload.credits;
13354
+ const paymentMethod = "payment_method" in payload ? payload.payment_method : void 0;
13355
+ const paymentLabel = paymentMethod?.label ?? [
13356
+ paymentMethod?.brand ? humanize(paymentMethod.brand) : null,
13357
+ paymentMethod?.last4 ? `ending in ${paymentMethod.last4}` : null
13311
13358
  ].filter(Boolean).join(" ");
13312
13359
  const compactEnvelope = {
13313
13360
  ok: true,
13314
- credits: payload.credits,
13361
+ credits: appliedCredits,
13315
13362
  amount_cents: payload.amount_cents,
13316
13363
  currency: payload.currency,
13317
- balance_credits: payload.balance,
13364
+ ...typeof payload.balance === "number" ? { balance_credits: payload.balance } : {},
13365
+ ..."operation_id" in payload ? {
13366
+ status: payload.status,
13367
+ operation_id: payload.operation_id,
13368
+ operation_state: payload.operation_state
13369
+ } : {},
13318
13370
  idempotency_key: idempotencyKey
13319
13371
  };
13320
13372
  const fullEnvelope = {
13321
13373
  ...payload,
13322
- balance_credits: payload.balance,
13374
+ ok: true,
13375
+ credits: appliedCredits,
13376
+ ...typeof payload.balance === "number" ? { balance_credits: payload.balance } : {},
13323
13377
  idempotency_key: idempotencyKey,
13324
13378
  render: {
13325
13379
  sections: [
13326
13380
  {
13327
13381
  title: "billing top-up",
13328
13382
  lines: [
13329
- `Added: ${payload.credits} Deepline Credits`,
13383
+ `Added: ${appliedCredits} Deepline Credits`,
13330
13384
  `Charged: ${amountText}`,
13331
- `Balance: ${payload.balance} Deepline Credits`,
13385
+ ...typeof payload.balance === "number" ? [`Balance: ${payload.balance} Deepline Credits`] : ["Balance: unavailable; check deepline billing balance."],
13332
13386
  ...paymentLabel ? [`Payment method: ${paymentLabel}`] : []
13333
13387
  ]
13334
13388
  }
@@ -13342,10 +13396,18 @@ async function handleTopUp(creditsRaw, options) {
13342
13396
  async function handleTargetStatus(options) {
13343
13397
  const client2 = new DeeplineClient();
13344
13398
  const payload = await client2.billing.targetStatus();
13399
+ const balanceCommand = "deepline billing balance --json";
13400
+ const recentChargesCommand = "deepline billing usage --limit 5 --json";
13401
+ const exactChargeCommand = "deepline billing usage --request-id <job_id> --json";
13345
13402
  printCommandEnvelope(
13346
13403
  {
13347
13404
  ok: true,
13348
13405
  ...payload,
13406
+ next: {
13407
+ balance: balanceCommand,
13408
+ recentCharges: recentChargesCommand,
13409
+ chargeByJobId: exactChargeCommand
13410
+ },
13349
13411
  render: {
13350
13412
  sections: [
13351
13413
  {
@@ -13354,7 +13416,10 @@ async function handleTargetStatus(options) {
13354
13416
  `Plan: ${payload.plan.name} (${payload.plan.sku})`,
13355
13417
  `State: ${payload.state}`,
13356
13418
  `Payment: ${payload.payment_state}`,
13357
- `Automatic recharge: ${payload.recharge_state}`
13419
+ `Automatic recharge: ${payload.recharge_state}`,
13420
+ `Balance: ${balanceCommand}`,
13421
+ `Recent charges: ${recentChargesCommand}`,
13422
+ `Charge for a tool job: ${exactChargeCommand}`
13358
13423
  ]
13359
13424
  }
13360
13425
  ]
@@ -13822,7 +13887,9 @@ Examples:
13822
13887
  "after",
13823
13888
  "\nAn absent intent is durably retired; an existing operation is returned unchanged.\nThis command never starts a payment. Use the original amount, workspace, and key.\nExample:\n deepline billing top-up-recover 1000 --org-id org_original --idempotency-key original-purchase-key --json\n"
13824
13889
  ).action(handleTopUpRecover);
13825
- billing.command("status").description("Show normalized target billing state.").option("--json", "Emit JSON output").action(handleTargetStatus);
13890
+ billing.command("status").description(
13891
+ "Show plan, payment, and recharge state; use usage for charges."
13892
+ ).option("--json", "Emit JSON output").action(handleTargetStatus);
13826
13893
  billing.command("auto-recharge").description("Inspect and manage automatic Deepline credit recharge.").addHelpText(
13827
13894
  "after",
13828
13895
  `
@@ -50465,6 +50532,7 @@ function buildToolExecuteBaseEnvelope(input2) {
50465
50532
  envelope,
50466
50533
  "output"
50467
50534
  );
50535
+ const billingLookup = typeof envelope.job_id === "string" && envelope.job_id.trim() ? `deepline billing usage --request-id ${shellQuote6(envelope.job_id)} --json` : null;
50468
50536
  const inspectCommand = `deepline tools execute ${input2.toolId} --input ${shellQuote6(JSON.stringify(input2.params))} --json`;
50469
50537
  const actions = input2.listConversion ? [
50470
50538
  {
@@ -50480,6 +50548,9 @@ function buildToolExecuteBaseEnvelope(input2) {
50480
50548
  }
50481
50549
  ] : []
50482
50550
  ] : [];
50551
+ if (billingLookup) {
50552
+ actions.push({ label: "charge", command: billingLookup });
50553
+ }
50483
50554
  return {
50484
50555
  ...envelope,
50485
50556
  ...input2.idempotencyKey ? { idempotency_key: input2.idempotencyKey } : {},
@@ -50489,6 +50560,7 @@ function buildToolExecuteBaseEnvelope(input2) {
50489
50560
  ...warningMessages.length > 0 ? { warnings: warningMessages } : {},
50490
50561
  next: {
50491
50562
  inspect: inspectCommand,
50563
+ ...billingLookup ? { billing: billingLookup } : {},
50492
50564
  ...apifyRecovery ?? {},
50493
50565
  playDebugging: "When fixing a play getter, inspect returned dataset handles with runs get and export rows with runs export; do not copy CLI preview paths blindly.",
50494
50566
  ...input2.listConversion ? {
@@ -50541,6 +50613,7 @@ function buildToolExecuteRowArtifactEnvelope(input2) {
50541
50613
  void _render;
50542
50614
  void _next;
50543
50615
  void _local;
50616
+ const billingLookup = isRecord12(input2.baseEnvelope.next) && typeof input2.baseEnvelope.next.billing === "string" ? input2.baseEnvelope.next.billing : null;
50544
50617
  return {
50545
50618
  ...base,
50546
50619
  status: typeof base.status === "string" ? base.status : "completed",
@@ -50583,6 +50656,7 @@ function buildToolExecuteRowArtifactEnvelope(input2) {
50583
50656
  },
50584
50657
  next: {
50585
50658
  inspect: "Re-run with --json only when you need the raw provider/tool response.",
50659
+ ...billingLookup ? { billing: billingLookup } : {},
50586
50660
  listSourcePath: input2.rowOutput.sourcePath,
50587
50661
  expandToPlay: "Use stable map and step keys so reruns are idempotent: completed rows are reused, and only missing or stale work runs again."
50588
50662
  },
@@ -50601,6 +50675,7 @@ function buildToolExecuteRowArtifactEnvelope(input2) {
50601
50675
  }
50602
50676
  ],
50603
50677
  actions: [
50678
+ ...billingLookup ? [{ label: "charge", command: billingLookup }] : [],
50604
50679
  {
50605
50680
  label: "next",
50606
50681
  command: "Move the script into a project folder and expand it into a Deepline play. Use stable map and step keys so reruns are idempotent: completed rows are reused, and only missing or stale work runs again."
@@ -3046,7 +3046,7 @@ var SDK_RELEASE = {
3046
3046
  // getters keep their established compatibility behavior.
3047
3047
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
3048
3048
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
3049
- version: "0.3.192",
3049
+ version: "0.3.194",
3050
3050
  updateSummary: "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.",
3051
3051
  packageCapabilities: {
3052
3052
  updatePreferences: 1
@@ -7202,6 +7202,7 @@ var DeeplineClient = class _DeeplineClient {
7202
7202
  };
7203
7203
  this.billing = {
7204
7204
  topUp: (options2) => this.topUpBillingBalance(options2),
7205
+ topUpWithReceipt: (options2) => this.topUpBillingBalanceWithReceipt(options2),
7205
7206
  plans: () => this.getBillingPlans(),
7206
7207
  subscription: {
7207
7208
  status: () => this.getBillingSubscriptionStatus(),
@@ -9832,6 +9833,22 @@ var DeeplineClient = class _DeeplineClient {
9832
9833
  { maxRetries: 0, exactUrlOnly: true }
9833
9834
  );
9834
9835
  }
9836
+ /**
9837
+ * Request a durable top-up operation receipt. A pending receipt does not
9838
+ * imply that payment or credit activation has completed. Prefer
9839
+ * `client.billing.topUpWithReceipt(...)`.
9840
+ */
9841
+ async topUpBillingBalanceWithReceipt(options) {
9842
+ return this.http.post(
9843
+ "/api/v2/billing/top-up",
9844
+ {
9845
+ credits: options.credits,
9846
+ ...options.idempotencyKey ? { idempotency_key: options.idempotencyKey } : {}
9847
+ },
9848
+ { "x-deepline-top-up-receipt": "operation-v1" },
9849
+ { maxRetries: 0, exactUrlOnly: true }
9850
+ );
9851
+ }
9835
9852
  /**
9836
9853
  * Subscription state for the active workspace: active plan, whether a
9837
9854
  * Stripe subscription backs it, renewal/cancellation facts, and remaining
@@ -13301,7 +13318,10 @@ async function handleTopUp(creditsRaw, options) {
13301
13318
  const client2 = new DeeplineClient();
13302
13319
  let payload;
13303
13320
  try {
13304
- payload = await client2.billing.topUp({ credits, idempotencyKey });
13321
+ payload = await client2.billing.topUpWithReceipt({
13322
+ credits,
13323
+ idempotencyKey
13324
+ });
13305
13325
  } catch (error) {
13306
13326
  const failure = billingTopUpFailureFromError(error, {
13307
13327
  credits,
@@ -13311,31 +13331,65 @@ async function handleTopUp(creditsRaw, options) {
13311
13331
  reportBillingFailure(failure, options);
13312
13332
  return;
13313
13333
  }
13334
+ if (payload.status === "pending") {
13335
+ printCommandEnvelope(
13336
+ {
13337
+ ok: true,
13338
+ ...payload,
13339
+ idempotency_key: idempotencyKey,
13340
+ next: topUpRetryCommand(credits, idempotencyKey),
13341
+ render: {
13342
+ sections: [
13343
+ {
13344
+ title: "billing top-up pending",
13345
+ lines: [
13346
+ `Requested: ${payload.requested_credits} Deepline Credits`,
13347
+ "Payment is still being confirmed. Credits have not been reported as added.",
13348
+ `Operation: ${payload.operation_id}`,
13349
+ `Retry with the same key: ${topUpRetryCommand(credits, idempotencyKey)}`
13350
+ ]
13351
+ }
13352
+ ]
13353
+ }
13354
+ },
13355
+ { json: options.json }
13356
+ );
13357
+ return;
13358
+ }
13314
13359
  const amountText = invoiceAmountText(payload.amount_cents, payload.currency);
13315
- const paymentLabel = payload.payment_method?.label ?? [
13316
- payload.payment_method?.brand ? humanize(payload.payment_method.brand) : null,
13317
- payload.payment_method?.last4 ? `ending in ${payload.payment_method.last4}` : null
13360
+ const appliedCredits = "applied_credits" in payload ? payload.applied_credits : payload.credits;
13361
+ const paymentMethod = "payment_method" in payload ? payload.payment_method : void 0;
13362
+ const paymentLabel = paymentMethod?.label ?? [
13363
+ paymentMethod?.brand ? humanize(paymentMethod.brand) : null,
13364
+ paymentMethod?.last4 ? `ending in ${paymentMethod.last4}` : null
13318
13365
  ].filter(Boolean).join(" ");
13319
13366
  const compactEnvelope = {
13320
13367
  ok: true,
13321
- credits: payload.credits,
13368
+ credits: appliedCredits,
13322
13369
  amount_cents: payload.amount_cents,
13323
13370
  currency: payload.currency,
13324
- balance_credits: payload.balance,
13371
+ ...typeof payload.balance === "number" ? { balance_credits: payload.balance } : {},
13372
+ ..."operation_id" in payload ? {
13373
+ status: payload.status,
13374
+ operation_id: payload.operation_id,
13375
+ operation_state: payload.operation_state
13376
+ } : {},
13325
13377
  idempotency_key: idempotencyKey
13326
13378
  };
13327
13379
  const fullEnvelope = {
13328
13380
  ...payload,
13329
- balance_credits: payload.balance,
13381
+ ok: true,
13382
+ credits: appliedCredits,
13383
+ ...typeof payload.balance === "number" ? { balance_credits: payload.balance } : {},
13330
13384
  idempotency_key: idempotencyKey,
13331
13385
  render: {
13332
13386
  sections: [
13333
13387
  {
13334
13388
  title: "billing top-up",
13335
13389
  lines: [
13336
- `Added: ${payload.credits} Deepline Credits`,
13390
+ `Added: ${appliedCredits} Deepline Credits`,
13337
13391
  `Charged: ${amountText}`,
13338
- `Balance: ${payload.balance} Deepline Credits`,
13392
+ ...typeof payload.balance === "number" ? [`Balance: ${payload.balance} Deepline Credits`] : ["Balance: unavailable; check deepline billing balance."],
13339
13393
  ...paymentLabel ? [`Payment method: ${paymentLabel}`] : []
13340
13394
  ]
13341
13395
  }
@@ -13349,10 +13403,18 @@ async function handleTopUp(creditsRaw, options) {
13349
13403
  async function handleTargetStatus(options) {
13350
13404
  const client2 = new DeeplineClient();
13351
13405
  const payload = await client2.billing.targetStatus();
13406
+ const balanceCommand = "deepline billing balance --json";
13407
+ const recentChargesCommand = "deepline billing usage --limit 5 --json";
13408
+ const exactChargeCommand = "deepline billing usage --request-id <job_id> --json";
13352
13409
  printCommandEnvelope(
13353
13410
  {
13354
13411
  ok: true,
13355
13412
  ...payload,
13413
+ next: {
13414
+ balance: balanceCommand,
13415
+ recentCharges: recentChargesCommand,
13416
+ chargeByJobId: exactChargeCommand
13417
+ },
13356
13418
  render: {
13357
13419
  sections: [
13358
13420
  {
@@ -13361,7 +13423,10 @@ async function handleTargetStatus(options) {
13361
13423
  `Plan: ${payload.plan.name} (${payload.plan.sku})`,
13362
13424
  `State: ${payload.state}`,
13363
13425
  `Payment: ${payload.payment_state}`,
13364
- `Automatic recharge: ${payload.recharge_state}`
13426
+ `Automatic recharge: ${payload.recharge_state}`,
13427
+ `Balance: ${balanceCommand}`,
13428
+ `Recent charges: ${recentChargesCommand}`,
13429
+ `Charge for a tool job: ${exactChargeCommand}`
13365
13430
  ]
13366
13431
  }
13367
13432
  ]
@@ -13829,7 +13894,9 @@ Examples:
13829
13894
  "after",
13830
13895
  "\nAn absent intent is durably retired; an existing operation is returned unchanged.\nThis command never starts a payment. Use the original amount, workspace, and key.\nExample:\n deepline billing top-up-recover 1000 --org-id org_original --idempotency-key original-purchase-key --json\n"
13831
13896
  ).action(handleTopUpRecover);
13832
- billing.command("status").description("Show normalized target billing state.").option("--json", "Emit JSON output").action(handleTargetStatus);
13897
+ billing.command("status").description(
13898
+ "Show plan, payment, and recharge state; use usage for charges."
13899
+ ).option("--json", "Emit JSON output").action(handleTargetStatus);
13833
13900
  billing.command("auto-recharge").description("Inspect and manage automatic Deepline credit recharge.").addHelpText(
13834
13901
  "after",
13835
13902
  `
@@ -50612,6 +50679,7 @@ function buildToolExecuteBaseEnvelope(input2) {
50612
50679
  envelope,
50613
50680
  "output"
50614
50681
  );
50682
+ const billingLookup = typeof envelope.job_id === "string" && envelope.job_id.trim() ? `deepline billing usage --request-id ${shellQuote6(envelope.job_id)} --json` : null;
50615
50683
  const inspectCommand = `deepline tools execute ${input2.toolId} --input ${shellQuote6(JSON.stringify(input2.params))} --json`;
50616
50684
  const actions = input2.listConversion ? [
50617
50685
  {
@@ -50627,6 +50695,9 @@ function buildToolExecuteBaseEnvelope(input2) {
50627
50695
  }
50628
50696
  ] : []
50629
50697
  ] : [];
50698
+ if (billingLookup) {
50699
+ actions.push({ label: "charge", command: billingLookup });
50700
+ }
50630
50701
  return {
50631
50702
  ...envelope,
50632
50703
  ...input2.idempotencyKey ? { idempotency_key: input2.idempotencyKey } : {},
@@ -50636,6 +50707,7 @@ function buildToolExecuteBaseEnvelope(input2) {
50636
50707
  ...warningMessages.length > 0 ? { warnings: warningMessages } : {},
50637
50708
  next: {
50638
50709
  inspect: inspectCommand,
50710
+ ...billingLookup ? { billing: billingLookup } : {},
50639
50711
  ...apifyRecovery ?? {},
50640
50712
  playDebugging: "When fixing a play getter, inspect returned dataset handles with runs get and export rows with runs export; do not copy CLI preview paths blindly.",
50641
50713
  ...input2.listConversion ? {
@@ -50688,6 +50760,7 @@ function buildToolExecuteRowArtifactEnvelope(input2) {
50688
50760
  void _render;
50689
50761
  void _next;
50690
50762
  void _local;
50763
+ const billingLookup = isRecord12(input2.baseEnvelope.next) && typeof input2.baseEnvelope.next.billing === "string" ? input2.baseEnvelope.next.billing : null;
50691
50764
  return {
50692
50765
  ...base,
50693
50766
  status: typeof base.status === "string" ? base.status : "completed",
@@ -50730,6 +50803,7 @@ function buildToolExecuteRowArtifactEnvelope(input2) {
50730
50803
  },
50731
50804
  next: {
50732
50805
  inspect: "Re-run with --json only when you need the raw provider/tool response.",
50806
+ ...billingLookup ? { billing: billingLookup } : {},
50733
50807
  listSourcePath: input2.rowOutput.sourcePath,
50734
50808
  expandToPlay: "Use stable map and step keys so reruns are idempotent: completed rows are reused, and only missing or stale work runs again."
50735
50809
  },
@@ -50748,6 +50822,7 @@ function buildToolExecuteRowArtifactEnvelope(input2) {
50748
50822
  }
50749
50823
  ],
50750
50824
  actions: [
50825
+ ...billingLookup ? [{ label: "charge", command: billingLookup }] : [],
50751
50826
  {
50752
50827
  label: "next",
50753
50828
  command: "Move the script into a project folder and expand it into a Deepline play. Use stable map and step keys so reruns are idempotent: completed rows are reused, and only missing or stale work runs again."
package/dist/index.d.mts CHANGED
@@ -4247,6 +4247,26 @@ type BillingTopUpResult = {
4247
4247
  stripe_payment_intent_id: string;
4248
4248
  payment_method?: BillingPaymentMethodSummary | null;
4249
4249
  };
4250
+ /** Operation receipt for a top-up that may still be awaiting payment. */
4251
+ type BillingTopUpReceipt = (BillingTopUpResult & {
4252
+ status?: undefined;
4253
+ }) | {
4254
+ status: 'pending';
4255
+ operation_id: string;
4256
+ operation_state: 'payment_pending';
4257
+ requested_credits: number;
4258
+ amount_cents: number;
4259
+ currency: string;
4260
+ } | {
4261
+ status: 'applied';
4262
+ operation_id: string;
4263
+ operation_state: 'applied';
4264
+ applied_credits: number;
4265
+ amount_cents: number;
4266
+ currency: string;
4267
+ balance?: number;
4268
+ stripe_payment_intent_id?: string;
4269
+ };
4250
4270
  /** One published plan from `GET /api/v2/billing/catalog/current`. */
4251
4271
  type BillingPlanEntry = {
4252
4272
  plan_family_id: string;
@@ -4409,6 +4429,11 @@ type BillingNamespace = {
4409
4429
  credits: number;
4410
4430
  idempotencyKey?: string;
4411
4431
  }) => Promise<BillingTopUpResult>;
4432
+ /** Request a durable pending or applied receipt for a saved-card top-up. */
4433
+ topUpWithReceipt: (options: {
4434
+ credits: number;
4435
+ idempotencyKey?: string;
4436
+ }) => Promise<BillingTopUpReceipt>;
4412
4437
  /** Published plans plus the plan you are on ("what plans exist and what am I on"). */
4413
4438
  plans: () => Promise<BillingPlansResult>;
4414
4439
  subscription: {
@@ -5528,6 +5553,15 @@ declare class DeeplineClient {
5528
5553
  credits: number;
5529
5554
  idempotencyKey?: string;
5530
5555
  }): Promise<BillingTopUpResult>;
5556
+ /**
5557
+ * Request a durable top-up operation receipt. A pending receipt does not
5558
+ * imply that payment or credit activation has completed. Prefer
5559
+ * `client.billing.topUpWithReceipt(...)`.
5560
+ */
5561
+ topUpBillingBalanceWithReceipt(options: {
5562
+ credits: number;
5563
+ idempotencyKey?: string;
5564
+ }): Promise<BillingTopUpReceipt>;
5531
5565
  /**
5532
5566
  * Subscription state for the active workspace: active plan, whether a
5533
5567
  * Stripe subscription backs it, renewal/cancellation facts, and remaining
@@ -6741,4 +6775,4 @@ declare function writeCsvOutputFile(rows: Array<Record<string, unknown>>, stem:
6741
6775
  */
6742
6776
  declare function extractSummaryFields(payload: unknown): Record<string, Scalar>;
6743
6777
 
6744
- export { type AsyncPlayRunRef, AuthError, type BillingCreditPool, type BillingInvoiceEntry, type BillingInvoicesResult, type BillingNamespace, type BillingPaymentMethodSummary, type BillingRecentUsageEntry, type BillingSubscriptionCancelResult, type BillingSubscriptionStatus, type BillingTopUpResult, type BillingUsageEvent, type BillingUsageOptions, type BillingUsageResult, type ClearPlayHistoryRequest, type ClearPlayHistoryResult, type ColumnMap, type ColumnResolver, type ConditionalStepResolver, ConfigError, type CreateNotificationGroupInput, type CreateNotificationGroupResult, type CsvInput, type CsvOptions, type CustomerDbQueryResult, DEEPLINE_TOOL_CATEGORIES, type DatasetBuilder, type DatasetColumnDefinition, type DatasetColumnRunInput, type DbNamespace, Deepline, DeeplineClient, type DeeplineClientOptions, DeeplineContext, DeeplineError, type DeeplineExecutionsNamespace, type DeeplineNamedPlay, type DeeplinePlayRuntimeContext, type DeeplinePlaysNamespace, type DeeplineToolCategory, type DeeplineToolExecuteResult, type DeeplineToolsNamespace, type DefinePlayConfig, type DefinedPlay, type ExecutionByKeyResult, type ExecutionRecovery, type FetchOptions, type FileInput, type IngestionStorageRepairResult, type LegacyMonitorStatusFilter, type LiveEventEnvelope, MONITOR_JOB_PHASES, MONITOR_JOB_RECONCILIATION_STATES, MONITOR_JOB_STATES, type MonitorBatchNamespace, type MonitorCheckResult, type MonitorDefinition, type MonitorDeleteResult, type MonitorDependents, type MonitorDeployResult, type MonitorDetail, type MonitorFleetDeactivateOptions, MonitorFleetDefinition, type MonitorFleetGetOptions, type MonitorFleetReactivateOptions, type MonitorFleetResult, type MonitorFleetStatus, type MonitorFleetSyncOptions, type MonitorFleetWaitOptions, type MonitorFleetsNamespace, type MonitorJobDeployOptions, type MonitorJobLogsOptions, type MonitorJobPhase, type MonitorJobReconciliationState, type MonitorJobResult, type MonitorJobState, type MonitorJobWaitOptions, type MonitorJobsNamespace, type MonitorListEntry, type MonitorPayload, type MonitorReactivateResult, type MonitorSpec, type MonitorState, type MonitorStateFilter, type MonitorUpdateChangeSummary, type MonitorUpdateResult, type MonitorsAccessStatus, type MonitorsAvailableOptions, type MonitorsAvailableResult, type MonitorsListOptions, type MonitorsListResult, type MonitorsNamespace, PLAY_BOOTSTRAP_COMPANY_FIELDS, PLAY_BOOTSTRAP_COMPANY_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_CONTACT_FIELDS, PLAY_BOOTSTRAP_FINDER_KINDS, PLAY_BOOTSTRAP_OUTPUT_FIELD_BY_FINDER, PLAY_BOOTSTRAP_PEOPLE_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_PROVIDER_CATEGORY_BY_FINDER, PLAY_BOOTSTRAP_SOURCE_KINDS, PLAY_BOOTSTRAP_STAGE_KINDS, PLAY_BOOTSTRAP_TEMPLATES, PROD_URL, type PlayActivityObservation, type PlayActivityState, type PlayActivityTarget, type PlayAsyncCallOptions, type PlayBindings, type PlayBootstrapEntityKind, type PlayBootstrapFinderKind, type PlayCallExecution, type PlayCallOptions, type PlayCostEstimate, type PlayFetchResponse, type PlayInputContract, type PlayJob, type PlayListItem, type PlayLiveEvent, type PlayReferenceLike, type PlayRevisionSummary, type PlayRunActionPackage, type PlayRunActivityProjection, type PlayRunDatasetActions, type PlayRunId, type PlayRunPackage, type PlayRunResult, type PlayRunStart, type PlaySheetRow, type PlaySheetRowsResult, type PlayStatus, type PlayStepProgramStep, type PlaysListOptions, type PlaysListPage, type PrebuiltPlayRef, type PublishPlayVersionRequest, type PublishPlayVersionResult, RateLimitError, type RerunOptions, type RerunPlayRunResult, type ResolvedConfig, RunObserveTransportUnavailableError, type RunsListOptions, type RunsListPage, type RunsLogsOptions, type RunsLogsResult, type RunsNamespace, type RunsTailOptions, type RuntimeStepOptions, SDK_API_CONTRACT, SDK_VERSION, type SqlListenerDeclaration, type SqlListenerEvent, type SqlListenerOperation, type SqlQuery, type StartPlayRunRequest, type StepOptions, type StepProgram, type StepProgramResolver, type StepResolver, type StopAllCandidate, type StopAllPlayRunsDryRunResult, type StopAllPlayRunsResult, type StopAllPlayRunsStopResult, type StopAllRunsOptions, type StopPlayRunResult, type ToolDefinition, ToolExecuteResult, type ToolExecution, ToolExecutionError, ToolExecutionErrorOptions, type ToolExecutionRequest, type ToolMetadata, ToolRateLimitError, ToolResultBilling, type ToolSearchOptions, type ToolSearchResult, type WorkspaceCreateResult, type WorkspacesNamespace, defineInput, defineMonitor, definePlay, defineWorkflow, extractSummaryFields, formatPlayBootstrapFinderKinds, formatPlayBootstrapFinderKindsForSentence, formatPlayBootstrapTemplates, getDefinedPlayMetadata, isPlayBootstrapFinderKind, isPlayBootstrapTemplate, isStopAllPlayRunsDryRunResult, resolveConfig, runIf, steps, tryConvertToList, writeCsvOutputFile, writeJsonOutputFile };
6778
+ export { type AsyncPlayRunRef, AuthError, type BillingCreditPool, type BillingInvoiceEntry, type BillingInvoicesResult, type BillingNamespace, type BillingPaymentMethodSummary, type BillingRecentUsageEntry, type BillingSubscriptionCancelResult, type BillingSubscriptionStatus, type BillingTopUpReceipt, type BillingTopUpResult, type BillingUsageEvent, type BillingUsageOptions, type BillingUsageResult, type ClearPlayHistoryRequest, type ClearPlayHistoryResult, type ColumnMap, type ColumnResolver, type ConditionalStepResolver, ConfigError, type CreateNotificationGroupInput, type CreateNotificationGroupResult, type CsvInput, type CsvOptions, type CustomerDbQueryResult, DEEPLINE_TOOL_CATEGORIES, type DatasetBuilder, type DatasetColumnDefinition, type DatasetColumnRunInput, type DbNamespace, Deepline, DeeplineClient, type DeeplineClientOptions, DeeplineContext, DeeplineError, type DeeplineExecutionsNamespace, type DeeplineNamedPlay, type DeeplinePlayRuntimeContext, type DeeplinePlaysNamespace, type DeeplineToolCategory, type DeeplineToolExecuteResult, type DeeplineToolsNamespace, type DefinePlayConfig, type DefinedPlay, type ExecutionByKeyResult, type ExecutionRecovery, type FetchOptions, type FileInput, type IngestionStorageRepairResult, type LegacyMonitorStatusFilter, type LiveEventEnvelope, MONITOR_JOB_PHASES, MONITOR_JOB_RECONCILIATION_STATES, MONITOR_JOB_STATES, type MonitorBatchNamespace, type MonitorCheckResult, type MonitorDefinition, type MonitorDeleteResult, type MonitorDependents, type MonitorDeployResult, type MonitorDetail, type MonitorFleetDeactivateOptions, MonitorFleetDefinition, type MonitorFleetGetOptions, type MonitorFleetReactivateOptions, type MonitorFleetResult, type MonitorFleetStatus, type MonitorFleetSyncOptions, type MonitorFleetWaitOptions, type MonitorFleetsNamespace, type MonitorJobDeployOptions, type MonitorJobLogsOptions, type MonitorJobPhase, type MonitorJobReconciliationState, type MonitorJobResult, type MonitorJobState, type MonitorJobWaitOptions, type MonitorJobsNamespace, type MonitorListEntry, type MonitorPayload, type MonitorReactivateResult, type MonitorSpec, type MonitorState, type MonitorStateFilter, type MonitorUpdateChangeSummary, type MonitorUpdateResult, type MonitorsAccessStatus, type MonitorsAvailableOptions, type MonitorsAvailableResult, type MonitorsListOptions, type MonitorsListResult, type MonitorsNamespace, PLAY_BOOTSTRAP_COMPANY_FIELDS, PLAY_BOOTSTRAP_COMPANY_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_CONTACT_FIELDS, PLAY_BOOTSTRAP_FINDER_KINDS, PLAY_BOOTSTRAP_OUTPUT_FIELD_BY_FINDER, PLAY_BOOTSTRAP_PEOPLE_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_PROVIDER_CATEGORY_BY_FINDER, PLAY_BOOTSTRAP_SOURCE_KINDS, PLAY_BOOTSTRAP_STAGE_KINDS, PLAY_BOOTSTRAP_TEMPLATES, PROD_URL, type PlayActivityObservation, type PlayActivityState, type PlayActivityTarget, type PlayAsyncCallOptions, type PlayBindings, type PlayBootstrapEntityKind, type PlayBootstrapFinderKind, type PlayCallExecution, type PlayCallOptions, type PlayCostEstimate, type PlayFetchResponse, type PlayInputContract, type PlayJob, type PlayListItem, type PlayLiveEvent, type PlayReferenceLike, type PlayRevisionSummary, type PlayRunActionPackage, type PlayRunActivityProjection, type PlayRunDatasetActions, type PlayRunId, type PlayRunPackage, type PlayRunResult, type PlayRunStart, type PlaySheetRow, type PlaySheetRowsResult, type PlayStatus, type PlayStepProgramStep, type PlaysListOptions, type PlaysListPage, type PrebuiltPlayRef, type PublishPlayVersionRequest, type PublishPlayVersionResult, RateLimitError, type RerunOptions, type RerunPlayRunResult, type ResolvedConfig, RunObserveTransportUnavailableError, type RunsListOptions, type RunsListPage, type RunsLogsOptions, type RunsLogsResult, type RunsNamespace, type RunsTailOptions, type RuntimeStepOptions, SDK_API_CONTRACT, SDK_VERSION, type SqlListenerDeclaration, type SqlListenerEvent, type SqlListenerOperation, type SqlQuery, type StartPlayRunRequest, type StepOptions, type StepProgram, type StepProgramResolver, type StepResolver, type StopAllCandidate, type StopAllPlayRunsDryRunResult, type StopAllPlayRunsResult, type StopAllPlayRunsStopResult, type StopAllRunsOptions, type StopPlayRunResult, type ToolDefinition, ToolExecuteResult, type ToolExecution, ToolExecutionError, ToolExecutionErrorOptions, type ToolExecutionRequest, type ToolMetadata, ToolRateLimitError, ToolResultBilling, type ToolSearchOptions, type ToolSearchResult, type WorkspaceCreateResult, type WorkspacesNamespace, defineInput, defineMonitor, definePlay, defineWorkflow, extractSummaryFields, formatPlayBootstrapFinderKinds, formatPlayBootstrapFinderKindsForSentence, formatPlayBootstrapTemplates, getDefinedPlayMetadata, isPlayBootstrapFinderKind, isPlayBootstrapTemplate, isStopAllPlayRunsDryRunResult, resolveConfig, runIf, steps, tryConvertToList, writeCsvOutputFile, writeJsonOutputFile };
package/dist/index.d.ts CHANGED
@@ -4247,6 +4247,26 @@ type BillingTopUpResult = {
4247
4247
  stripe_payment_intent_id: string;
4248
4248
  payment_method?: BillingPaymentMethodSummary | null;
4249
4249
  };
4250
+ /** Operation receipt for a top-up that may still be awaiting payment. */
4251
+ type BillingTopUpReceipt = (BillingTopUpResult & {
4252
+ status?: undefined;
4253
+ }) | {
4254
+ status: 'pending';
4255
+ operation_id: string;
4256
+ operation_state: 'payment_pending';
4257
+ requested_credits: number;
4258
+ amount_cents: number;
4259
+ currency: string;
4260
+ } | {
4261
+ status: 'applied';
4262
+ operation_id: string;
4263
+ operation_state: 'applied';
4264
+ applied_credits: number;
4265
+ amount_cents: number;
4266
+ currency: string;
4267
+ balance?: number;
4268
+ stripe_payment_intent_id?: string;
4269
+ };
4250
4270
  /** One published plan from `GET /api/v2/billing/catalog/current`. */
4251
4271
  type BillingPlanEntry = {
4252
4272
  plan_family_id: string;
@@ -4409,6 +4429,11 @@ type BillingNamespace = {
4409
4429
  credits: number;
4410
4430
  idempotencyKey?: string;
4411
4431
  }) => Promise<BillingTopUpResult>;
4432
+ /** Request a durable pending or applied receipt for a saved-card top-up. */
4433
+ topUpWithReceipt: (options: {
4434
+ credits: number;
4435
+ idempotencyKey?: string;
4436
+ }) => Promise<BillingTopUpReceipt>;
4412
4437
  /** Published plans plus the plan you are on ("what plans exist and what am I on"). */
4413
4438
  plans: () => Promise<BillingPlansResult>;
4414
4439
  subscription: {
@@ -5528,6 +5553,15 @@ declare class DeeplineClient {
5528
5553
  credits: number;
5529
5554
  idempotencyKey?: string;
5530
5555
  }): Promise<BillingTopUpResult>;
5556
+ /**
5557
+ * Request a durable top-up operation receipt. A pending receipt does not
5558
+ * imply that payment or credit activation has completed. Prefer
5559
+ * `client.billing.topUpWithReceipt(...)`.
5560
+ */
5561
+ topUpBillingBalanceWithReceipt(options: {
5562
+ credits: number;
5563
+ idempotencyKey?: string;
5564
+ }): Promise<BillingTopUpReceipt>;
5531
5565
  /**
5532
5566
  * Subscription state for the active workspace: active plan, whether a
5533
5567
  * Stripe subscription backs it, renewal/cancellation facts, and remaining
@@ -6741,4 +6775,4 @@ declare function writeCsvOutputFile(rows: Array<Record<string, unknown>>, stem:
6741
6775
  */
6742
6776
  declare function extractSummaryFields(payload: unknown): Record<string, Scalar>;
6743
6777
 
6744
- export { type AsyncPlayRunRef, AuthError, type BillingCreditPool, type BillingInvoiceEntry, type BillingInvoicesResult, type BillingNamespace, type BillingPaymentMethodSummary, type BillingRecentUsageEntry, type BillingSubscriptionCancelResult, type BillingSubscriptionStatus, type BillingTopUpResult, type BillingUsageEvent, type BillingUsageOptions, type BillingUsageResult, type ClearPlayHistoryRequest, type ClearPlayHistoryResult, type ColumnMap, type ColumnResolver, type ConditionalStepResolver, ConfigError, type CreateNotificationGroupInput, type CreateNotificationGroupResult, type CsvInput, type CsvOptions, type CustomerDbQueryResult, DEEPLINE_TOOL_CATEGORIES, type DatasetBuilder, type DatasetColumnDefinition, type DatasetColumnRunInput, type DbNamespace, Deepline, DeeplineClient, type DeeplineClientOptions, DeeplineContext, DeeplineError, type DeeplineExecutionsNamespace, type DeeplineNamedPlay, type DeeplinePlayRuntimeContext, type DeeplinePlaysNamespace, type DeeplineToolCategory, type DeeplineToolExecuteResult, type DeeplineToolsNamespace, type DefinePlayConfig, type DefinedPlay, type ExecutionByKeyResult, type ExecutionRecovery, type FetchOptions, type FileInput, type IngestionStorageRepairResult, type LegacyMonitorStatusFilter, type LiveEventEnvelope, MONITOR_JOB_PHASES, MONITOR_JOB_RECONCILIATION_STATES, MONITOR_JOB_STATES, type MonitorBatchNamespace, type MonitorCheckResult, type MonitorDefinition, type MonitorDeleteResult, type MonitorDependents, type MonitorDeployResult, type MonitorDetail, type MonitorFleetDeactivateOptions, MonitorFleetDefinition, type MonitorFleetGetOptions, type MonitorFleetReactivateOptions, type MonitorFleetResult, type MonitorFleetStatus, type MonitorFleetSyncOptions, type MonitorFleetWaitOptions, type MonitorFleetsNamespace, type MonitorJobDeployOptions, type MonitorJobLogsOptions, type MonitorJobPhase, type MonitorJobReconciliationState, type MonitorJobResult, type MonitorJobState, type MonitorJobWaitOptions, type MonitorJobsNamespace, type MonitorListEntry, type MonitorPayload, type MonitorReactivateResult, type MonitorSpec, type MonitorState, type MonitorStateFilter, type MonitorUpdateChangeSummary, type MonitorUpdateResult, type MonitorsAccessStatus, type MonitorsAvailableOptions, type MonitorsAvailableResult, type MonitorsListOptions, type MonitorsListResult, type MonitorsNamespace, PLAY_BOOTSTRAP_COMPANY_FIELDS, PLAY_BOOTSTRAP_COMPANY_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_CONTACT_FIELDS, PLAY_BOOTSTRAP_FINDER_KINDS, PLAY_BOOTSTRAP_OUTPUT_FIELD_BY_FINDER, PLAY_BOOTSTRAP_PEOPLE_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_PROVIDER_CATEGORY_BY_FINDER, PLAY_BOOTSTRAP_SOURCE_KINDS, PLAY_BOOTSTRAP_STAGE_KINDS, PLAY_BOOTSTRAP_TEMPLATES, PROD_URL, type PlayActivityObservation, type PlayActivityState, type PlayActivityTarget, type PlayAsyncCallOptions, type PlayBindings, type PlayBootstrapEntityKind, type PlayBootstrapFinderKind, type PlayCallExecution, type PlayCallOptions, type PlayCostEstimate, type PlayFetchResponse, type PlayInputContract, type PlayJob, type PlayListItem, type PlayLiveEvent, type PlayReferenceLike, type PlayRevisionSummary, type PlayRunActionPackage, type PlayRunActivityProjection, type PlayRunDatasetActions, type PlayRunId, type PlayRunPackage, type PlayRunResult, type PlayRunStart, type PlaySheetRow, type PlaySheetRowsResult, type PlayStatus, type PlayStepProgramStep, type PlaysListOptions, type PlaysListPage, type PrebuiltPlayRef, type PublishPlayVersionRequest, type PublishPlayVersionResult, RateLimitError, type RerunOptions, type RerunPlayRunResult, type ResolvedConfig, RunObserveTransportUnavailableError, type RunsListOptions, type RunsListPage, type RunsLogsOptions, type RunsLogsResult, type RunsNamespace, type RunsTailOptions, type RuntimeStepOptions, SDK_API_CONTRACT, SDK_VERSION, type SqlListenerDeclaration, type SqlListenerEvent, type SqlListenerOperation, type SqlQuery, type StartPlayRunRequest, type StepOptions, type StepProgram, type StepProgramResolver, type StepResolver, type StopAllCandidate, type StopAllPlayRunsDryRunResult, type StopAllPlayRunsResult, type StopAllPlayRunsStopResult, type StopAllRunsOptions, type StopPlayRunResult, type ToolDefinition, ToolExecuteResult, type ToolExecution, ToolExecutionError, ToolExecutionErrorOptions, type ToolExecutionRequest, type ToolMetadata, ToolRateLimitError, ToolResultBilling, type ToolSearchOptions, type ToolSearchResult, type WorkspaceCreateResult, type WorkspacesNamespace, defineInput, defineMonitor, definePlay, defineWorkflow, extractSummaryFields, formatPlayBootstrapFinderKinds, formatPlayBootstrapFinderKindsForSentence, formatPlayBootstrapTemplates, getDefinedPlayMetadata, isPlayBootstrapFinderKind, isPlayBootstrapTemplate, isStopAllPlayRunsDryRunResult, resolveConfig, runIf, steps, tryConvertToList, writeCsvOutputFile, writeJsonOutputFile };
6778
+ export { type AsyncPlayRunRef, AuthError, type BillingCreditPool, type BillingInvoiceEntry, type BillingInvoicesResult, type BillingNamespace, type BillingPaymentMethodSummary, type BillingRecentUsageEntry, type BillingSubscriptionCancelResult, type BillingSubscriptionStatus, type BillingTopUpReceipt, type BillingTopUpResult, type BillingUsageEvent, type BillingUsageOptions, type BillingUsageResult, type ClearPlayHistoryRequest, type ClearPlayHistoryResult, type ColumnMap, type ColumnResolver, type ConditionalStepResolver, ConfigError, type CreateNotificationGroupInput, type CreateNotificationGroupResult, type CsvInput, type CsvOptions, type CustomerDbQueryResult, DEEPLINE_TOOL_CATEGORIES, type DatasetBuilder, type DatasetColumnDefinition, type DatasetColumnRunInput, type DbNamespace, Deepline, DeeplineClient, type DeeplineClientOptions, DeeplineContext, DeeplineError, type DeeplineExecutionsNamespace, type DeeplineNamedPlay, type DeeplinePlayRuntimeContext, type DeeplinePlaysNamespace, type DeeplineToolCategory, type DeeplineToolExecuteResult, type DeeplineToolsNamespace, type DefinePlayConfig, type DefinedPlay, type ExecutionByKeyResult, type ExecutionRecovery, type FetchOptions, type FileInput, type IngestionStorageRepairResult, type LegacyMonitorStatusFilter, type LiveEventEnvelope, MONITOR_JOB_PHASES, MONITOR_JOB_RECONCILIATION_STATES, MONITOR_JOB_STATES, type MonitorBatchNamespace, type MonitorCheckResult, type MonitorDefinition, type MonitorDeleteResult, type MonitorDependents, type MonitorDeployResult, type MonitorDetail, type MonitorFleetDeactivateOptions, MonitorFleetDefinition, type MonitorFleetGetOptions, type MonitorFleetReactivateOptions, type MonitorFleetResult, type MonitorFleetStatus, type MonitorFleetSyncOptions, type MonitorFleetWaitOptions, type MonitorFleetsNamespace, type MonitorJobDeployOptions, type MonitorJobLogsOptions, type MonitorJobPhase, type MonitorJobReconciliationState, type MonitorJobResult, type MonitorJobState, type MonitorJobWaitOptions, type MonitorJobsNamespace, type MonitorListEntry, type MonitorPayload, type MonitorReactivateResult, type MonitorSpec, type MonitorState, type MonitorStateFilter, type MonitorUpdateChangeSummary, type MonitorUpdateResult, type MonitorsAccessStatus, type MonitorsAvailableOptions, type MonitorsAvailableResult, type MonitorsListOptions, type MonitorsListResult, type MonitorsNamespace, PLAY_BOOTSTRAP_COMPANY_FIELDS, PLAY_BOOTSTRAP_COMPANY_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_CONTACT_FIELDS, PLAY_BOOTSTRAP_FINDER_KINDS, PLAY_BOOTSTRAP_OUTPUT_FIELD_BY_FINDER, PLAY_BOOTSTRAP_PEOPLE_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_PROVIDER_CATEGORY_BY_FINDER, PLAY_BOOTSTRAP_SOURCE_KINDS, PLAY_BOOTSTRAP_STAGE_KINDS, PLAY_BOOTSTRAP_TEMPLATES, PROD_URL, type PlayActivityObservation, type PlayActivityState, type PlayActivityTarget, type PlayAsyncCallOptions, type PlayBindings, type PlayBootstrapEntityKind, type PlayBootstrapFinderKind, type PlayCallExecution, type PlayCallOptions, type PlayCostEstimate, type PlayFetchResponse, type PlayInputContract, type PlayJob, type PlayListItem, type PlayLiveEvent, type PlayReferenceLike, type PlayRevisionSummary, type PlayRunActionPackage, type PlayRunActivityProjection, type PlayRunDatasetActions, type PlayRunId, type PlayRunPackage, type PlayRunResult, type PlayRunStart, type PlaySheetRow, type PlaySheetRowsResult, type PlayStatus, type PlayStepProgramStep, type PlaysListOptions, type PlaysListPage, type PrebuiltPlayRef, type PublishPlayVersionRequest, type PublishPlayVersionResult, RateLimitError, type RerunOptions, type RerunPlayRunResult, type ResolvedConfig, RunObserveTransportUnavailableError, type RunsListOptions, type RunsListPage, type RunsLogsOptions, type RunsLogsResult, type RunsNamespace, type RunsTailOptions, type RuntimeStepOptions, SDK_API_CONTRACT, SDK_VERSION, type SqlListenerDeclaration, type SqlListenerEvent, type SqlListenerOperation, type SqlQuery, type StartPlayRunRequest, type StepOptions, type StepProgram, type StepProgramResolver, type StepResolver, type StopAllCandidate, type StopAllPlayRunsDryRunResult, type StopAllPlayRunsResult, type StopAllPlayRunsStopResult, type StopAllRunsOptions, type StopPlayRunResult, type ToolDefinition, ToolExecuteResult, type ToolExecution, ToolExecutionError, ToolExecutionErrorOptions, type ToolExecutionRequest, type ToolMetadata, ToolRateLimitError, ToolResultBilling, type ToolSearchOptions, type ToolSearchResult, type WorkspaceCreateResult, type WorkspacesNamespace, defineInput, defineMonitor, definePlay, defineWorkflow, extractSummaryFields, formatPlayBootstrapFinderKinds, formatPlayBootstrapFinderKindsForSentence, formatPlayBootstrapTemplates, getDefinedPlayMetadata, isPlayBootstrapFinderKind, isPlayBootstrapTemplate, isStopAllPlayRunsDryRunResult, resolveConfig, runIf, steps, tryConvertToList, writeCsvOutputFile, writeJsonOutputFile };
package/dist/index.js CHANGED
@@ -864,7 +864,7 @@ var SDK_RELEASE = {
864
864
  // getters keep their established compatibility behavior.
865
865
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
866
866
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
867
- version: "0.3.192",
867
+ version: "0.3.194",
868
868
  updateSummary: "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.",
869
869
  packageCapabilities: {
870
870
  updatePreferences: 1
@@ -4889,6 +4889,7 @@ var DeeplineClient = class _DeeplineClient {
4889
4889
  };
4890
4890
  this.billing = {
4891
4891
  topUp: (options2) => this.topUpBillingBalance(options2),
4892
+ topUpWithReceipt: (options2) => this.topUpBillingBalanceWithReceipt(options2),
4892
4893
  plans: () => this.getBillingPlans(),
4893
4894
  subscription: {
4894
4895
  status: () => this.getBillingSubscriptionStatus(),
@@ -7519,6 +7520,22 @@ var DeeplineClient = class _DeeplineClient {
7519
7520
  { maxRetries: 0, exactUrlOnly: true }
7520
7521
  );
7521
7522
  }
7523
+ /**
7524
+ * Request a durable top-up operation receipt. A pending receipt does not
7525
+ * imply that payment or credit activation has completed. Prefer
7526
+ * `client.billing.topUpWithReceipt(...)`.
7527
+ */
7528
+ async topUpBillingBalanceWithReceipt(options) {
7529
+ return this.http.post(
7530
+ "/api/v2/billing/top-up",
7531
+ {
7532
+ credits: options.credits,
7533
+ ...options.idempotencyKey ? { idempotency_key: options.idempotencyKey } : {}
7534
+ },
7535
+ { "x-deepline-top-up-receipt": "operation-v1" },
7536
+ { maxRetries: 0, exactUrlOnly: true }
7537
+ );
7538
+ }
7522
7539
  /**
7523
7540
  * Subscription state for the active workspace: active plan, whether a
7524
7541
  * Stripe subscription backs it, renewal/cancellation facts, and remaining
package/dist/index.mjs CHANGED
@@ -768,7 +768,7 @@ var SDK_RELEASE = {
768
768
  // getters keep their established compatibility behavior.
769
769
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
770
770
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
771
- version: "0.3.192",
771
+ version: "0.3.194",
772
772
  updateSummary: "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.",
773
773
  packageCapabilities: {
774
774
  updatePreferences: 1
@@ -4793,6 +4793,7 @@ var DeeplineClient = class _DeeplineClient {
4793
4793
  };
4794
4794
  this.billing = {
4795
4795
  topUp: (options2) => this.topUpBillingBalance(options2),
4796
+ topUpWithReceipt: (options2) => this.topUpBillingBalanceWithReceipt(options2),
4796
4797
  plans: () => this.getBillingPlans(),
4797
4798
  subscription: {
4798
4799
  status: () => this.getBillingSubscriptionStatus(),
@@ -7423,6 +7424,22 @@ var DeeplineClient = class _DeeplineClient {
7423
7424
  { maxRetries: 0, exactUrlOnly: true }
7424
7425
  );
7425
7426
  }
7427
+ /**
7428
+ * Request a durable top-up operation receipt. A pending receipt does not
7429
+ * imply that payment or credit activation has completed. Prefer
7430
+ * `client.billing.topUpWithReceipt(...)`.
7431
+ */
7432
+ async topUpBillingBalanceWithReceipt(options) {
7433
+ return this.http.post(
7434
+ "/api/v2/billing/top-up",
7435
+ {
7436
+ credits: options.credits,
7437
+ ...options.idempotencyKey ? { idempotency_key: options.idempotencyKey } : {}
7438
+ },
7439
+ { "x-deepline-top-up-receipt": "operation-v1" },
7440
+ { maxRetries: 0, exactUrlOnly: true }
7441
+ );
7442
+ }
7426
7443
  /**
7427
7444
  * Subscription state for the active workspace: active plan, whether a
7428
7445
  * Stripe subscription backs it, renewal/cancellation facts, and remaining
@@ -149,7 +149,7 @@ type SdkRelease = {
149
149
  supportPolicy: SdkSupportPolicy;
150
150
  };
151
151
  declare const SDK_RELEASE: {
152
- readonly version: "0.3.192";
152
+ readonly version: "0.3.194";
153
153
  readonly updateSummary: "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.";
154
154
  readonly packageCapabilities: {
155
155
  readonly updatePreferences: 1;
package/dist/release.d.ts CHANGED
@@ -149,7 +149,7 @@ type SdkRelease = {
149
149
  supportPolicy: SdkSupportPolicy;
150
150
  };
151
151
  declare const SDK_RELEASE: {
152
- readonly version: "0.3.192";
152
+ readonly version: "0.3.194";
153
153
  readonly updateSummary: "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.";
154
154
  readonly packageCapabilities: {
155
155
  readonly updatePreferences: 1;
package/dist/release.js CHANGED
@@ -74,7 +74,7 @@ var SDK_RELEASE = {
74
74
  // getters keep their established compatibility behavior.
75
75
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
76
76
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
77
- version: "0.3.192",
77
+ version: "0.3.194",
78
78
  updateSummary: "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.",
79
79
  packageCapabilities: {
80
80
  updatePreferences: 1
package/dist/release.mjs CHANGED
@@ -48,7 +48,7 @@ var SDK_RELEASE = {
48
48
  // getters keep their established compatibility behavior.
49
49
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
50
50
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
51
- version: "0.3.192",
51
+ version: "0.3.194",
52
52
  updateSummary: "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.",
53
53
  packageCapabilities: {
54
54
  updatePreferences: 1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.3.192",
3
+ "version": "0.3.194",
4
4
  "description": "GTM data CLI and TypeScript SDK for coding agents",
5
5
  "license": "MIT",
6
6
  "homepage": "https://code.deepline.com",