deepline 0.3.118 → 0.3.120

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.
@@ -166,4 +166,26 @@ export async function bundlePlayFile(
166
166
  return result;
167
167
  }
168
168
 
169
+ /**
170
+ * One play of a directory deploy (`deepline plays deploy`), bundled exactly
171
+ * as the managed deploy worker bundles it: the Node 20 CJS target, file
172
+ * identities relative to the deployed directory so the same sources hash the
173
+ * same wherever they are built, and validation left to the server's
174
+ * compile-manifest step.
175
+ */
176
+ export async function bundleDeployPlayFile(
177
+ entryFile: string,
178
+ options: { sourceIdentityRoot: string },
179
+ ): Promise<BundledPlayFileResult> {
180
+ return bundlePlayFileCore(entryFile, {
181
+ target: PLAY_ARTIFACT_KINDS.cjsNode20,
182
+ adapter: {
183
+ ...createSdkPlayBundlingAdapter(),
184
+ sourceIdentityRoot: options.sourceIdentityRoot,
185
+ // CI commonly runs with NODE_ENV=production; a deploy bundles by design.
186
+ warnAboutNonDevelopmentBundling: undefined,
187
+ },
188
+ });
189
+ }
190
+
169
191
  export { PLAY_ARTIFACT_KINDS };
@@ -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.118',
203
+ version: '0.3.120',
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: {
@@ -23,12 +23,23 @@ export const PLAY_RUN_PRE_RUN_VALIDATION_FAILED =
23
23
  'PLAY_RUN_PRE_RUN_VALIDATION_FAILED' as const;
24
24
  export const RUNTIME_DB_SESSION_PRELOAD_INCOMPLETE =
25
25
  'RUNTIME_DB_SESSION_PRELOAD_INCOMPLETE' as const;
26
+ /**
27
+ * A disabled-source replay cannot create a new Runtime Run. If the original
28
+ * Run is absent, retrying the same existing-only admission can never make
29
+ * progress and only keeps the receipt on the 503 retry path.
30
+ */
31
+ export const PLAY_RUN_ADMISSION_REPLAY_MISSING =
32
+ 'PLAY_RUN_ADMISSION_REPLAY_MISSING' as const;
33
+ /** A reused Run identity with different launch facts is permanently invalid. */
34
+ export const PLAY_RUN_LAUNCH_CONFLICT = 'PLAY_RUN_LAUNCH_CONFLICT' as const;
26
35
 
27
36
  export type PlayAdmissionBlockedCode =
28
37
  | typeof PLAY_ADMISSION_PAYLOAD_UNREADABLE
29
38
  | typeof PLAY_SECRET_UNAVAILABLE
30
39
  | typeof PLAY_RUN_PRE_RUN_VALIDATION_FAILED
31
- | typeof RUNTIME_DB_SESSION_PRELOAD_INCOMPLETE;
40
+ | typeof RUNTIME_DB_SESSION_PRELOAD_INCOMPLETE
41
+ | typeof PLAY_RUN_ADMISSION_REPLAY_MISSING
42
+ | typeof PLAY_RUN_LAUNCH_CONFLICT;
32
43
 
33
44
  export type PlayAdmissionRetryableCode = typeof PLAY_ADMISSION_INTERNAL_FAILURE;
34
45
 
@@ -49,6 +60,8 @@ export type PlayAdmissionFailure =
49
60
  const TERMINAL_PRE_ADMISSION_CODES = new Set<PlayAdmissionBlockedCode>([
50
61
  PLAY_RUN_PRE_RUN_VALIDATION_FAILED,
51
62
  RUNTIME_DB_SESSION_PRELOAD_INCOMPLETE,
63
+ PLAY_RUN_ADMISSION_REPLAY_MISSING,
64
+ PLAY_RUN_LAUNCH_CONFLICT,
52
65
  ]);
53
66
 
54
67
  function stableErrorCode(error: unknown): string | null {
@@ -1,11 +1,15 @@
1
1
  import { createHash } from 'node:crypto';
2
2
  import {
3
3
  classifyPlayAdmissionFailure,
4
+ PLAY_RUN_ADMISSION_REPLAY_MISSING,
5
+ PLAY_RUN_LAUNCH_CONFLICT,
4
6
  PLAY_RUN_PRE_RUN_VALIDATION_FAILED,
5
7
  RUNTIME_DB_SESSION_PRELOAD_INCOMPLETE,
6
8
  } from './/play-admission-outcome';
7
9
 
8
10
  export {
11
+ PLAY_RUN_ADMISSION_REPLAY_MISSING,
12
+ PLAY_RUN_LAUNCH_CONFLICT,
9
13
  PLAY_RUN_PRE_RUN_VALIDATION_FAILED,
10
14
  RUNTIME_DB_SESSION_PRELOAD_INCOMPLETE,
11
15
  };
@@ -54,9 +54,11 @@ export type PlayDeploymentDoc = {
54
54
  _id: GenericId<'playDeployments'>;
55
55
  _creationTime: number;
56
56
  orgId: string;
57
- playProjectId: GenericId<'playProjects'>;
58
- commitSha: string;
59
- ref: string;
57
+ /** Absent for a deployment the workspace ran itself, with no linked repo. */
58
+ playProjectId?: GenericId<'playProjects'>;
59
+ commitSha?: string;
60
+ ref?: string;
61
+ repoFullName?: string;
60
62
  isProduction: boolean;
61
63
  trigger: 'push' | 'pull_request' | 'manual' | 'redeliver';
62
64
  deliveryId?: string;
@@ -44,9 +44,12 @@ export function serializePlayProject(
44
44
  export type SerializedPlayDeployment = {
45
45
  id: string;
46
46
  orgId: string;
47
- playProjectId: string;
48
- commitSha: string;
49
- ref: string;
47
+ /** Null for a deployment of a directory rather than a linked repository. */
48
+ playProjectId: string | null;
49
+ commitSha: string | null;
50
+ ref: string | null;
51
+ /** Caller-supplied repository metadata when there is no linked repo. */
52
+ repoFullName: string | null;
50
53
  isProduction: boolean;
51
54
  trigger: string;
52
55
  status: string;
@@ -70,9 +73,12 @@ export function serializePlayDeployment(
70
73
  return {
71
74
  id: String(deployment._id),
72
75
  orgId: deployment.orgId,
73
- playProjectId: String(deployment.playProjectId),
74
- commitSha: deployment.commitSha,
75
- ref: deployment.ref,
76
+ playProjectId: deployment.playProjectId
77
+ ? String(deployment.playProjectId)
78
+ : null,
79
+ commitSha: deployment.commitSha ?? null,
80
+ ref: deployment.ref ?? null,
81
+ repoFullName: deployment.repoFullName ?? null,
76
82
  isProduction: deployment.isProduction,
77
83
  trigger: deployment.trigger,
78
84
  status: deployment.status,