deepline 0.3.74 → 0.3.76

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 (34) hide show
  1. package/dist/bundling-sources/sdk/src/client.ts +279 -21
  2. package/dist/bundling-sources/sdk/src/config.ts +21 -3
  3. package/dist/bundling-sources/sdk/src/index.ts +1 -0
  4. package/dist/bundling-sources/sdk/src/play.ts +3 -6
  5. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  6. package/dist/bundling-sources/sdk/src/types.ts +3 -2
  7. package/dist/bundling-sources/shared_libs/monitors/deactivation-reasons.ts +186 -0
  8. package/dist/bundling-sources/shared_libs/monitors/monitor-fleet-limits.ts +41 -0
  9. package/dist/bundling-sources/shared_libs/play-runtime/async-operation.ts +213 -55
  10. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +172 -299
  11. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +10 -0
  12. package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +13 -32
  13. package/dist/bundling-sources/shared_libs/play-runtime/governor/governor.ts +5 -1
  14. package/dist/bundling-sources/shared_libs/play-runtime/resource-governor.ts +7 -2
  15. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +11 -2
  16. package/dist/bundling-sources/shared_libs/play-runtime/runtime-incident-drills.ts +1 -1
  17. package/dist/bundling-sources/shared_libs/play-runtime/suspension.ts +16 -0
  18. package/dist/bundling-sources/shared_libs/play-runtime/tool-call/native-batch.ts +1 -0
  19. package/dist/bundling-sources/shared_libs/play-runtime/tool-call/testkit.ts +5 -4
  20. package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +12 -2
  21. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +1 -1
  22. package/dist/bundling-sources/shared_libs/plays/deployment-status.ts +74 -0
  23. package/dist/cli/index.js +940 -181
  24. package/dist/cli/index.mjs +940 -181
  25. package/dist/{compiler-manifest-CMNgA_JQ.d.mts → compiler-manifest-Dbov16F7.d.mts} +1 -1
  26. package/dist/{compiler-manifest-CMNgA_JQ.d.ts → compiler-manifest-Dbov16F7.d.ts} +1 -1
  27. package/dist/index.d.mts +176 -23
  28. package/dist/index.d.ts +176 -23
  29. package/dist/index.js +109 -12
  30. package/dist/index.mjs +109 -12
  31. package/dist/install-integrity.json +4 -2
  32. package/dist/plays/bundle-play-file.d.mts +2 -2
  33. package/dist/plays/bundle-play-file.d.ts +2 -2
  34. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -744,7 +744,7 @@ var SDK_RELEASE = {
744
744
  // available at toolResponse.rawV2 while toolResponse.raw and all declared
745
745
  // getters keep their established compatibility behavior.
746
746
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
747
- version: "0.3.74",
747
+ version: "0.3.76",
748
748
  updateSummary: "Automatic CLI updates are now enabled by default. To opt out, run `deepline settings autoupdate off`; use `deepline settings autoupdate on` to re-enable updates or `deepline settings autoupdate pin <version>` to hold an exact release. This release also adds raw-v2 tool responses at toolResponse.rawV2 while preserving existing toolResponse.raw and declared getters.",
749
749
  packageCapabilities: {
750
750
  updatePreferences: 1
@@ -1157,7 +1157,7 @@ var RUNTIME_INCIDENT_DRILL_CATALOG = [
1157
1157
  valueMeaning: "occurrence"
1158
1158
  },
1159
1159
  expected: {
1160
- outcome: "The same logical run completes through receipt replay; recovery remains bounded if the provider outcome must be retried.",
1160
+ outcome: "The same logical run completes through terminal-cache replay; any provider retry is governed by its separate operation policy.",
1161
1161
  safetyFacts: ["same_logical_run", "bounded_provider_execution"]
1162
1162
  },
1163
1163
  verification: {
@@ -3887,6 +3887,10 @@ var TERMINAL_PLAY_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "ca
3887
3887
  var INCLUDE_TOOL_METADATA_HEADER = "x-deepline-include-tool-metadata";
3888
3888
  var EXECUTE_RESPONSE_CONTRACT_HEADER = "x-deepline-execute-response-contract";
3889
3889
  var EXECUTE_RESPONSE_INTENT_HEADER = "x-deepline-execute-response-intent";
3890
+ var MONITOR_NON_RETRYABLE_MUTATION_OPTIONS = {
3891
+ maxRetries: 0,
3892
+ exactUrlOnly: true
3893
+ };
3890
3894
  var RAW_V2_EXECUTE_RESPONSE_CONTRACT = RAW_V2_TOOL_RESPONSE_CONTRACT;
3891
3895
  var COMPILE_MANIFEST_RETRY_DELAYS_MS = [250, 1e3];
3892
3896
  var REGISTER_PLAY_ARTIFACTS_COMPILE_CONCURRENCY = 3;
@@ -4445,11 +4449,15 @@ var DeeplineClient = class {
4445
4449
  update: (key, patch) => this.updateMonitor(key, patch),
4446
4450
  delete: (key, options2) => this.deleteMonitor(key, options2),
4447
4451
  reactivate: (key, options2) => this.reactivateMonitor(key, options2),
4452
+ audit: (options2) => this.auditMonitors(options2),
4453
+ repair: (options2) => this.repairMonitors(options2),
4454
+ health: (options2) => this.readMonitorsHealth(options2),
4448
4455
  fleets: {
4449
4456
  sync: (definitionOrId, options2) => this.syncMonitorFleet(definitionOrId, options2),
4450
4457
  get: (fleetId, options2) => fleetId === void 0 ? this.listMonitorFleets() : this.getMonitorFleet(fleetId, options2),
4451
4458
  list: () => this.listMonitorFleets(),
4452
4459
  deactivate: (fleetId, options2) => this.deactivateMonitorFleet(fleetId, options2),
4460
+ reactivate: (fleetId, options2) => this.reactivateMonitorFleet(fleetId, options2),
4453
4461
  waitForConvergence: (fleetId, options2) => this.waitForMonitorFleetConvergence(fleetId, options2)
4454
4462
  }
4455
4463
  };
@@ -6035,13 +6043,23 @@ var DeeplineClient = class {
6035
6043
  if (options?.grep?.trim()) {
6036
6044
  params.set("grep", options.grep.trim());
6037
6045
  params.set("grep_mode", options.grepMode ?? "all");
6046
+ params.set("grep_paginated", "1");
6038
6047
  params.set("limit", "60");
6039
6048
  }
6040
- const suffix = params.toString() ? `?${params.toString()}` : "";
6041
- const response = await this.http.get(
6042
- `/api/v2/plays${suffix}`
6043
- );
6044
- return response.plays ?? [];
6049
+ const plays = [];
6050
+ let cursor = null;
6051
+ let hasMore = true;
6052
+ do {
6053
+ if (cursor) params.set("cursor", cursor);
6054
+ const suffix = params.toString() ? `?${params.toString()}` : "";
6055
+ const response = await this.http.get(
6056
+ `/api/v2/plays${suffix}`
6057
+ );
6058
+ plays.push(...response.plays ?? []);
6059
+ cursor = response.pagination?.cursor ?? response.cursor ?? null;
6060
+ hasMore = Boolean(response.pagination?.hasMore ?? response.hasMore);
6061
+ } while (Boolean(options?.grep?.trim()) && hasMore && cursor);
6062
+ return plays;
6045
6063
  }
6046
6064
  /** Set whether an org-owned Play sorts before unpinned Plays. */
6047
6065
  async setPlayPinned(playName, pinned) {
@@ -6618,6 +6636,44 @@ var DeeplineClient = class {
6618
6636
  ...typeof payload.reason === "string" && payload.reason.trim() ? { reason: payload.reason.trim() } : {}
6619
6637
  };
6620
6638
  }
6639
+ /**
6640
+ * One bounded audit pass. Prefer `client.monitors.audit(...)`.
6641
+ *
6642
+ * Never auto-retried: it is idempotent, but a retry that races the caller's
6643
+ * own next pass would spend a provider slot to learn nothing new.
6644
+ */
6645
+ async auditMonitors(options) {
6646
+ return this.http.request("/api/v2/monitors/audit", {
6647
+ method: "POST",
6648
+ body: {
6649
+ ...options?.fleetId ? { fleet_id: options.fleetId } : {},
6650
+ ...options?.cursor ? { cursor: options.cursor } : {}
6651
+ },
6652
+ maxRetries: 0
6653
+ });
6654
+ }
6655
+ /** One repair pass or plan. Prefer `client.monitors.repair(...)`. */
6656
+ async repairMonitors(options) {
6657
+ return this.http.request("/api/v2/monitors/repair", {
6658
+ method: "POST",
6659
+ body: {
6660
+ ...options?.fleetId ? { fleet_id: options.fleetId } : {},
6661
+ ...options?.dryRun === void 0 ? {} : { dry_run: options.dryRun }
6662
+ },
6663
+ maxRetries: 0
6664
+ });
6665
+ }
6666
+ /** Delivery and convergence health. Prefer `client.monitors.health(...)`. */
6667
+ async readMonitorsHealth(options) {
6668
+ const params = new URLSearchParams();
6669
+ if (options?.fleetId) params.set("fleet_id", options.fleetId);
6670
+ const query = params.toString();
6671
+ const suffix = query ? `?${query}` : "";
6672
+ return this.http.request(
6673
+ `/api/v2/monitors/health${suffix}`,
6674
+ { method: "GET" }
6675
+ );
6676
+ }
6621
6677
  /**
6622
6678
  * The deployable monitor tools catalog. Pass a tool id (positional or
6623
6679
  * `{ tool }`) to describe one tool's full payload/stream contract, or no tool
@@ -6695,7 +6751,6 @@ var DeeplineClient = class {
6695
6751
  if (options?.limit !== void 0)
6696
6752
  params.set("limit", String(options.limit));
6697
6753
  if (options?.cursor) params.set("cursor", options.cursor);
6698
- if (options?.compact) params.set("compact", "true");
6699
6754
  if (options?.includeConsumers) params.set("include_consumers", "true");
6700
6755
  const query = params.toString();
6701
6756
  const suffix = query ? `?${query}` : "";
@@ -6712,13 +6767,22 @@ var DeeplineClient = class {
6712
6767
  );
6713
6768
  }
6714
6769
  async testMonitorWebhook(key, payload, options) {
6770
+ if (options?.dispatch === true || options?.validationOnly === false) {
6771
+ throw new DeeplineError(
6772
+ "Monitor tests are validation-only and cannot dispatch events.",
6773
+ void 0,
6774
+ "MONITOR_TEST_DISPATCH_NOT_SUPPORTED"
6775
+ );
6776
+ }
6715
6777
  return this.http.request(
6716
6778
  `/api/v2/monitors/deployed/${encodeURIComponent(key)}/test`,
6717
6779
  {
6718
6780
  method: "POST",
6719
6781
  body: {
6720
6782
  payload,
6721
- ...options?.validationOnly ? { mode: "validation_only" } : options?.dispatch ? { mode: "dispatch" } : {}
6783
+ // Send the legacy safe mode as well as accepting it server-side: an
6784
+ // upgraded SDK must be safe when it reaches a still-running server.
6785
+ mode: "validation_only"
6722
6786
  }
6723
6787
  }
6724
6788
  );
@@ -6746,7 +6810,14 @@ var DeeplineClient = class {
6746
6810
  async updateMonitor(key, patch) {
6747
6811
  return this.http.request(
6748
6812
  `/api/v2/monitors/deployed/${encodeURIComponent(key)}`,
6749
- { method: "PATCH", body: patch }
6813
+ {
6814
+ method: "PATCH",
6815
+ body: patch,
6816
+ // A monitor write may have reached the control plane before a network
6817
+ // failure reaches the caller. Do not turn that unknown outcome into a
6818
+ // second mutation with a fresh snapshot.
6819
+ ...MONITOR_NON_RETRYABLE_MUTATION_OPTIONS
6820
+ }
6750
6821
  );
6751
6822
  }
6752
6823
  /** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. Prefer `client.monitors.delete(...)`. */
@@ -6763,7 +6834,12 @@ var DeeplineClient = class {
6763
6834
  const query = params.toString();
6764
6835
  return this.http.request(
6765
6836
  `/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ""}`,
6766
- { method: "DELETE" }
6837
+ options?.dryRun ? { method: "DELETE" } : {
6838
+ method: "DELETE",
6839
+ // Deletion is a provider lifecycle operation. A timeout is an
6840
+ // unknown outcome, not authority to begin another delete attempt.
6841
+ ...MONITOR_NON_RETRYABLE_MUTATION_OPTIONS
6842
+ }
6767
6843
  );
6768
6844
  }
6769
6845
  /**
@@ -6774,7 +6850,13 @@ var DeeplineClient = class {
6774
6850
  const query = options?.dryRun ? "?dry_run=true" : "";
6775
6851
  return this.http.request(
6776
6852
  `/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
6777
- { method: "POST", body: {} }
6853
+ options?.dryRun ? { method: "POST", body: {} } : {
6854
+ method: "POST",
6855
+ body: {},
6856
+ // Reactivation can create an upstream resource, so it must not use
6857
+ // the generic transport's automatic replay policy.
6858
+ ...MONITOR_NON_RETRYABLE_MUTATION_OPTIONS
6859
+ }
6778
6860
  );
6779
6861
  }
6780
6862
  // ——————————————————————————————————————————————————————————
@@ -6851,6 +6933,21 @@ var DeeplineClient = class {
6851
6933
  }
6852
6934
  );
6853
6935
  }
6936
+ async reactivateMonitorFleet(fleetId, options) {
6937
+ return this.http.request(
6938
+ `${this.monitorFleetPath(fleetId)}/reactivate`,
6939
+ {
6940
+ method: "POST",
6941
+ body: {},
6942
+ headers: this.monitorFleetHeaders(
6943
+ "reactivate",
6944
+ options?.idempotencyKey
6945
+ ),
6946
+ maxRetries: 0,
6947
+ exactUrlOnly: true
6948
+ }
6949
+ );
6950
+ }
6854
6951
  /**
6855
6952
  * Poll one fleet until the server reports a terminal status.
6856
6953
  *
@@ -25,6 +25,7 @@
25
25
  "dist/bundling-sources/sdk/src/version.ts",
26
26
  "dist/bundling-sources/shared_libs/integrations/bettercontact-execution-policy.ts",
27
27
  "dist/bundling-sources/shared_libs/integrations/theirstack-execution-policy.ts",
28
+ "dist/bundling-sources/shared_libs/monitors/deactivation-reasons.ts",
28
29
  "dist/bundling-sources/shared_libs/monitors/monitor-fleet-limits.ts",
29
30
  "dist/bundling-sources/shared_libs/monitors/org-monitor-limits.ts",
30
31
  "dist/bundling-sources/shared_libs/monitors/validation.ts",
@@ -229,6 +230,7 @@
229
230
  "dist/bundling-sources/shared_libs/plays/dataset-summary.ts",
230
231
  "dist/bundling-sources/shared_libs/plays/dataset.ts",
231
232
  "dist/bundling-sources/shared_libs/plays/definition.ts",
233
+ "dist/bundling-sources/shared_libs/plays/deployment-status.ts",
232
234
  "dist/bundling-sources/shared_libs/plays/docflow-binding-owner.ts",
233
235
  "dist/bundling-sources/shared_libs/plays/docflow-binding.ts",
234
236
  "dist/bundling-sources/shared_libs/plays/docflow.ts",
@@ -266,8 +268,8 @@
266
268
  "dist/cli/index.js",
267
269
  "dist/cli/index.mjs",
268
270
  "dist/cli/text-imports.d.ts",
269
- "dist/compiler-manifest-CMNgA_JQ.d.mts",
270
- "dist/compiler-manifest-CMNgA_JQ.d.ts",
271
+ "dist/compiler-manifest-Dbov16F7.d.mts",
272
+ "dist/compiler-manifest-Dbov16F7.d.ts",
271
273
  "dist/helpers.d.mts",
272
274
  "dist/helpers.d.ts",
273
275
  "dist/helpers.js",
@@ -1,6 +1,6 @@
1
1
  /// <reference path="./text-imports.d.ts" />
2
- import { P as PlayArtifactKind, a as PlayBundleArtifact, b as PlaySandboxRuntimeDeclaration, c as PlayCompilerManifest } from '../compiler-manifest-CMNgA_JQ.mjs';
3
- export { d as PLAY_ARTIFACT_KINDS, e as PlayArtifactCompatibility, f as PlayImportPolicy, g as PlayPackageImport, h as PlayRuntimeFeature } from '../compiler-manifest-CMNgA_JQ.mjs';
2
+ import { P as PlayArtifactKind, a as PlayBundleArtifact, b as PlaySandboxRuntimeDeclaration, c as PlayCompilerManifest } from '../compiler-manifest-Dbov16F7.mjs';
3
+ export { d as PLAY_ARTIFACT_KINDS, e as PlayArtifactCompatibility, f as PlayImportPolicy, g as PlayPackageImport, h as PlayRuntimeFeature } from '../compiler-manifest-Dbov16F7.mjs';
4
4
  import '@sinclair/typebox';
5
5
 
6
6
  type ImportedPlayDependency = {
@@ -1,6 +1,6 @@
1
1
  /// <reference path="./text-imports.d.ts" />
2
- import { P as PlayArtifactKind, a as PlayBundleArtifact, b as PlaySandboxRuntimeDeclaration, c as PlayCompilerManifest } from '../compiler-manifest-CMNgA_JQ.js';
3
- export { d as PLAY_ARTIFACT_KINDS, e as PlayArtifactCompatibility, f as PlayImportPolicy, g as PlayPackageImport, h as PlayRuntimeFeature } from '../compiler-manifest-CMNgA_JQ.js';
2
+ import { P as PlayArtifactKind, a as PlayBundleArtifact, b as PlaySandboxRuntimeDeclaration, c as PlayCompilerManifest } from '../compiler-manifest-Dbov16F7.js';
3
+ export { d as PLAY_ARTIFACT_KINDS, e as PlayArtifactCompatibility, f as PlayImportPolicy, g as PlayPackageImport, h as PlayRuntimeFeature } from '../compiler-manifest-Dbov16F7.js';
4
4
  import '@sinclair/typebox';
5
5
 
6
6
  type ImportedPlayDependency = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.3.74",
3
+ "version": "0.3.76",
4
4
  "description": "GTM data CLI and TypeScript SDK for coding agents",
5
5
  "license": "MIT",
6
6
  "homepage": "https://code.deepline.com",