deepline 0.3.73 → 0.3.75

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 (37) 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/monitor-fleet-contract.ts +1 -1
  5. package/dist/bundling-sources/sdk/src/play.ts +3 -6
  6. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  7. package/dist/bundling-sources/sdk/src/types.ts +3 -2
  8. package/dist/bundling-sources/shared_libs/monitors/deactivation-reasons.ts +186 -0
  9. package/dist/bundling-sources/shared_libs/monitors/monitor-fleet-limits.ts +46 -3
  10. package/dist/bundling-sources/shared_libs/play-runtime/async-operation.ts +213 -55
  11. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +243 -356
  12. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +18 -0
  13. package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +13 -32
  14. package/dist/bundling-sources/shared_libs/play-runtime/governor/governor.ts +5 -1
  15. package/dist/bundling-sources/shared_libs/play-runtime/play-artifact-runtime-contract.ts +62 -0
  16. package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-semantics.ts +122 -0
  17. package/dist/bundling-sources/shared_libs/play-runtime/resource-governor.ts +7 -2
  18. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +11 -2
  19. package/dist/bundling-sources/shared_libs/play-runtime/runtime-incident-drills.ts +1 -1
  20. package/dist/bundling-sources/shared_libs/play-runtime/suspension.ts +16 -0
  21. package/dist/bundling-sources/shared_libs/play-runtime/tool-call/native-batch.ts +1 -0
  22. package/dist/bundling-sources/shared_libs/play-runtime/tool-call/testkit.ts +5 -4
  23. package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +12 -2
  24. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +1 -1
  25. package/dist/bundling-sources/shared_libs/plays/deployment-status.ts +74 -0
  26. package/dist/cli/index.js +919 -168
  27. package/dist/cli/index.mjs +919 -168
  28. package/dist/{compiler-manifest-CMNgA_JQ.d.mts → compiler-manifest-Dbov16F7.d.mts} +1 -1
  29. package/dist/{compiler-manifest-CMNgA_JQ.d.ts → compiler-manifest-Dbov16F7.d.ts} +1 -1
  30. package/dist/index.d.mts +177 -24
  31. package/dist/index.d.ts +177 -24
  32. package/dist/index.js +110 -13
  33. package/dist/index.mjs +110 -13
  34. package/dist/install-integrity.json +6 -2
  35. package/dist/plays/bundle-play-file.d.mts +2 -2
  36. package/dist/plays/bundle-play-file.d.ts +2 -2
  37. package/package.json +1 -1
@@ -128,6 +128,10 @@ const TERMINAL_PLAY_STATUSES = new Set(['completed', 'failed', 'cancelled']);
128
128
  const INCLUDE_TOOL_METADATA_HEADER = 'x-deepline-include-tool-metadata';
129
129
  const EXECUTE_RESPONSE_CONTRACT_HEADER = 'x-deepline-execute-response-contract';
130
130
  const EXECUTE_RESPONSE_INTENT_HEADER = 'x-deepline-execute-response-intent';
131
+ const MONITOR_NON_RETRYABLE_MUTATION_OPTIONS = {
132
+ maxRetries: 0,
133
+ exactUrlOnly: true,
134
+ };
131
135
  const RAW_V2_EXECUTE_RESPONSE_CONTRACT = RAW_V2_TOOL_RESPONSE_CONTRACT;
132
136
  const COMPILE_MANIFEST_RETRY_DELAYS_MS = [250, 1_000];
133
137
  const REGISTER_PLAY_ARTIFACTS_COMPILE_CONCURRENCY = 3;
@@ -771,6 +775,8 @@ export type MonitorsListResult = {
771
775
  monitors?: MonitorListEntry[];
772
776
  total?: number;
773
777
  returned?: number;
778
+ has_more?: boolean;
779
+ /** @deprecated Use has_more. */
774
780
  is_truncated?: boolean;
775
781
  next_cursor?: string | null;
776
782
  status_filter_applied?: string;
@@ -786,6 +792,7 @@ export type MonitorsListOptions = {
786
792
  limit?: number | string;
787
793
  /** Page past a truncated result using a prior response's `next_cursor`. */
788
794
  cursor?: string;
795
+ /** @deprecated Accepted as a no-op for compatibility. */
789
796
  compact?: boolean;
790
797
  /** Include bounded current SQL-listener delivery/run health (requires limit <= 20). */
791
798
  includeConsumers?: boolean;
@@ -849,6 +856,15 @@ export type MonitorUpdateResult = {
849
856
  export type MonitorDeleteResult = Record<string, unknown>;
850
857
  export type MonitorReactivateResult = Record<string, unknown>;
851
858
  export type MonitorTestResult = Record<string, unknown>;
859
+
860
+ /**
861
+ * @deprecated Monitor tests are always validation-only. `dispatch` and
862
+ * `validationOnly: false` are rejected before a request is made.
863
+ */
864
+ export type MonitorTestOptions = {
865
+ validationOnly?: boolean;
866
+ dispatch?: boolean;
867
+ };
852
868
  export type MonitorValidateResult = Record<string, unknown>;
853
869
 
854
870
  /**
@@ -867,7 +883,10 @@ export type MonitorFleetStatus =
867
883
  | 'converged'
868
884
  | 'degraded'
869
885
  | 'deactivating'
870
- | 'deactivated';
886
+ | 'deactivated'
887
+ | 'billing_suspending'
888
+ | 'billing_suspended'
889
+ | 'billing_reactivating';
871
890
 
872
891
  export type MonitorFleetSyncOptions = {
873
892
  /** Return the plan without changing fleet state (`dry_run: true`). */
@@ -891,6 +910,10 @@ export type MonitorFleetDeactivateOptions = {
891
910
  idempotencyKey?: string;
892
911
  };
893
912
 
913
+ export type MonitorFleetReactivateOptions = {
914
+ idempotencyKey?: string;
915
+ };
916
+
894
917
  export type MonitorFleetWaitOptions = {
895
918
  /** Give up after this long. Default 10 minutes. */
896
919
  timeoutMs?: number;
@@ -928,6 +951,11 @@ export type MonitorFleetsNamespace = {
928
951
  fleetId: string,
929
952
  options?: MonitorFleetDeactivateOptions,
930
953
  ) => Promise<MonitorFleetResult>;
954
+ /** Explicitly recreate a fleet after a credit-triggered suspension. */
955
+ reactivate: (
956
+ fleetId: string,
957
+ options?: MonitorFleetReactivateOptions,
958
+ ) => Promise<MonitorFleetResult>;
931
959
  /** Poll the fleet until the server reports a terminal status (or the timeout elapses). */
932
960
  waitForConvergence: (
933
961
  fleetId: string,
@@ -935,6 +963,104 @@ export type MonitorFleetsNamespace = {
935
963
  ) => Promise<MonitorFleetResult>;
936
964
  };
937
965
 
966
+ /**
967
+ * Delivery and convergence health for a scope, from
968
+ * `GET /api/v2/monitors/health`.
969
+ *
970
+ * Counts and bounded samples on purpose. It is also what `--watch` polls, so
971
+ * its shape is fixed independently of the transport: phase 2b publishes the
972
+ * same object over a reactive subscription without changing this contract.
973
+ */
974
+ export type MonitorsHealth = {
975
+ ok?: boolean;
976
+ scope: { org_id: string; fleet_id?: string };
977
+ scanned: number;
978
+ /** True when the scope was larger than one bounded read; counts are partial. */
979
+ truncated: boolean;
980
+ desired: { active: number; inactive: number; unset: number };
981
+ observed: {
982
+ active: number;
983
+ inactive: number;
984
+ missing: number;
985
+ unknown: number;
986
+ unset: number;
987
+ };
988
+ converged: number;
989
+ needs_repair: number;
990
+ /** Observed active, but nothing delivered inside `silent_window_days`. */
991
+ silent: number;
992
+ silent_window_days: number;
993
+ deactivation_reasons: Array<{
994
+ reason: string;
995
+ count: number;
996
+ summary: string | null;
997
+ resolution: string | null;
998
+ }>;
999
+ worst_offenders: Array<{
1000
+ monitor_key: string;
1001
+ tool: string;
1002
+ last_event_at: number | null;
1003
+ observed_at: number | null;
1004
+ provider_resource_id: string | null;
1005
+ }>;
1006
+ };
1007
+
1008
+ /** One bounded audit pass, from `POST /api/v2/monitors/audit`. */
1009
+ export type MonitorsAuditResult = {
1010
+ ok?: boolean;
1011
+ scope: { org_id: string; fleet_id?: string };
1012
+ audit: {
1013
+ scanned: number;
1014
+ asked: number;
1015
+ observed: {
1016
+ active: number;
1017
+ inactive: number;
1018
+ missing: number;
1019
+ unknown: number;
1020
+ };
1021
+ /** Observations a concurrent settle overtook. Not an error. */
1022
+ stale: number;
1023
+ absent: number;
1024
+ /** Capabilities that declare no batch read, so nothing could be asked. */
1025
+ unauditable_capabilities: string[];
1026
+ complete: boolean;
1027
+ /** Non-null when the scope was larger than one pass. Pass it back. */
1028
+ cursor: string | null;
1029
+ };
1030
+ health: MonitorsHealth;
1031
+ };
1032
+
1033
+ /** One repair pass or plan, from `POST /api/v2/monitors/repair`. */
1034
+ export type MonitorsRepairResult = {
1035
+ ok?: boolean;
1036
+ dry_run: boolean;
1037
+ scope: { org_id: string; fleet_id?: string };
1038
+ repair: {
1039
+ scanned: number;
1040
+ queued: number;
1041
+ plan: Array<{
1042
+ monitor_key: string;
1043
+ action: 'create' | 'remove';
1044
+ desired: 'active' | 'inactive';
1045
+ observed: 'active' | 'inactive' | 'missing';
1046
+ deactivation_reason?: string;
1047
+ }>;
1048
+ /** Disagreeing monitors no fleet owns; the convergence driver cannot move them. */
1049
+ unowned: string[];
1050
+ /** Monitors nobody has observed. Run audit first. */
1051
+ unaudited: string[];
1052
+ /**
1053
+ * Monitors with a provider operation still in flight. Deepline's own
1054
+ * convergence loop owns these; repair leaves them alone rather than risk
1055
+ * asking the provider to do the same work twice.
1056
+ */
1057
+ fenced: string[];
1058
+ refused: string[];
1059
+ complete: boolean;
1060
+ };
1061
+ health: MonitorsHealth;
1062
+ };
1063
+
938
1064
  /**
939
1065
  * Public monitors namespace exposed as `client.monitors`.
940
1066
  *
@@ -969,14 +1095,11 @@ export type MonitorsNamespace = {
969
1095
  list: (options?: MonitorsListOptions) => Promise<MonitorsListResult>;
970
1096
  /** Fetch one deployed monitor by public key with bounded current listener health. */
971
1097
  get: (key: string) => Promise<MonitorDetail>;
972
- /**
973
- * Test a deployed monitor. `validationOnly` safely verifies the callback
974
- * envelope; omitted options preserve the historic full-ingestion behavior.
975
- */
1098
+ /** Test a deployed monitor's callback envelope without side effects. */
976
1099
  test: (
977
1100
  key: string,
978
1101
  payload: Record<string, unknown>,
979
- options?: { validationOnly?: boolean; dispatch?: boolean },
1102
+ options?: MonitorTestOptions,
980
1103
  ) => Promise<MonitorTestResult>;
981
1104
  validate: (key: string) => Promise<MonitorValidateResult>;
982
1105
  /** List the published plays depending on one monitor's output streams. */
@@ -996,6 +1119,24 @@ export type MonitorsNamespace = {
996
1119
  key: string,
997
1120
  options?: { dryRun?: boolean },
998
1121
  ) => Promise<MonitorReactivateResult>;
1122
+ /**
1123
+ * Re-read what the provider holds onto the monitors that claim it. Bounded
1124
+ * and idempotent: pass `cursor` back while `audit.cursor` is non-null.
1125
+ */
1126
+ audit: (options?: {
1127
+ fleetId?: string;
1128
+ cursor?: string | null;
1129
+ }) => Promise<MonitorsAuditResult>;
1130
+ /**
1131
+ * Converge the monitors whose desired and observed states disagree.
1132
+ * `dryRun` returns the same plan without queueing anything.
1133
+ */
1134
+ repair: (options?: {
1135
+ fleetId?: string;
1136
+ dryRun?: boolean;
1137
+ }) => Promise<MonitorsRepairResult>;
1138
+ /** Delivery and convergence health for the workspace or one fleet. */
1139
+ health: (options?: { fleetId?: string }) => Promise<MonitorsHealth>;
999
1140
  /** Define, reconcile, and control table-backed monitor fleets. */
1000
1141
  fleets: MonitorFleetsNamespace;
1001
1142
  };
@@ -1915,6 +2056,9 @@ export class DeeplineClient {
1915
2056
  update: (key, patch) => this.updateMonitor(key, patch),
1916
2057
  delete: (key, options) => this.deleteMonitor(key, options),
1917
2058
  reactivate: (key, options) => this.reactivateMonitor(key, options),
2059
+ audit: (options) => this.auditMonitors(options),
2060
+ repair: (options) => this.repairMonitors(options),
2061
+ health: (options) => this.readMonitorsHealth(options),
1918
2062
  fleets: {
1919
2063
  sync: (definitionOrId, options) =>
1920
2064
  this.syncMonitorFleet(definitionOrId, options),
@@ -1925,6 +2069,8 @@ export class DeeplineClient {
1925
2069
  list: () => this.listMonitorFleets(),
1926
2070
  deactivate: (fleetId, options) =>
1927
2071
  this.deactivateMonitorFleet(fleetId, options),
2072
+ reactivate: (fleetId, options) =>
2073
+ this.reactivateMonitorFleet(fleetId, options),
1928
2074
  waitForConvergence: (fleetId, options) =>
1929
2075
  this.waitForMonitorFleetConvergence(fleetId, options),
1930
2076
  },
@@ -4073,13 +4219,29 @@ export class DeeplineClient {
4073
4219
  if (options?.grep?.trim()) {
4074
4220
  params.set('grep', options.grep.trim());
4075
4221
  params.set('grep_mode', options.grepMode ?? 'all');
4222
+ params.set('grep_paginated', '1');
4076
4223
  params.set('limit', '60');
4077
4224
  }
4078
- const suffix = params.toString() ? `?${params.toString()}` : '';
4079
- const response = await this.http.get<{ plays: PlayListItem[] }>(
4080
- `/api/v2/plays${suffix}`,
4081
- );
4082
- return response.plays ?? [];
4225
+ type PlayListResponse = {
4226
+ plays?: PlayListItem[];
4227
+ cursor?: string | null;
4228
+ hasMore?: boolean;
4229
+ pagination?: { cursor?: string | null; hasMore?: boolean };
4230
+ };
4231
+ const plays: PlayListItem[] = [];
4232
+ let cursor: string | null = null;
4233
+ let hasMore = true;
4234
+ do {
4235
+ if (cursor) params.set('cursor', cursor);
4236
+ const suffix = params.toString() ? `?${params.toString()}` : '';
4237
+ const response = await this.http.get<PlayListResponse>(
4238
+ `/api/v2/plays${suffix}`,
4239
+ );
4240
+ plays.push(...(response.plays ?? []));
4241
+ cursor = response.pagination?.cursor ?? response.cursor ?? null;
4242
+ hasMore = Boolean(response.pagination?.hasMore ?? response.hasMore);
4243
+ } while (Boolean(options?.grep?.trim()) && hasMore && cursor);
4244
+ return plays;
4083
4245
  }
4084
4246
 
4085
4247
  /** Set whether an org-owned Play sorts before unpinned Plays. */
@@ -4838,6 +5000,55 @@ export class DeeplineClient {
4838
5000
  };
4839
5001
  }
4840
5002
 
5003
+ /**
5004
+ * One bounded audit pass. Prefer `client.monitors.audit(...)`.
5005
+ *
5006
+ * Never auto-retried: it is idempotent, but a retry that races the caller's
5007
+ * own next pass would spend a provider slot to learn nothing new.
5008
+ */
5009
+ async auditMonitors(options?: {
5010
+ fleetId?: string;
5011
+ cursor?: string | null;
5012
+ }): Promise<MonitorsAuditResult> {
5013
+ return this.http.request<MonitorsAuditResult>('/api/v2/monitors/audit', {
5014
+ method: 'POST',
5015
+ body: {
5016
+ ...(options?.fleetId ? { fleet_id: options.fleetId } : {}),
5017
+ ...(options?.cursor ? { cursor: options.cursor } : {}),
5018
+ },
5019
+ maxRetries: 0,
5020
+ });
5021
+ }
5022
+
5023
+ /** One repair pass or plan. Prefer `client.monitors.repair(...)`. */
5024
+ async repairMonitors(options?: {
5025
+ fleetId?: string;
5026
+ dryRun?: boolean;
5027
+ }): Promise<MonitorsRepairResult> {
5028
+ return this.http.request<MonitorsRepairResult>('/api/v2/monitors/repair', {
5029
+ method: 'POST',
5030
+ body: {
5031
+ ...(options?.fleetId ? { fleet_id: options.fleetId } : {}),
5032
+ ...(options?.dryRun === undefined ? {} : { dry_run: options.dryRun }),
5033
+ },
5034
+ maxRetries: 0,
5035
+ });
5036
+ }
5037
+
5038
+ /** Delivery and convergence health. Prefer `client.monitors.health(...)`. */
5039
+ async readMonitorsHealth(options?: {
5040
+ fleetId?: string;
5041
+ }): Promise<MonitorsHealth> {
5042
+ const params = new URLSearchParams();
5043
+ if (options?.fleetId) params.set('fleet_id', options.fleetId);
5044
+ const query = params.toString();
5045
+ const suffix = query ? `?${query}` : '';
5046
+ return this.http.request<MonitorsHealth>(
5047
+ `/api/v2/monitors/health${suffix}`,
5048
+ { method: 'GET' },
5049
+ );
5050
+ }
5051
+
4841
5052
  /**
4842
5053
  * The deployable monitor tools catalog. Pass a tool id (positional or
4843
5054
  * `{ tool }`) to describe one tool's full payload/stream contract, or no tool
@@ -4953,7 +5164,8 @@ export class DeeplineClient {
4953
5164
  if (options?.limit !== undefined)
4954
5165
  params.set('limit', String(options.limit));
4955
5166
  if (options?.cursor) params.set('cursor', options.cursor);
4956
- if (options?.compact) params.set('compact', 'true');
5167
+ // `compact` used to promise a semantic projection. It is deliberately a
5168
+ // no-op now: audit fields must never disappear from a list response.
4957
5169
  if (options?.includeConsumers) params.set('include_consumers', 'true');
4958
5170
  const query = params.toString();
4959
5171
  // Single interpolation only — see availableMonitors: a nested template in
@@ -4976,19 +5188,24 @@ export class DeeplineClient {
4976
5188
  async testMonitorWebhook(
4977
5189
  key: string,
4978
5190
  payload: Record<string, unknown>,
4979
- options?: { validationOnly?: boolean; dispatch?: boolean },
5191
+ options?: MonitorTestOptions,
4980
5192
  ): Promise<MonitorTestResult> {
5193
+ if (options?.dispatch === true || options?.validationOnly === false) {
5194
+ throw new DeeplineError(
5195
+ 'Monitor tests are validation-only and cannot dispatch events.',
5196
+ undefined,
5197
+ 'MONITOR_TEST_DISPATCH_NOT_SUPPORTED',
5198
+ );
5199
+ }
4981
5200
  return this.http.request<MonitorTestResult>(
4982
5201
  `/api/v2/monitors/deployed/${encodeURIComponent(key)}/test`,
4983
5202
  {
4984
5203
  method: 'POST',
4985
5204
  body: {
4986
5205
  payload,
4987
- ...(options?.validationOnly
4988
- ? { mode: 'validation_only' }
4989
- : options?.dispatch
4990
- ? { mode: 'dispatch' }
4991
- : {}),
5206
+ // Send the legacy safe mode as well as accepting it server-side: an
5207
+ // upgraded SDK must be safe when it reaches a still-running server.
5208
+ mode: 'validation_only',
4992
5209
  },
4993
5210
  },
4994
5211
  );
@@ -5026,7 +5243,14 @@ export class DeeplineClient {
5026
5243
  ): Promise<MonitorUpdateResult> {
5027
5244
  return this.http.request<MonitorUpdateResult>(
5028
5245
  `/api/v2/monitors/deployed/${encodeURIComponent(key)}`,
5029
- { method: 'PATCH', body: patch },
5246
+ {
5247
+ method: 'PATCH',
5248
+ body: patch,
5249
+ // A monitor write may have reached the control plane before a network
5250
+ // failure reaches the caller. Do not turn that unknown outcome into a
5251
+ // second mutation with a fresh snapshot.
5252
+ ...MONITOR_NON_RETRYABLE_MUTATION_OPTIONS,
5253
+ },
5030
5254
  );
5031
5255
  }
5032
5256
 
@@ -5051,7 +5275,14 @@ export class DeeplineClient {
5051
5275
  const query = params.toString();
5052
5276
  return this.http.request<MonitorDeleteResult>(
5053
5277
  `/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ''}`,
5054
- { method: 'DELETE' },
5278
+ options?.dryRun
5279
+ ? { method: 'DELETE' }
5280
+ : {
5281
+ method: 'DELETE',
5282
+ // Deletion is a provider lifecycle operation. A timeout is an
5283
+ // unknown outcome, not authority to begin another delete attempt.
5284
+ ...MONITOR_NON_RETRYABLE_MUTATION_OPTIONS,
5285
+ },
5055
5286
  );
5056
5287
  }
5057
5288
 
@@ -5066,7 +5297,15 @@ export class DeeplineClient {
5066
5297
  const query = options?.dryRun ? '?dry_run=true' : '';
5067
5298
  return this.http.request<MonitorReactivateResult>(
5068
5299
  `/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
5069
- { method: 'POST', body: {} },
5300
+ options?.dryRun
5301
+ ? { method: 'POST', body: {} }
5302
+ : {
5303
+ method: 'POST',
5304
+ body: {},
5305
+ // Reactivation can create an upstream resource, so it must not use
5306
+ // the generic transport's automatic replay policy.
5307
+ ...MONITOR_NON_RETRYABLE_MUTATION_OPTIONS,
5308
+ },
5070
5309
  );
5071
5310
  }
5072
5311
 
@@ -5170,6 +5409,25 @@ export class DeeplineClient {
5170
5409
  );
5171
5410
  }
5172
5411
 
5412
+ async reactivateMonitorFleet(
5413
+ fleetId: string,
5414
+ options?: MonitorFleetReactivateOptions,
5415
+ ): Promise<MonitorFleetResult> {
5416
+ return this.http.request<MonitorFleetResult>(
5417
+ `${this.monitorFleetPath(fleetId)}/reactivate`,
5418
+ {
5419
+ method: 'POST',
5420
+ body: {},
5421
+ headers: this.monitorFleetHeaders(
5422
+ 'reactivate',
5423
+ options?.idempotencyKey,
5424
+ ),
5425
+ maxRetries: 0,
5426
+ exactUrlOnly: true,
5427
+ },
5428
+ );
5429
+ }
5430
+
5173
5431
  /**
5174
5432
  * Poll one fleet until the server reports a terminal status.
5175
5433
  *
@@ -541,6 +541,24 @@ function getResolvedProjectAuthSource(
541
541
  /**
542
542
  * Resolve SDK configuration from the public SDK CLI env contract.
543
543
  */
544
+ /**
545
+ * Base URL only, with no API key requirement. The GitHub connect flow is the
546
+ * chicken-and-egg case: it is the FIRST command a workspace runs, it only
547
+ * opens a browser URL, and the browser session — not an API key — carries the
548
+ * authorization. Requiring a key here would make the entry point unreachable.
549
+ */
550
+ export function resolveBaseUrlOnly(options?: DeeplineClientOptions): string {
551
+ const baseUrl = normalizeBaseUrl(
552
+ options?.baseUrl?.trim() || autoDetectBaseUrl(),
553
+ );
554
+ if (!baseUrl) {
555
+ throw new ConfigError(
556
+ `Invalid ${HOST_URL_ENV}. Expected an http(s) URL such as https://code.deepline.com.`,
557
+ );
558
+ }
559
+ return baseUrl;
560
+ }
561
+
544
562
  export function resolveConfig(options?: DeeplineClientOptions): ResolvedConfig {
545
563
  const baseUrl = normalizeBaseUrl(
546
564
  options?.baseUrl?.trim() || autoDetectBaseUrl(),
@@ -762,9 +780,9 @@ function findNearestProjectMarkerDir(startDir: string): string | null {
762
780
  * project. A project is a marked checkout, a Cowork-mounted project, or a
763
781
  * folder that already carries Deepline project auth.
764
782
  *
765
- * The result intentionally does not expose an API key. It lets the CLI reject
766
- * cloud mutations which would otherwise inherit a different project's shared
767
- * host-level organization selection.
783
+ * The result intentionally does not expose an API key. CLI diagnostics use it
784
+ * to show whether a project-specific pin is available while preserving
785
+ * compatibility with valid global credentials.
768
786
  */
769
787
  export function resolveCliAuthProvenance(
770
788
  config: Pick<ResolvedConfig, 'baseUrl' | 'apiKey'>,
@@ -87,6 +87,7 @@ export type {
87
87
  MonitorDeleteResult,
88
88
  MonitorReactivateResult,
89
89
  MonitorFleetDeactivateOptions,
90
+ MonitorFleetReactivateOptions,
90
91
  MonitorFleetGetOptions,
91
92
  MonitorFleetSyncOptions,
92
93
  MonitorFleetStatus,
@@ -54,7 +54,7 @@ export const MONITOR_FLEET_DOCUMENTATION = {
54
54
  summary:
55
55
  'A Monitor Fleet keeps one bounded, sticky set of ordinary monitors aligned with Customer DB rows.',
56
56
  authoredFields: {
57
- id: 'Stable lowercase fleet id used by sync, pause, resume, and deactivate.',
57
+ id: 'Stable lowercase fleet id used by sync, get, and deactivate.',
58
58
  source:
59
59
  'Customer DB table, unique row key, and optional equality filters that select candidate rows.',
60
60
  member:
@@ -290,8 +290,8 @@ export type { PreviousCell } from '../../shared_libs/plays/cell-staleness.js';
290
290
  * Keyword-style request object for `ctx.tools.execute(...)`.
291
291
  *
292
292
  * The `tool` value comes from live tool discovery. The `id` is the stable
293
- * logical call name used for logs, metadata, and receipt attachment. Provider
294
- * call reuse is keyed by play, tool, semantic input, auth scope, provider action
293
+ * logical call name used for logs, metadata, and result-cache identity. Provider
294
+ * result reuse is keyed by play, tool, semantic input, auth scope, provider action
295
295
  * version, and cache policy.
296
296
  *
297
297
  * @sdkReference runtime 160
@@ -1626,10 +1626,7 @@ export function definePlay<TInput, TOutput extends PlayReturnObject>(
1626
1626
  /** @internal Contextually type unannotated monitor-event handlers as unknown. */
1627
1627
  export function definePlay<TOutput extends PlayReturnObject>(
1628
1628
  name: string,
1629
- fn: (
1630
- context: DeeplinePlayRuntimeContext,
1631
- input: unknown,
1632
- ) => Promise<TOutput>,
1629
+ fn: (context: DeeplinePlayRuntimeContext, input: unknown) => Promise<TOutput>,
1633
1630
  bindings: PlayBindings<never> & {
1634
1631
  readonly sqlListeners: readonly SqlListenerDeclaration[];
1635
1632
  },
@@ -199,7 +199,7 @@ export const SDK_RELEASE = {
199
199
  // available at toolResponse.rawV2 while toolResponse.raw and all declared
200
200
  // getters keep their established compatibility behavior.
201
201
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
202
- version: '0.3.73',
202
+ version: '0.3.75',
203
203
  updateSummary:
204
204
  '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.',
205
205
  packageCapabilities: {
@@ -282,8 +282,9 @@ export interface ToolDefinition {
282
282
  term?: string;
283
283
  }>;
284
284
  /**
285
- * Whether this tool is callable in the current workspace. `false` for a
286
- * bring-your-own-credential provider that has not been connected.
285
+ * Whether this tool is callable in the current workspace. `false` when a
286
+ * required customer credential is missing or a managed provider is
287
+ * temporarily unavailable.
287
288
  */
288
289
  connected?: boolean;
289
290
  /** Whether the tool can be executed. Exact lookup may return non-callable deprecated aliases. */