deepline 0.3.144 → 0.3.146

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 (32) hide show
  1. package/dist/bundling-sources/sdk/src/client.ts +53 -1
  2. package/dist/bundling-sources/sdk/src/index.ts +1 -0
  3. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  4. package/dist/bundling-sources/shared_libs/play-runtime/async-operation.ts +40 -4
  5. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +259 -7
  6. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +10 -0
  7. package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +10 -0
  8. package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +58 -19
  9. package/dist/bundling-sources/shared_libs/play-runtime/run-snapshot-stream.ts +17 -11
  10. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +57 -2
  11. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +73 -16
  12. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +57 -3
  13. package/dist/bundling-sources/shared_libs/play-runtime/step-progress.ts +7 -0
  14. package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +35 -3
  15. package/dist/bundling-sources/shared_libs/play-runtime/worker-api-types.ts +1 -0
  16. package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +11 -1
  17. package/dist/cli/index.js +85 -17
  18. package/dist/cli/index.mjs +85 -17
  19. package/dist/{compiler-manifest-BIqRyj5m.d.mts → compiler-manifest-BJBNPTWt.d.mts} +2 -1
  20. package/dist/{compiler-manifest-BIqRyj5m.d.ts → compiler-manifest-BJBNPTWt.d.ts} +2 -1
  21. package/dist/index.d.mts +26 -4
  22. package/dist/index.d.ts +26 -4
  23. package/dist/index.js +78 -10
  24. package/dist/index.mjs +78 -10
  25. package/dist/install-integrity.json +2 -2
  26. package/dist/plays/bundle-play-file.d.mts +2 -2
  27. package/dist/plays/bundle-play-file.d.ts +2 -2
  28. package/dist/release.d.mts +1 -1
  29. package/dist/release.d.ts +1 -1
  30. package/dist/release.js +1 -1
  31. package/dist/release.mjs +1 -1
  32. package/package.json +1 -1
@@ -3063,7 +3063,7 @@ var SDK_RELEASE = {
3063
3063
  // getters keep their established compatibility behavior.
3064
3064
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
3065
3065
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
3066
- version: "0.3.144",
3066
+ version: "0.3.146",
3067
3067
  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.",
3068
3068
  packageCapabilities: {
3069
3069
  updatePreferences: 1
@@ -5308,19 +5308,32 @@ function summarizeRunRowOutcomes(snapshot) {
5308
5308
  let completedRows = 0;
5309
5309
  let failedRows = 0;
5310
5310
  let totalRows = 0;
5311
+ let supersededRows = 0;
5311
5312
  for (const step of Object.values(snapshot.stepsById)) {
5312
5313
  const progress = step.progress;
5313
5314
  if (!progress) continue;
5314
5315
  completedRows += Math.max(0, finiteNumber(progress.completed) ?? 0);
5315
5316
  failedRows += Math.max(0, finiteNumber(progress.failed) ?? 0);
5317
+ supersededRows += Math.max(0, finiteNumber(progress.supersededRows) ?? 0);
5316
5318
  const stepTotal = finiteNumber(progress.total);
5317
- totalRows += stepTotal !== null && stepTotal >= 0 ? stepTotal : Math.max(0, finiteNumber(progress.completed) ?? 0) + Math.max(0, finiteNumber(progress.failed) ?? 0);
5318
- }
5319
+ totalRows += stepTotal !== null && stepTotal >= 0 ? stepTotal : Math.max(0, finiteNumber(progress.completed) ?? 0) + Math.max(0, finiteNumber(progress.failed) ?? 0) + Math.max(0, finiteNumber(progress.supersededRows) ?? 0);
5320
+ }
5321
+ const resultSummary = isRecord5(snapshot.resultSummary) ? snapshot.resultSummary : null;
5322
+ const resultRowOutcomes = isRecord5(resultSummary?.rowOutcomes) ? resultSummary.rowOutcomes : null;
5323
+ const terminalCompletedRows = finiteNumber(resultRowOutcomes?.completedRows);
5324
+ const terminalFailedRows = finiteNumber(resultRowOutcomes?.failedRows);
5325
+ const terminalTotalRows = finiteNumber(resultRowOutcomes?.totalRows);
5326
+ const terminalSupersededRows = finiteNumber(
5327
+ resultRowOutcomes?.supersededRows
5328
+ );
5329
+ const settledCompletedRows = terminalCompletedRows ?? completedRows;
5330
+ const settledFailedRows = terminalFailedRows ?? failedRows;
5319
5331
  return {
5320
- completedRows,
5321
- failedRows,
5322
- totalRows,
5323
- hasRowFailures: failedRows > 0
5332
+ completedRows: settledCompletedRows,
5333
+ failedRows: settledFailedRows,
5334
+ totalRows: terminalTotalRows ?? totalRows,
5335
+ hasRowFailures: settledFailedRows > 0,
5336
+ ...(terminalSupersededRows ?? supersededRows) > 0 ? { supersededRows: terminalSupersededRows ?? supersededRows } : {}
5324
5337
  };
5325
5338
  }
5326
5339
  function createEmptyPlayRunLedgerSnapshot(input2) {
@@ -5478,6 +5491,7 @@ function normalizeStepProgress(value) {
5478
5491
  ...optionalFiniteNumber(value.activeRows) !== void 0 ? { activeRows: optionalFiniteNumber(value.activeRows) } : {},
5479
5492
  ...optionalFiniteNumber(value.waitingRows) !== void 0 ? { waitingRows: optionalFiniteNumber(value.waitingRows) } : {},
5480
5493
  ...optionalFiniteNumber(value.completedRows) !== void 0 ? { completedRows: optionalFiniteNumber(value.completedRows) } : {},
5494
+ ...optionalFiniteNumber(value.supersededRows) !== void 0 ? { supersededRows: optionalFiniteNumber(value.supersededRows) } : {},
5481
5495
  ...optionalString(value.message) ? { message: optionalString(value.message) } : {},
5482
5496
  ...optionalNullableString(value.artifactTableNamespace) !== void 0 ? {
5483
5497
  artifactTableNamespace: optionalNullableString(
@@ -5729,6 +5743,7 @@ function buildSnapshotFromLedger(snapshot) {
5729
5743
  activeRows: step.progress.activeRows,
5730
5744
  waitingRows: step.progress.waitingRows,
5731
5745
  completedRows: step.progress.completedRows,
5746
+ supersededRows: step.progress.supersededRows,
5732
5747
  message: step.progress.message,
5733
5748
  artifactTableNamespace: step.progress.artifactTableNamespace ?? step.artifactTableNamespace ?? null,
5734
5749
  startedAt: step.startedAt ?? null,
@@ -5742,7 +5757,8 @@ function buildSnapshotFromLedger(snapshot) {
5742
5757
  ...step.progress?.nodeIo ? { nodeIo: step.progress.nodeIo } : {}
5743
5758
  }));
5744
5759
  const liveStatus = normalizePlayRunLiveStatus(snapshot.status);
5745
- const rowOutcomes = isTerminalPlayRunLiveStatus(liveStatus) && Object.keys(snapshot.stepsById).length > 0 ? summarizeRunRowOutcomes(snapshot) : null;
5760
+ const terminalRowOutcomes = isTerminalPlayRunLiveStatus(liveStatus) ? summarizeRunRowOutcomes(snapshot) : null;
5761
+ const rowOutcomes = terminalRowOutcomes && (Object.keys(snapshot.stepsById).length > 0 || terminalRowOutcomes.totalRows > 0 || (terminalRowOutcomes.supersededRows ?? 0) > 0) ? terminalRowOutcomes : null;
5746
5762
  return {
5747
5763
  runId: snapshot.runId,
5748
5764
  status: liveStatus,
@@ -7095,6 +7111,7 @@ var DeeplineClient = class _DeeplineClient {
7095
7111
  invoices: {
7096
7112
  list: (options2) => this.listBillingInvoices(options2)
7097
7113
  },
7114
+ usageEvent: (requestId) => this.getBillingUsageEvent(requestId),
7098
7115
  targetPlans: () => this.getTargetBillingPlans(),
7099
7116
  targetStatus: () => this.getTargetBillingStatus(),
7100
7117
  autoRecharge: {
@@ -7429,7 +7446,7 @@ var DeeplineClient = class _DeeplineClient {
7429
7446
  * guaranteed support for every model. Runtime AI SDK/Gateway errors remain
7430
7447
  * authoritative for model-gated values.
7431
7448
  *
7432
- * @param model - Gateway model id such as `"openai/gpt-5.5"`
7449
+ * @param model - Exact-case Gateway model id such as `"openai/gpt-5.6-luna"`
7433
7450
  * @returns Model metadata, provider option shapes, and runnable examples
7434
7451
  */
7435
7452
  async describeModel(model) {
@@ -9466,6 +9483,33 @@ var DeeplineClient = class _DeeplineClient {
9466
9483
  async getBillingPlans() {
9467
9484
  return this.http.get("/api/v2/billing/catalog/current");
9468
9485
  }
9486
+ /**
9487
+ * Read the authenticated usage record for one execution request. The
9488
+ * request id comes from the original `executeTool` result and is not a
9489
+ * retry or idempotency token.
9490
+ */
9491
+ async getBillingUsageEvent(requestId) {
9492
+ const normalizedRequestId = requestId.trim();
9493
+ if (normalizedRequestId.length === 0 || normalizedRequestId.length > 200 || normalizedRequestId !== requestId) {
9494
+ throw new DeeplineError(
9495
+ "Usage request_id must contain 1\u2013200 characters with no leading or trailing whitespace.",
9496
+ void 0,
9497
+ "INVALID_USAGE_REQUEST_ID"
9498
+ );
9499
+ }
9500
+ const response = await this.http.get(
9501
+ `/api/v2/usage/events?request_id=${encodeURIComponent(normalizedRequestId)}`
9502
+ );
9503
+ const event = response.entries?.[0];
9504
+ if (!event) {
9505
+ throw new DeeplineError(
9506
+ "No usage event was found for this request_id.",
9507
+ void 0,
9508
+ "USAGE_EVENT_NOT_FOUND"
9509
+ );
9510
+ }
9511
+ return event;
9512
+ }
9469
9513
  /**
9470
9514
  * Charge the saved payment method and add Deepline credits to the active
9471
9515
  * workspace. Prefer `client.billing.topUp(...)`.
@@ -23700,14 +23744,18 @@ function getProgressLinesFromLiveEvent(event) {
23700
23744
  const rowOutcomes = readRowOutcomeSummary({
23701
23745
  rowOutcomes: payload.rowOutcomes
23702
23746
  });
23703
- if (rowOutcomes?.hasRowFailures) {
23747
+ if (rowOutcomes && (rowOutcomes.hasRowFailures || (rowOutcomes.supersededRows ?? 0) > 0)) {
23704
23748
  const counts = formatProgressCounts({
23705
23749
  completed: rowOutcomes.completedRows,
23706
23750
  total: rowOutcomes.totalRows,
23707
23751
  failed: rowOutcomes.failedRows
23708
23752
  });
23709
- if (counts) {
23710
- lines.push(`progress run outcomes: ${counts}`);
23753
+ const outcomeParts = [
23754
+ counts,
23755
+ ...rowOutcomes && (rowOutcomes.supersededRows ?? 0) > 0 ? [formatSupersededRowsNotice(rowOutcomes.supersededRows)] : []
23756
+ ].filter((part) => Boolean(part));
23757
+ if (outcomeParts.length > 0) {
23758
+ lines.push(`progress run outcomes: ${outcomeParts.join(", ")}`);
23711
23759
  }
23712
23760
  }
23713
23761
  return lines;
@@ -24586,9 +24634,13 @@ function buildRunWarnings(status, rowsInfo) {
24586
24634
  const rowOutcomeWarnings = rowOutcomes?.hasRowFailures ? [
24587
24635
  `${status.status === "completed" ? "Run completed" : "Run ended"} with ${formatInteger(rowOutcomes.failedRows)} failed row(s); inspect the persisted failed rows before treating the output as complete.`
24588
24636
  ] : [];
24637
+ const supersededRowNotices = (rowOutcomes?.supersededRows ?? 0) > 0 ? [
24638
+ `Latest-write-wins: ${formatSupersededRowsNotice(rowOutcomes.supersededRows ?? 0)}; the newer write still owns that Runtime Sheet row.`
24639
+ ] : [];
24589
24640
  if (status.status === "completed" && rowsInfo?.totalRows === 0) {
24590
24641
  return [
24591
24642
  ...rowOutcomeWarnings,
24643
+ ...supersededRowNotices,
24592
24644
  "Run completed with 0 output rows.",
24593
24645
  ...outputWarnings
24594
24646
  ];
@@ -24596,11 +24648,12 @@ function buildRunWarnings(status, rowsInfo) {
24596
24648
  if (rowsInfo && !rowsInfo.complete) {
24597
24649
  return [
24598
24650
  ...rowOutcomeWarnings,
24651
+ ...supersededRowNotices,
24599
24652
  `Run output is partial: showing ${rowsInfo.rows.length} preview row(s) of ${rowsInfo.totalRows}.`,
24600
24653
  ...outputWarnings
24601
24654
  ];
24602
24655
  }
24603
- return [...rowOutcomeWarnings, ...outputWarnings];
24656
+ return [...rowOutcomeWarnings, ...supersededRowNotices, ...outputWarnings];
24604
24657
  }
24605
24658
  function buildRunNextCommands(status) {
24606
24659
  const runId = status.runId?.trim();
@@ -24636,6 +24689,9 @@ function getNumericField(value, key) {
24636
24689
  const field = getRecordField(value, key);
24637
24690
  return typeof field === "number" && Number.isFinite(field) ? field : null;
24638
24691
  }
24692
+ function formatSupersededRowsNotice(count) {
24693
+ return `${formatInteger(count)} row${count === 1 ? "" : "s"} skipped because a newer Runtime Sheet write took precedence`;
24694
+ }
24639
24695
  function readRowOutcomeSummary(value) {
24640
24696
  const record3 = getRecordField(value, "rowOutcomes");
24641
24697
  if (!record3) return null;
@@ -24646,11 +24702,13 @@ function readRowOutcomeSummary(value) {
24646
24702
  return null;
24647
24703
  }
24648
24704
  const explicitHasFailures = getRecordField(record3, "hasRowFailures");
24705
+ const supersededRows = getNumericField(record3, "supersededRows");
24649
24706
  return {
24650
24707
  completedRows,
24651
24708
  failedRows,
24652
24709
  totalRows,
24653
- hasRowFailures: typeof explicitHasFailures === "boolean" ? explicitHasFailures : failedRows > 0
24710
+ hasRowFailures: typeof explicitHasFailures === "boolean" ? explicitHasFailures : failedRows > 0,
24711
+ ...supersededRows !== null ? { supersededRows: Math.max(0, supersededRows) } : {}
24654
24712
  };
24655
24713
  }
24656
24714
  function getStringField(value, key) {
@@ -24893,12 +24951,16 @@ function normalizeProgressForEnvelope(status, rowsInfo) {
24893
24951
  const total = rowOutcomes?.totalRows ?? getNumericField(progress, "totalRows") ?? getNumericField(progress, "total") ?? rowsInfo?.totalRows ?? null;
24894
24952
  const failed = rowOutcomes?.failedRows ?? getNumericField(progress, "failed") ?? getNumericField(progress, "failedRows") ?? null;
24895
24953
  const completed = rowOutcomes?.completedRows ?? getNumericField(progress, "completed") ?? getNumericField(progress, "completedRows") ?? (status.status === "completed" ? total : null);
24896
- const pending = getNumericField(progress, "pending") ?? (typeof total === "number" && typeof completed === "number" && typeof failed === "number" ? Math.max(0, total - completed - failed) : null);
24954
+ const supersededRows = rowOutcomes?.supersededRows ?? getNumericField(progress, "supersededRows");
24955
+ const supersededOffset = supersededRows ?? 0;
24956
+ const progressPending = getNumericField(progress, "pending");
24957
+ const pending = (progressPending !== null ? Math.max(0, progressPending - supersededOffset) : null) ?? (typeof total === "number" && typeof completed === "number" && typeof failed === "number" ? Math.max(0, total - completed - failed - supersededOffset) : null);
24897
24958
  return {
24898
24959
  total,
24899
24960
  totalRows: total,
24900
24961
  completed,
24901
24962
  completedRows: completed,
24963
+ ...supersededRows !== null ? { supersededRows: Math.max(0, supersededRows) } : {},
24902
24964
  pending,
24903
24965
  failed,
24904
24966
  executed: getNumericField(progress, "executed"),
@@ -25029,6 +25091,9 @@ function compactPlayStatus(status) {
25029
25091
  ) : [],
25030
25092
  ...rowOutcomes2.hasRowFailures ? [
25031
25093
  `${status.status === "completed" ? "Run completed" : "Run ended"} with ${formatInteger(rowOutcomes2.failedRows)} failed row(s); inspect the persisted failed rows before treating the output as complete.`
25094
+ ] : [],
25095
+ ...(rowOutcomes2.supersededRows ?? 0) > 0 ? [
25096
+ `Latest-write-wins: ${formatSupersededRowsNotice(rowOutcomes2.supersededRows ?? 0)}; the newer write still owns that Runtime Sheet row.`
25032
25097
  ] : []
25033
25098
  ]
25034
25099
  } : packaged;
@@ -48053,7 +48118,7 @@ Examples:
48053
48118
  deepline tools describe hunter_email_verifier --schema-only
48054
48119
  deepline tools describe hunter_email_verifier --examples-only
48055
48120
  deepline tools describe hunter_email_verifier --json
48056
- deepline tools describe deeplineagent --model openai/gpt-5.5 --json
48121
+ deepline tools describe deeplineagent --model openai/gpt-5.6-luna --json
48057
48122
  deepline tools describe ai_inference --estimate-payload @payload.json --json
48058
48123
  deepline tools describe ai_evaluate --estimate-payload @payload.json --json
48059
48124
  deepline tools execute hunter_email_verifier --input '{"email":"a@b.com"}'
@@ -48099,9 +48164,11 @@ Notes:
48099
48164
  waterfalls, row maps, checkpoints, and retries.
48100
48165
  Calling a provider-backed tool can spend Deepline credits. Use --json for the
48101
48166
  stable result payload plus output preview and debugging helpers.
48167
+ --timeout sets this CLI request's HTTP deadline; it does not cancel provider work.
48102
48168
 
48103
48169
  Examples:
48104
48170
  deepline tools execute hunter_email_verifier --input '{"email":"a@b.com"}'
48171
+ deepline tools execute bounceban_verify_bulk --input @batch.json --timeout 10m --json
48105
48172
  deepline tools execute hunter_email_verifier -p email=a@b.com
48106
48173
  deepline tools execute test_rate_limit --input '{"key":"smoke"}' --timeout 90s --json
48107
48174
  deepline tools execute test_rate_limit --input '{"key":"smoke"}' --json | jq '.status'
@@ -48126,7 +48193,7 @@ Examples:
48126
48193
  "Merge a JSON object or @file path into the tool params"
48127
48194
  ).option(
48128
48195
  "--timeout <duration>",
48129
- "Execution HTTP deadline (for example 90s, 5m, or 1h; bare numbers are seconds)"
48196
+ "Client-side HTTP deadline (for example 90s, 5m, or 1h; bare numbers are seconds); it does not cancel provider work"
48130
48197
  ).option(
48131
48198
  "--output-format <format>",
48132
48199
  "Output format: auto, csv, csv_file, json, or json_file"
@@ -49751,6 +49818,7 @@ async function executeTool(args) {
49751
49818
  return 2;
49752
49819
  }
49753
49820
  const rawResponse = await client2.executeTool(parsed.toolId, parsed.params, {
49821
+ ...parsed.timeoutMs !== void 0 ? { timeout: parsed.timeoutMs } : {},
49754
49822
  responseIntent: parsed.outPath || parsed.outputFormat === "csv" || parsed.outputFormat === "csv_file" ? "row_artifact" : "raw",
49755
49823
  ...parsed.timeoutMs !== void 0 ? { timeout: parsed.timeoutMs } : {}
49756
49824
  });
@@ -334,7 +334,8 @@ type ToolResultBilling = {
334
334
  cost_usd?: number;
335
335
  /** Missing on historical responses. Pending pricing has no final amount. */
336
336
  pricing_status?: 'final' | 'pending';
337
- settlement_status?: 'pending' | 'queued' | 'settled' | 'requires_recovery';
337
+ settlement_status?: 'pending' | 'queued' | 'settled' | 'released' | 'requires_recovery';
338
+ billing_outcome_reason?: 'free_operation' | 'provider_no_billable_result' | 'provider_reported_zero_usage' | 'zero_price';
338
339
  estimated_credits?: number;
339
340
  estimated_cost_usd?: number;
340
341
  /** Preserve additive public pricing details across runtime/deployment skew. */
@@ -334,7 +334,8 @@ type ToolResultBilling = {
334
334
  cost_usd?: number;
335
335
  /** Missing on historical responses. Pending pricing has no final amount. */
336
336
  pricing_status?: 'final' | 'pending';
337
- settlement_status?: 'pending' | 'queued' | 'settled' | 'requires_recovery';
337
+ settlement_status?: 'pending' | 'queued' | 'settled' | 'released' | 'requires_recovery';
338
+ billing_outcome_reason?: 'free_operation' | 'provider_no_billable_result' | 'provider_reported_zero_usage' | 'zero_price';
338
339
  estimated_credits?: number;
339
340
  estimated_cost_usd?: number;
340
341
  /** Preserve additive public pricing details across runtime/deployment skew. */
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference path="./text-imports.d.ts" />
2
- import { c as PlayCompilerManifest, T as ToolResultBilling, A as AsyncPlayRunRef$1, i as PlayAuthoringColumnMap, j as PlayAuthoringColumnResolver, k as PlayAuthoringRuntimeContext, l as PlayAuthoringConditionalStepResolver, m as PlayAuthoringCsvInput, n as PlayAuthoringCsvOptions, o as PlayAuthoringDatasetBuilder, p as PlayAuthoringDatasetColumnDefinition, q as PlayAuthoringDatasetColumnRunInput, r as ToolExecuteResult, s as PlayAuthoringReferenceLike, t as PlayReturnObject$1, u as PlayAuthoringDefineConfig, v as PlayAuthoringDefinedPlay, w as PlayAuthoringFetchOptions, x as PlayAuthoringFileInput, y as PlayAuthoringAsyncCallOptions, z as PlayAuthoringBindings, B as PlayAuthoringCallExecution, C as PlayAuthoringCallOptions, D as PlayAuthoringFetchResponse, E as PlayAuthoringInputContract, F as PlayRunId$1, G as PlayAuthoringStepProgramStep, H as PlayAuthoringRuntimeStepOptions, I as PlaySqlListenerDeclaration, J as PlaySqlListenerEvent, K as PlaySqlListenerOperation, L as PlaySqlQuery, M as PlayAuthoringStepOptions, N as PlayAuthoringStepProgram, O as PlayAuthoringStepProgramResolver, Q as PlayAuthoringStepResolver, R as PlayToolExecutionRequest, S as PlayAuthoringStepProgramOptions, U as DeeplineError, V as ToolExecutionError, W as ToolExecutionErrorOptions } from './compiler-manifest-BIqRyj5m.mjs';
3
- export { X as CtxFetchHttpError, Y as DEEPLINE_EXTRACTOR_TARGETS, Z as DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS, _ as DeeplineEmailStatusGetterValue, $ as DeeplineExtractorTarget, a0 as DeeplineGetterValue, a1 as DeeplineGetterValueMap, a2 as JOB_CHANGE_STATUS_VALUES, a3 as JobChangeStatus, a4 as PHONE_STATUS_VALUES, a5 as PhoneStatus, a6 as PlayDataset, a7 as PlayDatasetInput, a8 as PreviousCell, a9 as ProviderTransientError, aa as ProviderTransientErrorCategory, ab as ProviderUnavailableError, ac as ProviderUnavailableReason, ad as ToolExecutionErrorCategory, ae as ToolExecutionErrorOrigin, af as ToolExecutionFailureV1, ag as ToolExecutionNetworkKind, ah as ToolExecutionNetworkScope, ai as ToolExecutionPublicDetails, aj as getProviderUnavailableReason, ak as isDeeplineExtractorTarget, al as isProviderUnavailable, am as isProviderWaterfallUnavailableError } from './compiler-manifest-BIqRyj5m.mjs';
2
+ import { c as PlayCompilerManifest, T as ToolResultBilling, A as AsyncPlayRunRef$1, i as PlayAuthoringColumnMap, j as PlayAuthoringColumnResolver, k as PlayAuthoringRuntimeContext, l as PlayAuthoringConditionalStepResolver, m as PlayAuthoringCsvInput, n as PlayAuthoringCsvOptions, o as PlayAuthoringDatasetBuilder, p as PlayAuthoringDatasetColumnDefinition, q as PlayAuthoringDatasetColumnRunInput, r as ToolExecuteResult, s as PlayAuthoringReferenceLike, t as PlayReturnObject$1, u as PlayAuthoringDefineConfig, v as PlayAuthoringDefinedPlay, w as PlayAuthoringFetchOptions, x as PlayAuthoringFileInput, y as PlayAuthoringAsyncCallOptions, z as PlayAuthoringBindings, B as PlayAuthoringCallExecution, C as PlayAuthoringCallOptions, D as PlayAuthoringFetchResponse, E as PlayAuthoringInputContract, F as PlayRunId$1, G as PlayAuthoringStepProgramStep, H as PlayAuthoringRuntimeStepOptions, I as PlaySqlListenerDeclaration, J as PlaySqlListenerEvent, K as PlaySqlListenerOperation, L as PlaySqlQuery, M as PlayAuthoringStepOptions, N as PlayAuthoringStepProgram, O as PlayAuthoringStepProgramResolver, Q as PlayAuthoringStepResolver, R as PlayToolExecutionRequest, S as PlayAuthoringStepProgramOptions, U as DeeplineError, V as ToolExecutionError, W as ToolExecutionErrorOptions } from './compiler-manifest-BJBNPTWt.mjs';
3
+ export { X as CtxFetchHttpError, Y as DEEPLINE_EXTRACTOR_TARGETS, Z as DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS, _ as DeeplineEmailStatusGetterValue, $ as DeeplineExtractorTarget, a0 as DeeplineGetterValue, a1 as DeeplineGetterValueMap, a2 as JOB_CHANGE_STATUS_VALUES, a3 as JobChangeStatus, a4 as PHONE_STATUS_VALUES, a5 as PhoneStatus, a6 as PlayDataset, a7 as PlayDatasetInput, a8 as PreviousCell, a9 as ProviderTransientError, aa as ProviderTransientErrorCategory, ab as ProviderUnavailableError, ac as ProviderUnavailableReason, ad as ToolExecutionErrorCategory, ae as ToolExecutionErrorOrigin, af as ToolExecutionFailureV1, ag as ToolExecutionNetworkKind, ah as ToolExecutionNetworkScope, ai as ToolExecutionPublicDetails, aj as getProviderUnavailableReason, ak as isDeeplineExtractorTarget, al as isProviderUnavailable, am as isProviderWaterfallUnavailableError } from './compiler-manifest-BJBNPTWt.mjs';
4
4
  import { MonitorFleetDefinition } from './monitor-fleet-contract.mjs';
5
5
  export { AdmittedMonitorFleetAuthoringContract, MONITOR_FLEET_AUTHORING_CONTRACT_CHANGELOG, MONITOR_FLEET_AUTHORING_CONTRACT_EDITION, MONITOR_FLEET_DOCUMENTATION, MONITOR_FLEET_FRONTIER_MAX_ROWS, MONITOR_FLEET_MAX_MEMBERS, MonitorFleetAuthoringContractEdition, MonitorFleetAuthoringContractResult, MonitorFleetColumn, MonitorFleetContractIssue, MonitorFleetExpression, MonitorFleetTemplate, admitMonitorFleetAuthoringContract, defineMonitorFleet, fleetColumn, fleetKey, lintMonitorFleetInput, validateMonitorFleetDefinition } from './monitor-fleet-contract.mjs';
6
6
  export { BatchMonitorInput, MonitorInputIssue, MonitorSpec as MonitorInputSpec, lintMonitorBatchInput, lintMonitorSpecTemplate, renderMonitorSpecTemplate } from './monitor-input-contract.mjs';
@@ -4273,6 +4273,20 @@ type WorkspacesNamespace = {
4273
4273
  idempotencyKey: string;
4274
4274
  }) => Promise<WorkspaceCreateResult>;
4275
4275
  };
4276
+ /** One authenticated per-request usage event from `/api/v2/usage/events`. */
4277
+ type BillingUsageEvent = {
4278
+ id: string | null;
4279
+ provider: string;
4280
+ operation: string;
4281
+ status: string;
4282
+ request_id: string;
4283
+ billing_outcome_reason: string | null;
4284
+ credits: number | null;
4285
+ billing_mode: string | null;
4286
+ pricing_model: string | null;
4287
+ policy_id: string | null;
4288
+ created_at: string;
4289
+ };
4276
4290
  /**
4277
4291
  * Public `client.billing` namespace for CLI commands and programmatic callers.
4278
4292
  * Covers plans, subscription state, cancellation, and invoice/receipt history.
@@ -4304,6 +4318,8 @@ type BillingNamespace = {
4304
4318
  limit?: number;
4305
4319
  }) => Promise<BillingInvoicesResult>;
4306
4320
  };
4321
+ /** Read one exact execution outcome using the request_id returned by executeTool. */
4322
+ usageEvent: (requestId: string) => Promise<BillingUsageEvent>;
4307
4323
  /** Metronome-authored target catalog and current Contract projection. */
4308
4324
  targetPlans: () => Promise<TargetBillingPlansResult>;
4309
4325
  /** Normalized target billing state. */
@@ -4485,7 +4501,7 @@ declare class DeeplineClient {
4485
4501
  * guaranteed support for every model. Runtime AI SDK/Gateway errors remain
4486
4502
  * authoritative for model-gated values.
4487
4503
  *
4488
- * @param model - Gateway model id such as `"openai/gpt-5.5"`
4504
+ * @param model - Exact-case Gateway model id such as `"openai/gpt-5.6-luna"`
4489
4505
  * @returns Model metadata, provider option shapes, and runnable examples
4490
4506
  */
4491
4507
  describeModel(model: string): Promise<DeeplineAgentModelDescription>;
@@ -5368,6 +5384,12 @@ declare class DeeplineClient {
5368
5384
  * @returns Snake_case catalog from `GET /api/v2/billing/catalog/current`
5369
5385
  */
5370
5386
  getBillingPlans(): Promise<BillingPlansResult>;
5387
+ /**
5388
+ * Read the authenticated usage record for one execution request. The
5389
+ * request id comes from the original `executeTool` result and is not a
5390
+ * retry or idempotency token.
5391
+ */
5392
+ getBillingUsageEvent(requestId: string): Promise<BillingUsageEvent>;
5371
5393
  /**
5372
5394
  * Charge the saved payment method and add Deepline credits to the active
5373
5395
  * workspace. Prefer `client.billing.topUp(...)`.
@@ -6570,4 +6592,4 @@ declare function writeCsvOutputFile(rows: Array<Record<string, unknown>>, stem:
6570
6592
  */
6571
6593
  declare function extractSummaryFields(payload: unknown): Record<string, Scalar>;
6572
6594
 
6573
- export { type AsyncPlayRunRef, AuthError, type BillingCreditPool, type BillingInvoiceEntry, type BillingInvoicesResult, type BillingNamespace, type BillingPaymentMethodSummary, type BillingSubscriptionCancelResult, type BillingSubscriptionStatus, type BillingTopUpResult, 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 DeeplineNamedPlay, type DeeplinePlayRuntimeContext, type DeeplinePlaysNamespace, type DeeplineToolCategory, type DeeplineToolsNamespace, type DefinePlayConfig, type DefinedPlay, 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 };
6595
+ export { type AsyncPlayRunRef, AuthError, type BillingCreditPool, type BillingInvoiceEntry, type BillingInvoicesResult, type BillingNamespace, type BillingPaymentMethodSummary, type BillingSubscriptionCancelResult, type BillingSubscriptionStatus, type BillingTopUpResult, type BillingUsageEvent, 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 DeeplineNamedPlay, type DeeplinePlayRuntimeContext, type DeeplinePlaysNamespace, type DeeplineToolCategory, type DeeplineToolsNamespace, type DefinePlayConfig, type DefinedPlay, 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
@@ -1,6 +1,6 @@
1
1
  /// <reference path="./text-imports.d.ts" />
2
- import { c as PlayCompilerManifest, T as ToolResultBilling, A as AsyncPlayRunRef$1, i as PlayAuthoringColumnMap, j as PlayAuthoringColumnResolver, k as PlayAuthoringRuntimeContext, l as PlayAuthoringConditionalStepResolver, m as PlayAuthoringCsvInput, n as PlayAuthoringCsvOptions, o as PlayAuthoringDatasetBuilder, p as PlayAuthoringDatasetColumnDefinition, q as PlayAuthoringDatasetColumnRunInput, r as ToolExecuteResult, s as PlayAuthoringReferenceLike, t as PlayReturnObject$1, u as PlayAuthoringDefineConfig, v as PlayAuthoringDefinedPlay, w as PlayAuthoringFetchOptions, x as PlayAuthoringFileInput, y as PlayAuthoringAsyncCallOptions, z as PlayAuthoringBindings, B as PlayAuthoringCallExecution, C as PlayAuthoringCallOptions, D as PlayAuthoringFetchResponse, E as PlayAuthoringInputContract, F as PlayRunId$1, G as PlayAuthoringStepProgramStep, H as PlayAuthoringRuntimeStepOptions, I as PlaySqlListenerDeclaration, J as PlaySqlListenerEvent, K as PlaySqlListenerOperation, L as PlaySqlQuery, M as PlayAuthoringStepOptions, N as PlayAuthoringStepProgram, O as PlayAuthoringStepProgramResolver, Q as PlayAuthoringStepResolver, R as PlayToolExecutionRequest, S as PlayAuthoringStepProgramOptions, U as DeeplineError, V as ToolExecutionError, W as ToolExecutionErrorOptions } from './compiler-manifest-BIqRyj5m.js';
3
- export { X as CtxFetchHttpError, Y as DEEPLINE_EXTRACTOR_TARGETS, Z as DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS, _ as DeeplineEmailStatusGetterValue, $ as DeeplineExtractorTarget, a0 as DeeplineGetterValue, a1 as DeeplineGetterValueMap, a2 as JOB_CHANGE_STATUS_VALUES, a3 as JobChangeStatus, a4 as PHONE_STATUS_VALUES, a5 as PhoneStatus, a6 as PlayDataset, a7 as PlayDatasetInput, a8 as PreviousCell, a9 as ProviderTransientError, aa as ProviderTransientErrorCategory, ab as ProviderUnavailableError, ac as ProviderUnavailableReason, ad as ToolExecutionErrorCategory, ae as ToolExecutionErrorOrigin, af as ToolExecutionFailureV1, ag as ToolExecutionNetworkKind, ah as ToolExecutionNetworkScope, ai as ToolExecutionPublicDetails, aj as getProviderUnavailableReason, ak as isDeeplineExtractorTarget, al as isProviderUnavailable, am as isProviderWaterfallUnavailableError } from './compiler-manifest-BIqRyj5m.js';
2
+ import { c as PlayCompilerManifest, T as ToolResultBilling, A as AsyncPlayRunRef$1, i as PlayAuthoringColumnMap, j as PlayAuthoringColumnResolver, k as PlayAuthoringRuntimeContext, l as PlayAuthoringConditionalStepResolver, m as PlayAuthoringCsvInput, n as PlayAuthoringCsvOptions, o as PlayAuthoringDatasetBuilder, p as PlayAuthoringDatasetColumnDefinition, q as PlayAuthoringDatasetColumnRunInput, r as ToolExecuteResult, s as PlayAuthoringReferenceLike, t as PlayReturnObject$1, u as PlayAuthoringDefineConfig, v as PlayAuthoringDefinedPlay, w as PlayAuthoringFetchOptions, x as PlayAuthoringFileInput, y as PlayAuthoringAsyncCallOptions, z as PlayAuthoringBindings, B as PlayAuthoringCallExecution, C as PlayAuthoringCallOptions, D as PlayAuthoringFetchResponse, E as PlayAuthoringInputContract, F as PlayRunId$1, G as PlayAuthoringStepProgramStep, H as PlayAuthoringRuntimeStepOptions, I as PlaySqlListenerDeclaration, J as PlaySqlListenerEvent, K as PlaySqlListenerOperation, L as PlaySqlQuery, M as PlayAuthoringStepOptions, N as PlayAuthoringStepProgram, O as PlayAuthoringStepProgramResolver, Q as PlayAuthoringStepResolver, R as PlayToolExecutionRequest, S as PlayAuthoringStepProgramOptions, U as DeeplineError, V as ToolExecutionError, W as ToolExecutionErrorOptions } from './compiler-manifest-BJBNPTWt.js';
3
+ export { X as CtxFetchHttpError, Y as DEEPLINE_EXTRACTOR_TARGETS, Z as DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS, _ as DeeplineEmailStatusGetterValue, $ as DeeplineExtractorTarget, a0 as DeeplineGetterValue, a1 as DeeplineGetterValueMap, a2 as JOB_CHANGE_STATUS_VALUES, a3 as JobChangeStatus, a4 as PHONE_STATUS_VALUES, a5 as PhoneStatus, a6 as PlayDataset, a7 as PlayDatasetInput, a8 as PreviousCell, a9 as ProviderTransientError, aa as ProviderTransientErrorCategory, ab as ProviderUnavailableError, ac as ProviderUnavailableReason, ad as ToolExecutionErrorCategory, ae as ToolExecutionErrorOrigin, af as ToolExecutionFailureV1, ag as ToolExecutionNetworkKind, ah as ToolExecutionNetworkScope, ai as ToolExecutionPublicDetails, aj as getProviderUnavailableReason, ak as isDeeplineExtractorTarget, al as isProviderUnavailable, am as isProviderWaterfallUnavailableError } from './compiler-manifest-BJBNPTWt.js';
4
4
  import { MonitorFleetDefinition } from './monitor-fleet-contract.js';
5
5
  export { AdmittedMonitorFleetAuthoringContract, MONITOR_FLEET_AUTHORING_CONTRACT_CHANGELOG, MONITOR_FLEET_AUTHORING_CONTRACT_EDITION, MONITOR_FLEET_DOCUMENTATION, MONITOR_FLEET_FRONTIER_MAX_ROWS, MONITOR_FLEET_MAX_MEMBERS, MonitorFleetAuthoringContractEdition, MonitorFleetAuthoringContractResult, MonitorFleetColumn, MonitorFleetContractIssue, MonitorFleetExpression, MonitorFleetTemplate, admitMonitorFleetAuthoringContract, defineMonitorFleet, fleetColumn, fleetKey, lintMonitorFleetInput, validateMonitorFleetDefinition } from './monitor-fleet-contract.js';
6
6
  export { BatchMonitorInput, MonitorInputIssue, MonitorSpec as MonitorInputSpec, lintMonitorBatchInput, lintMonitorSpecTemplate, renderMonitorSpecTemplate } from './monitor-input-contract.js';
@@ -4273,6 +4273,20 @@ type WorkspacesNamespace = {
4273
4273
  idempotencyKey: string;
4274
4274
  }) => Promise<WorkspaceCreateResult>;
4275
4275
  };
4276
+ /** One authenticated per-request usage event from `/api/v2/usage/events`. */
4277
+ type BillingUsageEvent = {
4278
+ id: string | null;
4279
+ provider: string;
4280
+ operation: string;
4281
+ status: string;
4282
+ request_id: string;
4283
+ billing_outcome_reason: string | null;
4284
+ credits: number | null;
4285
+ billing_mode: string | null;
4286
+ pricing_model: string | null;
4287
+ policy_id: string | null;
4288
+ created_at: string;
4289
+ };
4276
4290
  /**
4277
4291
  * Public `client.billing` namespace for CLI commands and programmatic callers.
4278
4292
  * Covers plans, subscription state, cancellation, and invoice/receipt history.
@@ -4304,6 +4318,8 @@ type BillingNamespace = {
4304
4318
  limit?: number;
4305
4319
  }) => Promise<BillingInvoicesResult>;
4306
4320
  };
4321
+ /** Read one exact execution outcome using the request_id returned by executeTool. */
4322
+ usageEvent: (requestId: string) => Promise<BillingUsageEvent>;
4307
4323
  /** Metronome-authored target catalog and current Contract projection. */
4308
4324
  targetPlans: () => Promise<TargetBillingPlansResult>;
4309
4325
  /** Normalized target billing state. */
@@ -4485,7 +4501,7 @@ declare class DeeplineClient {
4485
4501
  * guaranteed support for every model. Runtime AI SDK/Gateway errors remain
4486
4502
  * authoritative for model-gated values.
4487
4503
  *
4488
- * @param model - Gateway model id such as `"openai/gpt-5.5"`
4504
+ * @param model - Exact-case Gateway model id such as `"openai/gpt-5.6-luna"`
4489
4505
  * @returns Model metadata, provider option shapes, and runnable examples
4490
4506
  */
4491
4507
  describeModel(model: string): Promise<DeeplineAgentModelDescription>;
@@ -5368,6 +5384,12 @@ declare class DeeplineClient {
5368
5384
  * @returns Snake_case catalog from `GET /api/v2/billing/catalog/current`
5369
5385
  */
5370
5386
  getBillingPlans(): Promise<BillingPlansResult>;
5387
+ /**
5388
+ * Read the authenticated usage record for one execution request. The
5389
+ * request id comes from the original `executeTool` result and is not a
5390
+ * retry or idempotency token.
5391
+ */
5392
+ getBillingUsageEvent(requestId: string): Promise<BillingUsageEvent>;
5371
5393
  /**
5372
5394
  * Charge the saved payment method and add Deepline credits to the active
5373
5395
  * workspace. Prefer `client.billing.topUp(...)`.
@@ -6570,4 +6592,4 @@ declare function writeCsvOutputFile(rows: Array<Record<string, unknown>>, stem:
6570
6592
  */
6571
6593
  declare function extractSummaryFields(payload: unknown): Record<string, Scalar>;
6572
6594
 
6573
- export { type AsyncPlayRunRef, AuthError, type BillingCreditPool, type BillingInvoiceEntry, type BillingInvoicesResult, type BillingNamespace, type BillingPaymentMethodSummary, type BillingSubscriptionCancelResult, type BillingSubscriptionStatus, type BillingTopUpResult, 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 DeeplineNamedPlay, type DeeplinePlayRuntimeContext, type DeeplinePlaysNamespace, type DeeplineToolCategory, type DeeplineToolsNamespace, type DefinePlayConfig, type DefinedPlay, 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 };
6595
+ export { type AsyncPlayRunRef, AuthError, type BillingCreditPool, type BillingInvoiceEntry, type BillingInvoicesResult, type BillingNamespace, type BillingPaymentMethodSummary, type BillingSubscriptionCancelResult, type BillingSubscriptionStatus, type BillingTopUpResult, type BillingUsageEvent, 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 DeeplineNamedPlay, type DeeplinePlayRuntimeContext, type DeeplinePlaysNamespace, type DeeplineToolCategory, type DeeplineToolsNamespace, type DefinePlayConfig, type DefinedPlay, 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.144",
867
+ version: "0.3.146",
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
@@ -3066,19 +3066,32 @@ function summarizeRunRowOutcomes(snapshot) {
3066
3066
  let completedRows = 0;
3067
3067
  let failedRows = 0;
3068
3068
  let totalRows = 0;
3069
+ let supersededRows = 0;
3069
3070
  for (const step of Object.values(snapshot.stepsById)) {
3070
3071
  const progress = step.progress;
3071
3072
  if (!progress) continue;
3072
3073
  completedRows += Math.max(0, finiteNumber(progress.completed) ?? 0);
3073
3074
  failedRows += Math.max(0, finiteNumber(progress.failed) ?? 0);
3075
+ supersededRows += Math.max(0, finiteNumber(progress.supersededRows) ?? 0);
3074
3076
  const stepTotal = finiteNumber(progress.total);
3075
- totalRows += stepTotal !== null && stepTotal >= 0 ? stepTotal : Math.max(0, finiteNumber(progress.completed) ?? 0) + Math.max(0, finiteNumber(progress.failed) ?? 0);
3076
- }
3077
+ totalRows += stepTotal !== null && stepTotal >= 0 ? stepTotal : Math.max(0, finiteNumber(progress.completed) ?? 0) + Math.max(0, finiteNumber(progress.failed) ?? 0) + Math.max(0, finiteNumber(progress.supersededRows) ?? 0);
3078
+ }
3079
+ const resultSummary = isRecord5(snapshot.resultSummary) ? snapshot.resultSummary : null;
3080
+ const resultRowOutcomes = isRecord5(resultSummary?.rowOutcomes) ? resultSummary.rowOutcomes : null;
3081
+ const terminalCompletedRows = finiteNumber(resultRowOutcomes?.completedRows);
3082
+ const terminalFailedRows = finiteNumber(resultRowOutcomes?.failedRows);
3083
+ const terminalTotalRows = finiteNumber(resultRowOutcomes?.totalRows);
3084
+ const terminalSupersededRows = finiteNumber(
3085
+ resultRowOutcomes?.supersededRows
3086
+ );
3087
+ const settledCompletedRows = terminalCompletedRows ?? completedRows;
3088
+ const settledFailedRows = terminalFailedRows ?? failedRows;
3077
3089
  return {
3078
- completedRows,
3079
- failedRows,
3080
- totalRows,
3081
- hasRowFailures: failedRows > 0
3090
+ completedRows: settledCompletedRows,
3091
+ failedRows: settledFailedRows,
3092
+ totalRows: terminalTotalRows ?? totalRows,
3093
+ hasRowFailures: settledFailedRows > 0,
3094
+ ...(terminalSupersededRows ?? supersededRows) > 0 ? { supersededRows: terminalSupersededRows ?? supersededRows } : {}
3082
3095
  };
3083
3096
  }
3084
3097
  function createEmptyPlayRunLedgerSnapshot(input) {
@@ -3236,6 +3249,7 @@ function normalizeStepProgress(value) {
3236
3249
  ...optionalFiniteNumber(value.activeRows) !== void 0 ? { activeRows: optionalFiniteNumber(value.activeRows) } : {},
3237
3250
  ...optionalFiniteNumber(value.waitingRows) !== void 0 ? { waitingRows: optionalFiniteNumber(value.waitingRows) } : {},
3238
3251
  ...optionalFiniteNumber(value.completedRows) !== void 0 ? { completedRows: optionalFiniteNumber(value.completedRows) } : {},
3252
+ ...optionalFiniteNumber(value.supersededRows) !== void 0 ? { supersededRows: optionalFiniteNumber(value.supersededRows) } : {},
3239
3253
  ...optionalString(value.message) ? { message: optionalString(value.message) } : {},
3240
3254
  ...optionalNullableString(value.artifactTableNamespace) !== void 0 ? {
3241
3255
  artifactTableNamespace: optionalNullableString(
@@ -3387,6 +3401,7 @@ function buildSnapshotFromLedger(snapshot) {
3387
3401
  activeRows: step.progress.activeRows,
3388
3402
  waitingRows: step.progress.waitingRows,
3389
3403
  completedRows: step.progress.completedRows,
3404
+ supersededRows: step.progress.supersededRows,
3390
3405
  message: step.progress.message,
3391
3406
  artifactTableNamespace: step.progress.artifactTableNamespace ?? step.artifactTableNamespace ?? null,
3392
3407
  startedAt: step.startedAt ?? null,
@@ -3400,7 +3415,8 @@ function buildSnapshotFromLedger(snapshot) {
3400
3415
  ...step.progress?.nodeIo ? { nodeIo: step.progress.nodeIo } : {}
3401
3416
  }));
3402
3417
  const liveStatus = normalizePlayRunLiveStatus(snapshot.status);
3403
- const rowOutcomes = isTerminalPlayRunLiveStatus(liveStatus) && Object.keys(snapshot.stepsById).length > 0 ? summarizeRunRowOutcomes(snapshot) : null;
3418
+ const terminalRowOutcomes = isTerminalPlayRunLiveStatus(liveStatus) ? summarizeRunRowOutcomes(snapshot) : null;
3419
+ const rowOutcomes = terminalRowOutcomes && (Object.keys(snapshot.stepsById).length > 0 || terminalRowOutcomes.totalRows > 0 || (terminalRowOutcomes.supersededRows ?? 0) > 0) ? terminalRowOutcomes : null;
3404
3420
  return {
3405
3421
  runId: snapshot.runId,
3406
3422
  status: liveStatus,
@@ -4774,6 +4790,7 @@ var DeeplineClient = class _DeeplineClient {
4774
4790
  invoices: {
4775
4791
  list: (options2) => this.listBillingInvoices(options2)
4776
4792
  },
4793
+ usageEvent: (requestId) => this.getBillingUsageEvent(requestId),
4777
4794
  targetPlans: () => this.getTargetBillingPlans(),
4778
4795
  targetStatus: () => this.getTargetBillingStatus(),
4779
4796
  autoRecharge: {
@@ -5108,7 +5125,7 @@ var DeeplineClient = class _DeeplineClient {
5108
5125
  * guaranteed support for every model. Runtime AI SDK/Gateway errors remain
5109
5126
  * authoritative for model-gated values.
5110
5127
  *
5111
- * @param model - Gateway model id such as `"openai/gpt-5.5"`
5128
+ * @param model - Exact-case Gateway model id such as `"openai/gpt-5.6-luna"`
5112
5129
  * @returns Model metadata, provider option shapes, and runnable examples
5113
5130
  */
5114
5131
  async describeModel(model) {
@@ -7145,6 +7162,33 @@ var DeeplineClient = class _DeeplineClient {
7145
7162
  async getBillingPlans() {
7146
7163
  return this.http.get("/api/v2/billing/catalog/current");
7147
7164
  }
7165
+ /**
7166
+ * Read the authenticated usage record for one execution request. The
7167
+ * request id comes from the original `executeTool` result and is not a
7168
+ * retry or idempotency token.
7169
+ */
7170
+ async getBillingUsageEvent(requestId) {
7171
+ const normalizedRequestId = requestId.trim();
7172
+ if (normalizedRequestId.length === 0 || normalizedRequestId.length > 200 || normalizedRequestId !== requestId) {
7173
+ throw new DeeplineError(
7174
+ "Usage request_id must contain 1\u2013200 characters with no leading or trailing whitespace.",
7175
+ void 0,
7176
+ "INVALID_USAGE_REQUEST_ID"
7177
+ );
7178
+ }
7179
+ const response = await this.http.get(
7180
+ `/api/v2/usage/events?request_id=${encodeURIComponent(normalizedRequestId)}`
7181
+ );
7182
+ const event = response.entries?.[0];
7183
+ if (!event) {
7184
+ throw new DeeplineError(
7185
+ "No usage event was found for this request_id.",
7186
+ void 0,
7187
+ "USAGE_EVENT_NOT_FOUND"
7188
+ );
7189
+ }
7190
+ return event;
7191
+ }
7148
7192
  /**
7149
7193
  * Charge the saved payment method and add Deepline credits to the active
7150
7194
  * workspace. Prefer `client.billing.topUp(...)`.
@@ -8844,6 +8888,17 @@ function findFirstTargetByPath(result, paths) {
8844
8888
  }
8845
8889
  return null;
8846
8890
  }
8891
+ function findFirstExplicitNullTargetByPath(result, paths) {
8892
+ for (const path of paths ?? []) {
8893
+ for (const candidate of candidateResultPaths(path)) {
8894
+ const explicitNull = valuesAtSegments(result, parsePath(candidate)).find(
8895
+ (entry) => entry.value === null
8896
+ );
8897
+ if (explicitNull) return { value: null, path: explicitNull.path };
8898
+ }
8899
+ }
8900
+ return null;
8901
+ }
8847
8902
  function firstValueForPaths(result, paths) {
8848
8903
  return findFirstTargetByPath(result, paths);
8849
8904
  }
@@ -9103,7 +9158,11 @@ function buildTargets(result, extractors, targetGetters) {
9103
9158
  continue;
9104
9159
  }
9105
9160
  const fromExtractor = findFirstTargetByPath(result, descriptor.paths);
9106
- if (!fromExtractor) continue;
9161
+ if (!fromExtractor) {
9162
+ const explicitNull = isSemanticStatus ? null : findFirstExplicitNullTargetByPath(result, descriptor.paths);
9163
+ if (explicitNull) targets[target] = explicitNull;
9164
+ continue;
9165
+ }
9107
9166
  const transformed = coerceToEnum(
9108
9167
  applyExtractorTransforms(fromExtractor.value, descriptor),
9109
9168
  descriptor
@@ -9126,6 +9185,14 @@ function buildTargets(result, extractors, targetGetters) {
9126
9185
  targets[target] = fromMetadata;
9127
9186
  continue;
9128
9187
  }
9188
+ const explicitNull = findFirstExplicitNullTargetByPath(
9189
+ result,
9190
+ targetGetters?.[target]
9191
+ );
9192
+ if (explicitNull) {
9193
+ targets[target] = explicitNull;
9194
+ continue;
9195
+ }
9129
9196
  const fallback = findFirstTargetByKey(result, target);
9130
9197
  if (fallback) {
9131
9198
  targets[target] = fallback;
@@ -9133,6 +9200,7 @@ function buildTargets(result, extractors, targetGetters) {
9133
9200
  }
9134
9201
  if (metadataTargets.size === 0) {
9135
9202
  for (const target of ["email", "phone", "linkedin", "domain", "status"]) {
9203
+ if (targets[target]) continue;
9136
9204
  const found = findFirstTargetByKey(result, target);
9137
9205
  if (found) targets[target] = found;
9138
9206
  }