deepline 0.3.274 → 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.
Files changed (29) hide show
  1. package/dist/bundling-sources/sdk/src/client.ts +140 -11
  2. package/dist/bundling-sources/sdk/src/index.ts +3 -0
  3. package/dist/bundling-sources/sdk/src/play.ts +4 -10
  4. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  5. package/dist/bundling-sources/sdk/src/runs/log-cursor.ts +35 -0
  6. package/dist/bundling-sources/sdk/src/types.ts +10 -3
  7. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +12 -26
  8. package/dist/bundling-sources/shared_libs/observability/scheduled-work-manual.ts +7 -3
  9. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +15 -7
  10. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd.ts +18 -18
  11. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +1 -0
  12. package/dist/bundling-sources/shared_libs/plays/docflow-binding-owner.ts +7 -4
  13. package/dist/bundling-sources/shared_libs/plays/table-csv.ts +152 -0
  14. package/dist/cli/index.js +326 -59
  15. package/dist/cli/index.mjs +326 -59
  16. package/dist/{client-D6fRwhnE.d.ts → client-5zY7LsId.d.ts} +70 -5
  17. package/dist/{client-2rIHKJiq.d.mts → client-CbNvJLgV.d.mts} +70 -5
  18. package/dist/index.d.mts +6 -12
  19. package/dist/index.d.ts +6 -12
  20. package/dist/index.js +87 -9
  21. package/dist/index.mjs +87 -9
  22. package/dist/install-integrity.json +4 -2
  23. package/dist/plays/run-request.d.mts +1 -1
  24. package/dist/plays/run-request.d.ts +1 -1
  25. package/dist/release.d.mts +1 -1
  26. package/dist/release.d.ts +1 -1
  27. package/dist/release.js +1 -1
  28. package/dist/release.mjs +1 -1
  29. package/package.json +1 -1
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.274",
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),
@@ -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
- let afterSeq = options?.all ? 0 : Math.max(0, lastStoredSeq - limit);
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(RUN_LOGS_PAGE_LIMIT, limit - entries.length)
5955
+ Math.min(
5956
+ RUN_LOGS_PAGE_LIMIT,
5957
+ limit - entries.length,
5958
+ upperSeq - afterSeq
5959
+ )
5885
5960
  );
5886
- if (page.entries.length === 0) {
5961
+ const inWindow = page.entries.filter((entry) => entry.seq <= upperSeq);
5962
+ if (inWindow.length === 0) {
5887
5963
  break;
5888
5964
  }
5889
- entries.push(...page.entries);
5890
- afterSeq = page.entries[page.entries.length - 1].seq;
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: lastSequence !== null && lastSequence < lastStoredSeq,
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-2rIHKJiq.d.mts",
597
- "dist/client-D6fRwhnE.d.ts",
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 { bB as CSV_DATA_INPUT_KEY, bC as FileInputBinding, bD as LocalFileInput, bE as MintStagedFileUpload, bF as PLAY_FILES_STAGE_MINT_PATH, bG as PLAY_FILES_STAGE_PATH, bH as PLAY_RUN_START_PATH, bI as PLAY_RUN_START_STREAM_PATH, bJ as PlayRunHttp, bK as ResolvedStartPlayRunRequest, bL as STAGE_LEGACY_MULTIPART_MAX_BYTES, bM as StagedFileCodec, bN as StagedFileInputs, bO as StagedFileUpload, bP as buildNamedPlayRunRequest, bQ as buildPlayRunStartBody, bR as createSessionPlayRunHttp, bS as createStagedFileUpload, bT as fileInputBindingsFromPlaySchema, bU as fileInputBindingsFromStaticPipeline, bV as getDottedInputValue, bW as isPlayRunPackage, bX as mintStagedPlayFileUploads, bY as normalizePlayRunStart, bZ as playRunFileInputBindings, b_ as setDottedInputValue, b$ as stageFileInputs, c0 as stagePlayFiles, c1 as stagedFileContentType, c2 as startPlayRun, c3 as webStagedFileCodec } from '../client-2rIHKJiq.mjs';
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 { bB as CSV_DATA_INPUT_KEY, bC as FileInputBinding, bD as LocalFileInput, bE as MintStagedFileUpload, bF as PLAY_FILES_STAGE_MINT_PATH, bG as PLAY_FILES_STAGE_PATH, bH as PLAY_RUN_START_PATH, bI as PLAY_RUN_START_STREAM_PATH, bJ as PlayRunHttp, bK as ResolvedStartPlayRunRequest, bL as STAGE_LEGACY_MULTIPART_MAX_BYTES, bM as StagedFileCodec, bN as StagedFileInputs, bO as StagedFileUpload, bP as buildNamedPlayRunRequest, bQ as buildPlayRunStartBody, bR as createSessionPlayRunHttp, bS as createStagedFileUpload, bT as fileInputBindingsFromPlaySchema, bU as fileInputBindingsFromStaticPipeline, bV as getDottedInputValue, bW as isPlayRunPackage, bX as mintStagedPlayFileUploads, bY as normalizePlayRunStart, bZ as playRunFileInputBindings, b_ as setDottedInputValue, b$ as stageFileInputs, c0 as stagePlayFiles, c1 as stagedFileContentType, c2 as startPlayRun, c3 as webStagedFileCodec } from '../client-D6fRwhnE.js';
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';
@@ -149,7 +149,7 @@ type SdkRelease = {
149
149
  supportPolicy: SdkSupportPolicy;
150
150
  };
151
151
  declare const SDK_RELEASE: {
152
- readonly version: "0.3.274";
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.274";
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.274",
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.274",
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.3.274",
3
+ "version": "0.3.275",
4
4
  "description": "GTM data CLI and TypeScript SDK for coding agents",
5
5
  "license": "MIT",
6
6
  "homepage": "https://code.deepline.com",