deepline 0.3.263 → 0.3.264

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.263',
203
+ version: '0.3.264',
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: {
@@ -1152,6 +1152,7 @@ export type PostgresSchedulerSchemaShapeRequirements = Readonly<{
1152
1152
  /** v38 makes buffered Gradient2 observations idempotent; v37 ignores it. */
1153
1153
  gradient2ObservationDeduplication?: boolean;
1154
1154
  outboxWakeTrigger?: boolean;
1155
+ gatewayReaderFence?: boolean;
1155
1156
  cronScheduleSchema?: boolean;
1156
1157
  /** v43 added per-run fair-share tracking for rate buckets; v42 ignores it. */
1157
1158
  rateRequesterFairShare?: boolean;
@@ -1448,7 +1449,7 @@ export async function hasCurrentPostgresSchedulerSchemaShape(
1448
1449
  AND to_regclass($15) IS NOT NULL
1449
1450
  AND to_regclass($17) IS NOT NULL
1450
1451
  AND to_regclass($18) IS NOT NULL
1451
- AND to_regclass($20) IS NOT NULL
1452
+ AND ($39::boolean = false OR to_regclass($20) IS NOT NULL)
1452
1453
  AND to_regclass($21) IS NOT NULL
1453
1454
  AND to_regclass($22) IS NOT NULL
1454
1455
  AND ($24::boolean = false OR to_regclass($23) IS NOT NULL)
@@ -1833,6 +1834,7 @@ export async function hasCurrentPostgresSchedulerSchemaShape(
1833
1834
  requirements.rateScopeRetryAfter !== false,
1834
1835
  `${quotedSchema}.${quoteIdent('rate_scope_holds')}`,
1835
1836
  requirements.runtimeLogStorage !== false,
1837
+ requirements.gatewayReaderFence !== false,
1836
1838
  ],
1837
1839
  );
1838
1840
  if (currentShape.rows[0]?.ready !== true) return false;
@@ -2016,6 +2018,40 @@ export async function hasCurrentPostgresSchedulerSchemaShape(
2016
2018
  return runtimeAdminIndexes.rows[0]?.ready === true;
2017
2019
  }
2018
2020
 
2021
+ async function ensurePostgresSchedulerCanonicalOutcomeColumns(
2022
+ client: PostgresSchedulerQueryClient,
2023
+ options?: Pick<PostgresSchedulerOptions, 'schema'>,
2024
+ ): Promise<void> {
2025
+ await client.query(`
2026
+ ALTER TABLE ${tableName('integration_invocation_receipts', options)}
2027
+ ADD COLUMN IF NOT EXISTS operation_request_digest text,
2028
+ ADD COLUMN IF NOT EXISTS legacy_request_fingerprint text,
2029
+ ADD COLUMN IF NOT EXISTS canonical_outcome_version smallint,
2030
+ ADD COLUMN IF NOT EXISTS canonical_outcome_json jsonb,
2031
+ ADD COLUMN IF NOT EXISTS canonical_outcome_ref jsonb,
2032
+ ADD COLUMN IF NOT EXISTS canonical_outcome_pending_ref jsonb
2033
+ `);
2034
+ }
2035
+
2036
+ async function ensurePostgresSchedulerGatewayReaderFenceSchema(
2037
+ client: PostgresSchedulerQueryClient,
2038
+ options?: Pick<PostgresSchedulerOptions, 'schema'>,
2039
+ ): Promise<void> {
2040
+ await client.query(`
2041
+ CREATE TABLE IF NOT EXISTS ${tableName('runtime_gateway_reader_fences', options)} (
2042
+ scheduler_schema text PRIMARY KEY,
2043
+ epoch bigint NOT NULL CHECK (epoch > 0),
2044
+ mode text NOT NULL CHECK (mode IN ('legacy_byte_reader', 'canonical_v1')),
2045
+ canonical_reader_proof jsonb,
2046
+ updated_at timestamptz NOT NULL DEFAULT now(),
2047
+ CHECK (
2048
+ (mode = 'legacy_byte_reader' AND canonical_reader_proof IS NULL)
2049
+ OR (mode = 'canonical_v1' AND canonical_reader_proof IS NOT NULL)
2050
+ )
2051
+ )
2052
+ `);
2053
+ }
2054
+
2019
2055
  /**
2020
2056
  * Expand the shared scheduler schema without retaining locks across tables.
2021
2057
  *
@@ -2039,11 +2075,7 @@ export async function ensurePostgresSchedulerOnlineAdditiveExpansion(
2039
2075
  ALTER TABLE ${tableName('receipts', options)}
2040
2076
  ADD COLUMN IF NOT EXISTS output_ref jsonb
2041
2077
  `);
2042
- await client.query(`
2043
- ALTER TABLE ${tableName('integration_invocation_receipts', options)}
2044
- ADD COLUMN IF NOT EXISTS canonical_outcome_ref jsonb,
2045
- ADD COLUMN IF NOT EXISTS canonical_outcome_pending_ref jsonb
2046
- `);
2078
+ await ensurePostgresSchedulerCanonicalOutcomeColumns(client, options);
2047
2079
  await client.query(`
2048
2080
  CREATE TABLE IF NOT EXISTS ${tableName(
2049
2081
  'runtime_integration_operation_value_retirements',
@@ -2074,6 +2106,7 @@ export async function ensurePostgresSchedulerOnlineAdditiveExpansion(
2074
2106
  )} (state, updated_at)
2075
2107
  `);
2076
2108
  await ensurePostgresSchedulerRunLogStorageExpansion(client, options);
2109
+ await ensurePostgresSchedulerGatewayReaderFenceSchema(client, options);
2077
2110
  }
2078
2111
 
2079
2112
  /** Deployment-only expansion; absent values keep legacy storage authoritative. */
@@ -2228,7 +2261,7 @@ async function ensurePostgresSchedulerTerminalComputeBillingOutboxTrigger(
2228
2261
  * future lifecycle producers. LISTEN/NOTIFY is only a hint; the projector
2229
2262
  * still leases and reads the durable outbox before delivery.
2230
2263
  */
2231
- async function ensurePostgresSchedulerOutboxWakeTrigger(
2264
+ export async function ensurePostgresSchedulerOutboxWakeTrigger(
2232
2265
  client: PostgresSchedulerQueryClient,
2233
2266
  options?: Pick<PostgresSchedulerOptions, 'schema'>,
2234
2267
  ): Promise<void> {
@@ -3169,15 +3202,7 @@ export async function ensurePostgresSchedulerSchema(
3169
3202
  // historical transport records, not inferred canonical outcomes; gateway
3170
3203
  // replay keeps serving them byte-for-byte while the new operation Module
3171
3204
  // fails closed rather than redispatching or guessing their semantics.
3172
- await client.query(`
3173
- ALTER TABLE ${tableName('integration_invocation_receipts', options)}
3174
- ADD COLUMN IF NOT EXISTS operation_request_digest text,
3175
- ADD COLUMN IF NOT EXISTS legacy_request_fingerprint text,
3176
- ADD COLUMN IF NOT EXISTS canonical_outcome_version smallint,
3177
- ADD COLUMN IF NOT EXISTS canonical_outcome_json jsonb,
3178
- ADD COLUMN IF NOT EXISTS canonical_outcome_ref jsonb,
3179
- ADD COLUMN IF NOT EXISTS canonical_outcome_pending_ref jsonb
3180
- `);
3205
+ await ensurePostgresSchedulerCanonicalOutcomeColumns(client, options);
3181
3206
  await client.query(`
3182
3207
  ALTER TABLE ${tableName('integration_invocation_receipts', options)}
3183
3208
  ADD COLUMN IF NOT EXISTS parent_run_id text NOT NULL DEFAULT ''
@@ -3218,19 +3243,7 @@ export async function ensurePostgresSchedulerSchema(
3218
3243
  // intentionally separate from runtime release admission: worker lanes do
3219
3244
  // not prove that every receipt/execution gateway can decode canonical IO
3220
3245
  // rows. Convex owns the source record; this is its local gateway mirror.
3221
- await client.query(`
3222
- CREATE TABLE IF NOT EXISTS ${tableName('runtime_gateway_reader_fences', options)} (
3223
- scheduler_schema text PRIMARY KEY,
3224
- epoch bigint NOT NULL CHECK (epoch > 0),
3225
- mode text NOT NULL CHECK (mode IN ('legacy_byte_reader', 'canonical_v1')),
3226
- canonical_reader_proof jsonb,
3227
- updated_at timestamptz NOT NULL DEFAULT now(),
3228
- CHECK (
3229
- (mode = 'legacy_byte_reader' AND canonical_reader_proof IS NULL)
3230
- OR (mode = 'canonical_v1' AND canonical_reader_proof IS NOT NULL)
3231
- )
3232
- )
3233
- `);
3246
+ await ensurePostgresSchedulerGatewayReaderFenceSchema(client, options);
3234
3247
  await client.query(`
3235
3248
  CREATE INDEX IF NOT EXISTS ${quoteIdent(
3236
3249
  `${schema}_integration_invocation_state_updated_idx`,
package/dist/cli/index.js CHANGED
@@ -3512,7 +3512,7 @@ var SDK_RELEASE = {
3512
3512
  // getters keep their established compatibility behavior.
3513
3513
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
3514
3514
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
3515
- version: "0.3.263",
3515
+ version: "0.3.264",
3516
3516
  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.",
3517
3517
  packageCapabilities: {
3518
3518
  updatePreferences: 1
@@ -38592,6 +38592,7 @@ async function buildPlanArgs(args) {
38592
38592
  "--with-force",
38593
38593
  "--timeout",
38594
38594
  "--profile",
38595
+ "--run-id-file",
38595
38596
  "--max-credits-per-run"
38596
38597
  ]);
38597
38598
  const localBooleanOptions = /* @__PURE__ */ new Set([
@@ -39024,41 +39025,34 @@ async function stopGeneratedEnrichRunAfterWatchError(client2, error) {
39024
39025
  }).catch(() => void 0);
39025
39026
  }
39026
39027
  async function runGeneratedEnrichPlay(client2, runArgs, options = {}) {
39027
- for (let attempt = 0; attempt < 2; attempt += 1) {
39028
+ const maxAttempts = runArgs.includes("--run-id-file") ? 1 : 2;
39029
+ for (let attempt = 0; attempt < maxAttempts; attempt += 1) {
39028
39030
  try {
39029
- let terminalStatus2 = null;
39030
- const captured2 = await captureStdout(
39031
+ let terminalStatus = null;
39032
+ const captured = await captureStdout(
39031
39033
  () => handlePlayRun(runArgs, {
39032
39034
  onRunStarted: options.onRunStarted,
39033
39035
  onTerminalStatus: (status) => {
39034
- terminalStatus2 = status;
39036
+ terminalStatus = status;
39035
39037
  }
39036
39038
  }),
39037
39039
  {
39038
39040
  passthrough: options.passthroughStdout
39039
39041
  }
39040
39042
  );
39041
- return { ...captured2, terminalStatus: terminalStatus2 };
39043
+ return { ...captured, terminalStatus };
39042
39044
  } catch (error) {
39043
39045
  await stopGeneratedEnrichRunAfterWatchError(client2, error);
39044
- if (attempt === 0 && isPlayStartStreamEndedError(error)) {
39046
+ if (attempt + 1 < maxAttempts && isPlayStartStreamEndedError(error)) {
39045
39047
  await sleep7(250);
39046
39048
  continue;
39047
39049
  }
39048
39050
  throw error;
39049
39051
  }
39050
39052
  }
39051
- let terminalStatus = null;
39052
- const captured = await captureStdout(
39053
- () => handlePlayRun(runArgs, {
39054
- onRunStarted: options.onRunStarted,
39055
- onTerminalStatus: (status) => {
39056
- terminalStatus = status;
39057
- }
39058
- }),
39059
- { passthrough: options.passthroughStdout }
39053
+ throw new Error(
39054
+ "Generated enrich invocation exhausted its allowed attempts."
39060
39055
  );
39061
- return { ...captured, terminalStatus };
39062
39056
  }
39063
39057
  function writeEnrichInterruptionHint(input2) {
39064
39058
  const output2 = input2.outputPath ? ` --out ${input2.outputPath}` : "";
@@ -41602,7 +41596,10 @@ function registerEnrichCommand(program) {
41602
41596
  optionTerm(option) {
41603
41597
  return option.long === "--timeout" ? "--timeout SECONDS" : option.flags;
41604
41598
  }
41605
- }).option("--input <path>", "Input CSV path.").option("--csv <path>", "Alias for --input.").option("--output <path>", "Output CSV path.").option("--config <path>", "JSON enrich config.").requiredOption(
41599
+ }).option("--input <path>", "Input CSV path.").option("--csv <path>", "Alias for --input.").option("--output <path>", "Output CSV path.").option(
41600
+ "--run-id-file <path>",
41601
+ "Persist the allocated and confirmed run identity for cancellation and recovery."
41602
+ ).option("--config <path>", "JSON enrich config.").requiredOption(
41606
41603
  "--name <name>",
41607
41604
  "Name for the compiled enrich play. Reuse a name to keep iterating on the same play; use a new name for a distinct enrichment so runs stay separate in the run ledger and share URLs."
41608
41605
  ).option(
@@ -41815,6 +41812,9 @@ function registerEnrichCommand(program) {
41815
41812
  JSON.stringify(runtimeInput),
41816
41813
  "--watch"
41817
41814
  ];
41815
+ if (options.runIdFile) {
41816
+ runArgs.push("--run-id-file", options.runIdFile);
41817
+ }
41818
41818
  if (options.profile) {
41819
41819
  runArgs.push("--profile", options.profile);
41820
41820
  }
@@ -3507,7 +3507,7 @@ var SDK_RELEASE = {
3507
3507
  // getters keep their established compatibility behavior.
3508
3508
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
3509
3509
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
3510
- version: "0.3.263",
3510
+ version: "0.3.264",
3511
3511
  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.",
3512
3512
  packageCapabilities: {
3513
3513
  updatePreferences: 1
@@ -38665,6 +38665,7 @@ async function buildPlanArgs(args) {
38665
38665
  "--with-force",
38666
38666
  "--timeout",
38667
38667
  "--profile",
38668
+ "--run-id-file",
38668
38669
  "--max-credits-per-run"
38669
38670
  ]);
38670
38671
  const localBooleanOptions = /* @__PURE__ */ new Set([
@@ -39097,41 +39098,34 @@ async function stopGeneratedEnrichRunAfterWatchError(client2, error) {
39097
39098
  }).catch(() => void 0);
39098
39099
  }
39099
39100
  async function runGeneratedEnrichPlay(client2, runArgs, options = {}) {
39100
- for (let attempt = 0; attempt < 2; attempt += 1) {
39101
+ const maxAttempts = runArgs.includes("--run-id-file") ? 1 : 2;
39102
+ for (let attempt = 0; attempt < maxAttempts; attempt += 1) {
39101
39103
  try {
39102
- let terminalStatus2 = null;
39103
- const captured2 = await captureStdout(
39104
+ let terminalStatus = null;
39105
+ const captured = await captureStdout(
39104
39106
  () => handlePlayRun(runArgs, {
39105
39107
  onRunStarted: options.onRunStarted,
39106
39108
  onTerminalStatus: (status) => {
39107
- terminalStatus2 = status;
39109
+ terminalStatus = status;
39108
39110
  }
39109
39111
  }),
39110
39112
  {
39111
39113
  passthrough: options.passthroughStdout
39112
39114
  }
39113
39115
  );
39114
- return { ...captured2, terminalStatus: terminalStatus2 };
39116
+ return { ...captured, terminalStatus };
39115
39117
  } catch (error) {
39116
39118
  await stopGeneratedEnrichRunAfterWatchError(client2, error);
39117
- if (attempt === 0 && isPlayStartStreamEndedError(error)) {
39119
+ if (attempt + 1 < maxAttempts && isPlayStartStreamEndedError(error)) {
39118
39120
  await sleep7(250);
39119
39121
  continue;
39120
39122
  }
39121
39123
  throw error;
39122
39124
  }
39123
39125
  }
39124
- let terminalStatus = null;
39125
- const captured = await captureStdout(
39126
- () => handlePlayRun(runArgs, {
39127
- onRunStarted: options.onRunStarted,
39128
- onTerminalStatus: (status) => {
39129
- terminalStatus = status;
39130
- }
39131
- }),
39132
- { passthrough: options.passthroughStdout }
39126
+ throw new Error(
39127
+ "Generated enrich invocation exhausted its allowed attempts."
39133
39128
  );
39134
- return { ...captured, terminalStatus };
39135
39129
  }
39136
39130
  function writeEnrichInterruptionHint(input2) {
39137
39131
  const output2 = input2.outputPath ? ` --out ${input2.outputPath}` : "";
@@ -41675,7 +41669,10 @@ function registerEnrichCommand(program) {
41675
41669
  optionTerm(option) {
41676
41670
  return option.long === "--timeout" ? "--timeout SECONDS" : option.flags;
41677
41671
  }
41678
- }).option("--input <path>", "Input CSV path.").option("--csv <path>", "Alias for --input.").option("--output <path>", "Output CSV path.").option("--config <path>", "JSON enrich config.").requiredOption(
41672
+ }).option("--input <path>", "Input CSV path.").option("--csv <path>", "Alias for --input.").option("--output <path>", "Output CSV path.").option(
41673
+ "--run-id-file <path>",
41674
+ "Persist the allocated and confirmed run identity for cancellation and recovery."
41675
+ ).option("--config <path>", "JSON enrich config.").requiredOption(
41679
41676
  "--name <name>",
41680
41677
  "Name for the compiled enrich play. Reuse a name to keep iterating on the same play; use a new name for a distinct enrichment so runs stay separate in the run ledger and share URLs."
41681
41678
  ).option(
@@ -41888,6 +41885,9 @@ function registerEnrichCommand(program) {
41888
41885
  JSON.stringify(runtimeInput),
41889
41886
  "--watch"
41890
41887
  ];
41888
+ if (options.runIdFile) {
41889
+ runArgs.push("--run-id-file", options.runIdFile);
41890
+ }
41891
41891
  if (options.profile) {
41892
41892
  runArgs.push("--profile", options.profile);
41893
41893
  }
package/dist/index.js CHANGED
@@ -1325,7 +1325,7 @@ var SDK_RELEASE = {
1325
1325
  // getters keep their established compatibility behavior.
1326
1326
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
1327
1327
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
1328
- version: "0.3.263",
1328
+ version: "0.3.264",
1329
1329
  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.",
1330
1330
  packageCapabilities: {
1331
1331
  updatePreferences: 1
package/dist/index.mjs CHANGED
@@ -1229,7 +1229,7 @@ var SDK_RELEASE = {
1229
1229
  // getters keep their established compatibility behavior.
1230
1230
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
1231
1231
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
1232
- version: "0.3.263",
1232
+ version: "0.3.264",
1233
1233
  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.",
1234
1234
  packageCapabilities: {
1235
1235
  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.263";
152
+ readonly version: "0.3.264";
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.263";
152
+ readonly version: "0.3.264";
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.263",
77
+ version: "0.3.264",
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.263",
51
+ version: "0.3.264",
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.263",
3
+ "version": "0.3.264",
4
4
  "description": "GTM data CLI and TypeScript SDK for coding agents",
5
5
  "license": "MIT",
6
6
  "homepage": "https://code.deepline.com",