deepline 0.2.37 → 0.2.39
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.
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/cli/index.js +38 -6
- package/dist/cli/index.mjs +38 -6
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -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.
|
|
163
|
+
version: '0.2.39',
|
|
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.
|
|
1047
|
+
version: "0.2.39",
|
|
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
|
-
`}, {
|
|
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({
|
|
@@ -30370,7 +30394,7 @@ function monitorsErrorExitCode(error) {
|
|
|
30370
30394
|
const status = error.statusCode;
|
|
30371
30395
|
if (status === 401 || status === 403) return 3;
|
|
30372
30396
|
if (status === 404) return 4;
|
|
30373
|
-
if (status === 400 || status === 422) return 7;
|
|
30397
|
+
if (status === 400 || status === 409 || status === 422) return 7;
|
|
30374
30398
|
return 5;
|
|
30375
30399
|
}
|
|
30376
30400
|
return 5;
|
|
@@ -30805,6 +30829,8 @@ function renderDeployedListText(payload, requestedStatus) {
|
|
|
30805
30829
|
const name = asString(entry.name);
|
|
30806
30830
|
const outputTable = asString(entry.output_table);
|
|
30807
30831
|
const webhookState = asString(entry.webhook_state);
|
|
30832
|
+
const hasLastReceivedEvent = "last_received_event" in entry;
|
|
30833
|
+
const lastReceivedEvent = asString(entry.last_received_event);
|
|
30808
30834
|
const boundPlays = Array.isArray(entry.bound_plays) ? entry.bound_plays.length : void 0;
|
|
30809
30835
|
lines.push(
|
|
30810
30836
|
` ${key}${status ? ` ${status}` : ""}${tool ? ` ${tool}` : ""}${name ? ` (${name})` : ""}`
|
|
@@ -30818,6 +30844,9 @@ function renderDeployedListText(payload, requestedStatus) {
|
|
|
30818
30844
|
].filter(Boolean).join(" ")}`
|
|
30819
30845
|
);
|
|
30820
30846
|
}
|
|
30847
|
+
if (hasLastReceivedEvent) {
|
|
30848
|
+
lines.push(` last received: ${lastReceivedEvent ?? "never"}`);
|
|
30849
|
+
}
|
|
30821
30850
|
}
|
|
30822
30851
|
const applied = asString(payload.status_filter_applied) ?? requestedStatus ?? "active";
|
|
30823
30852
|
lines.push(
|
|
@@ -30894,6 +30923,8 @@ function renderMonitorGet(payload) {
|
|
|
30894
30923
|
const tool = asString(payload.tool);
|
|
30895
30924
|
if (!key || !tool) return void 0;
|
|
30896
30925
|
const status = asString(payload.status);
|
|
30926
|
+
const hasLastReceivedEvent = "last_received_event" in payload;
|
|
30927
|
+
const lastReceivedEvent = asString(payload.last_received_event);
|
|
30897
30928
|
const definition = asRecord2(payload.definition);
|
|
30898
30929
|
const pricingLine = monitorPricingLine(payload.pricing);
|
|
30899
30930
|
const billing = asRecord2(payload.billing);
|
|
@@ -30906,6 +30937,7 @@ function renderMonitorGet(payload) {
|
|
|
30906
30937
|
`Monitor: ${key}`,
|
|
30907
30938
|
`Tool: ${tool}`,
|
|
30908
30939
|
...status ? [`Status: ${status}`] : [],
|
|
30940
|
+
...hasLastReceivedEvent ? [`Last received: ${lastReceivedEvent ?? "never"}`] : [],
|
|
30909
30941
|
...pricingLine ? [`Pricing: ${pricingLine}`] : [],
|
|
30910
30942
|
...nextRenewalAt ? [`Next renewal: ${nextRenewalAt}`] : []
|
|
30911
30943
|
];
|
package/dist/cli/index.mjs
CHANGED
|
@@ -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.
|
|
1033
|
+
version: "0.2.39",
|
|
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
|
-
`}, {
|
|
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({
|
|
@@ -30421,7 +30445,7 @@ function monitorsErrorExitCode(error) {
|
|
|
30421
30445
|
const status = error.statusCode;
|
|
30422
30446
|
if (status === 401 || status === 403) return 3;
|
|
30423
30447
|
if (status === 404) return 4;
|
|
30424
|
-
if (status === 400 || status === 422) return 7;
|
|
30448
|
+
if (status === 400 || status === 409 || status === 422) return 7;
|
|
30425
30449
|
return 5;
|
|
30426
30450
|
}
|
|
30427
30451
|
return 5;
|
|
@@ -30856,6 +30880,8 @@ function renderDeployedListText(payload, requestedStatus) {
|
|
|
30856
30880
|
const name = asString(entry.name);
|
|
30857
30881
|
const outputTable = asString(entry.output_table);
|
|
30858
30882
|
const webhookState = asString(entry.webhook_state);
|
|
30883
|
+
const hasLastReceivedEvent = "last_received_event" in entry;
|
|
30884
|
+
const lastReceivedEvent = asString(entry.last_received_event);
|
|
30859
30885
|
const boundPlays = Array.isArray(entry.bound_plays) ? entry.bound_plays.length : void 0;
|
|
30860
30886
|
lines.push(
|
|
30861
30887
|
` ${key}${status ? ` ${status}` : ""}${tool ? ` ${tool}` : ""}${name ? ` (${name})` : ""}`
|
|
@@ -30869,6 +30895,9 @@ function renderDeployedListText(payload, requestedStatus) {
|
|
|
30869
30895
|
].filter(Boolean).join(" ")}`
|
|
30870
30896
|
);
|
|
30871
30897
|
}
|
|
30898
|
+
if (hasLastReceivedEvent) {
|
|
30899
|
+
lines.push(` last received: ${lastReceivedEvent ?? "never"}`);
|
|
30900
|
+
}
|
|
30872
30901
|
}
|
|
30873
30902
|
const applied = asString(payload.status_filter_applied) ?? requestedStatus ?? "active";
|
|
30874
30903
|
lines.push(
|
|
@@ -30945,6 +30974,8 @@ function renderMonitorGet(payload) {
|
|
|
30945
30974
|
const tool = asString(payload.tool);
|
|
30946
30975
|
if (!key || !tool) return void 0;
|
|
30947
30976
|
const status = asString(payload.status);
|
|
30977
|
+
const hasLastReceivedEvent = "last_received_event" in payload;
|
|
30978
|
+
const lastReceivedEvent = asString(payload.last_received_event);
|
|
30948
30979
|
const definition = asRecord2(payload.definition);
|
|
30949
30980
|
const pricingLine = monitorPricingLine(payload.pricing);
|
|
30950
30981
|
const billing = asRecord2(payload.billing);
|
|
@@ -30957,6 +30988,7 @@ function renderMonitorGet(payload) {
|
|
|
30957
30988
|
`Monitor: ${key}`,
|
|
30958
30989
|
`Tool: ${tool}`,
|
|
30959
30990
|
...status ? [`Status: ${status}`] : [],
|
|
30991
|
+
...hasLastReceivedEvent ? [`Last received: ${lastReceivedEvent ?? "never"}`] : [],
|
|
30960
30992
|
...pricingLine ? [`Pricing: ${pricingLine}`] : [],
|
|
30961
30993
|
...nextRenewalAt ? [`Next renewal: ${nextRenewalAt}`] : []
|
|
30962
30994
|
];
|
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.
|
|
766
|
+
version: "0.2.39",
|
|
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.
|
|
692
|
+
version: "0.2.39",
|
|
693
693
|
contracts: {
|
|
694
694
|
api: {
|
|
695
695
|
name: "sdk-http-api",
|