deepline 0.3.273 → 0.3.275
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/client.ts +143 -14
- package/dist/bundling-sources/sdk/src/index.ts +4 -1
- package/dist/bundling-sources/sdk/src/play.ts +5 -11
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/runs/log-cursor.ts +35 -0
- package/dist/bundling-sources/sdk/src/types.ts +10 -3
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +12 -26
- package/dist/bundling-sources/shared_libs/observability/scheduled-work-manual.ts +7 -3
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +15 -7
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd.ts +18 -18
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +1 -0
- package/dist/bundling-sources/shared_libs/plays/docflow-binding-owner.ts +7 -4
- package/dist/bundling-sources/shared_libs/plays/table-csv.ts +152 -0
- package/dist/cli/index.js +418 -103
- package/dist/cli/index.mjs +418 -103
- package/dist/{client-5xpuGpRn.d.ts → client-5zY7LsId.d.ts} +72 -7
- package/dist/{client-D9annc6K.d.mts → client-CbNvJLgV.d.mts} +72 -7
- package/dist/index.d.mts +6 -12
- package/dist/index.d.ts +6 -12
- package/dist/index.js +90 -12
- package/dist/index.mjs +90 -12
- package/dist/install-integrity.json +4 -2
- package/dist/plays/run-request.d.mts +1 -1
- package/dist/plays/run-request.d.ts +1 -1
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +1 -1
- package/dist/release.mjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1325,7 +1325,7 @@ var SDK_RELEASE = {
|
|
|
1325
1325
|
// getters keep their established compatibility behavior.
|
|
1326
1326
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
1327
1327
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
1328
|
-
version: "0.3.
|
|
1328
|
+
version: "0.3.275",
|
|
1329
1329
|
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.",
|
|
1330
1330
|
packageCapabilities: {
|
|
1331
1331
|
updatePreferences: 1
|
|
@@ -3846,6 +3846,28 @@ async function* watchRunEvents(options) {
|
|
|
3846
3846
|
}
|
|
3847
3847
|
}
|
|
3848
3848
|
|
|
3849
|
+
// src/runs/log-cursor.ts
|
|
3850
|
+
var RUN_LOGS_CURSOR_PREFIX = "before:";
|
|
3851
|
+
function encodeRunLogsCursor(beforeSequence) {
|
|
3852
|
+
return `${RUN_LOGS_CURSOR_PREFIX}${beforeSequence}`;
|
|
3853
|
+
}
|
|
3854
|
+
function isRunLogsCursor(value) {
|
|
3855
|
+
return value.startsWith(RUN_LOGS_CURSOR_PREFIX);
|
|
3856
|
+
}
|
|
3857
|
+
function parseRunLogsCursor(value) {
|
|
3858
|
+
const raw = isRunLogsCursor(value) ? value.slice(RUN_LOGS_CURSOR_PREFIX.length) : "";
|
|
3859
|
+
const parsed = /^[1-9]\d*$/.test(raw) ? Number(raw) : NaN;
|
|
3860
|
+
if (!Number.isSafeInteger(parsed)) {
|
|
3861
|
+
throw Object.assign(
|
|
3862
|
+
new Error(
|
|
3863
|
+
`Invalid run log cursor ${JSON.stringify(value)}. Pass the nextCursor value from a previous deepline runs logs result.`
|
|
3864
|
+
),
|
|
3865
|
+
{ exitCode: 2 }
|
|
3866
|
+
);
|
|
3867
|
+
}
|
|
3868
|
+
return parsed;
|
|
3869
|
+
}
|
|
3870
|
+
|
|
3849
3871
|
// src/types.ts
|
|
3850
3872
|
function isStopAllPlayRunsDryRunResult(result) {
|
|
3851
3873
|
return "dryRun" in result && result.dryRun === true;
|
|
@@ -4665,6 +4687,7 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
4665
4687
|
status: (runId) => this.getRunLifecycleStatus(runId),
|
|
4666
4688
|
list: (options2) => this.listRuns(options2),
|
|
4667
4689
|
listPage: (options2) => this.listRunsPage(options2),
|
|
4690
|
+
history: (options2) => this.getRunsHistory(options2),
|
|
4668
4691
|
watch: (runId, options2) => this.watchRunToTerminal(runId, options2),
|
|
4669
4692
|
tail: (runId, options2) => this.tailRun(runId, options2),
|
|
4670
4693
|
logs: (runId, options2) => this.getRunLogs(runId, options2),
|
|
@@ -4795,7 +4818,7 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
4795
4818
|
}
|
|
4796
4819
|
playRunCommand(play) {
|
|
4797
4820
|
const target = play.reference || play.name;
|
|
4798
|
-
return `deepline plays run ${target}${playInputExampleArgs(play.inputSchema)}
|
|
4821
|
+
return `deepline plays run ${target}${playInputExampleArgs(play.inputSchema)}`;
|
|
4799
4822
|
}
|
|
4800
4823
|
starterPlayPath(play) {
|
|
4801
4824
|
const target = play.reference || play.name;
|
|
@@ -5356,7 +5379,7 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
5356
5379
|
* Convenience wrapper around {@link registerPlayArtifact} plus
|
|
5357
5380
|
* {@link startPlayRun}. This is the canonical file-backed path used by wrappers.
|
|
5358
5381
|
* The returned id can be passed to {@link getPlayStatus} to retrieve the same
|
|
5359
|
-
* durable `{ result }` object that the CLI prints after
|
|
5382
|
+
* durable `{ result }` object that the CLI prints after `plays run` completes.
|
|
5360
5383
|
*
|
|
5361
5384
|
* @param code - Source string fallback; the bundled artifact should be passed in `options.artifact`
|
|
5362
5385
|
* @param csvPath - Path to input CSV file, or `null`
|
|
@@ -5477,7 +5500,7 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
5477
5500
|
* Get the current status of a play execution.
|
|
5478
5501
|
*
|
|
5479
5502
|
* Internal/advanced primitive. Public callers should usually prefer
|
|
5480
|
-
* {@link runPlay}, {@link PlayJob.get}, or `deepline plays run
|
|
5503
|
+
* {@link runPlay}, {@link PlayJob.get}, or `deepline plays run`.
|
|
5481
5504
|
*
|
|
5482
5505
|
* @param workflowId - Play-run id from {@link startPlayRun}
|
|
5483
5506
|
* @returns Current status with progress logs and partial results
|
|
@@ -5742,11 +5765,21 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
5742
5765
|
if (options?.full === true) {
|
|
5743
5766
|
params.set("full", "true");
|
|
5744
5767
|
}
|
|
5768
|
+
if (options?.configuration === true) {
|
|
5769
|
+
params.set("include", "configuration");
|
|
5770
|
+
}
|
|
5745
5771
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
5746
5772
|
const response = await this.http.get(
|
|
5747
5773
|
`/api/v2/runs/${encodeURIComponent(runId)}${query}`,
|
|
5748
5774
|
{ headers: { "x-deepline-run-status": "1" } }
|
|
5749
5775
|
);
|
|
5776
|
+
if (options?.configuration === true && !Object.hasOwn(response, "contract")) {
|
|
5777
|
+
throw new DeeplineError(
|
|
5778
|
+
"This server does not support recorded configuration reads.",
|
|
5779
|
+
void 0,
|
|
5780
|
+
"RUN_CONFIGURATION_UNAVAILABLE"
|
|
5781
|
+
);
|
|
5782
|
+
}
|
|
5750
5783
|
const status = normalizePlayStatus(response);
|
|
5751
5784
|
if (options?.failedLogs !== true || status.status !== "failed") {
|
|
5752
5785
|
return status;
|
|
@@ -5834,6 +5867,33 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
5834
5867
|
async listRuns(options) {
|
|
5835
5868
|
return (await this.listRunsPage(options)).runs;
|
|
5836
5869
|
}
|
|
5870
|
+
/** The same tenant-scoped run history searched by the dashboard and CLI. */
|
|
5871
|
+
async getRunsHistory(options = {}) {
|
|
5872
|
+
const params = new URLSearchParams();
|
|
5873
|
+
const search = options.search?.trim();
|
|
5874
|
+
if (search && search.length > 200) {
|
|
5875
|
+
throw new Error("Run search must be at most 200 characters.");
|
|
5876
|
+
}
|
|
5877
|
+
if (options.type && options.type !== "all" && !search) {
|
|
5878
|
+
throw new Error("runs.history options.type requires options.search.");
|
|
5879
|
+
}
|
|
5880
|
+
if (search) params.set("search", search);
|
|
5881
|
+
if (search && options.type) params.set("type", options.type);
|
|
5882
|
+
if (options.cursor) params.set("cursor", options.cursor);
|
|
5883
|
+
if (options.orgId) params.set("orgId", options.orgId);
|
|
5884
|
+
if (options.limit !== void 0) {
|
|
5885
|
+
if (!Number.isSafeInteger(options.limit) || options.limit < 1) {
|
|
5886
|
+
throw new Error(
|
|
5887
|
+
"runs.history options.limit must be a positive integer."
|
|
5888
|
+
);
|
|
5889
|
+
}
|
|
5890
|
+
params.set("limit", String(options.limit));
|
|
5891
|
+
}
|
|
5892
|
+
return this.http.get(
|
|
5893
|
+
`/api/v2/dashboard/runs-history?${params.toString()}`,
|
|
5894
|
+
{ signal: options.signal }
|
|
5895
|
+
);
|
|
5896
|
+
}
|
|
5837
5897
|
/** Read one run page without discarding server pagination metadata. */
|
|
5838
5898
|
async listRunsPage(options) {
|
|
5839
5899
|
const playName = options.play?.trim();
|
|
@@ -5940,6 +6000,13 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
5940
6000
|
"INVALID_RUN_LOG_VIEW"
|
|
5941
6001
|
);
|
|
5942
6002
|
}
|
|
6003
|
+
if (options?.cursor !== void 0 && options.failed === true) {
|
|
6004
|
+
throw new DeeplineError(
|
|
6005
|
+
"runs.logs cannot combine failed with cursor.",
|
|
6006
|
+
void 0,
|
|
6007
|
+
"INVALID_RUN_LOG_VIEW"
|
|
6008
|
+
);
|
|
6009
|
+
}
|
|
5943
6010
|
if (options?.failed === true) {
|
|
5944
6011
|
const requestedLimit = typeof options.limit === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : RUNS_FAILED_LOG_LIMIT;
|
|
5945
6012
|
const failedLimit = Math.min(RUNS_FAILED_LOG_LIMIT, requestedLimit);
|
|
@@ -5965,6 +6032,7 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
5965
6032
|
...page.logsTruncated ? { logsTruncated: true } : {}
|
|
5966
6033
|
};
|
|
5967
6034
|
}
|
|
6035
|
+
const beforeSequence = options?.cursor !== void 0 ? parseRunLogsCursor(options.cursor) : null;
|
|
5968
6036
|
const limit = options?.all ? Number.MAX_SAFE_INTEGER : typeof options?.limit === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : 200;
|
|
5969
6037
|
const fetchPage = (afterSeq2, pageLimit) => this.http.get(
|
|
5970
6038
|
`/api/v2/runs/${encodeURIComponent(runId)}/logs?afterSeq=${afterSeq2}&limit=${pageLimit}`,
|
|
@@ -5972,24 +6040,33 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
5972
6040
|
);
|
|
5973
6041
|
const probe = await fetchPage(0, 1);
|
|
5974
6042
|
const lastStoredSeq = probe.lastStoredSeq;
|
|
5975
|
-
|
|
6043
|
+
const oldestStoredSeq = probe.entries[0]?.seq ?? null;
|
|
6044
|
+
const upperSeq = beforeSequence === null ? Number.POSITIVE_INFINITY : Math.min(beforeSequence - 1, lastStoredSeq);
|
|
6045
|
+
const windowEndSeq = Math.min(upperSeq, lastStoredSeq);
|
|
6046
|
+
let afterSeq = options?.all ? 0 : Math.max(0, windowEndSeq - limit);
|
|
5976
6047
|
const entries = [];
|
|
5977
|
-
while (entries.length < limit) {
|
|
6048
|
+
while (entries.length < limit && afterSeq < upperSeq) {
|
|
5978
6049
|
const page = await fetchPage(
|
|
5979
6050
|
afterSeq,
|
|
5980
|
-
Math.min(
|
|
6051
|
+
Math.min(
|
|
6052
|
+
RUN_LOGS_PAGE_LIMIT,
|
|
6053
|
+
limit - entries.length,
|
|
6054
|
+
upperSeq - afterSeq
|
|
6055
|
+
)
|
|
5981
6056
|
);
|
|
5982
|
-
|
|
6057
|
+
const inWindow = page.entries.filter((entry) => entry.seq <= upperSeq);
|
|
6058
|
+
if (inWindow.length === 0) {
|
|
5983
6059
|
break;
|
|
5984
6060
|
}
|
|
5985
|
-
entries.push(...
|
|
5986
|
-
afterSeq =
|
|
5987
|
-
if (!page.hasMore) {
|
|
6061
|
+
entries.push(...inWindow);
|
|
6062
|
+
afterSeq = inWindow[inWindow.length - 1].seq;
|
|
6063
|
+
if (!page.hasMore || inWindow.length < page.entries.length) {
|
|
5988
6064
|
break;
|
|
5989
6065
|
}
|
|
5990
6066
|
}
|
|
5991
6067
|
const firstSequence = entries.length > 0 ? entries[0].seq : null;
|
|
5992
6068
|
const lastSequence = entries.length > 0 ? entries[entries.length - 1].seq : null;
|
|
6069
|
+
const olderLinesExist = firstSequence !== null && oldestStoredSeq !== null && firstSequence > oldestStoredSeq;
|
|
5993
6070
|
return {
|
|
5994
6071
|
runId: probe.runId,
|
|
5995
6072
|
totalCount: probe.totalLogCount,
|
|
@@ -5997,7 +6074,8 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
5997
6074
|
firstSequence,
|
|
5998
6075
|
lastSequence,
|
|
5999
6076
|
truncated: entries.length < probe.totalLogCount,
|
|
6000
|
-
hasMore:
|
|
6077
|
+
hasMore: olderLinesExist,
|
|
6078
|
+
nextCursor: olderLinesExist ? encodeRunLogsCursor(firstSequence) : null,
|
|
6001
6079
|
entries: entries.map((entry) => entry.line),
|
|
6002
6080
|
view: options?.all ? "all" : "tail",
|
|
6003
6081
|
...probe.logsTruncated ? { logsTruncated: true } : {}
|
package/dist/index.mjs
CHANGED
|
@@ -1229,7 +1229,7 @@ var SDK_RELEASE = {
|
|
|
1229
1229
|
// getters keep their established compatibility behavior.
|
|
1230
1230
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
1231
1231
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
1232
|
-
version: "0.3.
|
|
1232
|
+
version: "0.3.275",
|
|
1233
1233
|
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.",
|
|
1234
1234
|
packageCapabilities: {
|
|
1235
1235
|
updatePreferences: 1
|
|
@@ -3750,6 +3750,28 @@ async function* watchRunEvents(options) {
|
|
|
3750
3750
|
}
|
|
3751
3751
|
}
|
|
3752
3752
|
|
|
3753
|
+
// src/runs/log-cursor.ts
|
|
3754
|
+
var RUN_LOGS_CURSOR_PREFIX = "before:";
|
|
3755
|
+
function encodeRunLogsCursor(beforeSequence) {
|
|
3756
|
+
return `${RUN_LOGS_CURSOR_PREFIX}${beforeSequence}`;
|
|
3757
|
+
}
|
|
3758
|
+
function isRunLogsCursor(value) {
|
|
3759
|
+
return value.startsWith(RUN_LOGS_CURSOR_PREFIX);
|
|
3760
|
+
}
|
|
3761
|
+
function parseRunLogsCursor(value) {
|
|
3762
|
+
const raw = isRunLogsCursor(value) ? value.slice(RUN_LOGS_CURSOR_PREFIX.length) : "";
|
|
3763
|
+
const parsed = /^[1-9]\d*$/.test(raw) ? Number(raw) : NaN;
|
|
3764
|
+
if (!Number.isSafeInteger(parsed)) {
|
|
3765
|
+
throw Object.assign(
|
|
3766
|
+
new Error(
|
|
3767
|
+
`Invalid run log cursor ${JSON.stringify(value)}. Pass the nextCursor value from a previous deepline runs logs result.`
|
|
3768
|
+
),
|
|
3769
|
+
{ exitCode: 2 }
|
|
3770
|
+
);
|
|
3771
|
+
}
|
|
3772
|
+
return parsed;
|
|
3773
|
+
}
|
|
3774
|
+
|
|
3753
3775
|
// src/types.ts
|
|
3754
3776
|
function isStopAllPlayRunsDryRunResult(result) {
|
|
3755
3777
|
return "dryRun" in result && result.dryRun === true;
|
|
@@ -4569,6 +4591,7 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
4569
4591
|
status: (runId) => this.getRunLifecycleStatus(runId),
|
|
4570
4592
|
list: (options2) => this.listRuns(options2),
|
|
4571
4593
|
listPage: (options2) => this.listRunsPage(options2),
|
|
4594
|
+
history: (options2) => this.getRunsHistory(options2),
|
|
4572
4595
|
watch: (runId, options2) => this.watchRunToTerminal(runId, options2),
|
|
4573
4596
|
tail: (runId, options2) => this.tailRun(runId, options2),
|
|
4574
4597
|
logs: (runId, options2) => this.getRunLogs(runId, options2),
|
|
@@ -4699,7 +4722,7 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
4699
4722
|
}
|
|
4700
4723
|
playRunCommand(play) {
|
|
4701
4724
|
const target = play.reference || play.name;
|
|
4702
|
-
return `deepline plays run ${target}${playInputExampleArgs(play.inputSchema)}
|
|
4725
|
+
return `deepline plays run ${target}${playInputExampleArgs(play.inputSchema)}`;
|
|
4703
4726
|
}
|
|
4704
4727
|
starterPlayPath(play) {
|
|
4705
4728
|
const target = play.reference || play.name;
|
|
@@ -5260,7 +5283,7 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
5260
5283
|
* Convenience wrapper around {@link registerPlayArtifact} plus
|
|
5261
5284
|
* {@link startPlayRun}. This is the canonical file-backed path used by wrappers.
|
|
5262
5285
|
* The returned id can be passed to {@link getPlayStatus} to retrieve the same
|
|
5263
|
-
* durable `{ result }` object that the CLI prints after
|
|
5286
|
+
* durable `{ result }` object that the CLI prints after `plays run` completes.
|
|
5264
5287
|
*
|
|
5265
5288
|
* @param code - Source string fallback; the bundled artifact should be passed in `options.artifact`
|
|
5266
5289
|
* @param csvPath - Path to input CSV file, or `null`
|
|
@@ -5381,7 +5404,7 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
5381
5404
|
* Get the current status of a play execution.
|
|
5382
5405
|
*
|
|
5383
5406
|
* Internal/advanced primitive. Public callers should usually prefer
|
|
5384
|
-
* {@link runPlay}, {@link PlayJob.get}, or `deepline plays run
|
|
5407
|
+
* {@link runPlay}, {@link PlayJob.get}, or `deepline plays run`.
|
|
5385
5408
|
*
|
|
5386
5409
|
* @param workflowId - Play-run id from {@link startPlayRun}
|
|
5387
5410
|
* @returns Current status with progress logs and partial results
|
|
@@ -5646,11 +5669,21 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
5646
5669
|
if (options?.full === true) {
|
|
5647
5670
|
params.set("full", "true");
|
|
5648
5671
|
}
|
|
5672
|
+
if (options?.configuration === true) {
|
|
5673
|
+
params.set("include", "configuration");
|
|
5674
|
+
}
|
|
5649
5675
|
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
5650
5676
|
const response = await this.http.get(
|
|
5651
5677
|
`/api/v2/runs/${encodeURIComponent(runId)}${query}`,
|
|
5652
5678
|
{ headers: { "x-deepline-run-status": "1" } }
|
|
5653
5679
|
);
|
|
5680
|
+
if (options?.configuration === true && !Object.hasOwn(response, "contract")) {
|
|
5681
|
+
throw new DeeplineError(
|
|
5682
|
+
"This server does not support recorded configuration reads.",
|
|
5683
|
+
void 0,
|
|
5684
|
+
"RUN_CONFIGURATION_UNAVAILABLE"
|
|
5685
|
+
);
|
|
5686
|
+
}
|
|
5654
5687
|
const status = normalizePlayStatus(response);
|
|
5655
5688
|
if (options?.failedLogs !== true || status.status !== "failed") {
|
|
5656
5689
|
return status;
|
|
@@ -5738,6 +5771,33 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
5738
5771
|
async listRuns(options) {
|
|
5739
5772
|
return (await this.listRunsPage(options)).runs;
|
|
5740
5773
|
}
|
|
5774
|
+
/** The same tenant-scoped run history searched by the dashboard and CLI. */
|
|
5775
|
+
async getRunsHistory(options = {}) {
|
|
5776
|
+
const params = new URLSearchParams();
|
|
5777
|
+
const search = options.search?.trim();
|
|
5778
|
+
if (search && search.length > 200) {
|
|
5779
|
+
throw new Error("Run search must be at most 200 characters.");
|
|
5780
|
+
}
|
|
5781
|
+
if (options.type && options.type !== "all" && !search) {
|
|
5782
|
+
throw new Error("runs.history options.type requires options.search.");
|
|
5783
|
+
}
|
|
5784
|
+
if (search) params.set("search", search);
|
|
5785
|
+
if (search && options.type) params.set("type", options.type);
|
|
5786
|
+
if (options.cursor) params.set("cursor", options.cursor);
|
|
5787
|
+
if (options.orgId) params.set("orgId", options.orgId);
|
|
5788
|
+
if (options.limit !== void 0) {
|
|
5789
|
+
if (!Number.isSafeInteger(options.limit) || options.limit < 1) {
|
|
5790
|
+
throw new Error(
|
|
5791
|
+
"runs.history options.limit must be a positive integer."
|
|
5792
|
+
);
|
|
5793
|
+
}
|
|
5794
|
+
params.set("limit", String(options.limit));
|
|
5795
|
+
}
|
|
5796
|
+
return this.http.get(
|
|
5797
|
+
`/api/v2/dashboard/runs-history?${params.toString()}`,
|
|
5798
|
+
{ signal: options.signal }
|
|
5799
|
+
);
|
|
5800
|
+
}
|
|
5741
5801
|
/** Read one run page without discarding server pagination metadata. */
|
|
5742
5802
|
async listRunsPage(options) {
|
|
5743
5803
|
const playName = options.play?.trim();
|
|
@@ -5844,6 +5904,13 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
5844
5904
|
"INVALID_RUN_LOG_VIEW"
|
|
5845
5905
|
);
|
|
5846
5906
|
}
|
|
5907
|
+
if (options?.cursor !== void 0 && options.failed === true) {
|
|
5908
|
+
throw new DeeplineError(
|
|
5909
|
+
"runs.logs cannot combine failed with cursor.",
|
|
5910
|
+
void 0,
|
|
5911
|
+
"INVALID_RUN_LOG_VIEW"
|
|
5912
|
+
);
|
|
5913
|
+
}
|
|
5847
5914
|
if (options?.failed === true) {
|
|
5848
5915
|
const requestedLimit = typeof options.limit === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : RUNS_FAILED_LOG_LIMIT;
|
|
5849
5916
|
const failedLimit = Math.min(RUNS_FAILED_LOG_LIMIT, requestedLimit);
|
|
@@ -5869,6 +5936,7 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
5869
5936
|
...page.logsTruncated ? { logsTruncated: true } : {}
|
|
5870
5937
|
};
|
|
5871
5938
|
}
|
|
5939
|
+
const beforeSequence = options?.cursor !== void 0 ? parseRunLogsCursor(options.cursor) : null;
|
|
5872
5940
|
const limit = options?.all ? Number.MAX_SAFE_INTEGER : typeof options?.limit === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : 200;
|
|
5873
5941
|
const fetchPage = (afterSeq2, pageLimit) => this.http.get(
|
|
5874
5942
|
`/api/v2/runs/${encodeURIComponent(runId)}/logs?afterSeq=${afterSeq2}&limit=${pageLimit}`,
|
|
@@ -5876,24 +5944,33 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
5876
5944
|
);
|
|
5877
5945
|
const probe = await fetchPage(0, 1);
|
|
5878
5946
|
const lastStoredSeq = probe.lastStoredSeq;
|
|
5879
|
-
|
|
5947
|
+
const oldestStoredSeq = probe.entries[0]?.seq ?? null;
|
|
5948
|
+
const upperSeq = beforeSequence === null ? Number.POSITIVE_INFINITY : Math.min(beforeSequence - 1, lastStoredSeq);
|
|
5949
|
+
const windowEndSeq = Math.min(upperSeq, lastStoredSeq);
|
|
5950
|
+
let afterSeq = options?.all ? 0 : Math.max(0, windowEndSeq - limit);
|
|
5880
5951
|
const entries = [];
|
|
5881
|
-
while (entries.length < limit) {
|
|
5952
|
+
while (entries.length < limit && afterSeq < upperSeq) {
|
|
5882
5953
|
const page = await fetchPage(
|
|
5883
5954
|
afterSeq,
|
|
5884
|
-
Math.min(
|
|
5955
|
+
Math.min(
|
|
5956
|
+
RUN_LOGS_PAGE_LIMIT,
|
|
5957
|
+
limit - entries.length,
|
|
5958
|
+
upperSeq - afterSeq
|
|
5959
|
+
)
|
|
5885
5960
|
);
|
|
5886
|
-
|
|
5961
|
+
const inWindow = page.entries.filter((entry) => entry.seq <= upperSeq);
|
|
5962
|
+
if (inWindow.length === 0) {
|
|
5887
5963
|
break;
|
|
5888
5964
|
}
|
|
5889
|
-
entries.push(...
|
|
5890
|
-
afterSeq =
|
|
5891
|
-
if (!page.hasMore) {
|
|
5965
|
+
entries.push(...inWindow);
|
|
5966
|
+
afterSeq = inWindow[inWindow.length - 1].seq;
|
|
5967
|
+
if (!page.hasMore || inWindow.length < page.entries.length) {
|
|
5892
5968
|
break;
|
|
5893
5969
|
}
|
|
5894
5970
|
}
|
|
5895
5971
|
const firstSequence = entries.length > 0 ? entries[0].seq : null;
|
|
5896
5972
|
const lastSequence = entries.length > 0 ? entries[entries.length - 1].seq : null;
|
|
5973
|
+
const olderLinesExist = firstSequence !== null && oldestStoredSeq !== null && firstSequence > oldestStoredSeq;
|
|
5897
5974
|
return {
|
|
5898
5975
|
runId: probe.runId,
|
|
5899
5976
|
totalCount: probe.totalLogCount,
|
|
@@ -5901,7 +5978,8 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
5901
5978
|
firstSequence,
|
|
5902
5979
|
lastSequence,
|
|
5903
5980
|
truncated: entries.length < probe.totalLogCount,
|
|
5904
|
-
hasMore:
|
|
5981
|
+
hasMore: olderLinesExist,
|
|
5982
|
+
nextCursor: olderLinesExist ? encodeRunLogsCursor(firstSequence) : null,
|
|
5905
5983
|
entries: entries.map((entry) => entry.line),
|
|
5906
5984
|
view: options?.all ? "all" : "tail",
|
|
5907
5985
|
...probe.logsTruncated ? { logsTruncated: true } : {}
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"dist/bundling-sources/sdk/src/plays/local-file-discovery.ts",
|
|
25
25
|
"dist/bundling-sources/sdk/src/plays/run-request.ts",
|
|
26
26
|
"dist/bundling-sources/sdk/src/release.ts",
|
|
27
|
+
"dist/bundling-sources/sdk/src/runs/log-cursor.ts",
|
|
27
28
|
"dist/bundling-sources/sdk/src/runs/observe-transport.ts",
|
|
28
29
|
"dist/bundling-sources/sdk/src/runs/overview.ts",
|
|
29
30
|
"dist/bundling-sources/sdk/src/runs/read-errors.ts",
|
|
@@ -545,6 +546,7 @@
|
|
|
545
546
|
"dist/bundling-sources/shared_libs/plays/static-pipeline-storage-codec.ts",
|
|
546
547
|
"dist/bundling-sources/shared_libs/plays/static-pipeline.ts",
|
|
547
548
|
"dist/bundling-sources/shared_libs/plays/status-result.ts",
|
|
549
|
+
"dist/bundling-sources/shared_libs/plays/table-csv.ts",
|
|
548
550
|
"dist/bundling-sources/shared_libs/plays/tool-category-descriptions.ts",
|
|
549
551
|
"dist/bundling-sources/shared_libs/plays/tool-codegen.ts",
|
|
550
552
|
"dist/bundling-sources/shared_libs/plays/tool-execution-error.ts",
|
|
@@ -593,8 +595,8 @@
|
|
|
593
595
|
"dist/cli/index.js",
|
|
594
596
|
"dist/cli/index.mjs",
|
|
595
597
|
"dist/cli/text-imports.d.ts",
|
|
596
|
-
"dist/client-
|
|
597
|
-
"dist/client-
|
|
598
|
+
"dist/client-5zY7LsId.d.ts",
|
|
599
|
+
"dist/client-CbNvJLgV.d.mts",
|
|
598
600
|
"dist/compiler-manifest-C1bKB9bY.d.mts",
|
|
599
601
|
"dist/compiler-manifest-C1bKB9bY.d.ts",
|
|
600
602
|
"dist/helpers.d.mts",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference path="./text-imports.d.ts" />
|
|
2
2
|
export { S as DeeplineError } from '../compiler-manifest-C1bKB9bY.mjs';
|
|
3
|
-
export {
|
|
3
|
+
export { bE as CSV_DATA_INPUT_KEY, bF as FileInputBinding, bG as LocalFileInput, bH as MintStagedFileUpload, bI as PLAY_FILES_STAGE_MINT_PATH, bJ as PLAY_FILES_STAGE_PATH, bK as PLAY_RUN_START_PATH, bL as PLAY_RUN_START_STREAM_PATH, bM as PlayRunHttp, bN as ResolvedStartPlayRunRequest, bO as STAGE_LEGACY_MULTIPART_MAX_BYTES, bP as StagedFileCodec, bQ as StagedFileInputs, bR as StagedFileUpload, bS as buildNamedPlayRunRequest, bT as buildPlayRunStartBody, bU as createSessionPlayRunHttp, bV as createStagedFileUpload, bW as fileInputBindingsFromPlaySchema, bX as fileInputBindingsFromStaticPipeline, bY as getDottedInputValue, bZ as isPlayRunPackage, b_ as mintStagedPlayFileUploads, b$ as normalizePlayRunStart, c0 as playRunFileInputBindings, c1 as setDottedInputValue, c2 as stageFileInputs, c3 as stagePlayFiles, c4 as stagedFileContentType, c5 as startPlayRun, c6 as webStagedFileCodec } from '../client-CbNvJLgV.mjs';
|
|
4
4
|
import '@sinclair/typebox';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import '../monitor-fleet-contract.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference path="./text-imports.d.ts" />
|
|
2
2
|
export { S as DeeplineError } from '../compiler-manifest-C1bKB9bY.js';
|
|
3
|
-
export {
|
|
3
|
+
export { bE as CSV_DATA_INPUT_KEY, bF as FileInputBinding, bG as LocalFileInput, bH as MintStagedFileUpload, bI as PLAY_FILES_STAGE_MINT_PATH, bJ as PLAY_FILES_STAGE_PATH, bK as PLAY_RUN_START_PATH, bL as PLAY_RUN_START_STREAM_PATH, bM as PlayRunHttp, bN as ResolvedStartPlayRunRequest, bO as STAGE_LEGACY_MULTIPART_MAX_BYTES, bP as StagedFileCodec, bQ as StagedFileInputs, bR as StagedFileUpload, bS as buildNamedPlayRunRequest, bT as buildPlayRunStartBody, bU as createSessionPlayRunHttp, bV as createStagedFileUpload, bW as fileInputBindingsFromPlaySchema, bX as fileInputBindingsFromStaticPipeline, bY as getDottedInputValue, bZ as isPlayRunPackage, b_ as mintStagedPlayFileUploads, b$ as normalizePlayRunStart, c0 as playRunFileInputBindings, c1 as setDottedInputValue, c2 as stageFileInputs, c3 as stagePlayFiles, c4 as stagedFileContentType, c5 as startPlayRun, c6 as webStagedFileCodec } from '../client-5zY7LsId.js';
|
|
4
4
|
import '@sinclair/typebox';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import '../monitor-fleet-contract.js';
|
package/dist/release.d.mts
CHANGED
|
@@ -149,7 +149,7 @@ type SdkRelease = {
|
|
|
149
149
|
supportPolicy: SdkSupportPolicy;
|
|
150
150
|
};
|
|
151
151
|
declare const SDK_RELEASE: {
|
|
152
|
-
readonly version: "0.3.
|
|
152
|
+
readonly version: "0.3.275";
|
|
153
153
|
readonly updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.";
|
|
154
154
|
readonly packageCapabilities: {
|
|
155
155
|
readonly updatePreferences: 1;
|
package/dist/release.d.ts
CHANGED
|
@@ -149,7 +149,7 @@ type SdkRelease = {
|
|
|
149
149
|
supportPolicy: SdkSupportPolicy;
|
|
150
150
|
};
|
|
151
151
|
declare const SDK_RELEASE: {
|
|
152
|
-
readonly version: "0.3.
|
|
152
|
+
readonly version: "0.3.275";
|
|
153
153
|
readonly updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.";
|
|
154
154
|
readonly packageCapabilities: {
|
|
155
155
|
readonly updatePreferences: 1;
|
package/dist/release.js
CHANGED
|
@@ -74,7 +74,7 @@ var SDK_RELEASE = {
|
|
|
74
74
|
// getters keep their established compatibility behavior.
|
|
75
75
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
76
76
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
77
|
-
version: "0.3.
|
|
77
|
+
version: "0.3.275",
|
|
78
78
|
updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
|
|
79
79
|
packageCapabilities: {
|
|
80
80
|
updatePreferences: 1
|
package/dist/release.mjs
CHANGED
|
@@ -48,7 +48,7 @@ var SDK_RELEASE = {
|
|
|
48
48
|
// getters keep their established compatibility behavior.
|
|
49
49
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
50
50
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
51
|
-
version: "0.3.
|
|
51
|
+
version: "0.3.275",
|
|
52
52
|
updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
|
|
53
53
|
packageCapabilities: {
|
|
54
54
|
updatePreferences: 1
|