deepline 0.3.123 → 0.3.124

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.
@@ -6424,9 +6424,22 @@ export class DeeplineClient {
6424
6424
  // Monitor Jobs, Batches, and Fleets
6425
6425
  // ——————————————————————————————————————————————————————————
6426
6426
 
6427
+ private static readonly MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH = 96;
6428
+
6427
6429
  private monitorJobIdempotencyKey(operation: string): string {
6428
- const uuid = globalThis.crypto?.randomUUID?.();
6429
- return `monitor-job-${operation}-${uuid ?? `${Date.now()}-${Math.random().toString(36).slice(2)}`}`;
6430
+ const uuid =
6431
+ globalThis.crypto?.randomUUID?.() ??
6432
+ `${Date.now()}-${Math.random().toString(36).slice(2)}`;
6433
+ const prefix = 'monitor-job-';
6434
+ const safeOperation = operation.replace(/[^A-Za-z0-9._-]/g, '-');
6435
+ const maxOperationLength = Math.max(
6436
+ 0,
6437
+ DeeplineClient.MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH -
6438
+ prefix.length -
6439
+ uuid.length -
6440
+ 1,
6441
+ );
6442
+ return `${prefix}${safeOperation.slice(0, maxOperationLength)}-${uuid}`;
6430
6443
  }
6431
6444
 
6432
6445
  private monitorJobHeaders(
@@ -200,7 +200,7 @@ export const SDK_RELEASE = {
200
200
  // getters keep their established compatibility behavior.
201
201
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
202
202
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
203
- version: '0.3.123',
203
+ version: '0.3.124',
204
204
  updateSummary:
205
205
  '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.',
206
206
  packageCapabilities: {
@@ -63,6 +63,8 @@
63
63
  "./provider-callback-verification.js": "./provider-callback-verification.ts",
64
64
  "./provider-monitor-batch-operation": "./provider-monitor-batch-operation.ts",
65
65
  "./provider-monitor-batch-operation.js": "./provider-monitor-batch-operation.ts",
66
+ "./provider-monitor-control-plane-capability": "./provider-monitor-control-plane-capability.ts",
67
+ "./provider-monitor-control-plane-capability.js": "./provider-monitor-control-plane-capability.ts",
66
68
  "./provider-monitor-capability": "./provider-monitor-capability.ts",
67
69
  "./provider-monitor-capability.js": "./provider-monitor-capability.ts",
68
70
  "./provider-monitor-consumer-health": "./provider-monitor-consumer-health.ts",
@@ -0,0 +1,47 @@
1
+ import { createHmac } from 'node:crypto';
2
+
3
+ const BATCH_SECRET_ENV = 'PROVIDER_MONITOR_BATCH_OPERATION_CONTINUATION_SECRET';
4
+ const GLOBAL_AUDIT_SECRET_ENV =
5
+ 'PROVIDER_MONITOR_GLOBAL_AUDIT_CONTINUATION_SECRET';
6
+ const LEGACY_SECRET_ENV = 'PROVIDER_MONITOR_RECONCILIATION_CONTINUATION_SECRET';
7
+ const INTERNAL_TOKEN_ENV = 'DEEPLINE_INTERNAL_TOKEN';
8
+
9
+ // Preview derives this narrow capability from the deployment's internal token
10
+ // instead of copying the root token into Convex. Both the Convex scheduler and
11
+ // the app callback route must use this exact context and derivation.
12
+ export const PROVIDER_MONITOR_CONTROL_PLANE_CAPABILITY_CONTEXT =
13
+ 'deepline/provider-monitor-control-plane-continuation/v1';
14
+
15
+ function derivedControlPlaneCapability(
16
+ env: Record<string, string | undefined>,
17
+ ): string | undefined {
18
+ const internalToken = env[INTERNAL_TOKEN_ENV]?.trim();
19
+ if (!internalToken) return undefined;
20
+ return createHmac('sha256', internalToken)
21
+ .update(PROVIDER_MONITOR_CONTROL_PLANE_CAPABILITY_CONTEXT)
22
+ .digest('base64url');
23
+ }
24
+
25
+ /**
26
+ * The dedicated batch value is the normal production configuration. The
27
+ * legacy value keeps rolling deploys compatible. Preview has neither, so it
28
+ * uses the scoped capability derived from the Preview-only internal token.
29
+ */
30
+ export function providerMonitorBatchOperationContinuationSecret(
31
+ env: Record<string, string | undefined> = process.env,
32
+ ): string | undefined {
33
+ return (
34
+ env[BATCH_SECRET_ENV]?.trim() ||
35
+ env[LEGACY_SECRET_ENV]?.trim() ||
36
+ derivedControlPlaneCapability(env)
37
+ );
38
+ }
39
+
40
+ export function providerMonitorGlobalAuditContinuationSecret(
41
+ env: Record<string, string | undefined> = process.env,
42
+ ): string | undefined {
43
+ return (
44
+ env[GLOBAL_AUDIT_SECRET_ENV]?.trim() ||
45
+ providerMonitorBatchOperationContinuationSecret(env)
46
+ );
47
+ }
package/dist/cli/index.js CHANGED
@@ -3068,7 +3068,7 @@ var SDK_RELEASE = {
3068
3068
  // getters keep their established compatibility behavior.
3069
3069
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
3070
3070
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
3071
- version: "0.3.123",
3071
+ version: "0.3.124",
3072
3072
  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.",
3073
3073
  packageCapabilities: {
3074
3074
  updatePreferences: 1
@@ -6919,7 +6919,7 @@ function playRunStatusFromState(state) {
6919
6919
  ..."result" in state ? { result: state.result } : {}
6920
6920
  };
6921
6921
  }
6922
- var DeeplineClient = class {
6922
+ var DeeplineClient = class _DeeplineClient {
6923
6923
  http;
6924
6924
  config;
6925
6925
  /** Canonical run lifecycle namespace backed by `/api/v2/runs`. */
@@ -9844,9 +9844,16 @@ var DeeplineClient = class {
9844
9844
  // ——————————————————————————————————————————————————————————
9845
9845
  // Monitor Jobs, Batches, and Fleets
9846
9846
  // ——————————————————————————————————————————————————————————
9847
+ static MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH = 96;
9847
9848
  monitorJobIdempotencyKey(operation) {
9848
- const uuid = globalThis.crypto?.randomUUID?.();
9849
- return `monitor-job-${operation}-${uuid ?? `${Date.now()}-${Math.random().toString(36).slice(2)}`}`;
9849
+ const uuid = globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Math.random().toString(36).slice(2)}`;
9850
+ const prefix = "monitor-job-";
9851
+ const safeOperation = operation.replace(/[^A-Za-z0-9._-]/g, "-");
9852
+ const maxOperationLength = Math.max(
9853
+ 0,
9854
+ _DeeplineClient.MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH - prefix.length - uuid.length - 1
9855
+ );
9856
+ return `${prefix}${safeOperation.slice(0, maxOperationLength)}-${uuid}`;
9850
9857
  }
9851
9858
  monitorJobHeaders(operation, idempotencyKey) {
9852
9859
  return {
@@ -3063,7 +3063,7 @@ var SDK_RELEASE = {
3063
3063
  // getters keep their established compatibility behavior.
3064
3064
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
3065
3065
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
3066
- version: "0.3.123",
3066
+ version: "0.3.124",
3067
3067
  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.",
3068
3068
  packageCapabilities: {
3069
3069
  updatePreferences: 1
@@ -6914,7 +6914,7 @@ function playRunStatusFromState(state) {
6914
6914
  ..."result" in state ? { result: state.result } : {}
6915
6915
  };
6916
6916
  }
6917
- var DeeplineClient = class {
6917
+ var DeeplineClient = class _DeeplineClient {
6918
6918
  http;
6919
6919
  config;
6920
6920
  /** Canonical run lifecycle namespace backed by `/api/v2/runs`. */
@@ -9839,9 +9839,16 @@ var DeeplineClient = class {
9839
9839
  // ——————————————————————————————————————————————————————————
9840
9840
  // Monitor Jobs, Batches, and Fleets
9841
9841
  // ——————————————————————————————————————————————————————————
9842
+ static MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH = 96;
9842
9843
  monitorJobIdempotencyKey(operation) {
9843
- const uuid = globalThis.crypto?.randomUUID?.();
9844
- return `monitor-job-${operation}-${uuid ?? `${Date.now()}-${Math.random().toString(36).slice(2)}`}`;
9844
+ const uuid = globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Math.random().toString(36).slice(2)}`;
9845
+ const prefix = "monitor-job-";
9846
+ const safeOperation = operation.replace(/[^A-Za-z0-9._-]/g, "-");
9847
+ const maxOperationLength = Math.max(
9848
+ 0,
9849
+ _DeeplineClient.MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH - prefix.length - uuid.length - 1
9850
+ );
9851
+ return `${prefix}${safeOperation.slice(0, maxOperationLength)}-${uuid}`;
9845
9852
  }
9846
9853
  monitorJobHeaders(operation, idempotencyKey) {
9847
9854
  return {
package/dist/index.d.mts CHANGED
@@ -5464,6 +5464,7 @@ declare class DeeplineClient {
5464
5464
  reactivateMonitor(key: string, options?: {
5465
5465
  dryRun?: boolean;
5466
5466
  }): Promise<MonitorReactivateResult>;
5467
+ private static readonly MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH;
5467
5468
  private monitorJobIdempotencyKey;
5468
5469
  private monitorJobHeaders;
5469
5470
  deployMonitorBatch(definitions: MonitorDefinition[], options?: MonitorJobDeployOptions): Promise<MonitorJobResult>;
package/dist/index.d.ts CHANGED
@@ -5464,6 +5464,7 @@ declare class DeeplineClient {
5464
5464
  reactivateMonitor(key: string, options?: {
5465
5465
  dryRun?: boolean;
5466
5466
  }): Promise<MonitorReactivateResult>;
5467
+ private static readonly MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH;
5467
5468
  private monitorJobIdempotencyKey;
5468
5469
  private monitorJobHeaders;
5469
5470
  deployMonitorBatch(definitions: MonitorDefinition[], options?: MonitorJobDeployOptions): Promise<MonitorJobResult>;
package/dist/index.js CHANGED
@@ -864,7 +864,7 @@ var SDK_RELEASE = {
864
864
  // getters keep their established compatibility behavior.
865
865
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
866
866
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
867
- version: "0.3.123",
867
+ version: "0.3.124",
868
868
  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.",
869
869
  packageCapabilities: {
870
870
  updatePreferences: 1
@@ -4593,7 +4593,7 @@ function playRunStatusFromState(state) {
4593
4593
  ..."result" in state ? { result: state.result } : {}
4594
4594
  };
4595
4595
  }
4596
- var DeeplineClient = class {
4596
+ var DeeplineClient = class _DeeplineClient {
4597
4597
  http;
4598
4598
  config;
4599
4599
  /** Canonical run lifecycle namespace backed by `/api/v2/runs`. */
@@ -7518,9 +7518,16 @@ var DeeplineClient = class {
7518
7518
  // ——————————————————————————————————————————————————————————
7519
7519
  // Monitor Jobs, Batches, and Fleets
7520
7520
  // ——————————————————————————————————————————————————————————
7521
+ static MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH = 96;
7521
7522
  monitorJobIdempotencyKey(operation) {
7522
- const uuid = globalThis.crypto?.randomUUID?.();
7523
- return `monitor-job-${operation}-${uuid ?? `${Date.now()}-${Math.random().toString(36).slice(2)}`}`;
7523
+ const uuid = globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Math.random().toString(36).slice(2)}`;
7524
+ const prefix = "monitor-job-";
7525
+ const safeOperation = operation.replace(/[^A-Za-z0-9._-]/g, "-");
7526
+ const maxOperationLength = Math.max(
7527
+ 0,
7528
+ _DeeplineClient.MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH - prefix.length - uuid.length - 1
7529
+ );
7530
+ return `${prefix}${safeOperation.slice(0, maxOperationLength)}-${uuid}`;
7524
7531
  }
7525
7532
  monitorJobHeaders(operation, idempotencyKey) {
7526
7533
  return {
package/dist/index.mjs CHANGED
@@ -768,7 +768,7 @@ var SDK_RELEASE = {
768
768
  // getters keep their established compatibility behavior.
769
769
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
770
770
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
771
- version: "0.3.123",
771
+ version: "0.3.124",
772
772
  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.",
773
773
  packageCapabilities: {
774
774
  updatePreferences: 1
@@ -4497,7 +4497,7 @@ function playRunStatusFromState(state) {
4497
4497
  ..."result" in state ? { result: state.result } : {}
4498
4498
  };
4499
4499
  }
4500
- var DeeplineClient = class {
4500
+ var DeeplineClient = class _DeeplineClient {
4501
4501
  http;
4502
4502
  config;
4503
4503
  /** Canonical run lifecycle namespace backed by `/api/v2/runs`. */
@@ -7422,9 +7422,16 @@ var DeeplineClient = class {
7422
7422
  // ——————————————————————————————————————————————————————————
7423
7423
  // Monitor Jobs, Batches, and Fleets
7424
7424
  // ——————————————————————————————————————————————————————————
7425
+ static MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH = 96;
7425
7426
  monitorJobIdempotencyKey(operation) {
7426
- const uuid = globalThis.crypto?.randomUUID?.();
7427
- return `monitor-job-${operation}-${uuid ?? `${Date.now()}-${Math.random().toString(36).slice(2)}`}`;
7427
+ const uuid = globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Math.random().toString(36).slice(2)}`;
7428
+ const prefix = "monitor-job-";
7429
+ const safeOperation = operation.replace(/[^A-Za-z0-9._-]/g, "-");
7430
+ const maxOperationLength = Math.max(
7431
+ 0,
7432
+ _DeeplineClient.MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH - prefix.length - uuid.length - 1
7433
+ );
7434
+ return `${prefix}${safeOperation.slice(0, maxOperationLength)}-${uuid}`;
7428
7435
  }
7429
7436
  monitorJobHeaders(operation, idempotencyKey) {
7430
7437
  return {
@@ -65,6 +65,7 @@
65
65
  "dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts",
66
66
  "dist/bundling-sources/shared_libs/monitors/provider-monitor-capability.ts",
67
67
  "dist/bundling-sources/shared_libs/monitors/provider-monitor-consumer-health.ts",
68
+ "dist/bundling-sources/shared_libs/monitors/provider-monitor-control-plane-capability.ts",
68
69
  "dist/bundling-sources/shared_libs/monitors/provider-monitor-errors.ts",
69
70
  "dist/bundling-sources/shared_libs/monitors/provider-monitor-identity-claims.ts",
70
71
  "dist/bundling-sources/shared_libs/monitors/provider-monitor-legacy-aliases.ts",
@@ -149,7 +149,7 @@ type SdkRelease = {
149
149
  supportPolicy: SdkSupportPolicy;
150
150
  };
151
151
  declare const SDK_RELEASE: {
152
- readonly version: "0.3.123";
152
+ readonly version: "0.3.124";
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.123";
152
+ readonly version: "0.3.124";
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.123",
77
+ version: "0.3.124",
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.123",
51
+ version: "0.3.124",
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.123",
3
+ "version": "0.3.124",
4
4
  "description": "GTM data CLI and TypeScript SDK for coding agents",
5
5
  "license": "MIT",
6
6
  "homepage": "https://code.deepline.com",