deepline 0.2.37 → 0.2.38

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.
@@ -160,7 +160,7 @@ export const SDK_RELEASE = {
160
160
  // 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
161
161
  // exposed storage-dependent synchronous access. This deliberate minor
162
162
  // release keeps lazy paging semantics independent of row residency.
163
- version: '0.2.37',
163
+ version: '0.2.38',
164
164
  contracts: {
165
165
  api: {
166
166
  name: 'sdk-http-api',
package/dist/cli/index.js CHANGED
@@ -1044,7 +1044,7 @@ var SDK_RELEASE = {
1044
1044
  // 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
1045
1045
  // exposed storage-dependent synchronous access. This deliberate minor
1046
1046
  // release keeps lazy paging semantics independent of row residency.
1047
- version: "0.2.37",
1047
+ version: "0.2.38",
1048
1048
  contracts: {
1049
1049
  api: {
1050
1050
  name: "sdk-http-api",
@@ -24840,6 +24840,9 @@ function renderWaterfallColumns(command, forceAliases, inlineRunJavascript, idio
24840
24840
  ];
24841
24841
  }
24842
24842
  function compileEnrichConfigToPlaySource(config, options = {}) {
24843
+ if (options.maxCreditsPerRun !== void 0 && (!Number.isFinite(options.maxCreditsPerRun) || options.maxCreditsPerRun <= 0)) {
24844
+ throw new Error("maxCreditsPerRun must be a number greater than 0.");
24845
+ }
24843
24846
  const compatibility = buildEnrichCompatibilityPlan(options);
24844
24847
  const { playName, mapName } = compatibility;
24845
24848
  const inlineRunJavascript = options.inlineRunJavascript ?? false;
@@ -24891,6 +24894,10 @@ function compileEnrichConfigToPlaySource(config, options = {}) {
24891
24894
  const metadataColumnSource = renderMetadataColumnStep(config);
24892
24895
  const generatedAliases = collectGeneratedAliases(config.commands);
24893
24896
  const runOptionsSource = options.failFast ? `{ key: (row, index) => __dlEnrichRowKey(row, index + rowStart), onRowError: 'fail' as const }` : `{ key: (row, index) => __dlEnrichRowKey(row, index + rowStart) }`;
24897
+ const playOptionsSource = [
24898
+ `description: ${stringLiteral("Read a CSV file, run the configured Deepline enrich commands, and return enriched rows.")}`,
24899
+ ...options.maxCreditsPerRun === void 0 ? [] : [`billing: { maxCreditsPerRun: ${String(options.maxCreditsPerRun)} }`]
24900
+ ].join(", ");
24894
24901
  const body = [
24895
24902
  `function __dlRunInlinePlay<TContext, TInput, TOutput>(handler: (ctx: TContext, input: TInput) => Promise<TOutput>, scope: TContext, payload: TInput, force: boolean): Promise<TOutput> {`,
24896
24903
  ` if (!force) return handler(scope, payload);`,
@@ -24924,7 +24931,7 @@ function compileEnrichConfigToPlaySource(config, options = {}) {
24924
24931
  ...metadataColumnSource ? [metadataColumnSource] : [],
24925
24932
  ` .run(${runOptionsSource});`,
24926
24933
  ` return { rows: enriched, count: await enriched.count() };`,
24927
- `}, { description: ${stringLiteral("Read a CSV file, run the configured Deepline enrich commands, and return enriched rows.")} });`
24934
+ `}, { ${playOptionsSource} });`
24928
24935
  ];
24929
24936
  const helpers = idiomaticGetters ? selectUsedHelpers(helperSource(), body.join("\n")) : helperSource();
24930
24937
  const typeImports = idiomaticGetters ? inlineTypeImports : [.../* @__PURE__ */ new Set([...inlineTypeImports, "DeeplinePlayRuntimeContext"])].sort();
@@ -26125,7 +26132,8 @@ async function buildPlanArgs(args) {
26125
26132
  "--rows",
26126
26133
  "--with-force",
26127
26134
  "--timeout",
26128
- "--profile"
26135
+ "--profile",
26136
+ "--max-credits-per-run"
26129
26137
  ]);
26130
26138
  const localBooleanOptions = /* @__PURE__ */ new Set([
26131
26139
  "--dry-run",
@@ -26284,6 +26292,16 @@ function parseRows(value, all) {
26284
26292
  }
26285
26293
  return { rowStart: single, rowEnd: single };
26286
26294
  }
26295
+ function parseMaxCreditsPerRun(value) {
26296
+ if (value === void 0) {
26297
+ return void 0;
26298
+ }
26299
+ const parsed = Number(value.trim());
26300
+ if (!Number.isFinite(parsed) || parsed <= 0) {
26301
+ throw new Error("--max-credits-per-run must be a number greater than 0.");
26302
+ }
26303
+ return parsed;
26304
+ }
26287
26305
  function summarizePlan(config, playSource) {
26288
26306
  const steps = [];
26289
26307
  for (const command of config.commands) {
@@ -29150,6 +29168,9 @@ function registerEnrichCommand(program) {
29150
29168
  ).option(
29151
29169
  "--fail-fast",
29152
29170
  "Fail the generated play when any selected row errors, while preserving recovered runtime-sheet rows for export."
29171
+ ).option(
29172
+ "--max-credits-per-run <credits>",
29173
+ "Set a hard Deepline-credit ceiling enforced by the runtime for this run."
29153
29174
  ).action(async (options, _command) => {
29154
29175
  if (currentEnrichArgs().some(
29155
29176
  (arg) => arg === "--no-open" || arg.startsWith("--no-open=")
@@ -29174,6 +29195,7 @@ function registerEnrichCommand(program) {
29174
29195
  }
29175
29196
  const client2 = new DeeplineClient();
29176
29197
  const args = currentEnrichArgs();
29198
+ const maxCreditsPerRun = parseMaxCreditsPerRun(options.maxCreditsPerRun);
29177
29199
  const config = await compileConfig({ client: client2, args, options });
29178
29200
  emitEnrichDebugValidationLines(config);
29179
29201
  if (options.dryRun) {
@@ -29182,7 +29204,8 @@ function registerEnrichCommand(program) {
29182
29204
  forceAliases: forceAliases2,
29183
29205
  playName: options.name,
29184
29206
  inlineRunJavascript: true,
29185
- failFast: options.failFast
29207
+ failFast: options.failFast,
29208
+ maxCreditsPerRun
29186
29209
  });
29187
29210
  const summary = summarizePlan(config, playSource2);
29188
29211
  if (options.json) {
@@ -29214,7 +29237,8 @@ function registerEnrichCommand(program) {
29214
29237
  forceAliases,
29215
29238
  playName: options.name,
29216
29239
  inlineRunJavascript: true,
29217
- failFast: options.failFast
29240
+ failFast: options.failFast,
29241
+ maxCreditsPerRun
29218
29242
  });
29219
29243
  const selectedRange = selectedSourceCsvRange(sourceCsvPath, rows);
29220
29244
  const sdkEnrichTelemetry = createSdkEnrichTelemetryContext({
@@ -1030,7 +1030,7 @@ var SDK_RELEASE = {
1030
1030
  // 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
1031
1031
  // exposed storage-dependent synchronous access. This deliberate minor
1032
1032
  // release keeps lazy paging semantics independent of row residency.
1033
- version: "0.2.37",
1033
+ version: "0.2.38",
1034
1034
  contracts: {
1035
1035
  api: {
1036
1036
  name: "sdk-http-api",
@@ -24884,6 +24884,9 @@ function renderWaterfallColumns(command, forceAliases, inlineRunJavascript, idio
24884
24884
  ];
24885
24885
  }
24886
24886
  function compileEnrichConfigToPlaySource(config, options = {}) {
24887
+ if (options.maxCreditsPerRun !== void 0 && (!Number.isFinite(options.maxCreditsPerRun) || options.maxCreditsPerRun <= 0)) {
24888
+ throw new Error("maxCreditsPerRun must be a number greater than 0.");
24889
+ }
24887
24890
  const compatibility = buildEnrichCompatibilityPlan(options);
24888
24891
  const { playName, mapName } = compatibility;
24889
24892
  const inlineRunJavascript = options.inlineRunJavascript ?? false;
@@ -24935,6 +24938,10 @@ function compileEnrichConfigToPlaySource(config, options = {}) {
24935
24938
  const metadataColumnSource = renderMetadataColumnStep(config);
24936
24939
  const generatedAliases = collectGeneratedAliases(config.commands);
24937
24940
  const runOptionsSource = options.failFast ? `{ key: (row, index) => __dlEnrichRowKey(row, index + rowStart), onRowError: 'fail' as const }` : `{ key: (row, index) => __dlEnrichRowKey(row, index + rowStart) }`;
24941
+ const playOptionsSource = [
24942
+ `description: ${stringLiteral("Read a CSV file, run the configured Deepline enrich commands, and return enriched rows.")}`,
24943
+ ...options.maxCreditsPerRun === void 0 ? [] : [`billing: { maxCreditsPerRun: ${String(options.maxCreditsPerRun)} }`]
24944
+ ].join(", ");
24938
24945
  const body = [
24939
24946
  `function __dlRunInlinePlay<TContext, TInput, TOutput>(handler: (ctx: TContext, input: TInput) => Promise<TOutput>, scope: TContext, payload: TInput, force: boolean): Promise<TOutput> {`,
24940
24947
  ` if (!force) return handler(scope, payload);`,
@@ -24968,7 +24975,7 @@ function compileEnrichConfigToPlaySource(config, options = {}) {
24968
24975
  ...metadataColumnSource ? [metadataColumnSource] : [],
24969
24976
  ` .run(${runOptionsSource});`,
24970
24977
  ` return { rows: enriched, count: await enriched.count() };`,
24971
- `}, { description: ${stringLiteral("Read a CSV file, run the configured Deepline enrich commands, and return enriched rows.")} });`
24978
+ `}, { ${playOptionsSource} });`
24972
24979
  ];
24973
24980
  const helpers = idiomaticGetters ? selectUsedHelpers(helperSource(), body.join("\n")) : helperSource();
24974
24981
  const typeImports = idiomaticGetters ? inlineTypeImports : [.../* @__PURE__ */ new Set([...inlineTypeImports, "DeeplinePlayRuntimeContext"])].sort();
@@ -26169,7 +26176,8 @@ async function buildPlanArgs(args) {
26169
26176
  "--rows",
26170
26177
  "--with-force",
26171
26178
  "--timeout",
26172
- "--profile"
26179
+ "--profile",
26180
+ "--max-credits-per-run"
26173
26181
  ]);
26174
26182
  const localBooleanOptions = /* @__PURE__ */ new Set([
26175
26183
  "--dry-run",
@@ -26328,6 +26336,16 @@ function parseRows(value, all) {
26328
26336
  }
26329
26337
  return { rowStart: single, rowEnd: single };
26330
26338
  }
26339
+ function parseMaxCreditsPerRun(value) {
26340
+ if (value === void 0) {
26341
+ return void 0;
26342
+ }
26343
+ const parsed = Number(value.trim());
26344
+ if (!Number.isFinite(parsed) || parsed <= 0) {
26345
+ throw new Error("--max-credits-per-run must be a number greater than 0.");
26346
+ }
26347
+ return parsed;
26348
+ }
26331
26349
  function summarizePlan(config, playSource) {
26332
26350
  const steps = [];
26333
26351
  for (const command of config.commands) {
@@ -29194,6 +29212,9 @@ function registerEnrichCommand(program) {
29194
29212
  ).option(
29195
29213
  "--fail-fast",
29196
29214
  "Fail the generated play when any selected row errors, while preserving recovered runtime-sheet rows for export."
29215
+ ).option(
29216
+ "--max-credits-per-run <credits>",
29217
+ "Set a hard Deepline-credit ceiling enforced by the runtime for this run."
29197
29218
  ).action(async (options, _command) => {
29198
29219
  if (currentEnrichArgs().some(
29199
29220
  (arg) => arg === "--no-open" || arg.startsWith("--no-open=")
@@ -29218,6 +29239,7 @@ function registerEnrichCommand(program) {
29218
29239
  }
29219
29240
  const client2 = new DeeplineClient();
29220
29241
  const args = currentEnrichArgs();
29242
+ const maxCreditsPerRun = parseMaxCreditsPerRun(options.maxCreditsPerRun);
29221
29243
  const config = await compileConfig({ client: client2, args, options });
29222
29244
  emitEnrichDebugValidationLines(config);
29223
29245
  if (options.dryRun) {
@@ -29226,7 +29248,8 @@ function registerEnrichCommand(program) {
29226
29248
  forceAliases: forceAliases2,
29227
29249
  playName: options.name,
29228
29250
  inlineRunJavascript: true,
29229
- failFast: options.failFast
29251
+ failFast: options.failFast,
29252
+ maxCreditsPerRun
29230
29253
  });
29231
29254
  const summary = summarizePlan(config, playSource2);
29232
29255
  if (options.json) {
@@ -29258,7 +29281,8 @@ function registerEnrichCommand(program) {
29258
29281
  forceAliases,
29259
29282
  playName: options.name,
29260
29283
  inlineRunJavascript: true,
29261
- failFast: options.failFast
29284
+ failFast: options.failFast,
29285
+ maxCreditsPerRun
29262
29286
  });
29263
29287
  const selectedRange = selectedSourceCsvRange(sourceCsvPath, rows);
29264
29288
  const sdkEnrichTelemetry = createSdkEnrichTelemetryContext({
package/dist/index.js CHANGED
@@ -763,7 +763,7 @@ var SDK_RELEASE = {
763
763
  // 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
764
764
  // exposed storage-dependent synchronous access. This deliberate minor
765
765
  // release keeps lazy paging semantics independent of row residency.
766
- version: "0.2.37",
766
+ version: "0.2.38",
767
767
  contracts: {
768
768
  api: {
769
769
  name: "sdk-http-api",
package/dist/index.mjs CHANGED
@@ -689,7 +689,7 @@ var SDK_RELEASE = {
689
689
  // 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
690
690
  // exposed storage-dependent synchronous access. This deliberate minor
691
691
  // release keeps lazy paging semantics independent of row residency.
692
- version: "0.2.37",
692
+ version: "0.2.38",
693
693
  contracts: {
694
694
  api: {
695
695
  name: "sdk-http-api",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.2.37",
3
+ "version": "0.2.38",
4
4
  "description": "Deepline SDK + CLI — B2B data enrichment powered by durable cloud execution",
5
5
  "license": "MIT",
6
6
  "repository": {