deepline 0.1.78 → 0.1.80
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/cli/index.js +69 -37
- package/dist/cli/index.mjs +69 -37
- package/dist/index.d.mts +32 -1
- package/dist/index.d.ts +32 -1
- package/dist/index.js +7 -4
- package/dist/index.mjs +7 -4
- package/dist/repo/apps/play-runner-workers/src/child-play-await.ts +192 -0
- package/dist/repo/apps/play-runner-workers/src/coordinator-entry.ts +1320 -1644
- package/dist/repo/apps/play-runner-workers/src/dedup-do.ts +515 -648
- package/dist/repo/apps/play-runner-workers/src/entry.ts +896 -354
- package/dist/repo/apps/play-runner-workers/src/workflow-retry-state.ts +209 -0
- package/dist/repo/sdk/src/client.ts +9 -2
- package/dist/repo/sdk/src/release.ts +2 -2
- package/dist/repo/sdk/src/types.ts +5 -0
- package/dist/repo/shared_libs/play-runtime/governor/coordinator-rate-state-backend.ts +231 -0
- package/dist/repo/shared_libs/play-runtime/governor/governor.ts +376 -0
- package/dist/repo/shared_libs/play-runtime/governor/policy.ts +179 -0
- package/dist/repo/shared_libs/play-runtime/governor/rate-state-backend.ts +87 -0
- package/dist/repo/shared_libs/play-runtime/run-failure.ts +12 -0
- package/dist/repo/shared_libs/play-runtime/scheduler-backend.ts +24 -0
- package/dist/repo/shared_libs/play-runtime/submit-limits.ts +35 -0
- package/dist/repo/shared_libs/plays/bundling/index.ts +4 -12
- package/dist/repo/shared_libs/plays/bundling/limits.ts +29 -0
- package/dist/repo/shared_libs/plays/static-pipeline.ts +314 -1
- package/dist/repo/shared_libs/temporal/constants.ts +38 -0
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -229,10 +229,10 @@ var import_node_path2 = require("path");
|
|
|
229
229
|
|
|
230
230
|
// src/release.ts
|
|
231
231
|
var SDK_RELEASE = {
|
|
232
|
-
version: "0.1.
|
|
232
|
+
version: "0.1.80",
|
|
233
233
|
apiContract: "2026-06-dataset-column-cell-stale-hard-cutover",
|
|
234
234
|
supportPolicy: {
|
|
235
|
-
latest: "0.1.
|
|
235
|
+
latest: "0.1.80",
|
|
236
236
|
minimumSupported: "0.1.53",
|
|
237
237
|
deprecatedBelow: "0.1.53"
|
|
238
238
|
}
|
|
@@ -869,6 +869,7 @@ var DeeplineClient = class {
|
|
|
869
869
|
params.set("grep", options.grep.trim());
|
|
870
870
|
params.set("grep_mode", options.grepMode ?? "all");
|
|
871
871
|
}
|
|
872
|
+
params.set("compact", options?.compact === true ? "true" : "false");
|
|
872
873
|
const suffix = params.toString() ? `?${params.toString()}` : "";
|
|
873
874
|
const res = await this.http.get(
|
|
874
875
|
`/api/v2/tools${suffix}`
|
|
@@ -1424,6 +1425,7 @@ var DeeplineClient = class {
|
|
|
1424
1425
|
if (status) {
|
|
1425
1426
|
params.set("status", status);
|
|
1426
1427
|
}
|
|
1428
|
+
params.set("compact", "true");
|
|
1427
1429
|
const response = await this.http.get(
|
|
1428
1430
|
`/api/v2/runs?${params.toString()}`
|
|
1429
1431
|
);
|
|
@@ -1588,10 +1590,11 @@ var DeeplineClient = class {
|
|
|
1588
1590
|
* @param name - Play name
|
|
1589
1591
|
* @returns Version list (newest first)
|
|
1590
1592
|
*/
|
|
1591
|
-
async listPlayVersions(name) {
|
|
1593
|
+
async listPlayVersions(name, options) {
|
|
1592
1594
|
const encodedName = encodeURIComponent(name);
|
|
1595
|
+
const suffix = options?.full ? "?full=true" : "";
|
|
1593
1596
|
const response = await this.http.get(
|
|
1594
|
-
`/api/v2/plays/${encodedName}/versions`
|
|
1597
|
+
`/api/v2/plays/${encodedName}/versions${suffix}`
|
|
1595
1598
|
);
|
|
1596
1599
|
return response.versions ?? [];
|
|
1597
1600
|
}
|
|
@@ -2866,9 +2869,9 @@ function recentUsageLines(entries) {
|
|
|
2866
2869
|
for (const entry of entries) {
|
|
2867
2870
|
const op = `${humanize(entry.provider)} ${humanize(entry.operation)}`.trim();
|
|
2868
2871
|
const charge = entry.billing_mode === "no_bill" ? "free" : `${entry.credits ?? 0} cr`;
|
|
2869
|
-
const
|
|
2872
|
+
const state = entry.charge_state === "temporary_hold" ? "temporary hold, awaiting actual usage" : entry.status || "completed";
|
|
2870
2873
|
lines.push(
|
|
2871
|
-
`${op} | ${charge} | ${
|
|
2874
|
+
`${op} | ${charge} | ${state} | ${entry.created_at || "unknown"}`
|
|
2872
2875
|
);
|
|
2873
2876
|
}
|
|
2874
2877
|
return lines;
|
|
@@ -2952,9 +2955,12 @@ async function handleUsage(options) {
|
|
|
2952
2955
|
const usage = payload.usage ?? {};
|
|
2953
2956
|
const quota = payload.quota ?? {};
|
|
2954
2957
|
const recent = payload.recent ?? {};
|
|
2958
|
+
const last30Usage = usage.last_30_days_usage_credits ?? usage.month_spent_credits;
|
|
2959
|
+
const temporaryHolds = Number(usage.temporary_hold_credits ?? 0);
|
|
2955
2960
|
const lines = [
|
|
2956
2961
|
`Balance: ${payload.balance ?? "(unknown)"}`,
|
|
2957
|
-
`Last 30 days
|
|
2962
|
+
`Last 30 days usage: ${last30Usage ?? "(unknown)"}`,
|
|
2963
|
+
...Number.isFinite(temporaryHolds) && temporaryHolds > 0 ? [`Temporary holds: ${temporaryHolds}`] : [],
|
|
2958
2964
|
`Monthly limit: ${quota.enabled ? quota.monthly_credits_limit ?? "(unknown)" : "off"}`,
|
|
2959
2965
|
...recentUsageLines(
|
|
2960
2966
|
Array.isArray(recent.entries) ? recent.entries : []
|
|
@@ -4417,10 +4423,12 @@ function validatePlaySourceFilesHaveNoInlineSecrets(sourceFiles) {
|
|
|
4417
4423
|
}
|
|
4418
4424
|
}
|
|
4419
4425
|
|
|
4420
|
-
// ../shared_libs/plays/bundling/
|
|
4421
|
-
var PLAY_BUNDLE_CACHE_VERSION = 24;
|
|
4426
|
+
// ../shared_libs/plays/bundling/limits.ts
|
|
4422
4427
|
var MAX_PLAY_BUNDLE_BYTES = 30 * 1024 * 1024;
|
|
4423
4428
|
var MAX_ESM_WORKERS_BUNDLE_BYTES = 115e4;
|
|
4429
|
+
|
|
4430
|
+
// ../shared_libs/plays/bundling/index.ts
|
|
4431
|
+
var PLAY_BUNDLE_CACHE_VERSION = 24;
|
|
4424
4432
|
var PLAY_ARTIFACT_CACHE_DIR = (0, import_node_path8.join)(
|
|
4425
4433
|
(0, import_node_os5.tmpdir)(),
|
|
4426
4434
|
`deepline-play-artifacts-v${PLAY_BUNDLE_CACHE_VERSION}`
|
|
@@ -7734,7 +7742,6 @@ ${hint}`;
|
|
|
7734
7742
|
}
|
|
7735
7743
|
|
|
7736
7744
|
// src/cli/commands/play.ts
|
|
7737
|
-
var PLAY_START_STREAM_FAST_COMPLETION_WAIT_MS = 2500;
|
|
7738
7745
|
var PLAY_RUN_RESERVED_BOOLEAN_FLAGS = /* @__PURE__ */ new Set([
|
|
7739
7746
|
"--json",
|
|
7740
7747
|
"--wait",
|
|
@@ -8561,13 +8568,20 @@ async function waitForPlayCompletionByStream(input2) {
|
|
|
8561
8568
|
progress: input2.progress
|
|
8562
8569
|
});
|
|
8563
8570
|
}
|
|
8571
|
+
const finalStatus = getFinalStatusFromLiveEvent(event);
|
|
8572
|
+
if (finalStatus) {
|
|
8573
|
+
return input2.dashboardUrl ? { ...finalStatus, dashboardUrl: input2.dashboardUrl } : finalStatus;
|
|
8574
|
+
}
|
|
8564
8575
|
const status = getStatusFromLiveEvent(event);
|
|
8565
8576
|
if (status && TERMINAL_PLAY_STATUSES2.has(status)) {
|
|
8566
|
-
const
|
|
8567
|
-
|
|
8568
|
-
|
|
8569
|
-
|
|
8570
|
-
|
|
8577
|
+
const refreshedStatus = await input2.client.getPlayStatus(
|
|
8578
|
+
input2.workflowId,
|
|
8579
|
+
{
|
|
8580
|
+
billing: false
|
|
8581
|
+
}
|
|
8582
|
+
);
|
|
8583
|
+
if (TERMINAL_PLAY_STATUSES2.has(refreshedStatus.status)) {
|
|
8584
|
+
return input2.dashboardUrl ? { ...refreshedStatus, dashboardUrl: input2.dashboardUrl } : refreshedStatus;
|
|
8571
8585
|
}
|
|
8572
8586
|
}
|
|
8573
8587
|
}
|
|
@@ -8639,10 +8653,6 @@ async function startAndWaitForPlayCompletionByStreamOnce(input2) {
|
|
|
8639
8653
|
let eventCount = 0;
|
|
8640
8654
|
let firstRunIdMs = null;
|
|
8641
8655
|
let lastPhase = null;
|
|
8642
|
-
const startRequest = {
|
|
8643
|
-
...input2.request,
|
|
8644
|
-
waitForCompletionMs: typeof input2.request.waitForCompletionMs === "number" ? input2.request.waitForCompletionMs : PLAY_START_STREAM_FAST_COMPLETION_WAIT_MS
|
|
8645
|
-
};
|
|
8646
8656
|
const timeout = input2.waitTimeoutMs === null ? null : setTimeout(
|
|
8647
8657
|
() => {
|
|
8648
8658
|
timedOut = true;
|
|
@@ -8651,7 +8661,7 @@ async function startAndWaitForPlayCompletionByStreamOnce(input2) {
|
|
|
8651
8661
|
Math.max(1, input2.waitTimeoutMs)
|
|
8652
8662
|
);
|
|
8653
8663
|
try {
|
|
8654
|
-
for await (const event of input2.client.startPlayRunStream(
|
|
8664
|
+
for await (const event of input2.client.startPlayRunStream(input2.request, {
|
|
8655
8665
|
signal: controller.signal
|
|
8656
8666
|
})) {
|
|
8657
8667
|
eventCount += 1;
|
|
@@ -9612,7 +9622,7 @@ function writePlayResult(status, jsonOutput, options) {
|
|
|
9612
9622
|
);
|
|
9613
9623
|
}
|
|
9614
9624
|
async function resolvePlayRunOutputStatus(input2) {
|
|
9615
|
-
if (!getPlayRunPackage(input2.status)) {
|
|
9625
|
+
if (!input2.fullJson || !getPlayRunPackage(input2.status)) {
|
|
9616
9626
|
return input2.status;
|
|
9617
9627
|
}
|
|
9618
9628
|
const runId = input2.status.runId;
|
|
@@ -10829,7 +10839,7 @@ async function handleRunsList(args) {
|
|
|
10829
10839
|
for (let index = 0; index < args.length; index += 1) {
|
|
10830
10840
|
const arg = args[index];
|
|
10831
10841
|
if ((arg === "--play" || arg === "--name") && args[index + 1]) {
|
|
10832
|
-
playName =
|
|
10842
|
+
playName = args[++index].trim();
|
|
10833
10843
|
continue;
|
|
10834
10844
|
}
|
|
10835
10845
|
if (arg === "--status" && args[index + 1]) {
|
|
@@ -11218,7 +11228,7 @@ async function handlePlayList(args) {
|
|
|
11218
11228
|
const reference = formatPlayListReference(play);
|
|
11219
11229
|
process.stdout.write(` ${reference}${flags ? ` [${flags}]` : ""}
|
|
11220
11230
|
`);
|
|
11221
|
-
if (play.inputSchema) {
|
|
11231
|
+
if (play.inputSchema || play.hasInputSchema) {
|
|
11222
11232
|
process.stdout.write(" inputSchema: yes\n");
|
|
11223
11233
|
}
|
|
11224
11234
|
process.stdout.write(` run: deepline plays run ${reference} --watch
|
|
@@ -11571,22 +11581,42 @@ async function handlePlayPublish(args) {
|
|
|
11571
11581
|
}
|
|
11572
11582
|
let graph;
|
|
11573
11583
|
try {
|
|
11574
|
-
graph = await
|
|
11575
|
-
|
|
11576
|
-
|
|
11584
|
+
graph = await traceCliSpan(
|
|
11585
|
+
"cli.play_publish_bundle_graph",
|
|
11586
|
+
{ targetKind: "file" },
|
|
11587
|
+
() => collectBundledPlayGraph((0, import_node_path12.resolve)(playName))
|
|
11588
|
+
);
|
|
11589
|
+
await traceCliSpan(
|
|
11590
|
+
"cli.play_publish_compile_manifests",
|
|
11591
|
+
{ targetKind: "file", nodeCount: graph.nodes.size },
|
|
11592
|
+
() => compileBundledPlayGraphManifests(client, graph)
|
|
11593
|
+
);
|
|
11594
|
+
await traceCliSpan(
|
|
11595
|
+
"cli.play_publish_imports",
|
|
11596
|
+
{ targetKind: "file", nodeCount: graph.nodes.size },
|
|
11597
|
+
() => publishImportedPlayDependencies(client, graph)
|
|
11598
|
+
);
|
|
11577
11599
|
} catch (error) {
|
|
11578
11600
|
console.error(error instanceof Error ? error.message : String(error));
|
|
11579
11601
|
return 1;
|
|
11580
11602
|
}
|
|
11581
11603
|
const rootPlayName = graph.root.playName ?? extractPlayName(graph.root.sourceCode, graph.root.filePath);
|
|
11582
|
-
const published = await
|
|
11583
|
-
|
|
11584
|
-
|
|
11585
|
-
|
|
11586
|
-
|
|
11587
|
-
|
|
11588
|
-
|
|
11589
|
-
|
|
11604
|
+
const published = await traceCliSpan(
|
|
11605
|
+
"cli.play_publish_register_root",
|
|
11606
|
+
{
|
|
11607
|
+
targetKind: "file",
|
|
11608
|
+
playName: rootPlayName,
|
|
11609
|
+
artifactHash: graph.root.artifact.artifactHash
|
|
11610
|
+
},
|
|
11611
|
+
() => client.registerPlayArtifact({
|
|
11612
|
+
name: rootPlayName,
|
|
11613
|
+
sourceCode: graph.root.sourceCode,
|
|
11614
|
+
sourceFiles: graph.root.sourceFiles,
|
|
11615
|
+
artifact: graph.root.artifact,
|
|
11616
|
+
compilerManifest: requireCompilerManifest(graph.root),
|
|
11617
|
+
publish: true
|
|
11618
|
+
})
|
|
11619
|
+
);
|
|
11590
11620
|
process.stdout.write(
|
|
11591
11621
|
`${JSON.stringify({
|
|
11592
11622
|
success: true,
|
|
@@ -14043,10 +14073,11 @@ async function listTools(args) {
|
|
|
14043
14073
|
const client = new DeeplineClient();
|
|
14044
14074
|
const categoryArgIndex = args.findIndex((arg) => arg === "--categories");
|
|
14045
14075
|
const categoryFilter = categoryArgIndex >= 0 ? args[categoryArgIndex + 1] : "";
|
|
14046
|
-
const compact =
|
|
14076
|
+
const compact = !args.includes("--full");
|
|
14047
14077
|
const requestedCategories = categoryFilter ? categoryFilter.split(",").map((item) => item.trim()).filter(Boolean) : [];
|
|
14048
14078
|
const items = (await client.listTools({
|
|
14049
|
-
...categoryFilter ? { categories: categoryFilter } : {}
|
|
14079
|
+
...categoryFilter ? { categories: categoryFilter } : {},
|
|
14080
|
+
compact
|
|
14050
14081
|
})).map(toListedTool).filter(
|
|
14051
14082
|
(item) => requestedCategories.length === 0 || requestedCategories.some(
|
|
14052
14083
|
(category) => item.categories.includes(category)
|
|
@@ -14121,7 +14152,8 @@ async function grepTools(queryInput, options = {}) {
|
|
|
14121
14152
|
const tools = (await client.listTools({
|
|
14122
14153
|
grep: query,
|
|
14123
14154
|
grepMode: mode,
|
|
14124
|
-
...options.categories ? { categories: options.categories } : {}
|
|
14155
|
+
...options.categories ? { categories: options.categories } : {},
|
|
14156
|
+
compact: options.compact ?? true
|
|
14125
14157
|
})).map(toListedTool).filter(
|
|
14126
14158
|
(item) => requestedCategories.length === 0 || requestedCategories.some(
|
|
14127
14159
|
(category) => item.categories.includes(category)
|
package/dist/cli/index.mjs
CHANGED
|
@@ -206,10 +206,10 @@ import { join as join2 } from "path";
|
|
|
206
206
|
|
|
207
207
|
// src/release.ts
|
|
208
208
|
var SDK_RELEASE = {
|
|
209
|
-
version: "0.1.
|
|
209
|
+
version: "0.1.80",
|
|
210
210
|
apiContract: "2026-06-dataset-column-cell-stale-hard-cutover",
|
|
211
211
|
supportPolicy: {
|
|
212
|
-
latest: "0.1.
|
|
212
|
+
latest: "0.1.80",
|
|
213
213
|
minimumSupported: "0.1.53",
|
|
214
214
|
deprecatedBelow: "0.1.53"
|
|
215
215
|
}
|
|
@@ -846,6 +846,7 @@ var DeeplineClient = class {
|
|
|
846
846
|
params.set("grep", options.grep.trim());
|
|
847
847
|
params.set("grep_mode", options.grepMode ?? "all");
|
|
848
848
|
}
|
|
849
|
+
params.set("compact", options?.compact === true ? "true" : "false");
|
|
849
850
|
const suffix = params.toString() ? `?${params.toString()}` : "";
|
|
850
851
|
const res = await this.http.get(
|
|
851
852
|
`/api/v2/tools${suffix}`
|
|
@@ -1401,6 +1402,7 @@ var DeeplineClient = class {
|
|
|
1401
1402
|
if (status) {
|
|
1402
1403
|
params.set("status", status);
|
|
1403
1404
|
}
|
|
1405
|
+
params.set("compact", "true");
|
|
1404
1406
|
const response = await this.http.get(
|
|
1405
1407
|
`/api/v2/runs?${params.toString()}`
|
|
1406
1408
|
);
|
|
@@ -1565,10 +1567,11 @@ var DeeplineClient = class {
|
|
|
1565
1567
|
* @param name - Play name
|
|
1566
1568
|
* @returns Version list (newest first)
|
|
1567
1569
|
*/
|
|
1568
|
-
async listPlayVersions(name) {
|
|
1570
|
+
async listPlayVersions(name, options) {
|
|
1569
1571
|
const encodedName = encodeURIComponent(name);
|
|
1572
|
+
const suffix = options?.full ? "?full=true" : "";
|
|
1570
1573
|
const response = await this.http.get(
|
|
1571
|
-
`/api/v2/plays/${encodedName}/versions`
|
|
1574
|
+
`/api/v2/plays/${encodedName}/versions${suffix}`
|
|
1572
1575
|
);
|
|
1573
1576
|
return response.versions ?? [];
|
|
1574
1577
|
}
|
|
@@ -2849,9 +2852,9 @@ function recentUsageLines(entries) {
|
|
|
2849
2852
|
for (const entry of entries) {
|
|
2850
2853
|
const op = `${humanize(entry.provider)} ${humanize(entry.operation)}`.trim();
|
|
2851
2854
|
const charge = entry.billing_mode === "no_bill" ? "free" : `${entry.credits ?? 0} cr`;
|
|
2852
|
-
const
|
|
2855
|
+
const state = entry.charge_state === "temporary_hold" ? "temporary hold, awaiting actual usage" : entry.status || "completed";
|
|
2853
2856
|
lines.push(
|
|
2854
|
-
`${op} | ${charge} | ${
|
|
2857
|
+
`${op} | ${charge} | ${state} | ${entry.created_at || "unknown"}`
|
|
2855
2858
|
);
|
|
2856
2859
|
}
|
|
2857
2860
|
return lines;
|
|
@@ -2935,9 +2938,12 @@ async function handleUsage(options) {
|
|
|
2935
2938
|
const usage = payload.usage ?? {};
|
|
2936
2939
|
const quota = payload.quota ?? {};
|
|
2937
2940
|
const recent = payload.recent ?? {};
|
|
2941
|
+
const last30Usage = usage.last_30_days_usage_credits ?? usage.month_spent_credits;
|
|
2942
|
+
const temporaryHolds = Number(usage.temporary_hold_credits ?? 0);
|
|
2938
2943
|
const lines = [
|
|
2939
2944
|
`Balance: ${payload.balance ?? "(unknown)"}`,
|
|
2940
|
-
`Last 30 days
|
|
2945
|
+
`Last 30 days usage: ${last30Usage ?? "(unknown)"}`,
|
|
2946
|
+
...Number.isFinite(temporaryHolds) && temporaryHolds > 0 ? [`Temporary holds: ${temporaryHolds}`] : [],
|
|
2941
2947
|
`Monthly limit: ${quota.enabled ? quota.monthly_credits_limit ?? "(unknown)" : "off"}`,
|
|
2942
2948
|
...recentUsageLines(
|
|
2943
2949
|
Array.isArray(recent.entries) ? recent.entries : []
|
|
@@ -4413,10 +4419,12 @@ function validatePlaySourceFilesHaveNoInlineSecrets(sourceFiles) {
|
|
|
4413
4419
|
}
|
|
4414
4420
|
}
|
|
4415
4421
|
|
|
4416
|
-
// ../shared_libs/plays/bundling/
|
|
4417
|
-
var PLAY_BUNDLE_CACHE_VERSION = 24;
|
|
4422
|
+
// ../shared_libs/plays/bundling/limits.ts
|
|
4418
4423
|
var MAX_PLAY_BUNDLE_BYTES = 30 * 1024 * 1024;
|
|
4419
4424
|
var MAX_ESM_WORKERS_BUNDLE_BYTES = 115e4;
|
|
4425
|
+
|
|
4426
|
+
// ../shared_libs/plays/bundling/index.ts
|
|
4427
|
+
var PLAY_BUNDLE_CACHE_VERSION = 24;
|
|
4420
4428
|
var PLAY_ARTIFACT_CACHE_DIR = join4(
|
|
4421
4429
|
tmpdir(),
|
|
4422
4430
|
`deepline-play-artifacts-v${PLAY_BUNDLE_CACHE_VERSION}`
|
|
@@ -7737,7 +7745,6 @@ ${hint}`;
|
|
|
7737
7745
|
}
|
|
7738
7746
|
|
|
7739
7747
|
// src/cli/commands/play.ts
|
|
7740
|
-
var PLAY_START_STREAM_FAST_COMPLETION_WAIT_MS = 2500;
|
|
7741
7748
|
var PLAY_RUN_RESERVED_BOOLEAN_FLAGS = /* @__PURE__ */ new Set([
|
|
7742
7749
|
"--json",
|
|
7743
7750
|
"--wait",
|
|
@@ -8564,13 +8571,20 @@ async function waitForPlayCompletionByStream(input2) {
|
|
|
8564
8571
|
progress: input2.progress
|
|
8565
8572
|
});
|
|
8566
8573
|
}
|
|
8574
|
+
const finalStatus = getFinalStatusFromLiveEvent(event);
|
|
8575
|
+
if (finalStatus) {
|
|
8576
|
+
return input2.dashboardUrl ? { ...finalStatus, dashboardUrl: input2.dashboardUrl } : finalStatus;
|
|
8577
|
+
}
|
|
8567
8578
|
const status = getStatusFromLiveEvent(event);
|
|
8568
8579
|
if (status && TERMINAL_PLAY_STATUSES2.has(status)) {
|
|
8569
|
-
const
|
|
8570
|
-
|
|
8571
|
-
|
|
8572
|
-
|
|
8573
|
-
|
|
8580
|
+
const refreshedStatus = await input2.client.getPlayStatus(
|
|
8581
|
+
input2.workflowId,
|
|
8582
|
+
{
|
|
8583
|
+
billing: false
|
|
8584
|
+
}
|
|
8585
|
+
);
|
|
8586
|
+
if (TERMINAL_PLAY_STATUSES2.has(refreshedStatus.status)) {
|
|
8587
|
+
return input2.dashboardUrl ? { ...refreshedStatus, dashboardUrl: input2.dashboardUrl } : refreshedStatus;
|
|
8574
8588
|
}
|
|
8575
8589
|
}
|
|
8576
8590
|
}
|
|
@@ -8642,10 +8656,6 @@ async function startAndWaitForPlayCompletionByStreamOnce(input2) {
|
|
|
8642
8656
|
let eventCount = 0;
|
|
8643
8657
|
let firstRunIdMs = null;
|
|
8644
8658
|
let lastPhase = null;
|
|
8645
|
-
const startRequest = {
|
|
8646
|
-
...input2.request,
|
|
8647
|
-
waitForCompletionMs: typeof input2.request.waitForCompletionMs === "number" ? input2.request.waitForCompletionMs : PLAY_START_STREAM_FAST_COMPLETION_WAIT_MS
|
|
8648
|
-
};
|
|
8649
8659
|
const timeout = input2.waitTimeoutMs === null ? null : setTimeout(
|
|
8650
8660
|
() => {
|
|
8651
8661
|
timedOut = true;
|
|
@@ -8654,7 +8664,7 @@ async function startAndWaitForPlayCompletionByStreamOnce(input2) {
|
|
|
8654
8664
|
Math.max(1, input2.waitTimeoutMs)
|
|
8655
8665
|
);
|
|
8656
8666
|
try {
|
|
8657
|
-
for await (const event of input2.client.startPlayRunStream(
|
|
8667
|
+
for await (const event of input2.client.startPlayRunStream(input2.request, {
|
|
8658
8668
|
signal: controller.signal
|
|
8659
8669
|
})) {
|
|
8660
8670
|
eventCount += 1;
|
|
@@ -9615,7 +9625,7 @@ function writePlayResult(status, jsonOutput, options) {
|
|
|
9615
9625
|
);
|
|
9616
9626
|
}
|
|
9617
9627
|
async function resolvePlayRunOutputStatus(input2) {
|
|
9618
|
-
if (!getPlayRunPackage(input2.status)) {
|
|
9628
|
+
if (!input2.fullJson || !getPlayRunPackage(input2.status)) {
|
|
9619
9629
|
return input2.status;
|
|
9620
9630
|
}
|
|
9621
9631
|
const runId = input2.status.runId;
|
|
@@ -10832,7 +10842,7 @@ async function handleRunsList(args) {
|
|
|
10832
10842
|
for (let index = 0; index < args.length; index += 1) {
|
|
10833
10843
|
const arg = args[index];
|
|
10834
10844
|
if ((arg === "--play" || arg === "--name") && args[index + 1]) {
|
|
10835
|
-
playName =
|
|
10845
|
+
playName = args[++index].trim();
|
|
10836
10846
|
continue;
|
|
10837
10847
|
}
|
|
10838
10848
|
if (arg === "--status" && args[index + 1]) {
|
|
@@ -11221,7 +11231,7 @@ async function handlePlayList(args) {
|
|
|
11221
11231
|
const reference = formatPlayListReference(play);
|
|
11222
11232
|
process.stdout.write(` ${reference}${flags ? ` [${flags}]` : ""}
|
|
11223
11233
|
`);
|
|
11224
|
-
if (play.inputSchema) {
|
|
11234
|
+
if (play.inputSchema || play.hasInputSchema) {
|
|
11225
11235
|
process.stdout.write(" inputSchema: yes\n");
|
|
11226
11236
|
}
|
|
11227
11237
|
process.stdout.write(` run: deepline plays run ${reference} --watch
|
|
@@ -11574,22 +11584,42 @@ async function handlePlayPublish(args) {
|
|
|
11574
11584
|
}
|
|
11575
11585
|
let graph;
|
|
11576
11586
|
try {
|
|
11577
|
-
graph = await
|
|
11578
|
-
|
|
11579
|
-
|
|
11587
|
+
graph = await traceCliSpan(
|
|
11588
|
+
"cli.play_publish_bundle_graph",
|
|
11589
|
+
{ targetKind: "file" },
|
|
11590
|
+
() => collectBundledPlayGraph(resolve10(playName))
|
|
11591
|
+
);
|
|
11592
|
+
await traceCliSpan(
|
|
11593
|
+
"cli.play_publish_compile_manifests",
|
|
11594
|
+
{ targetKind: "file", nodeCount: graph.nodes.size },
|
|
11595
|
+
() => compileBundledPlayGraphManifests(client, graph)
|
|
11596
|
+
);
|
|
11597
|
+
await traceCliSpan(
|
|
11598
|
+
"cli.play_publish_imports",
|
|
11599
|
+
{ targetKind: "file", nodeCount: graph.nodes.size },
|
|
11600
|
+
() => publishImportedPlayDependencies(client, graph)
|
|
11601
|
+
);
|
|
11580
11602
|
} catch (error) {
|
|
11581
11603
|
console.error(error instanceof Error ? error.message : String(error));
|
|
11582
11604
|
return 1;
|
|
11583
11605
|
}
|
|
11584
11606
|
const rootPlayName = graph.root.playName ?? extractPlayName(graph.root.sourceCode, graph.root.filePath);
|
|
11585
|
-
const published = await
|
|
11586
|
-
|
|
11587
|
-
|
|
11588
|
-
|
|
11589
|
-
|
|
11590
|
-
|
|
11591
|
-
|
|
11592
|
-
|
|
11607
|
+
const published = await traceCliSpan(
|
|
11608
|
+
"cli.play_publish_register_root",
|
|
11609
|
+
{
|
|
11610
|
+
targetKind: "file",
|
|
11611
|
+
playName: rootPlayName,
|
|
11612
|
+
artifactHash: graph.root.artifact.artifactHash
|
|
11613
|
+
},
|
|
11614
|
+
() => client.registerPlayArtifact({
|
|
11615
|
+
name: rootPlayName,
|
|
11616
|
+
sourceCode: graph.root.sourceCode,
|
|
11617
|
+
sourceFiles: graph.root.sourceFiles,
|
|
11618
|
+
artifact: graph.root.artifact,
|
|
11619
|
+
compilerManifest: requireCompilerManifest(graph.root),
|
|
11620
|
+
publish: true
|
|
11621
|
+
})
|
|
11622
|
+
);
|
|
11593
11623
|
process.stdout.write(
|
|
11594
11624
|
`${JSON.stringify({
|
|
11595
11625
|
success: true,
|
|
@@ -14046,10 +14076,11 @@ async function listTools(args) {
|
|
|
14046
14076
|
const client = new DeeplineClient();
|
|
14047
14077
|
const categoryArgIndex = args.findIndex((arg) => arg === "--categories");
|
|
14048
14078
|
const categoryFilter = categoryArgIndex >= 0 ? args[categoryArgIndex + 1] : "";
|
|
14049
|
-
const compact =
|
|
14079
|
+
const compact = !args.includes("--full");
|
|
14050
14080
|
const requestedCategories = categoryFilter ? categoryFilter.split(",").map((item) => item.trim()).filter(Boolean) : [];
|
|
14051
14081
|
const items = (await client.listTools({
|
|
14052
|
-
...categoryFilter ? { categories: categoryFilter } : {}
|
|
14082
|
+
...categoryFilter ? { categories: categoryFilter } : {},
|
|
14083
|
+
compact
|
|
14053
14084
|
})).map(toListedTool).filter(
|
|
14054
14085
|
(item) => requestedCategories.length === 0 || requestedCategories.some(
|
|
14055
14086
|
(category) => item.categories.includes(category)
|
|
@@ -14124,7 +14155,8 @@ async function grepTools(queryInput, options = {}) {
|
|
|
14124
14155
|
const tools = (await client.listTools({
|
|
14125
14156
|
grep: query,
|
|
14126
14157
|
grepMode: mode,
|
|
14127
|
-
...options.categories ? { categories: options.categories } : {}
|
|
14158
|
+
...options.categories ? { categories: options.categories } : {},
|
|
14159
|
+
compact: options.compact ?? true
|
|
14128
14160
|
})).map(toListedTool).filter(
|
|
14129
14161
|
(item) => requestedCategories.length === 0 || requestedCategories.some(
|
|
14130
14162
|
(category) => item.categories.includes(category)
|
package/dist/index.d.mts
CHANGED
|
@@ -16,6 +16,7 @@ type PlayArtifactKind = (typeof PLAY_ARTIFACT_KINDS)[keyof typeof PLAY_ARTIFACT_
|
|
|
16
16
|
interface PlayStaticPipelineSnapshot {
|
|
17
17
|
tableNamespace?: string;
|
|
18
18
|
inputFields?: string[];
|
|
19
|
+
rowKeyFields?: string[];
|
|
19
20
|
csvArg?: string;
|
|
20
21
|
hasInlineData?: boolean;
|
|
21
22
|
csvDescription?: string;
|
|
@@ -39,11 +40,30 @@ interface PlaySheetColumnContractSnapshot {
|
|
|
39
40
|
outputSqlName?: string;
|
|
40
41
|
stepId?: string;
|
|
41
42
|
toolId?: string;
|
|
43
|
+
isRowKey?: boolean;
|
|
42
44
|
}
|
|
43
45
|
interface PlaySheetContractSnapshot {
|
|
44
46
|
tableNamespace: string;
|
|
45
47
|
columns: PlaySheetColumnContractSnapshot[];
|
|
46
48
|
}
|
|
49
|
+
type PlayStaticColumnProducerKindSnapshot = 'tool' | 'waterfall' | 'stepProgram' | 'playCall' | 'transform';
|
|
50
|
+
interface PlayStaticColumnProducerSnapshot {
|
|
51
|
+
id: string;
|
|
52
|
+
kind: PlayStaticColumnProducerKindSnapshot;
|
|
53
|
+
field: string;
|
|
54
|
+
toolId?: string;
|
|
55
|
+
playId?: string;
|
|
56
|
+
conditional?: boolean;
|
|
57
|
+
sourceRange?: PlayStaticSourceRangeSnapshot;
|
|
58
|
+
steps?: PlayStaticColumnProducerSnapshot[];
|
|
59
|
+
substep: PlayStaticSubstepSnapshot;
|
|
60
|
+
}
|
|
61
|
+
interface PlayStaticDatasetColumnSnapshot {
|
|
62
|
+
id: string;
|
|
63
|
+
source: PlaySheetColumnSourceSnapshot;
|
|
64
|
+
sqlName?: string;
|
|
65
|
+
producers: PlayStaticColumnProducerSnapshot[];
|
|
66
|
+
}
|
|
47
67
|
interface PlayStaticSourceRangeSnapshot {
|
|
48
68
|
sourcePath?: string;
|
|
49
69
|
startLine: number;
|
|
@@ -68,8 +88,11 @@ type PlayStaticSubstepSnapshot = PlayStaticSubstepMetadataSnapshot & ({
|
|
|
68
88
|
name?: string;
|
|
69
89
|
tableNamespace?: string;
|
|
70
90
|
inputFields?: string[];
|
|
91
|
+
rowKeyFields?: string[];
|
|
71
92
|
outputFields?: string[];
|
|
93
|
+
columns?: PlayStaticDatasetColumnSnapshot[];
|
|
72
94
|
waterfallIds?: string[];
|
|
95
|
+
steps?: PlayStaticSubstepSnapshot[];
|
|
73
96
|
sheetContract?: PlaySheetContractSnapshot | null;
|
|
74
97
|
description?: string;
|
|
75
98
|
sourceRange?: PlayStaticSourceRangeSnapshot;
|
|
@@ -282,6 +305,10 @@ interface ToolDefinition {
|
|
|
282
305
|
operationId?: string;
|
|
283
306
|
/** Alternative names that resolve to this tool. */
|
|
284
307
|
operationAliases?: string[];
|
|
308
|
+
/** Whether detailed input schema is available from `tools describe`. */
|
|
309
|
+
hasInputSchema?: boolean;
|
|
310
|
+
/** Whether detailed output schema is available from `tools describe`. */
|
|
311
|
+
hasOutputSchema?: boolean;
|
|
285
312
|
/** JSON Schema describing the tool's input parameters. */
|
|
286
313
|
inputSchema?: Record<string, unknown>;
|
|
287
314
|
/** JSON Schema describing the tool's output shape. */
|
|
@@ -773,6 +800,7 @@ interface PlayListItem {
|
|
|
773
800
|
currentPublishedVersion?: number | null;
|
|
774
801
|
tableNamespace?: string | null;
|
|
775
802
|
isDraftDirty?: boolean;
|
|
803
|
+
hasInputSchema?: boolean;
|
|
776
804
|
inputSchema?: Record<string, unknown> | null;
|
|
777
805
|
outputSchema?: Record<string, unknown> | null;
|
|
778
806
|
staticPipeline?: unknown;
|
|
@@ -1240,6 +1268,7 @@ declare class DeeplineClient {
|
|
|
1240
1268
|
categories?: string;
|
|
1241
1269
|
grep?: string;
|
|
1242
1270
|
grepMode?: 'all' | 'any' | 'phrase';
|
|
1271
|
+
compact?: boolean;
|
|
1243
1272
|
}): Promise<ToolDefinition[]>;
|
|
1244
1273
|
/**
|
|
1245
1274
|
* Search available tools using Deepline's ranked backend search.
|
|
@@ -1653,7 +1682,9 @@ declare class DeeplineClient {
|
|
|
1653
1682
|
* @param name - Play name
|
|
1654
1683
|
* @returns Version list (newest first)
|
|
1655
1684
|
*/
|
|
1656
|
-
listPlayVersions(name: string
|
|
1685
|
+
listPlayVersions(name: string, options?: {
|
|
1686
|
+
full?: boolean;
|
|
1687
|
+
}): Promise<PlayRevisionSummary[]>;
|
|
1657
1688
|
/**
|
|
1658
1689
|
* Make a play revision live.
|
|
1659
1690
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ type PlayArtifactKind = (typeof PLAY_ARTIFACT_KINDS)[keyof typeof PLAY_ARTIFACT_
|
|
|
16
16
|
interface PlayStaticPipelineSnapshot {
|
|
17
17
|
tableNamespace?: string;
|
|
18
18
|
inputFields?: string[];
|
|
19
|
+
rowKeyFields?: string[];
|
|
19
20
|
csvArg?: string;
|
|
20
21
|
hasInlineData?: boolean;
|
|
21
22
|
csvDescription?: string;
|
|
@@ -39,11 +40,30 @@ interface PlaySheetColumnContractSnapshot {
|
|
|
39
40
|
outputSqlName?: string;
|
|
40
41
|
stepId?: string;
|
|
41
42
|
toolId?: string;
|
|
43
|
+
isRowKey?: boolean;
|
|
42
44
|
}
|
|
43
45
|
interface PlaySheetContractSnapshot {
|
|
44
46
|
tableNamespace: string;
|
|
45
47
|
columns: PlaySheetColumnContractSnapshot[];
|
|
46
48
|
}
|
|
49
|
+
type PlayStaticColumnProducerKindSnapshot = 'tool' | 'waterfall' | 'stepProgram' | 'playCall' | 'transform';
|
|
50
|
+
interface PlayStaticColumnProducerSnapshot {
|
|
51
|
+
id: string;
|
|
52
|
+
kind: PlayStaticColumnProducerKindSnapshot;
|
|
53
|
+
field: string;
|
|
54
|
+
toolId?: string;
|
|
55
|
+
playId?: string;
|
|
56
|
+
conditional?: boolean;
|
|
57
|
+
sourceRange?: PlayStaticSourceRangeSnapshot;
|
|
58
|
+
steps?: PlayStaticColumnProducerSnapshot[];
|
|
59
|
+
substep: PlayStaticSubstepSnapshot;
|
|
60
|
+
}
|
|
61
|
+
interface PlayStaticDatasetColumnSnapshot {
|
|
62
|
+
id: string;
|
|
63
|
+
source: PlaySheetColumnSourceSnapshot;
|
|
64
|
+
sqlName?: string;
|
|
65
|
+
producers: PlayStaticColumnProducerSnapshot[];
|
|
66
|
+
}
|
|
47
67
|
interface PlayStaticSourceRangeSnapshot {
|
|
48
68
|
sourcePath?: string;
|
|
49
69
|
startLine: number;
|
|
@@ -68,8 +88,11 @@ type PlayStaticSubstepSnapshot = PlayStaticSubstepMetadataSnapshot & ({
|
|
|
68
88
|
name?: string;
|
|
69
89
|
tableNamespace?: string;
|
|
70
90
|
inputFields?: string[];
|
|
91
|
+
rowKeyFields?: string[];
|
|
71
92
|
outputFields?: string[];
|
|
93
|
+
columns?: PlayStaticDatasetColumnSnapshot[];
|
|
72
94
|
waterfallIds?: string[];
|
|
95
|
+
steps?: PlayStaticSubstepSnapshot[];
|
|
73
96
|
sheetContract?: PlaySheetContractSnapshot | null;
|
|
74
97
|
description?: string;
|
|
75
98
|
sourceRange?: PlayStaticSourceRangeSnapshot;
|
|
@@ -282,6 +305,10 @@ interface ToolDefinition {
|
|
|
282
305
|
operationId?: string;
|
|
283
306
|
/** Alternative names that resolve to this tool. */
|
|
284
307
|
operationAliases?: string[];
|
|
308
|
+
/** Whether detailed input schema is available from `tools describe`. */
|
|
309
|
+
hasInputSchema?: boolean;
|
|
310
|
+
/** Whether detailed output schema is available from `tools describe`. */
|
|
311
|
+
hasOutputSchema?: boolean;
|
|
285
312
|
/** JSON Schema describing the tool's input parameters. */
|
|
286
313
|
inputSchema?: Record<string, unknown>;
|
|
287
314
|
/** JSON Schema describing the tool's output shape. */
|
|
@@ -773,6 +800,7 @@ interface PlayListItem {
|
|
|
773
800
|
currentPublishedVersion?: number | null;
|
|
774
801
|
tableNamespace?: string | null;
|
|
775
802
|
isDraftDirty?: boolean;
|
|
803
|
+
hasInputSchema?: boolean;
|
|
776
804
|
inputSchema?: Record<string, unknown> | null;
|
|
777
805
|
outputSchema?: Record<string, unknown> | null;
|
|
778
806
|
staticPipeline?: unknown;
|
|
@@ -1240,6 +1268,7 @@ declare class DeeplineClient {
|
|
|
1240
1268
|
categories?: string;
|
|
1241
1269
|
grep?: string;
|
|
1242
1270
|
grepMode?: 'all' | 'any' | 'phrase';
|
|
1271
|
+
compact?: boolean;
|
|
1243
1272
|
}): Promise<ToolDefinition[]>;
|
|
1244
1273
|
/**
|
|
1245
1274
|
* Search available tools using Deepline's ranked backend search.
|
|
@@ -1653,7 +1682,9 @@ declare class DeeplineClient {
|
|
|
1653
1682
|
* @param name - Play name
|
|
1654
1683
|
* @returns Version list (newest first)
|
|
1655
1684
|
*/
|
|
1656
|
-
listPlayVersions(name: string
|
|
1685
|
+
listPlayVersions(name: string, options?: {
|
|
1686
|
+
full?: boolean;
|
|
1687
|
+
}): Promise<PlayRevisionSummary[]>;
|
|
1657
1688
|
/**
|
|
1658
1689
|
* Make a play revision live.
|
|
1659
1690
|
*
|