deepline 0.3.181 → 0.3.182
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.
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +91 -39
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.mjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +1 -1
- package/dist/release.mjs +1 -1
- package/package.json +1 -1
|
@@ -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
|
+
version: '0.3.182',
|
|
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: {
|
|
@@ -13126,6 +13126,22 @@ function postgresSchedulerReceiptLeaseId(input: {
|
|
|
13126
13126
|
: null;
|
|
13127
13127
|
}
|
|
13128
13128
|
|
|
13129
|
+
function postgresSchedulerReceiptOwnerIsTerminalSql(
|
|
13130
|
+
receiptTableReference: string,
|
|
13131
|
+
options?: Pick<PostgresSchedulerOptions, 'schema'>,
|
|
13132
|
+
): string {
|
|
13133
|
+
return `EXISTS (
|
|
13134
|
+
SELECT 1
|
|
13135
|
+
FROM ${tableName('runs', options)} AS receipt_owner_run
|
|
13136
|
+
WHERE receipt_owner_run.run_id = COALESCE(
|
|
13137
|
+
${receiptTableReference}.lease_owner_run_id,
|
|
13138
|
+
${receiptTableReference}.run_id
|
|
13139
|
+
)
|
|
13140
|
+
AND receipt_owner_run.org_id = ${receiptTableReference}.org_id
|
|
13141
|
+
AND receipt_owner_run.status IN ('completed', 'failed', 'cancelled')
|
|
13142
|
+
)`;
|
|
13143
|
+
}
|
|
13144
|
+
|
|
13129
13145
|
function mapReceiptRow(row: ReceiptRow): RuntimeStepReceipt {
|
|
13130
13146
|
const leaseExpiresAt = row.lease_expires_at;
|
|
13131
13147
|
const outputRef = isRuntimeReceiptValueReference(row.output_ref)
|
|
@@ -13429,6 +13445,11 @@ export async function claimPostgresSchedulerReceipt(
|
|
|
13429
13445
|
);
|
|
13430
13446
|
const leaseId =
|
|
13431
13447
|
input.leaseId?.trim() || postgresSchedulerReceiptLeaseId(input);
|
|
13448
|
+
const receiptTable = tableName('receipts', options);
|
|
13449
|
+
const ownerIsTerminal = postgresSchedulerReceiptOwnerIsTerminalSql(
|
|
13450
|
+
receiptTable,
|
|
13451
|
+
options,
|
|
13452
|
+
);
|
|
13432
13453
|
const result = await client.query<ReceiptRow & { claim_state: string }>(
|
|
13433
13454
|
`
|
|
13434
13455
|
WITH terminal AS (
|
|
@@ -13436,14 +13457,14 @@ export async function claimPostgresSchedulerReceipt(
|
|
|
13436
13457
|
-- explicitly forces refresh. Read them before the UPSERT so popular
|
|
13437
13458
|
-- prebuilt keys do not take a conflicting-row lock or create WAL.
|
|
13438
13459
|
SELECT k, status, output_json, output_ref, error, error_payload, failure_kind, run_id, lease_id, lease_owner_run_id, lease_owner_attempt, lease_expires_at
|
|
13439
|
-
FROM ${
|
|
13460
|
+
FROM ${receiptTable}
|
|
13440
13461
|
WHERE org_id = $9
|
|
13441
13462
|
AND k = $1
|
|
13442
13463
|
AND status IN ('completed', 'skipped')
|
|
13443
13464
|
AND ($7::boolean IS NOT TRUE OR run_id = $2)
|
|
13444
13465
|
),
|
|
13445
13466
|
claimed AS (
|
|
13446
|
-
INSERT INTO ${
|
|
13467
|
+
INSERT INTO ${receiptTable} (
|
|
13447
13468
|
org_id,
|
|
13448
13469
|
k,
|
|
13449
13470
|
status,
|
|
@@ -13484,33 +13505,45 @@ export async function claimPostgresSchedulerReceipt(
|
|
|
13484
13505
|
error_payload = NULL,
|
|
13485
13506
|
failure_kind = 0,
|
|
13486
13507
|
updated_at = now()
|
|
13487
|
-
WHERE ${
|
|
13488
|
-
AND ${
|
|
13508
|
+
WHERE ${receiptTable}.status = ANY($3::text[])
|
|
13509
|
+
AND ${receiptTable}.org_id = $9
|
|
13489
13510
|
AND (
|
|
13490
|
-
${
|
|
13511
|
+
${receiptTable}.status <> 'failed'
|
|
13491
13512
|
OR $7::boolean
|
|
13492
13513
|
OR $8::boolean
|
|
13493
|
-
OR ${
|
|
13514
|
+
OR ${receiptTable}.run_id IS DISTINCT FROM $2
|
|
13494
13515
|
)
|
|
13495
13516
|
AND (
|
|
13496
|
-
|
|
13497
|
-
|
|
13498
|
-
AND ${
|
|
13499
|
-
|
|
13517
|
+
(
|
|
13518
|
+
${receiptTable}.status IN ('queued', 'running')
|
|
13519
|
+
AND ${ownerIsTerminal}
|
|
13520
|
+
)
|
|
13500
13521
|
OR (
|
|
13501
|
-
|
|
13502
|
-
|
|
13503
|
-
|
|
13504
|
-
|
|
13505
|
-
|
|
13506
|
-
|
|
13507
|
-
|
|
13508
|
-
|
|
13509
|
-
|
|
13510
|
-
|
|
13511
|
-
|
|
13512
|
-
|
|
13513
|
-
|
|
13522
|
+
(
|
|
13523
|
+
${receiptTable}.status NOT IN ('queued', 'running')
|
|
13524
|
+
OR $10::boolean
|
|
13525
|
+
)
|
|
13526
|
+
AND (
|
|
13527
|
+
${receiptTable}.status = 'failed'
|
|
13528
|
+
OR ${receiptTable}.lease_id IS NULL
|
|
13529
|
+
AND ${receiptTable}.lease_expires_at IS NULL
|
|
13530
|
+
OR ${receiptTable}.lease_expires_at <= now()
|
|
13531
|
+
OR (
|
|
13532
|
+
-- Billed-implies-durable: a higher scheduler invocation must never
|
|
13533
|
+
-- steal a live work-receipt lease while the prior invocation may
|
|
13534
|
+
-- still be inside a provider call. Same-run reclaims are allowed
|
|
13535
|
+
-- only after the lease TTL proves the prior attempt is dead.
|
|
13536
|
+
${receiptTable}.lease_id IS NOT NULL
|
|
13537
|
+
AND ${receiptTable}.lease_expires_at IS NOT NULL
|
|
13538
|
+
AND ${receiptTable}.lease_expires_at <= now()
|
|
13539
|
+
AND
|
|
13540
|
+
COALESCE(
|
|
13541
|
+
${receiptTable}.lease_owner_run_id,
|
|
13542
|
+
${receiptTable}.run_id
|
|
13543
|
+
) = $2
|
|
13544
|
+
AND COALESCE(${receiptTable}.lease_owner_attempt, 0) < $5::integer
|
|
13545
|
+
)
|
|
13546
|
+
)
|
|
13514
13547
|
)
|
|
13515
13548
|
)
|
|
13516
13549
|
RETURNING k, status, output_json, output_ref, error, error_payload, failure_kind, run_id, lease_id, lease_owner_run_id, lease_owner_attempt, lease_expires_at
|
|
@@ -13530,13 +13563,14 @@ export async function claimPostgresSchedulerReceipt(
|
|
|
13530
13563
|
? ['pending', 'failed', 'running', 'completed', 'skipped']
|
|
13531
13564
|
: input.reclaimRunning
|
|
13532
13565
|
? ['pending', 'failed', 'running']
|
|
13533
|
-
: ['pending', 'failed'],
|
|
13566
|
+
: ['pending', 'failed', 'queued', 'running'],
|
|
13534
13567
|
leaseId,
|
|
13535
13568
|
runAttempt,
|
|
13536
13569
|
PLAY_RUNTIME_WORK_RECEIPT_LEASE_TTL_MS,
|
|
13537
13570
|
input.forceRefresh === true,
|
|
13538
13571
|
input.forceFailedRefresh === true,
|
|
13539
13572
|
receiptOrgId(options),
|
|
13573
|
+
input.forceRefresh === true || input.reclaimRunning === true,
|
|
13540
13574
|
],
|
|
13541
13575
|
);
|
|
13542
13576
|
if (result.rows[0]) {
|
|
@@ -13581,6 +13615,11 @@ export async function claimPostgresSchedulerReceipts(
|
|
|
13581
13615
|
const providedLeaseId = input.leaseIds?.[index]?.trim();
|
|
13582
13616
|
return providedLeaseId || postgresSchedulerReceiptLeaseId(input);
|
|
13583
13617
|
});
|
|
13618
|
+
const receiptTable = tableName('receipts', options);
|
|
13619
|
+
const ownerIsTerminal = postgresSchedulerReceiptOwnerIsTerminalSql(
|
|
13620
|
+
receiptTable,
|
|
13621
|
+
options,
|
|
13622
|
+
);
|
|
13584
13623
|
const result = await client.query<ReceiptRow & { claim_state?: string }>(
|
|
13585
13624
|
`
|
|
13586
13625
|
WITH inputs AS (
|
|
@@ -13608,7 +13647,7 @@ export async function claimPostgresSchedulerReceipts(
|
|
|
13608
13647
|
receipt.lease_expires_at,
|
|
13609
13648
|
inputs.ord
|
|
13610
13649
|
FROM inputs
|
|
13611
|
-
JOIN ${
|
|
13650
|
+
JOIN ${receiptTable} AS receipt
|
|
13612
13651
|
ON receipt.org_id = $10
|
|
13613
13652
|
AND receipt.k = inputs.k
|
|
13614
13653
|
WHERE receipt.status IN ('completed', 'skipped')
|
|
@@ -13628,7 +13667,7 @@ export async function claimPostgresSchedulerReceipts(
|
|
|
13628
13667
|
ORDER BY inputs.k, inputs.ord
|
|
13629
13668
|
),
|
|
13630
13669
|
claimed AS (
|
|
13631
|
-
INSERT INTO ${
|
|
13670
|
+
INSERT INTO ${receiptTable} (
|
|
13632
13671
|
org_id,
|
|
13633
13672
|
k,
|
|
13634
13673
|
status,
|
|
@@ -13668,19 +13707,31 @@ export async function claimPostgresSchedulerReceipts(
|
|
|
13668
13707
|
error_payload = NULL,
|
|
13669
13708
|
failure_kind = 0,
|
|
13670
13709
|
updated_at = now()
|
|
13671
|
-
WHERE ${
|
|
13672
|
-
AND ${
|
|
13710
|
+
WHERE ${receiptTable}.status = ANY($3::text[])
|
|
13711
|
+
AND ${receiptTable}.org_id = $10
|
|
13673
13712
|
AND (
|
|
13674
|
-
${
|
|
13713
|
+
${receiptTable}.status <> 'failed'
|
|
13675
13714
|
OR $7::boolean
|
|
13676
13715
|
OR $8::boolean
|
|
13677
|
-
OR ${
|
|
13716
|
+
OR ${receiptTable}.run_id IS DISTINCT FROM $2
|
|
13678
13717
|
)
|
|
13679
13718
|
AND (
|
|
13680
|
-
|
|
13681
|
-
|
|
13682
|
-
AND ${
|
|
13683
|
-
|
|
13719
|
+
(
|
|
13720
|
+
${receiptTable}.status IN ('queued', 'running')
|
|
13721
|
+
AND ${ownerIsTerminal}
|
|
13722
|
+
)
|
|
13723
|
+
OR (
|
|
13724
|
+
(
|
|
13725
|
+
${receiptTable}.status NOT IN ('queued', 'running')
|
|
13726
|
+
OR $11::boolean
|
|
13727
|
+
)
|
|
13728
|
+
AND (
|
|
13729
|
+
${receiptTable}.status = 'failed'
|
|
13730
|
+
OR ${receiptTable}.lease_id IS NULL
|
|
13731
|
+
AND ${receiptTable}.lease_expires_at IS NULL
|
|
13732
|
+
OR ${receiptTable}.lease_expires_at <= now()
|
|
13733
|
+
)
|
|
13734
|
+
)
|
|
13684
13735
|
)
|
|
13685
13736
|
RETURNING k, status, output_json, output_ref, error, error_payload, failure_kind, run_id, lease_id, lease_owner_run_id, lease_owner_attempt, lease_expires_at
|
|
13686
13737
|
),
|
|
@@ -13703,7 +13754,7 @@ export async function claimPostgresSchedulerReceipts(
|
|
|
13703
13754
|
AS replayed_claim,
|
|
13704
13755
|
inputs.ord
|
|
13705
13756
|
FROM inputs
|
|
13706
|
-
JOIN ${
|
|
13757
|
+
JOIN ${receiptTable} AS receipt
|
|
13707
13758
|
ON receipt.org_id = $10
|
|
13708
13759
|
AND receipt.k = inputs.k
|
|
13709
13760
|
WHERE (
|
|
@@ -13801,7 +13852,7 @@ export async function claimPostgresSchedulerReceipts(
|
|
|
13801
13852
|
? ['pending', 'failed', 'running', 'completed', 'skipped']
|
|
13802
13853
|
: input.reclaimRunning
|
|
13803
13854
|
? ['pending', 'failed', 'running']
|
|
13804
|
-
: ['pending', 'failed'],
|
|
13855
|
+
: ['pending', 'failed', 'queued', 'running'],
|
|
13805
13856
|
leaseIds,
|
|
13806
13857
|
runAttempt,
|
|
13807
13858
|
PLAY_RUNTIME_WORK_RECEIPT_LEASE_TTL_MS,
|
|
@@ -13809,6 +13860,7 @@ export async function claimPostgresSchedulerReceipts(
|
|
|
13809
13860
|
input.forceFailedRefresh === true,
|
|
13810
13861
|
input.forceRefresh === true,
|
|
13811
13862
|
receiptOrgId(options),
|
|
13863
|
+
input.forceRefresh === true || input.reclaimRunning === true,
|
|
13812
13864
|
],
|
|
13813
13865
|
);
|
|
13814
13866
|
return result.rows.map((row) =>
|
|
@@ -14511,9 +14563,9 @@ export async function releasePostgresSchedulerReceipt(
|
|
|
14511
14563
|
|
|
14512
14564
|
/**
|
|
14513
14565
|
* The write that returns a claimed receipt to the free pool. Every release
|
|
14514
|
-
* path shares it so a successor's non-forced claim
|
|
14515
|
-
*
|
|
14516
|
-
*
|
|
14566
|
+
* path shares it so a successor's non-forced claim always matches what a dead
|
|
14567
|
+
* owner left behind. Claimers also understand terminal ownership directly so
|
|
14568
|
+
* a later writer release can stop rewriting every receipt synchronously.
|
|
14517
14569
|
*/
|
|
14518
14570
|
const RELEASE_RECEIPT_TO_PENDING_SET_CLAUSE = `status = 'pending',
|
|
14519
14571
|
output_json = NULL,
|
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.
|
|
3054
|
+
version: "0.3.182",
|
|
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
|
package/dist/cli/index.mjs
CHANGED
|
@@ -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.
|
|
3049
|
+
version: "0.3.182",
|
|
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.
|
|
867
|
+
version: "0.3.182",
|
|
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.
|
|
771
|
+
version: "0.3.182",
|
|
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
|
package/dist/release.d.mts
CHANGED
|
@@ -149,7 +149,7 @@ type SdkRelease = {
|
|
|
149
149
|
supportPolicy: SdkSupportPolicy;
|
|
150
150
|
};
|
|
151
151
|
declare const SDK_RELEASE: {
|
|
152
|
-
readonly version: "0.3.
|
|
152
|
+
readonly version: "0.3.182";
|
|
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.
|
|
152
|
+
readonly version: "0.3.182";
|
|
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.
|
|
77
|
+
version: "0.3.182",
|
|
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.
|
|
51
|
+
version: "0.3.182",
|
|
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
|