deepline 0.3.117 → 0.3.119

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.117',
203
+ version: '0.3.119',
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,3 +1,4 @@
1
1
  export * from './column-names';
2
2
  export * from './contracts';
3
3
  export * from './sheet-contract';
4
+ export * from './runtime-sheet-storage-contract';
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Canonical contract for the runtime sheet cell-provenance column.
3
+ *
4
+ * Runtime sheet writers intentionally omit this column and rely on the
5
+ * database default. Keep the type, nullability, and default in one Module so
6
+ * table creation, readiness probes, migrations, and diagnostics cannot drift.
7
+ */
8
+ export const RUNTIME_SHEET_CELL_META_COLUMN = {
9
+ name: '_cell_meta',
10
+ dataType: 'jsonb',
11
+ nullable: 'NO',
12
+ defaultSql: "'{}'::jsonb",
13
+ } as const;
14
+
15
+ export type RuntimeSheetCellMetaColumnState = {
16
+ data_type: string;
17
+ is_nullable: string;
18
+ column_default: string | null;
19
+ };
20
+
21
+ export function isRuntimeSheetCellMetaColumnReady(
22
+ state: RuntimeSheetCellMetaColumnState | null | undefined,
23
+ ): boolean {
24
+ return (
25
+ state?.data_type === RUNTIME_SHEET_CELL_META_COLUMN.dataType &&
26
+ state.is_nullable === RUNTIME_SHEET_CELL_META_COLUMN.nullable &&
27
+ state.column_default != null
28
+ );
29
+ }
@@ -24,6 +24,7 @@ import {
24
24
  physicalSheetColumnProjections,
25
25
  type PhysicalSheetColumnProjection,
26
26
  } from '../play-data-plane/sheet-contract';
27
+ import { RUNTIME_SHEET_CELL_META_COLUMN } from '../play-data-plane/runtime-sheet-storage-contract';
27
28
  import type {
28
29
  CreateDbSessionResponse,
29
30
  DbLogicalTable,
@@ -1025,11 +1026,30 @@ async function isRuntimeSheetSchemaReady(
1025
1026
  [...RUNTIME_SHEET_TIMESTAMP_COLUMNS],
1026
1027
  ],
1027
1028
  );
1029
+ const cellMetaColumn = await client.query<Record<string, unknown>>(
1030
+ `
1031
+ SELECT count(*)::int AS ready_count
1032
+ FROM information_schema.columns
1033
+ WHERE table_schema = $1
1034
+ AND table_name = $2
1035
+ AND column_name = $3
1036
+ AND data_type = $4
1037
+ AND is_nullable = 'NO'
1038
+ AND column_default IS NOT NULL
1039
+ `,
1040
+ [
1041
+ session.postgres.schema,
1042
+ session.postgres.sheetTable,
1043
+ RUNTIME_SHEET_CELL_META_COLUMN.name,
1044
+ RUNTIME_SHEET_CELL_META_COLUMN.dataType,
1045
+ ],
1046
+ );
1028
1047
  return (
1029
1048
  Number(attemptColumns.rows[0]?.present_count ?? 0) ===
1030
1049
  RUNTIME_SHEET_ATTEMPT_COLUMNS.length &&
1031
1050
  Number(timestampColumns.rows[0]?.ready_count ?? 0) ===
1032
- RUNTIME_SHEET_TIMESTAMP_COLUMNS.length
1051
+ RUNTIME_SHEET_TIMESTAMP_COLUMNS.length &&
1052
+ Number(cellMetaColumn.rows[0]?.ready_count ?? 0) === 1
1033
1053
  );
1034
1054
  };
1035
1055
  try {
@@ -1121,6 +1141,17 @@ async function readRuntimeSheetSchemaDiagnostic(
1121
1141
  hasDefault: state?.column_default != null,
1122
1142
  };
1123
1143
  }),
1144
+ cellMetaColumnState: (() => {
1145
+ const state = visibleColumns.rows.find(
1146
+ (column) =>
1147
+ column.column_name === RUNTIME_SHEET_CELL_META_COLUMN.name,
1148
+ );
1149
+ return {
1150
+ dataType: state?.data_type ?? null,
1151
+ isNullable: state?.is_nullable ?? null,
1152
+ hasDefault: state?.column_default != null,
1153
+ };
1154
+ })(),
1124
1155
  };
1125
1156
  };
1126
1157
  try {
@@ -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,