deepline 0.2.42 → 0.2.44
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/client.ts +6 -7
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/integrations/theirstack-execution-policy.ts +21 -0
- package/dist/bundling-sources/shared_libs/play-runtime/receipt-sql.ts +20 -7
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +6 -3
- package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +3 -1
- package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-state-machine.ts +26 -0
- package/dist/cli/index.js +44 -11
- package/dist/cli/index.mjs +44 -11
- package/dist/index.js +13 -4
- package/dist/index.mjs +13 -4
- package/dist/viewer/viewer.css +366 -88
- package/dist/viewer/viewer.js +404 -37
- package/package.json +1 -1
|
@@ -86,10 +86,7 @@ import type { PlayStagedFileRef } from './plays/local-file-discovery.js';
|
|
|
86
86
|
import type { PlayCompilerManifest } from '../../shared_libs/plays/compiler-manifest.js';
|
|
87
87
|
import type { EnrichCompiledConfig } from './cli/enrich-play-compiler.js';
|
|
88
88
|
import { RUNTIME_ENVIRONMENT_TOKEN_HEADER } from '../../shared_libs/play-runtime/coordinator-headers.js';
|
|
89
|
-
import {
|
|
90
|
-
THEIRSTACK_SLOW_JOB_SEARCH_CLIENT_TIMEOUT_MS,
|
|
91
|
-
usesExtendedTheirstackJobSearchBudget,
|
|
92
|
-
} from '../../shared_libs/integrations/theirstack-execution-policy.js';
|
|
89
|
+
import { resolveTheirstackClientTimeoutMs } from '../../shared_libs/integrations/theirstack-execution-policy.js';
|
|
93
90
|
import {
|
|
94
91
|
normalizePlayRuntimeEnvironment,
|
|
95
92
|
normalizePlayRuntimeNamespace,
|
|
@@ -424,9 +421,11 @@ function resolveToolExecuteTimeoutMs(
|
|
|
424
421
|
// Provider-specific slow-request policies live in shared modules so the SDK
|
|
425
422
|
// and server classify the same payloads. If more providers need this, replace
|
|
426
423
|
// these individual checks with a shared policy registry, not a wider default.
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
424
|
+
const theirstackTimeoutMs = resolveTheirstackClientTimeoutMs(
|
|
425
|
+
normalized,
|
|
426
|
+
input,
|
|
427
|
+
);
|
|
428
|
+
if (theirstackTimeoutMs !== null) return theirstackTimeoutMs;
|
|
430
429
|
return normalized === 'deeplineagent' ||
|
|
431
430
|
normalized === 'deeplineagent_deeplineagent' ||
|
|
432
431
|
normalized === 'ai_inference' ||
|
|
@@ -160,7 +160,7 @@ export const SDK_RELEASE = {
|
|
|
160
160
|
// 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
|
|
161
161
|
// exposed storage-dependent synchronous access. This deliberate minor
|
|
162
162
|
// release keeps lazy paging semantics independent of row residency.
|
|
163
|
-
version: '0.2.
|
|
163
|
+
version: '0.2.44',
|
|
164
164
|
contracts: {
|
|
165
165
|
api: {
|
|
166
166
|
name: 'sdk-http-api',
|
|
@@ -23,6 +23,14 @@ export const THEIRSTACK_SLOW_JOB_SEARCH_PROVIDER_TIMEOUT_MS = 135_000;
|
|
|
23
23
|
export const THEIRSTACK_SLOW_JOB_SEARCH_CLIENT_TIMEOUT_MS =
|
|
24
24
|
60_000 + THEIRSTACK_SLOW_JOB_SEARCH_PROVIDER_TIMEOUT_MS + 15_000;
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* TheirStack company search is synchronous but can spend the full upstream
|
|
28
|
+
* request window before returning a large result set. The SDK default is only
|
|
29
|
+
* 60 seconds, so keep it alive through the server's 120-second provider
|
|
30
|
+
* deadline plus the same permit and response grace used for slow job search.
|
|
31
|
+
*/
|
|
32
|
+
export const THEIRSTACK_COMPANY_SEARCH_CLIENT_TIMEOUT_MS = 210_000;
|
|
33
|
+
|
|
26
34
|
const LONG_JOB_SEARCH_WINDOW_MS = 365 * 24 * 60 * 60 * 1_000;
|
|
27
35
|
const DATE_ONLY_PATTERN = /^\d{4}-\d{2}-\d{2}$/;
|
|
28
36
|
|
|
@@ -95,3 +103,16 @@ export function usesExtendedTheirstackJobSearchBudget(
|
|
|
95
103
|
? true
|
|
96
104
|
: usesLongExplicitDateWindow(payload);
|
|
97
105
|
}
|
|
106
|
+
|
|
107
|
+
/** SDK-only timeout selection. Provider request timeouts remain action-local. */
|
|
108
|
+
export function resolveTheirstackClientTimeoutMs(
|
|
109
|
+
endpointId: string,
|
|
110
|
+
payload: Record<string, unknown>,
|
|
111
|
+
): number | null {
|
|
112
|
+
if (endpointId === 'theirstack_company_search') {
|
|
113
|
+
return THEIRSTACK_COMPANY_SEARCH_CLIENT_TIMEOUT_MS;
|
|
114
|
+
}
|
|
115
|
+
return usesExtendedTheirstackJobSearchBudget(endpointId, payload)
|
|
116
|
+
? THEIRSTACK_SLOW_JOB_SEARCH_CLIENT_TIMEOUT_MS
|
|
117
|
+
: null;
|
|
118
|
+
}
|
|
@@ -5,12 +5,11 @@ import { workReceiptFailureKindCode } from './work-receipts';
|
|
|
5
5
|
// `isLegacyRepairableWorkReceiptError` in ./work-receipt-state-machine.ts.
|
|
6
6
|
// Write-side classification and this read-side reclaim gate share one contract:
|
|
7
7
|
// a receipt is repairable if its failure_kind is repairable, OR it is a legacy
|
|
8
|
-
// terminal receipt whose error text proves a
|
|
9
|
-
// transport, timeout,
|
|
10
|
-
//
|
|
11
|
-
// billing
|
|
12
|
-
//
|
|
13
|
-
// those receipts re-execute on the next run instead of replaying the failure.
|
|
8
|
+
// terminal receipt whose error text proves a later-run-repairable failure (5xx,
|
|
9
|
+
// transport, timeout, a transient billing-plane outage, or the structured
|
|
10
|
+
// insufficient-balance snapshot). These narrow legacy clauses are checked
|
|
11
|
+
// BEFORE the hard-billing exclusions so poisoned receipts re-execute on the
|
|
12
|
+
// next run instead of replaying stale mutable state.
|
|
14
13
|
export function workReceiptRepairableFailurePredicateSql(
|
|
15
14
|
receiptTable: string,
|
|
16
15
|
): string {
|
|
@@ -23,6 +22,10 @@ export function workReceiptRepairableFailurePredicateSql(
|
|
|
23
22
|
lower(${receiptTable}.error) LIKE '%billing_unavailable%'
|
|
24
23
|
OR lower(${receiptTable}.error) LIKE '%billing is temporarily unavailable%'
|
|
25
24
|
OR lower(${receiptTable}.error) LIKE '%billing temporarily unavailable%'
|
|
25
|
+
OR (
|
|
26
|
+
lower(${receiptTable}.error) LIKE '%workspace balance %'
|
|
27
|
+
AND lower(${receiptTable}.error) LIKE '% < required %'
|
|
28
|
+
)
|
|
26
29
|
OR (
|
|
27
30
|
lower(${receiptTable}.error) NOT LIKE '%billing cap%'
|
|
28
31
|
AND lower(${receiptTable}.error) NOT LIKE '%insufficient credits%'
|
|
@@ -77,7 +80,16 @@ export function workReceiptClaimConflictPredicateSql(input: {
|
|
|
77
80
|
const forceFailedRefreshSql = input.forceFailedRefreshSql ?? 'false';
|
|
78
81
|
return `${table}.status = ANY(${input.claimableStatusesSql}::smallint[])
|
|
79
82
|
AND (
|
|
80
|
-
|
|
83
|
+
(
|
|
84
|
+
${input.forceRefreshSql}::boolean
|
|
85
|
+
AND (
|
|
86
|
+
${table}.status NOT IN (
|
|
87
|
+
${RECEIPT_STATUS_CODE.completed}::smallint,
|
|
88
|
+
${RECEIPT_STATUS_CODE.skipped}::smallint
|
|
89
|
+
)
|
|
90
|
+
OR ${table}.run_id IS DISTINCT FROM ${input.claimantRunIdSql}
|
|
91
|
+
)
|
|
92
|
+
)
|
|
81
93
|
OR (
|
|
82
94
|
${forceFailedRefreshSql}::boolean
|
|
83
95
|
AND ${table}.status = ${RECEIPT_STATUS_CODE.failed}::smallint
|
|
@@ -111,6 +123,7 @@ export function workReceiptClaimConflictPredicateSql(input: {
|
|
|
111
123
|
${RECEIPT_STATUS_CODE.completed}::smallint,
|
|
112
124
|
${RECEIPT_STATUS_CODE.skipped}::smallint
|
|
113
125
|
)
|
|
126
|
+
AND ${table}.run_id IS DISTINCT FROM ${input.claimantRunIdSql}
|
|
114
127
|
AND (
|
|
115
128
|
(
|
|
116
129
|
${table}.lease_id IS NULL
|
|
@@ -4402,8 +4402,8 @@ export async function claimRuntimeWorkReceipt(
|
|
|
4402
4402
|
}
|
|
4403
4403
|
if (
|
|
4404
4404
|
latest &&
|
|
4405
|
-
|
|
4406
|
-
|
|
4405
|
+
isReusableWorkReceipt(latest) &&
|
|
4406
|
+
(input.forceRefresh !== true || latest.runId === input.runId)
|
|
4407
4407
|
) {
|
|
4408
4408
|
return { disposition: 'reused', receipt: latest };
|
|
4409
4409
|
}
|
|
@@ -4697,7 +4697,10 @@ export async function claimRuntimeWorkReceipts(
|
|
|
4697
4697
|
});
|
|
4698
4698
|
continue;
|
|
4699
4699
|
}
|
|
4700
|
-
if (
|
|
4700
|
+
if (
|
|
4701
|
+
isReusableWorkReceipt(receipt) &&
|
|
4702
|
+
(input.forceRefresh !== true || receipt.runId === input.runId)
|
|
4703
|
+
) {
|
|
4701
4704
|
claimsByKey.set(receipt.key, {
|
|
4702
4705
|
disposition: 'reused',
|
|
4703
4706
|
receipt,
|
|
@@ -460,7 +460,9 @@ export function normalizeToolHttpErrorMessage(input: {
|
|
|
460
460
|
)}`,
|
|
461
461
|
billing,
|
|
462
462
|
input.status,
|
|
463
|
-
|
|
463
|
+
// Insufficient balance is fatal and non-retryable for the current run,
|
|
464
|
+
// but a later explicit run must re-check the mutable workspace balance.
|
|
465
|
+
'repairable',
|
|
464
466
|
{
|
|
465
467
|
...publicOptions,
|
|
466
468
|
origin: 'deepline',
|
|
@@ -37,6 +37,16 @@ export function isLegacyRepairableWorkReceiptError(
|
|
|
37
37
|
) {
|
|
38
38
|
return true;
|
|
39
39
|
}
|
|
40
|
+
// Before insufficient-credit failures were written as repairable, the
|
|
41
|
+
// structured billing formatter persisted the balance snapshot in this
|
|
42
|
+
// stable shape. A later run must re-check the now-mutable balance while the
|
|
43
|
+
// same run attempt remains fenced by the claim decision below.
|
|
44
|
+
if (
|
|
45
|
+
message.includes('workspace balance ') &&
|
|
46
|
+
message.includes(' < required ')
|
|
47
|
+
) {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
40
50
|
if (
|
|
41
51
|
message.includes('billing cap') ||
|
|
42
52
|
message.includes('insufficient credits') ||
|
|
@@ -277,6 +287,22 @@ export function decideWorkReceiptClaim(input: {
|
|
|
277
287
|
}): WorkReceiptClaimDecision {
|
|
278
288
|
if (!input.receipt) return { kind: 'claim' };
|
|
279
289
|
const state = classifyWorkReceiptState(input.receipt, input.nowMs);
|
|
290
|
+
const sameLogicalRun =
|
|
291
|
+
normalize(input.claimantRunId) !== null &&
|
|
292
|
+
normalize(input.claimantRunId) === normalize(input.receipt.runId);
|
|
293
|
+
const sameRunNewerLeaseAttempt =
|
|
294
|
+
state.reusable &&
|
|
295
|
+
state.lease.kind === 'active' &&
|
|
296
|
+
state.lease.ownerRunId === normalize(input.claimantRunId) &&
|
|
297
|
+
state.lease.ownerAttempt < normalizeAttempt(input.claimantRunAttempt);
|
|
298
|
+
// Force refresh means new intent across runs. Within one run it is a replay,
|
|
299
|
+
// so reuse terminal output instead of creating a second terminal payload
|
|
300
|
+
// under the run's existing Runtime Sheet write version. A newer lease
|
|
301
|
+
// generation is the exception: it is a new attempt and retains the existing
|
|
302
|
+
// stale-owner fence semantics.
|
|
303
|
+
if (state.reusable && sameLogicalRun && !sameRunNewerLeaseAttempt) {
|
|
304
|
+
return { kind: 'reuse_terminal' };
|
|
305
|
+
}
|
|
280
306
|
if (state.reusable && input.forceRefresh !== true) {
|
|
281
307
|
return { kind: 'reuse_terminal' };
|
|
282
308
|
}
|
package/dist/cli/index.js
CHANGED
|
@@ -1044,7 +1044,7 @@ var SDK_RELEASE = {
|
|
|
1044
1044
|
// 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
|
|
1045
1045
|
// exposed storage-dependent synchronous access. This deliberate minor
|
|
1046
1046
|
// release keeps lazy paging semantics independent of row residency.
|
|
1047
|
-
version: "0.2.
|
|
1047
|
+
version: "0.2.44",
|
|
1048
1048
|
contracts: {
|
|
1049
1049
|
api: {
|
|
1050
1050
|
name: "sdk-http-api",
|
|
@@ -3272,6 +3272,7 @@ async function* observeRunEvents(options) {
|
|
|
3272
3272
|
// ../shared_libs/integrations/theirstack-execution-policy.ts
|
|
3273
3273
|
var THEIRSTACK_SLOW_JOB_SEARCH_PROVIDER_TIMEOUT_MS = 135e3;
|
|
3274
3274
|
var THEIRSTACK_SLOW_JOB_SEARCH_CLIENT_TIMEOUT_MS = 6e4 + THEIRSTACK_SLOW_JOB_SEARCH_PROVIDER_TIMEOUT_MS + 15e3;
|
|
3275
|
+
var THEIRSTACK_COMPANY_SEARCH_CLIENT_TIMEOUT_MS = 21e4;
|
|
3275
3276
|
var LONG_JOB_SEARCH_WINDOW_MS = 365 * 24 * 60 * 60 * 1e3;
|
|
3276
3277
|
var DATE_ONLY_PATTERN = /^\d{4}-\d{2}-\d{2}$/;
|
|
3277
3278
|
function parseDateOnly(value) {
|
|
@@ -3315,6 +3316,12 @@ function usesExtendedTheirstackJobSearchBudget(endpointId, payload) {
|
|
|
3315
3316
|
const maxAgeDays = parseMaxAgeDays(payload.posted_at_max_age_days);
|
|
3316
3317
|
return maxAgeDays !== null && maxAgeDays >= 365 ? true : usesLongExplicitDateWindow(payload);
|
|
3317
3318
|
}
|
|
3319
|
+
function resolveTheirstackClientTimeoutMs(endpointId, payload) {
|
|
3320
|
+
if (endpointId === "theirstack_company_search") {
|
|
3321
|
+
return THEIRSTACK_COMPANY_SEARCH_CLIENT_TIMEOUT_MS;
|
|
3322
|
+
}
|
|
3323
|
+
return usesExtendedTheirstackJobSearchBudget(endpointId, payload) ? THEIRSTACK_SLOW_JOB_SEARCH_CLIENT_TIMEOUT_MS : null;
|
|
3324
|
+
}
|
|
3318
3325
|
|
|
3319
3326
|
// ../shared_libs/play-runtime/backend.ts
|
|
3320
3327
|
var PLAY_RUNTIME_BACKENDS = {
|
|
@@ -3561,9 +3568,11 @@ function resolveToolExecuteTimeoutMs(toolId, input2) {
|
|
|
3561
3568
|
return Math.floor(requestedTimeoutMs) + APIFY_SYNC_RESPONSE_GRACE_MS;
|
|
3562
3569
|
}
|
|
3563
3570
|
}
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3571
|
+
const theirstackTimeoutMs = resolveTheirstackClientTimeoutMs(
|
|
3572
|
+
normalized,
|
|
3573
|
+
input2
|
|
3574
|
+
);
|
|
3575
|
+
if (theirstackTimeoutMs !== null) return theirstackTimeoutMs;
|
|
3567
3576
|
return normalized === "deeplineagent" || normalized === "deeplineagent_deeplineagent" || normalized === "ai_inference" || normalized === "deeplineagent_ai_inference" || normalized === "aiinference" ? DEEPLINEAGENT_EXECUTE_TIMEOUT_MS : void 0;
|
|
3568
3577
|
}
|
|
3569
3578
|
var RUNS_FAILED_LOG_LIMIT = 20;
|
|
@@ -27217,6 +27226,7 @@ async function buildEnrichFailureReport(input2) {
|
|
|
27217
27226
|
config: input2.config,
|
|
27218
27227
|
rows: input2.rows,
|
|
27219
27228
|
rowRange: input2.rowRange,
|
|
27229
|
+
runOutcome: input2.runOutcome,
|
|
27220
27230
|
client: input2.client,
|
|
27221
27231
|
outputPath: input2.reportOutputPath ?? input2.exportResult?.path ?? input2.outputPath ?? null,
|
|
27222
27232
|
followUpOutputPath: input2.followUpOutputPath,
|
|
@@ -28585,7 +28595,15 @@ async function maybeEmitEnrichFailureReport(input2) {
|
|
|
28585
28595
|
rows: input2.rowRange
|
|
28586
28596
|
});
|
|
28587
28597
|
if (jobs.length > 0) {
|
|
28588
|
-
|
|
28598
|
+
const failedRows = new Set(jobs.map((job) => job.row_id)).size;
|
|
28599
|
+
if (input2.runOutcome === "failed") {
|
|
28600
|
+
process.stderr.write("Execution failed.\n");
|
|
28601
|
+
} else {
|
|
28602
|
+
process.stderr.write(
|
|
28603
|
+
`Enrichment completed with failures in ${failedRows} ${failedRows === 1 ? "row" : "rows"}.
|
|
28604
|
+
`
|
|
28605
|
+
);
|
|
28606
|
+
}
|
|
28589
28607
|
process.stderr.write("Failure preview (up to 5 failed jobs):\n");
|
|
28590
28608
|
process.stderr.write("job_id row_id col_index column status error\n");
|
|
28591
28609
|
for (const job of jobs.slice(0, 5)) {
|
|
@@ -28636,14 +28654,24 @@ async function maybeEmitEnrichFailureReport(input2) {
|
|
|
28636
28654
|
process.stderr.write(`Full enrich report: ${reportPath}
|
|
28637
28655
|
`);
|
|
28638
28656
|
}
|
|
28639
|
-
|
|
28640
|
-
|
|
28641
|
-
|
|
28657
|
+
if (jobs.length > 0) {
|
|
28658
|
+
if (input2.runOutcome === "failed") {
|
|
28659
|
+
process.stderr.write("Enrichment failed. See report above.\n");
|
|
28660
|
+
}
|
|
28661
|
+
} else {
|
|
28662
|
+
process.stderr.write(
|
|
28663
|
+
"Enrichment produced no values for at least one requested waterfall. See issue preview above.\n"
|
|
28664
|
+
);
|
|
28665
|
+
}
|
|
28642
28666
|
return { path: reportPath, jobs, issues: allEnrichIssues };
|
|
28643
28667
|
}
|
|
28644
|
-
|
|
28645
|
-
|
|
28646
|
-
|
|
28668
|
+
if (jobs.length > 0) {
|
|
28669
|
+
if (input2.runOutcome === "failed") {
|
|
28670
|
+
process.stderr.write("Enrichment failed.\n");
|
|
28671
|
+
}
|
|
28672
|
+
} else {
|
|
28673
|
+
process.stderr.write("Enrichment needs attention.\n");
|
|
28674
|
+
}
|
|
28647
28675
|
return { path: "", jobs, issues: allEnrichIssues };
|
|
28648
28676
|
}
|
|
28649
28677
|
function mergePreferredColumns(preferredColumns, rows) {
|
|
@@ -29565,6 +29593,7 @@ function registerEnrichCommand(program) {
|
|
|
29565
29593
|
config,
|
|
29566
29594
|
rows: rowsForFailureReport,
|
|
29567
29595
|
rowRange: rows,
|
|
29596
|
+
runOutcome: "failed",
|
|
29568
29597
|
client: client2,
|
|
29569
29598
|
exportResult: committedExportResult2,
|
|
29570
29599
|
outputPath,
|
|
@@ -29597,6 +29626,7 @@ function registerEnrichCommand(program) {
|
|
|
29597
29626
|
config,
|
|
29598
29627
|
rows: rowsForFailureReport,
|
|
29599
29628
|
rowRange: rows,
|
|
29629
|
+
runOutcome: "completed",
|
|
29600
29630
|
client: client2,
|
|
29601
29631
|
exportResult,
|
|
29602
29632
|
outputPath,
|
|
@@ -29636,6 +29666,7 @@ function registerEnrichCommand(program) {
|
|
|
29636
29666
|
config,
|
|
29637
29667
|
rows: rowsForFailureReport,
|
|
29638
29668
|
rowRange: rows,
|
|
29669
|
+
runOutcome: "completed",
|
|
29639
29670
|
client: client2,
|
|
29640
29671
|
outputPath: failureReportOutputPath ?? exportResult?.path ?? null,
|
|
29641
29672
|
followUpOutputPath: enrichIssueFollowUpOutputPath,
|
|
@@ -30312,6 +30343,8 @@ ${refreshMeta}
|
|
|
30312
30343
|
</head>
|
|
30313
30344
|
<body>
|
|
30314
30345
|
<div class="layout">
|
|
30346
|
+
<div class="sidebar hidden" id="sidebar"></div>
|
|
30347
|
+
<div class="run-sidebar hidden" id="run-sidebar"></div>
|
|
30315
30348
|
<div class="main" id="main-content"></div>
|
|
30316
30349
|
</div>
|
|
30317
30350
|
<script type="application/json" id="raw-sessions">${rawJson}</script>
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1030,7 +1030,7 @@ var SDK_RELEASE = {
|
|
|
1030
1030
|
// 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
|
|
1031
1031
|
// exposed storage-dependent synchronous access. This deliberate minor
|
|
1032
1032
|
// release keeps lazy paging semantics independent of row residency.
|
|
1033
|
-
version: "0.2.
|
|
1033
|
+
version: "0.2.44",
|
|
1034
1034
|
contracts: {
|
|
1035
1035
|
api: {
|
|
1036
1036
|
name: "sdk-http-api",
|
|
@@ -3258,6 +3258,7 @@ async function* observeRunEvents(options) {
|
|
|
3258
3258
|
// ../shared_libs/integrations/theirstack-execution-policy.ts
|
|
3259
3259
|
var THEIRSTACK_SLOW_JOB_SEARCH_PROVIDER_TIMEOUT_MS = 135e3;
|
|
3260
3260
|
var THEIRSTACK_SLOW_JOB_SEARCH_CLIENT_TIMEOUT_MS = 6e4 + THEIRSTACK_SLOW_JOB_SEARCH_PROVIDER_TIMEOUT_MS + 15e3;
|
|
3261
|
+
var THEIRSTACK_COMPANY_SEARCH_CLIENT_TIMEOUT_MS = 21e4;
|
|
3261
3262
|
var LONG_JOB_SEARCH_WINDOW_MS = 365 * 24 * 60 * 60 * 1e3;
|
|
3262
3263
|
var DATE_ONLY_PATTERN = /^\d{4}-\d{2}-\d{2}$/;
|
|
3263
3264
|
function parseDateOnly(value) {
|
|
@@ -3301,6 +3302,12 @@ function usesExtendedTheirstackJobSearchBudget(endpointId, payload) {
|
|
|
3301
3302
|
const maxAgeDays = parseMaxAgeDays(payload.posted_at_max_age_days);
|
|
3302
3303
|
return maxAgeDays !== null && maxAgeDays >= 365 ? true : usesLongExplicitDateWindow(payload);
|
|
3303
3304
|
}
|
|
3305
|
+
function resolveTheirstackClientTimeoutMs(endpointId, payload) {
|
|
3306
|
+
if (endpointId === "theirstack_company_search") {
|
|
3307
|
+
return THEIRSTACK_COMPANY_SEARCH_CLIENT_TIMEOUT_MS;
|
|
3308
|
+
}
|
|
3309
|
+
return usesExtendedTheirstackJobSearchBudget(endpointId, payload) ? THEIRSTACK_SLOW_JOB_SEARCH_CLIENT_TIMEOUT_MS : null;
|
|
3310
|
+
}
|
|
3304
3311
|
|
|
3305
3312
|
// ../shared_libs/play-runtime/backend.ts
|
|
3306
3313
|
var PLAY_RUNTIME_BACKENDS = {
|
|
@@ -3547,9 +3554,11 @@ function resolveToolExecuteTimeoutMs(toolId, input2) {
|
|
|
3547
3554
|
return Math.floor(requestedTimeoutMs) + APIFY_SYNC_RESPONSE_GRACE_MS;
|
|
3548
3555
|
}
|
|
3549
3556
|
}
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3557
|
+
const theirstackTimeoutMs = resolveTheirstackClientTimeoutMs(
|
|
3558
|
+
normalized,
|
|
3559
|
+
input2
|
|
3560
|
+
);
|
|
3561
|
+
if (theirstackTimeoutMs !== null) return theirstackTimeoutMs;
|
|
3553
3562
|
return normalized === "deeplineagent" || normalized === "deeplineagent_deeplineagent" || normalized === "ai_inference" || normalized === "deeplineagent_ai_inference" || normalized === "aiinference" ? DEEPLINEAGENT_EXECUTE_TIMEOUT_MS : void 0;
|
|
3554
3563
|
}
|
|
3555
3564
|
var RUNS_FAILED_LOG_LIMIT = 20;
|
|
@@ -27261,6 +27270,7 @@ async function buildEnrichFailureReport(input2) {
|
|
|
27261
27270
|
config: input2.config,
|
|
27262
27271
|
rows: input2.rows,
|
|
27263
27272
|
rowRange: input2.rowRange,
|
|
27273
|
+
runOutcome: input2.runOutcome,
|
|
27264
27274
|
client: input2.client,
|
|
27265
27275
|
outputPath: input2.reportOutputPath ?? input2.exportResult?.path ?? input2.outputPath ?? null,
|
|
27266
27276
|
followUpOutputPath: input2.followUpOutputPath,
|
|
@@ -28629,7 +28639,15 @@ async function maybeEmitEnrichFailureReport(input2) {
|
|
|
28629
28639
|
rows: input2.rowRange
|
|
28630
28640
|
});
|
|
28631
28641
|
if (jobs.length > 0) {
|
|
28632
|
-
|
|
28642
|
+
const failedRows = new Set(jobs.map((job) => job.row_id)).size;
|
|
28643
|
+
if (input2.runOutcome === "failed") {
|
|
28644
|
+
process.stderr.write("Execution failed.\n");
|
|
28645
|
+
} else {
|
|
28646
|
+
process.stderr.write(
|
|
28647
|
+
`Enrichment completed with failures in ${failedRows} ${failedRows === 1 ? "row" : "rows"}.
|
|
28648
|
+
`
|
|
28649
|
+
);
|
|
28650
|
+
}
|
|
28633
28651
|
process.stderr.write("Failure preview (up to 5 failed jobs):\n");
|
|
28634
28652
|
process.stderr.write("job_id row_id col_index column status error\n");
|
|
28635
28653
|
for (const job of jobs.slice(0, 5)) {
|
|
@@ -28680,14 +28698,24 @@ async function maybeEmitEnrichFailureReport(input2) {
|
|
|
28680
28698
|
process.stderr.write(`Full enrich report: ${reportPath}
|
|
28681
28699
|
`);
|
|
28682
28700
|
}
|
|
28683
|
-
|
|
28684
|
-
|
|
28685
|
-
|
|
28701
|
+
if (jobs.length > 0) {
|
|
28702
|
+
if (input2.runOutcome === "failed") {
|
|
28703
|
+
process.stderr.write("Enrichment failed. See report above.\n");
|
|
28704
|
+
}
|
|
28705
|
+
} else {
|
|
28706
|
+
process.stderr.write(
|
|
28707
|
+
"Enrichment produced no values for at least one requested waterfall. See issue preview above.\n"
|
|
28708
|
+
);
|
|
28709
|
+
}
|
|
28686
28710
|
return { path: reportPath, jobs, issues: allEnrichIssues };
|
|
28687
28711
|
}
|
|
28688
|
-
|
|
28689
|
-
|
|
28690
|
-
|
|
28712
|
+
if (jobs.length > 0) {
|
|
28713
|
+
if (input2.runOutcome === "failed") {
|
|
28714
|
+
process.stderr.write("Enrichment failed.\n");
|
|
28715
|
+
}
|
|
28716
|
+
} else {
|
|
28717
|
+
process.stderr.write("Enrichment needs attention.\n");
|
|
28718
|
+
}
|
|
28691
28719
|
return { path: "", jobs, issues: allEnrichIssues };
|
|
28692
28720
|
}
|
|
28693
28721
|
function mergePreferredColumns(preferredColumns, rows) {
|
|
@@ -29609,6 +29637,7 @@ function registerEnrichCommand(program) {
|
|
|
29609
29637
|
config,
|
|
29610
29638
|
rows: rowsForFailureReport,
|
|
29611
29639
|
rowRange: rows,
|
|
29640
|
+
runOutcome: "failed",
|
|
29612
29641
|
client: client2,
|
|
29613
29642
|
exportResult: committedExportResult2,
|
|
29614
29643
|
outputPath,
|
|
@@ -29641,6 +29670,7 @@ function registerEnrichCommand(program) {
|
|
|
29641
29670
|
config,
|
|
29642
29671
|
rows: rowsForFailureReport,
|
|
29643
29672
|
rowRange: rows,
|
|
29673
|
+
runOutcome: "completed",
|
|
29644
29674
|
client: client2,
|
|
29645
29675
|
exportResult,
|
|
29646
29676
|
outputPath,
|
|
@@ -29680,6 +29710,7 @@ function registerEnrichCommand(program) {
|
|
|
29680
29710
|
config,
|
|
29681
29711
|
rows: rowsForFailureReport,
|
|
29682
29712
|
rowRange: rows,
|
|
29713
|
+
runOutcome: "completed",
|
|
29683
29714
|
client: client2,
|
|
29684
29715
|
outputPath: failureReportOutputPath ?? exportResult?.path ?? null,
|
|
29685
29716
|
followUpOutputPath: enrichIssueFollowUpOutputPath,
|
|
@@ -30363,6 +30394,8 @@ ${refreshMeta}
|
|
|
30363
30394
|
</head>
|
|
30364
30395
|
<body>
|
|
30365
30396
|
<div class="layout">
|
|
30397
|
+
<div class="sidebar hidden" id="sidebar"></div>
|
|
30398
|
+
<div class="run-sidebar hidden" id="run-sidebar"></div>
|
|
30366
30399
|
<div class="main" id="main-content"></div>
|
|
30367
30400
|
</div>
|
|
30368
30401
|
<script type="application/json" id="raw-sessions">${rawJson}</script>
|
package/dist/index.js
CHANGED
|
@@ -763,7 +763,7 @@ var SDK_RELEASE = {
|
|
|
763
763
|
// 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
|
|
764
764
|
// exposed storage-dependent synchronous access. This deliberate minor
|
|
765
765
|
// release keeps lazy paging semantics independent of row residency.
|
|
766
|
-
version: "0.2.
|
|
766
|
+
version: "0.2.44",
|
|
767
767
|
contracts: {
|
|
768
768
|
api: {
|
|
769
769
|
name: "sdk-http-api",
|
|
@@ -2991,6 +2991,7 @@ async function* observeRunEvents(options) {
|
|
|
2991
2991
|
// ../shared_libs/integrations/theirstack-execution-policy.ts
|
|
2992
2992
|
var THEIRSTACK_SLOW_JOB_SEARCH_PROVIDER_TIMEOUT_MS = 135e3;
|
|
2993
2993
|
var THEIRSTACK_SLOW_JOB_SEARCH_CLIENT_TIMEOUT_MS = 6e4 + THEIRSTACK_SLOW_JOB_SEARCH_PROVIDER_TIMEOUT_MS + 15e3;
|
|
2994
|
+
var THEIRSTACK_COMPANY_SEARCH_CLIENT_TIMEOUT_MS = 21e4;
|
|
2994
2995
|
var LONG_JOB_SEARCH_WINDOW_MS = 365 * 24 * 60 * 60 * 1e3;
|
|
2995
2996
|
var DATE_ONLY_PATTERN = /^\d{4}-\d{2}-\d{2}$/;
|
|
2996
2997
|
function parseDateOnly(value) {
|
|
@@ -3034,6 +3035,12 @@ function usesExtendedTheirstackJobSearchBudget(endpointId, payload) {
|
|
|
3034
3035
|
const maxAgeDays = parseMaxAgeDays(payload.posted_at_max_age_days);
|
|
3035
3036
|
return maxAgeDays !== null && maxAgeDays >= 365 ? true : usesLongExplicitDateWindow(payload);
|
|
3036
3037
|
}
|
|
3038
|
+
function resolveTheirstackClientTimeoutMs(endpointId, payload) {
|
|
3039
|
+
if (endpointId === "theirstack_company_search") {
|
|
3040
|
+
return THEIRSTACK_COMPANY_SEARCH_CLIENT_TIMEOUT_MS;
|
|
3041
|
+
}
|
|
3042
|
+
return usesExtendedTheirstackJobSearchBudget(endpointId, payload) ? THEIRSTACK_SLOW_JOB_SEARCH_CLIENT_TIMEOUT_MS : null;
|
|
3043
|
+
}
|
|
3037
3044
|
|
|
3038
3045
|
// ../shared_libs/play-runtime/backend.ts
|
|
3039
3046
|
var PLAY_RUNTIME_BACKENDS = {
|
|
@@ -3280,9 +3287,11 @@ function resolveToolExecuteTimeoutMs(toolId, input) {
|
|
|
3280
3287
|
return Math.floor(requestedTimeoutMs) + APIFY_SYNC_RESPONSE_GRACE_MS;
|
|
3281
3288
|
}
|
|
3282
3289
|
}
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3290
|
+
const theirstackTimeoutMs = resolveTheirstackClientTimeoutMs(
|
|
3291
|
+
normalized,
|
|
3292
|
+
input
|
|
3293
|
+
);
|
|
3294
|
+
if (theirstackTimeoutMs !== null) return theirstackTimeoutMs;
|
|
3286
3295
|
return normalized === "deeplineagent" || normalized === "deeplineagent_deeplineagent" || normalized === "ai_inference" || normalized === "deeplineagent_ai_inference" || normalized === "aiinference" ? DEEPLINEAGENT_EXECUTE_TIMEOUT_MS : void 0;
|
|
3287
3296
|
}
|
|
3288
3297
|
var RUNS_FAILED_LOG_LIMIT = 20;
|
package/dist/index.mjs
CHANGED
|
@@ -689,7 +689,7 @@ var SDK_RELEASE = {
|
|
|
689
689
|
// 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
|
|
690
690
|
// exposed storage-dependent synchronous access. This deliberate minor
|
|
691
691
|
// release keeps lazy paging semantics independent of row residency.
|
|
692
|
-
version: "0.2.
|
|
692
|
+
version: "0.2.44",
|
|
693
693
|
contracts: {
|
|
694
694
|
api: {
|
|
695
695
|
name: "sdk-http-api",
|
|
@@ -2917,6 +2917,7 @@ async function* observeRunEvents(options) {
|
|
|
2917
2917
|
// ../shared_libs/integrations/theirstack-execution-policy.ts
|
|
2918
2918
|
var THEIRSTACK_SLOW_JOB_SEARCH_PROVIDER_TIMEOUT_MS = 135e3;
|
|
2919
2919
|
var THEIRSTACK_SLOW_JOB_SEARCH_CLIENT_TIMEOUT_MS = 6e4 + THEIRSTACK_SLOW_JOB_SEARCH_PROVIDER_TIMEOUT_MS + 15e3;
|
|
2920
|
+
var THEIRSTACK_COMPANY_SEARCH_CLIENT_TIMEOUT_MS = 21e4;
|
|
2920
2921
|
var LONG_JOB_SEARCH_WINDOW_MS = 365 * 24 * 60 * 60 * 1e3;
|
|
2921
2922
|
var DATE_ONLY_PATTERN = /^\d{4}-\d{2}-\d{2}$/;
|
|
2922
2923
|
function parseDateOnly(value) {
|
|
@@ -2960,6 +2961,12 @@ function usesExtendedTheirstackJobSearchBudget(endpointId, payload) {
|
|
|
2960
2961
|
const maxAgeDays = parseMaxAgeDays(payload.posted_at_max_age_days);
|
|
2961
2962
|
return maxAgeDays !== null && maxAgeDays >= 365 ? true : usesLongExplicitDateWindow(payload);
|
|
2962
2963
|
}
|
|
2964
|
+
function resolveTheirstackClientTimeoutMs(endpointId, payload) {
|
|
2965
|
+
if (endpointId === "theirstack_company_search") {
|
|
2966
|
+
return THEIRSTACK_COMPANY_SEARCH_CLIENT_TIMEOUT_MS;
|
|
2967
|
+
}
|
|
2968
|
+
return usesExtendedTheirstackJobSearchBudget(endpointId, payload) ? THEIRSTACK_SLOW_JOB_SEARCH_CLIENT_TIMEOUT_MS : null;
|
|
2969
|
+
}
|
|
2963
2970
|
|
|
2964
2971
|
// ../shared_libs/play-runtime/backend.ts
|
|
2965
2972
|
var PLAY_RUNTIME_BACKENDS = {
|
|
@@ -3206,9 +3213,11 @@ function resolveToolExecuteTimeoutMs(toolId, input) {
|
|
|
3206
3213
|
return Math.floor(requestedTimeoutMs) + APIFY_SYNC_RESPONSE_GRACE_MS;
|
|
3207
3214
|
}
|
|
3208
3215
|
}
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3216
|
+
const theirstackTimeoutMs = resolveTheirstackClientTimeoutMs(
|
|
3217
|
+
normalized,
|
|
3218
|
+
input
|
|
3219
|
+
);
|
|
3220
|
+
if (theirstackTimeoutMs !== null) return theirstackTimeoutMs;
|
|
3212
3221
|
return normalized === "deeplineagent" || normalized === "deeplineagent_deeplineagent" || normalized === "ai_inference" || normalized === "deeplineagent_ai_inference" || normalized === "aiinference" ? DEEPLINEAGENT_EXECUTE_TIMEOUT_MS : void 0;
|
|
3213
3222
|
}
|
|
3214
3223
|
var RUNS_FAILED_LOG_LIMIT = 20;
|