deepline 0.3.203 → 0.3.204

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.
@@ -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.203',
203
+ version: '0.3.204',
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: {
@@ -1,16 +1,73 @@
1
1
  import { spawnSync } from 'node:child_process';
2
2
 
3
- function run(command: string, args: string[], quiet = false): boolean {
4
- const result = spawnSync(command, args, {
3
+ const FLY_REGISTRY_COMMAND_TIMEOUT_MS = 30_000;
4
+ const RUNTIME_IMAGE_MANIFEST_TIMEOUT_MS = 10_000;
5
+
6
+ type FlyRegistryCommandResult = Readonly<{
7
+ error?: Error & { code?: string };
8
+ status: number | null;
9
+ stdout?: string | null;
10
+ stderr?: string | null;
11
+ }>;
12
+
13
+ type FlyRegistryCommandSpawn = (
14
+ command: string,
15
+ args: readonly string[],
16
+ options: Readonly<{
17
+ encoding: 'utf8';
18
+ killSignal: 'SIGKILL';
19
+ stdio: 'inherit' | 'pipe';
20
+ timeout: number;
21
+ }>,
22
+ ) => FlyRegistryCommandResult;
23
+
24
+ function run(
25
+ command: string,
26
+ args: string[],
27
+ quiet = false,
28
+ timeoutMs = FLY_REGISTRY_COMMAND_TIMEOUT_MS,
29
+ spawnOverride?: FlyRegistryCommandSpawn,
30
+ ): boolean {
31
+ const spawnCommand: FlyRegistryCommandSpawn =
32
+ spawnOverride ??
33
+ ((executable, commandArgs, spawnOptions) =>
34
+ spawnSync(executable, [...commandArgs], spawnOptions));
35
+ const result = spawnCommand(command, args, {
5
36
  encoding: 'utf8',
37
+ killSignal: 'SIGKILL',
6
38
  stdio: quiet ? 'pipe' : 'inherit',
39
+ timeout: timeoutMs,
7
40
  });
41
+ if (result.error) {
42
+ const error = result.error as NodeJS.ErrnoException;
43
+ if (error.code === 'ETIMEDOUT') {
44
+ throw Object.assign(
45
+ new Error(
46
+ `[fly-registry] ${command} ${args.join(' ')} timed out after ${timeoutMs}ms.`,
47
+ ),
48
+ { code: error.code },
49
+ );
50
+ }
51
+ throw result.error;
52
+ }
8
53
  return result.status === 0;
9
54
  }
10
55
 
11
56
  /** Shared immutable-tag presence probe for image builds and rollback planning. */
12
- export function runtimeImageManifestExists(image: string): boolean {
13
- return run('docker', ['manifest', 'inspect', image], true);
57
+ export function runtimeImageManifestExists(
58
+ image: string,
59
+ options: {
60
+ timeoutMs?: number;
61
+ spawnCommand?: FlyRegistryCommandSpawn;
62
+ } = {},
63
+ ): boolean {
64
+ return run(
65
+ 'docker',
66
+ ['manifest', 'inspect', image],
67
+ true,
68
+ options.timeoutMs ?? RUNTIME_IMAGE_MANIFEST_TIMEOUT_MS,
69
+ options.spawnCommand,
70
+ );
14
71
  }
15
72
 
16
73
  export const FLY_REGISTRY_AUTH_ATTEMPTS = 3;
@@ -25,13 +82,37 @@ const FLY_REGISTRY_AUTH_RETRY_DELAY_MS = 1_500;
25
82
  */
26
83
  export function authenticateFlyRegistry(
27
84
  sleep: (ms: number) => void = sleepSync,
85
+ spawnOverride?: FlyRegistryCommandSpawn,
28
86
  ): void {
87
+ let lastTimeoutError: Error | undefined;
29
88
  for (let attempt = 1; attempt <= FLY_REGISTRY_AUTH_ATTEMPTS; attempt += 1) {
30
- if (run('flyctl', ['auth', 'docker'])) return;
89
+ try {
90
+ if (
91
+ run(
92
+ 'flyctl',
93
+ ['auth', 'docker'],
94
+ false,
95
+ FLY_REGISTRY_COMMAND_TIMEOUT_MS,
96
+ spawnOverride,
97
+ )
98
+ ) {
99
+ return;
100
+ }
101
+ lastTimeoutError = undefined;
102
+ } catch (error) {
103
+ if (
104
+ !(error instanceof Error) ||
105
+ (error as NodeJS.ErrnoException).code !== 'ETIMEDOUT'
106
+ ) {
107
+ throw error;
108
+ }
109
+ lastTimeoutError = error;
110
+ }
31
111
  if (attempt < FLY_REGISTRY_AUTH_ATTEMPTS) {
32
112
  sleep(FLY_REGISTRY_AUTH_RETRY_DELAY_MS * attempt);
33
113
  }
34
114
  }
115
+ if (lastTimeoutError) throw lastTimeoutError;
35
116
  throw new Error(
36
117
  `Fly registry authentication failed after ${FLY_REGISTRY_AUTH_ATTEMPTS} attempts.`,
37
118
  );
package/dist/cli/index.js CHANGED
@@ -3051,7 +3051,7 @@ var SDK_RELEASE = {
3051
3051
  // getters keep their established compatibility behavior.
3052
3052
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
3053
3053
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
3054
- version: "0.3.203",
3054
+ version: "0.3.204",
3055
3055
  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.",
3056
3056
  packageCapabilities: {
3057
3057
  updatePreferences: 1
@@ -3046,7 +3046,7 @@ var SDK_RELEASE = {
3046
3046
  // getters keep their established compatibility behavior.
3047
3047
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
3048
3048
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
3049
- version: "0.3.203",
3049
+ version: "0.3.204",
3050
3050
  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.",
3051
3051
  packageCapabilities: {
3052
3052
  updatePreferences: 1
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.203",
867
+ version: "0.3.204",
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
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.203",
771
+ version: "0.3.204",
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
@@ -149,7 +149,7 @@ type SdkRelease = {
149
149
  supportPolicy: SdkSupportPolicy;
150
150
  };
151
151
  declare const SDK_RELEASE: {
152
- readonly version: "0.3.203";
152
+ readonly version: "0.3.204";
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.203";
152
+ readonly version: "0.3.204";
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.203",
77
+ version: "0.3.204",
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.203",
51
+ version: "0.3.204",
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.203",
3
+ "version": "0.3.204",
4
4
  "description": "GTM data CLI and TypeScript SDK for coding agents",
5
5
  "license": "MIT",
6
6
  "homepage": "https://code.deepline.com",