deepline 0.1.216 → 0.1.218
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/apps/play-runner-workers/src/coordinator-entry.ts +10 -85
- package/dist/bundling-sources/apps/play-runner-workers/src/entry.ts +9 -7
- package/dist/bundling-sources/sdk/src/release.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +6 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +18 -43
- package/dist/cli/index.js +10 -3
- package/dist/cli/index.mjs +10 -3
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/bundling-sources/apps/play-runner-workers/src/coordinator-runtime-proxy.ts +0 -34
|
@@ -57,13 +57,9 @@ import {
|
|
|
57
57
|
PLAY_RUNTIME_CONTRACT_HEADER,
|
|
58
58
|
} from '../../../shared_libs/play-runtime/runtime-contract';
|
|
59
59
|
import {
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
PLAY_RUNTIME_API_COMPAT_PATH,
|
|
61
|
+
PLAY_RUNTIME_TAIL_LOG_COMPAT_PATH,
|
|
62
62
|
} from '../../../shared_libs/play-runtime/runtime-api-paths';
|
|
63
|
-
import {
|
|
64
|
-
executorTokenFromAuthorizationHeader,
|
|
65
|
-
isCoordinatorRuntimeProxyPath,
|
|
66
|
-
} from './coordinator-runtime-proxy';
|
|
67
63
|
import {
|
|
68
64
|
decideWorkflowPlatformRetry,
|
|
69
65
|
PLATFORM_DEPLOY_WORKFLOW_RETRY_LIMIT,
|
|
@@ -1335,7 +1331,7 @@ async function markWorkflowRuntimeFailure(input: {
|
|
|
1335
1331
|
} satisfies PlayRunLedgerEvent,
|
|
1336
1332
|
],
|
|
1337
1333
|
});
|
|
1338
|
-
const url = `${baseUrl.replace(/\/$/, '')}${
|
|
1334
|
+
const url = `${baseUrl.replace(/\/$/, '')}${PLAY_RUNTIME_API_COMPAT_PATH}`;
|
|
1339
1335
|
const backoffMs = [200, 500, 1500];
|
|
1340
1336
|
let lastError: unknown = null;
|
|
1341
1337
|
for (let attempt = 0; attempt <= backoffMs.length; attempt += 1) {
|
|
@@ -1424,7 +1420,7 @@ async function appendWorkflowChildCompletedRunEvent(input: {
|
|
|
1424
1420
|
} satisfies PlayRunLedgerEvent,
|
|
1425
1421
|
],
|
|
1426
1422
|
});
|
|
1427
|
-
const url = `${baseUrl.replace(/\/$/, '')}${
|
|
1423
|
+
const url = `${baseUrl.replace(/\/$/, '')}${PLAY_RUNTIME_API_COMPAT_PATH}`;
|
|
1428
1424
|
const response = await fetch(url, { method: 'POST', headers, body });
|
|
1429
1425
|
if (!response.ok) {
|
|
1430
1426
|
throw new Error(
|
|
@@ -1844,7 +1840,7 @@ async function markRegisteredChildRunFailed(input: {
|
|
|
1844
1840
|
contract: PLAY_RUNTIME_CONTRACT,
|
|
1845
1841
|
executorToken: input.childExecutorToken,
|
|
1846
1842
|
baseUrl: input.baseUrl,
|
|
1847
|
-
path:
|
|
1843
|
+
path: PLAY_RUNTIME_API_COMPAT_PATH,
|
|
1848
1844
|
headers: {
|
|
1849
1845
|
'x-deepline-request-id': crypto.randomUUID(),
|
|
1850
1846
|
[PLAY_RUNTIME_CONTRACT_HEADER]: String(PLAY_RUNTIME_CONTRACT),
|
|
@@ -1901,7 +1897,7 @@ async function appendRegisteredChildRunTerminal(input: {
|
|
|
1901
1897
|
contract: PLAY_RUNTIME_CONTRACT,
|
|
1902
1898
|
executorToken: input.childExecutorToken,
|
|
1903
1899
|
baseUrl: input.baseUrl,
|
|
1904
|
-
path:
|
|
1900
|
+
path: PLAY_RUNTIME_API_COMPAT_PATH,
|
|
1905
1901
|
headers: {
|
|
1906
1902
|
'x-deepline-request-id': crypto.randomUUID(),
|
|
1907
1903
|
[PLAY_RUNTIME_CONTRACT_HEADER]: String(PLAY_RUNTIME_CONTRACT),
|
|
@@ -1983,7 +1979,7 @@ async function callRuntimeApiFromCoordinator(input: {
|
|
|
1983
1979
|
contract: PLAY_RUNTIME_CONTRACT,
|
|
1984
1980
|
executorToken: input.executorToken,
|
|
1985
1981
|
baseUrl: input.baseUrl,
|
|
1986
|
-
path:
|
|
1982
|
+
path: PLAY_RUNTIME_API_COMPAT_PATH,
|
|
1987
1983
|
body,
|
|
1988
1984
|
headers: {
|
|
1989
1985
|
'x-deepline-request-id': requestId,
|
|
@@ -3122,8 +3118,7 @@ async function submitChildWorkflowThroughCoordinator(input: {
|
|
|
3122
3118
|
* Workflows serializes the dynamic Worker's `env` map when it persists
|
|
3123
3119
|
* workflow state. WorkerEntrypoint stubs ARE cloneable.
|
|
3124
3120
|
*
|
|
3125
|
-
* Path allowlist:
|
|
3126
|
-
* `/api/v2/integrations/*`.
|
|
3121
|
+
* Path allowlist: only `/api/v2/plays/*` and `/api/v2/integrations/*`.
|
|
3127
3122
|
* Anything else is a sandbox-escape attempt and gets a loud 403 — the
|
|
3128
3123
|
* coordinator must NOT proxy a play's request to internal admin routes
|
|
3129
3124
|
* even if the play tries to construct such a URL.
|
|
@@ -3132,7 +3127,6 @@ export class RuntimeApi extends WorkerEntrypoint<CoordinatorEnv, undefined> {
|
|
|
3132
3127
|
async fetch(request: Request): Promise<Response> {
|
|
3133
3128
|
const incoming = new URL(request.url);
|
|
3134
3129
|
const allowed =
|
|
3135
|
-
incoming.pathname === PLAY_RUNTIME_API_CURRENT_PATH ||
|
|
3136
3130
|
incoming.pathname.startsWith('/api/v2/plays/') ||
|
|
3137
3131
|
incoming.pathname.startsWith('/api/v2/integrations/');
|
|
3138
3132
|
if (!allowed) {
|
|
@@ -3765,62 +3759,6 @@ const coordinatorEntrypoint = {
|
|
|
3765
3759
|
|
|
3766
3760
|
export default coordinatorEntrypoint;
|
|
3767
3761
|
|
|
3768
|
-
const COORDINATOR_RUNTIME_PROXY_MAX_BODY_BYTES = 16 * 1024 * 1024;
|
|
3769
|
-
|
|
3770
|
-
async function proxyCoordinatorRuntimeApiRequest(input: {
|
|
3771
|
-
request: Request;
|
|
3772
|
-
env: CoordinatorEnv;
|
|
3773
|
-
url: URL;
|
|
3774
|
-
}): Promise<Response> {
|
|
3775
|
-
const { request, env, url } = input;
|
|
3776
|
-
if (request.method !== 'GET' && request.method !== 'POST') {
|
|
3777
|
-
return new Response('method not allowed', { status: 405 });
|
|
3778
|
-
}
|
|
3779
|
-
const executorToken = executorTokenFromAuthorizationHeader(
|
|
3780
|
-
request.headers.get('authorization'),
|
|
3781
|
-
);
|
|
3782
|
-
if (!executorToken) {
|
|
3783
|
-
return Response.json(
|
|
3784
|
-
{ error: 'Runtime gateway requires a bearer executor token.' },
|
|
3785
|
-
{ status: 401 },
|
|
3786
|
-
);
|
|
3787
|
-
}
|
|
3788
|
-
const contentLength = Number(request.headers.get('content-length') ?? '0');
|
|
3789
|
-
if (
|
|
3790
|
-
Number.isFinite(contentLength) &&
|
|
3791
|
-
contentLength > COORDINATOR_RUNTIME_PROXY_MAX_BODY_BYTES
|
|
3792
|
-
) {
|
|
3793
|
-
return Response.json(
|
|
3794
|
-
{ error: 'Runtime gateway request body exceeds the 16 MiB limit.' },
|
|
3795
|
-
{ status: 413 },
|
|
3796
|
-
);
|
|
3797
|
-
}
|
|
3798
|
-
let body: unknown = {};
|
|
3799
|
-
if (request.method === 'POST') {
|
|
3800
|
-
try {
|
|
3801
|
-
body = await request.json();
|
|
3802
|
-
} catch {
|
|
3803
|
-
return Response.json(
|
|
3804
|
-
{ error: 'Runtime gateway requires a JSON request body.' },
|
|
3805
|
-
{ status: 400 },
|
|
3806
|
-
);
|
|
3807
|
-
}
|
|
3808
|
-
}
|
|
3809
|
-
const upstream = await env.HARNESS.runtimeApiCall({
|
|
3810
|
-
contract: PLAY_RUNTIME_CONTRACT,
|
|
3811
|
-
executorToken,
|
|
3812
|
-
method: request.method,
|
|
3813
|
-
path: `${url.pathname}${url.search}`,
|
|
3814
|
-
body,
|
|
3815
|
-
headers: Object.fromEntries(request.headers.entries()),
|
|
3816
|
-
});
|
|
3817
|
-
const headers = new Headers(upstream.headers);
|
|
3818
|
-
// The harness materializes the upstream response body as a string. Let this
|
|
3819
|
-
// Response calculate its own byte length instead of forwarding a stale one.
|
|
3820
|
-
headers.delete('content-length');
|
|
3821
|
-
return new Response(upstream.body, { status: upstream.status, headers });
|
|
3822
|
-
}
|
|
3823
|
-
|
|
3824
3762
|
/**
|
|
3825
3763
|
* Route dispatcher for the coordinator fetch handler. Extracted as a standalone
|
|
3826
3764
|
* function so the outer {@link coordinatorEntrypoint.fetch} try/catch backstop
|
|
@@ -3849,19 +3787,6 @@ async function coordinatorRouteFetch(
|
|
|
3849
3787
|
}
|
|
3850
3788
|
return new Response('ok', { status: 200, headers });
|
|
3851
3789
|
}
|
|
3852
|
-
if (isCoordinatorRuntimeProxyPath(url.pathname)) {
|
|
3853
|
-
try {
|
|
3854
|
-
return await proxyCoordinatorRuntimeApiRequest({ request, env, url });
|
|
3855
|
-
} catch (error) {
|
|
3856
|
-
return coordinatorRouteErrorResponse({
|
|
3857
|
-
logTag: '[coordinator.runtime_proxy.error]',
|
|
3858
|
-
code: 'COORDINATOR_RUNTIME_PROXY_FAILED',
|
|
3859
|
-
phase: 'coordinator.runtime_proxy',
|
|
3860
|
-
runId: null,
|
|
3861
|
-
error,
|
|
3862
|
-
});
|
|
3863
|
-
}
|
|
3864
|
-
}
|
|
3865
3790
|
if (url.pathname === '/internal-token/probe') {
|
|
3866
3791
|
const authError = authorizeCoordinatorControlRequest({ request, env });
|
|
3867
3792
|
if (authError) return authError;
|
|
@@ -4110,7 +4035,7 @@ async function flushTailRunLogs(
|
|
|
4110
4035
|
return;
|
|
4111
4036
|
}
|
|
4112
4037
|
await fetch(
|
|
4113
|
-
`${env.DEEPLINE_API_BASE_URL}${
|
|
4038
|
+
`${env.DEEPLINE_API_BASE_URL}${PLAY_RUNTIME_TAIL_LOG_COMPAT_PATH}`,
|
|
4114
4039
|
{
|
|
4115
4040
|
method: 'POST',
|
|
4116
4041
|
headers: {
|
|
@@ -5530,7 +5455,7 @@ export class TenantWorkflow extends WorkflowEntrypoint {
|
|
|
5530
5455
|
const runId = payload && typeof payload.runId === "string" ? payload.runId : "warmup";
|
|
5531
5456
|
const startedAt = Date.now();
|
|
5532
5457
|
if (this.env.RUNTIME_API) {
|
|
5533
|
-
await this.env.RUNTIME_API.fetch(new Request("https://deepline.runtime.internal${
|
|
5458
|
+
await this.env.RUNTIME_API.fetch(new Request("https://deepline.runtime.internal${PLAY_RUNTIME_API_COMPAT_PATH}", {
|
|
5534
5459
|
method: "POST",
|
|
5535
5460
|
headers: { "content-type": "application/json" },
|
|
5536
5461
|
body: "{}"
|
|
@@ -185,8 +185,8 @@ import {
|
|
|
185
185
|
PLAY_RUNTIME_CONTRACT_HEADER,
|
|
186
186
|
} from '../../../shared_libs/play-runtime/runtime-contract';
|
|
187
187
|
import {
|
|
188
|
-
|
|
189
|
-
|
|
188
|
+
PLAY_RUNTIME_API_COMPAT_PATH,
|
|
189
|
+
PLAY_RUNTIME_EGRESS_FETCH_COMPAT_PATH,
|
|
190
190
|
} from '../../../shared_libs/play-runtime/runtime-api-paths';
|
|
191
191
|
import { DYNAMIC_PLAY_WORKER_ARTIFACT_VERSION } from '../../../shared_libs/play-runtime/dynamic-worker-version';
|
|
192
192
|
import {
|
|
@@ -860,7 +860,7 @@ async function fetchRuntimeApi(
|
|
|
860
860
|
? Math.max(1, Math.ceil(options.timeoutMsOverride))
|
|
861
861
|
: path === '/api/v2/plays/run'
|
|
862
862
|
? RUNTIME_API_PLAY_RUN_TIMEOUT_MS
|
|
863
|
-
: path ===
|
|
863
|
+
: path === PLAY_RUNTIME_EGRESS_FETCH_COMPAT_PATH
|
|
864
864
|
? RUNTIME_API_EGRESS_FETCH_TIMEOUT_MS
|
|
865
865
|
: /^\/api\/v2\/integrations\/[^/]+\/execute$/.test(path)
|
|
866
866
|
? RUNTIME_API_INTEGRATION_EXECUTE_TIMEOUT_MS
|
|
@@ -1170,6 +1170,8 @@ function recordRunnerPerfTrace(input: {
|
|
|
1170
1170
|
ts: Date.now(),
|
|
1171
1171
|
source: 'dynamic_worker' as const,
|
|
1172
1172
|
runId: input.req.runId,
|
|
1173
|
+
playName: input.req.playName,
|
|
1174
|
+
orgId: input.req.orgId,
|
|
1173
1175
|
phase,
|
|
1174
1176
|
ms: input.ms ?? 0,
|
|
1175
1177
|
...(input.extra ?? {}),
|
|
@@ -1316,7 +1318,7 @@ async function postRuntimeApi<T>(
|
|
|
1316
1318
|
try {
|
|
1317
1319
|
res = await fetchRuntimeApi(
|
|
1318
1320
|
baseUrl,
|
|
1319
|
-
|
|
1321
|
+
PLAY_RUNTIME_API_COMPAT_PATH,
|
|
1320
1322
|
{
|
|
1321
1323
|
method: 'POST',
|
|
1322
1324
|
headers: {
|
|
@@ -2890,7 +2892,7 @@ async function postRuntimeEgressFetch(
|
|
|
2890
2892
|
) {
|
|
2891
2893
|
const response = await fetchRuntimeApi(
|
|
2892
2894
|
req.baseUrl,
|
|
2893
|
-
|
|
2895
|
+
PLAY_RUNTIME_EGRESS_FETCH_COMPAT_PATH,
|
|
2894
2896
|
{
|
|
2895
2897
|
method: 'POST',
|
|
2896
2898
|
headers: {
|
|
@@ -4263,7 +4265,7 @@ function createMinimalWorkerCtx(
|
|
|
4263
4265
|
if (!auth) return {};
|
|
4264
4266
|
const response = await fetchRuntimeApi(
|
|
4265
4267
|
req.baseUrl,
|
|
4266
|
-
|
|
4268
|
+
PLAY_RUNTIME_API_COMPAT_PATH,
|
|
4267
4269
|
{
|
|
4268
4270
|
method: 'POST',
|
|
4269
4271
|
headers: {
|
|
@@ -8942,7 +8944,7 @@ export class TenantWorkflow extends WorkflowEntrypoint<
|
|
|
8942
8944
|
try {
|
|
8943
8945
|
const response = await fetchRuntimeApi(
|
|
8944
8946
|
req.baseUrl,
|
|
8945
|
-
|
|
8947
|
+
PLAY_RUNTIME_API_COMPAT_PATH,
|
|
8946
8948
|
{
|
|
8947
8949
|
method: 'POST',
|
|
8948
8950
|
headers: {
|
|
@@ -106,10 +106,10 @@ export const SDK_RELEASE = {
|
|
|
106
106
|
// 0.1.154 removes the short-lived generated enrich StepOptions recompute
|
|
107
107
|
// fields shipped in 0.1.153.
|
|
108
108
|
// 0.1.175 ships loud `deepline enrich` empty-waterfall reporting.
|
|
109
|
-
version: '0.1.
|
|
109
|
+
version: '0.1.218',
|
|
110
110
|
apiContract: '2026-06-dataset-handle-results-hard-cutover',
|
|
111
111
|
supportPolicy: {
|
|
112
|
-
latest: '0.1.
|
|
112
|
+
latest: '0.1.218',
|
|
113
113
|
minimumSupported: '0.1.53',
|
|
114
114
|
deprecatedBelow: '0.1.53',
|
|
115
115
|
commandMinimumSupported: [
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
PLAY_RUNTIME_CONTRACT,
|
|
39
39
|
PLAY_RUNTIME_CONTRACT_HEADER,
|
|
40
40
|
} from '@shared_libs/play-runtime/runtime-contract';
|
|
41
|
-
import {
|
|
41
|
+
import { PLAY_RUNTIME_API_COMPAT_PATH } from '@shared_libs/play-runtime/runtime-api-paths';
|
|
42
42
|
import { PLAY_RUNTIME_TEST_FAULT_HEADER } from '@shared_libs/play-runtime/test-runtime-seams';
|
|
43
43
|
import { vercelProtectionBypassHeaders } from '@shared_libs/play-runtime/vercel-protection';
|
|
44
44
|
|
|
@@ -788,7 +788,7 @@ export class AppRuntimeApiTransportError extends Error {
|
|
|
788
788
|
|
|
789
789
|
function resolveAppRuntimeApiUrl(context: WorkerRuntimeApiContext): string {
|
|
790
790
|
const baseUrl = context.baseUrl.trim().replace(/\/$/, '');
|
|
791
|
-
return `${baseUrl}${
|
|
791
|
+
return `${baseUrl}${PLAY_RUNTIME_API_COMPAT_PATH}`;
|
|
792
792
|
}
|
|
793
793
|
|
|
794
794
|
async function postAppRuntimeApi<TResponse>(
|
|
@@ -47,7 +47,10 @@ import {
|
|
|
47
47
|
RUNTIME_SCHEDULER_SCHEMA_OVERRIDE_HEADER,
|
|
48
48
|
SYNTHETIC_RUN_HEADER,
|
|
49
49
|
} from './coordinator-headers';
|
|
50
|
-
import {
|
|
50
|
+
import {
|
|
51
|
+
PLAY_RUNTIME_API_COMPAT_PATH,
|
|
52
|
+
PLAY_RUNTIME_API_CURRENT_PATH,
|
|
53
|
+
} from './runtime-api-paths';
|
|
51
54
|
import {
|
|
52
55
|
createRootRunExecutionScope,
|
|
53
56
|
deriveChildRunExecutionScope,
|
|
@@ -1728,7 +1731,7 @@ export class PlayContextImpl {
|
|
|
1728
1731
|
| null
|
|
1729
1732
|
> {
|
|
1730
1733
|
const response = await fetch(
|
|
1731
|
-
`${this.runtimeApiBaseUrl()}${
|
|
1734
|
+
`${this.runtimeApiBaseUrl()}${PLAY_RUNTIME_API_COMPAT_PATH}`,
|
|
1732
1735
|
{
|
|
1733
1736
|
method: 'POST',
|
|
1734
1737
|
headers: await this.runtimeApiHeaders(),
|
|
@@ -1843,7 +1846,7 @@ export class PlayContextImpl {
|
|
|
1843
1846
|
this.#options.runId
|
|
1844
1847
|
) {
|
|
1845
1848
|
const response = await fetch(
|
|
1846
|
-
`${this.#options.baseUrl.replace(/\/$/, '')}${
|
|
1849
|
+
`${this.#options.baseUrl.replace(/\/$/, '')}${PLAY_RUNTIME_API_COMPAT_PATH}`,
|
|
1847
1850
|
{
|
|
1848
1851
|
method: 'POST',
|
|
1849
1852
|
headers: {
|
|
@@ -95,7 +95,7 @@ import {
|
|
|
95
95
|
PLAY_RUNTIME_CONTRACT,
|
|
96
96
|
PLAY_RUNTIME_CONTRACT_HEADER,
|
|
97
97
|
} from './runtime-contract';
|
|
98
|
-
import {
|
|
98
|
+
import { PLAY_RUNTIME_API_COMPAT_PATH } from './runtime-api-paths';
|
|
99
99
|
import {
|
|
100
100
|
PLAY_RUNTIME_SHEET_ATTEMPT_LEASE_TTL_MS,
|
|
101
101
|
PLAY_RUNTIME_WORK_RECEIPT_LEASE_TTL_MS,
|
|
@@ -298,7 +298,6 @@ const RUNTIME_WORK_RECEIPT_LEASE_COLUMNS = [
|
|
|
298
298
|
'lease_expires_at',
|
|
299
299
|
] as const;
|
|
300
300
|
const RUNTIME_WORK_RECEIPT_FAILURE_KIND_COLUMN = 'failure_kind';
|
|
301
|
-
const RUNTIME_WORK_RECEIPT_KEY_INDEX = 'idx_deepline_step_receipts_k_unique';
|
|
302
301
|
const RUNTIME_WORK_RECEIPT_SELF_HEAL_COLUMNS = [
|
|
303
302
|
...RUNTIME_WORK_RECEIPT_LEASE_COLUMNS,
|
|
304
303
|
RUNTIME_WORK_RECEIPT_FAILURE_KIND_COLUMN,
|
|
@@ -505,7 +504,7 @@ function resolveRuntimeApiUrl(context: RuntimeApiContext): string {
|
|
|
505
504
|
if (!baseUrl) {
|
|
506
505
|
throw new Error('Runner runtime API requires a baseUrl.');
|
|
507
506
|
}
|
|
508
|
-
return `${baseUrl.replace(/\/$/, '')}${
|
|
507
|
+
return `${baseUrl.replace(/\/$/, '')}${PLAY_RUNTIME_API_COMPAT_PATH}`;
|
|
509
508
|
}
|
|
510
509
|
|
|
511
510
|
function resolveRuntimeApiHeaders(
|
|
@@ -2043,22 +2042,6 @@ function isMissingRuntimeWorkReceiptSelfHealColumnError(
|
|
|
2043
2042
|
);
|
|
2044
2043
|
}
|
|
2045
2044
|
|
|
2046
|
-
function isMissingRuntimeWorkReceiptKeyConstraintError(
|
|
2047
|
-
error: unknown,
|
|
2048
|
-
): boolean {
|
|
2049
|
-
if (!error || typeof error !== 'object') {
|
|
2050
|
-
return false;
|
|
2051
|
-
}
|
|
2052
|
-
const code = 'code' in error ? String(error.code) : '';
|
|
2053
|
-
const message = 'message' in error ? String(error.message) : '';
|
|
2054
|
-
return (
|
|
2055
|
-
code === '42P10' ||
|
|
2056
|
-
/no unique or exclusion constraint matching the ON CONFLICT specification/i.test(
|
|
2057
|
-
message,
|
|
2058
|
-
)
|
|
2059
|
-
);
|
|
2060
|
-
}
|
|
2061
|
-
|
|
2062
2045
|
function runtimeWorkReceiptEnsureCacheKey(
|
|
2063
2046
|
session: RuntimePostgresSession,
|
|
2064
2047
|
): string {
|
|
@@ -2138,29 +2121,22 @@ async function ensureRuntimeWorkReceiptTable(
|
|
|
2138
2121
|
session,
|
|
2139
2122
|
client,
|
|
2140
2123
|
);
|
|
2141
|
-
if (missingColumns.length
|
|
2142
|
-
await client.query(`
|
|
2143
|
-
ALTER TABLE ${workReceiptTable(session)}
|
|
2144
|
-
${missingColumns
|
|
2145
|
-
.map((column) => {
|
|
2146
|
-
const type =
|
|
2147
|
-
column === 'lease_expires_at'
|
|
2148
|
-
? 'timestamptz'
|
|
2149
|
-
: column === 'lease_owner_attempt'
|
|
2150
|
-
? 'integer'
|
|
2151
|
-
: column === RUNTIME_WORK_RECEIPT_FAILURE_KIND_COLUMN
|
|
2152
|
-
? 'smallint NOT NULL DEFAULT 0'
|
|
2153
|
-
: 'text';
|
|
2154
|
-
return `ADD COLUMN IF NOT EXISTS ${column} ${type}`;
|
|
2155
|
-
})
|
|
2156
|
-
.join(',\n ')}
|
|
2157
|
-
`);
|
|
2158
|
-
}
|
|
2124
|
+
if (missingColumns.length === 0) return;
|
|
2159
2125
|
await client.query(`
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2126
|
+
ALTER TABLE ${workReceiptTable(session)}
|
|
2127
|
+
${missingColumns
|
|
2128
|
+
.map((column) => {
|
|
2129
|
+
const type =
|
|
2130
|
+
column === 'lease_expires_at'
|
|
2131
|
+
? 'timestamptz'
|
|
2132
|
+
: column === 'lease_owner_attempt'
|
|
2133
|
+
? 'integer'
|
|
2134
|
+
: column === RUNTIME_WORK_RECEIPT_FAILURE_KIND_COLUMN
|
|
2135
|
+
? 'smallint NOT NULL DEFAULT 0'
|
|
2136
|
+
: 'text';
|
|
2137
|
+
return `ADD COLUMN IF NOT EXISTS ${column} ${type}`;
|
|
2138
|
+
})
|
|
2139
|
+
.join(',\n ')}
|
|
2164
2140
|
`);
|
|
2165
2141
|
})
|
|
2166
2142
|
.then(() => undefined);
|
|
@@ -2264,8 +2240,7 @@ async function withRuntimeWorkReceiptClient<T>(
|
|
|
2264
2240
|
} catch (error) {
|
|
2265
2241
|
if (
|
|
2266
2242
|
isMissingRelationError(error) ||
|
|
2267
|
-
isMissingRuntimeWorkReceiptSelfHealColumnError(error)
|
|
2268
|
-
isMissingRuntimeWorkReceiptKeyConstraintError(error)
|
|
2243
|
+
isMissingRuntimeWorkReceiptSelfHealColumnError(error)
|
|
2269
2244
|
) {
|
|
2270
2245
|
runtimeWorkReceiptEnsureCache.delete(
|
|
2271
2246
|
runtimeWorkReceiptEnsureCacheKey(session),
|
package/dist/cli/index.js
CHANGED
|
@@ -623,10 +623,10 @@ var SDK_RELEASE = {
|
|
|
623
623
|
// 0.1.154 removes the short-lived generated enrich StepOptions recompute
|
|
624
624
|
// fields shipped in 0.1.153.
|
|
625
625
|
// 0.1.175 ships loud `deepline enrich` empty-waterfall reporting.
|
|
626
|
-
version: "0.1.
|
|
626
|
+
version: "0.1.218",
|
|
627
627
|
apiContract: "2026-06-dataset-handle-results-hard-cutover",
|
|
628
628
|
supportPolicy: {
|
|
629
|
-
latest: "0.1.
|
|
629
|
+
latest: "0.1.218",
|
|
630
630
|
minimumSupported: "0.1.53",
|
|
631
631
|
deprecatedBelow: "0.1.53",
|
|
632
632
|
commandMinimumSupported: [
|
|
@@ -19217,7 +19217,14 @@ async function emitSdkEnrichTelemetry(context, event, summary) {
|
|
|
19217
19217
|
method: "POST",
|
|
19218
19218
|
headers: {
|
|
19219
19219
|
Authorization: `Bearer ${context.apiKey}`,
|
|
19220
|
-
"Content-Type": "application/json"
|
|
19220
|
+
"Content-Type": "application/json",
|
|
19221
|
+
"User-Agent": `deepline-ts-sdk/${SDK_VERSION}`,
|
|
19222
|
+
"X-Deepline-Client-Family": "sdk",
|
|
19223
|
+
"X-Deepline-CLI-Family": "sdk",
|
|
19224
|
+
"X-Deepline-Agent-Runtime": detectAgentRuntime(),
|
|
19225
|
+
"X-Deepline-CLI-Version": SDK_VERSION,
|
|
19226
|
+
"X-Deepline-SDK-Version": SDK_VERSION,
|
|
19227
|
+
"X-Deepline-API-Contract": SDK_API_CONTRACT
|
|
19221
19228
|
},
|
|
19222
19229
|
body: JSON.stringify(body),
|
|
19223
19230
|
signal: controller.signal
|
package/dist/cli/index.mjs
CHANGED
|
@@ -608,10 +608,10 @@ var SDK_RELEASE = {
|
|
|
608
608
|
// 0.1.154 removes the short-lived generated enrich StepOptions recompute
|
|
609
609
|
// fields shipped in 0.1.153.
|
|
610
610
|
// 0.1.175 ships loud `deepline enrich` empty-waterfall reporting.
|
|
611
|
-
version: "0.1.
|
|
611
|
+
version: "0.1.218",
|
|
612
612
|
apiContract: "2026-06-dataset-handle-results-hard-cutover",
|
|
613
613
|
supportPolicy: {
|
|
614
|
-
latest: "0.1.
|
|
614
|
+
latest: "0.1.218",
|
|
615
615
|
minimumSupported: "0.1.53",
|
|
616
616
|
deprecatedBelow: "0.1.53",
|
|
617
617
|
commandMinimumSupported: [
|
|
@@ -19246,7 +19246,14 @@ async function emitSdkEnrichTelemetry(context, event, summary) {
|
|
|
19246
19246
|
method: "POST",
|
|
19247
19247
|
headers: {
|
|
19248
19248
|
Authorization: `Bearer ${context.apiKey}`,
|
|
19249
|
-
"Content-Type": "application/json"
|
|
19249
|
+
"Content-Type": "application/json",
|
|
19250
|
+
"User-Agent": `deepline-ts-sdk/${SDK_VERSION}`,
|
|
19251
|
+
"X-Deepline-Client-Family": "sdk",
|
|
19252
|
+
"X-Deepline-CLI-Family": "sdk",
|
|
19253
|
+
"X-Deepline-Agent-Runtime": detectAgentRuntime(),
|
|
19254
|
+
"X-Deepline-CLI-Version": SDK_VERSION,
|
|
19255
|
+
"X-Deepline-SDK-Version": SDK_VERSION,
|
|
19256
|
+
"X-Deepline-API-Contract": SDK_API_CONTRACT
|
|
19250
19257
|
},
|
|
19251
19258
|
body: JSON.stringify(body),
|
|
19252
19259
|
signal: controller.signal
|
package/dist/index.js
CHANGED
|
@@ -422,10 +422,10 @@ var SDK_RELEASE = {
|
|
|
422
422
|
// 0.1.154 removes the short-lived generated enrich StepOptions recompute
|
|
423
423
|
// fields shipped in 0.1.153.
|
|
424
424
|
// 0.1.175 ships loud `deepline enrich` empty-waterfall reporting.
|
|
425
|
-
version: "0.1.
|
|
425
|
+
version: "0.1.218",
|
|
426
426
|
apiContract: "2026-06-dataset-handle-results-hard-cutover",
|
|
427
427
|
supportPolicy: {
|
|
428
|
-
latest: "0.1.
|
|
428
|
+
latest: "0.1.218",
|
|
429
429
|
minimumSupported: "0.1.53",
|
|
430
430
|
deprecatedBelow: "0.1.53",
|
|
431
431
|
commandMinimumSupported: [
|
package/dist/index.mjs
CHANGED
|
@@ -352,10 +352,10 @@ var SDK_RELEASE = {
|
|
|
352
352
|
// 0.1.154 removes the short-lived generated enrich StepOptions recompute
|
|
353
353
|
// fields shipped in 0.1.153.
|
|
354
354
|
// 0.1.175 ships loud `deepline enrich` empty-waterfall reporting.
|
|
355
|
-
version: "0.1.
|
|
355
|
+
version: "0.1.218",
|
|
356
356
|
apiContract: "2026-06-dataset-handle-results-hard-cutover",
|
|
357
357
|
supportPolicy: {
|
|
358
|
-
latest: "0.1.
|
|
358
|
+
latest: "0.1.218",
|
|
359
359
|
minimumSupported: "0.1.53",
|
|
360
360
|
deprecatedBelow: "0.1.53",
|
|
361
361
|
commandMinimumSupported: [
|
package/package.json
CHANGED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
PLAY_RUNTIME_API_CURRENT_PATH,
|
|
3
|
-
PLAY_RUNTIME_CHILD_EXECUTOR_TOKEN_CURRENT_PATH,
|
|
4
|
-
PLAY_RUNTIME_EGRESS_FETCH_CURRENT_PATH,
|
|
5
|
-
} from '../../../shared_libs/play-runtime/runtime-api-paths';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Paths a credential-isolated Daytona sandbox may send through the
|
|
9
|
-
* coordinator. The sandbox receives the coordinator as its runtime origin so
|
|
10
|
-
* it never holds the Vercel protection-bypass credential; the harness owns the
|
|
11
|
-
* protected upstream hop. Keep this deliberately narrower than the harness
|
|
12
|
-
* allowlist: a coordinator URL is public, while the harness is a service
|
|
13
|
-
* binding.
|
|
14
|
-
*/
|
|
15
|
-
export function isCoordinatorRuntimeProxyPath(pathname: string): boolean {
|
|
16
|
-
return (
|
|
17
|
-
pathname === PLAY_RUNTIME_API_CURRENT_PATH ||
|
|
18
|
-
pathname === PLAY_RUNTIME_CHILD_EXECUTOR_TOKEN_CURRENT_PATH ||
|
|
19
|
-
pathname === PLAY_RUNTIME_EGRESS_FETCH_CURRENT_PATH ||
|
|
20
|
-
pathname === '/api/v2/plays/run' ||
|
|
21
|
-
/^\/api\/v2\/plays\/runtime-tools\/[^/]+(?:\/(?:auth-scope|event-wait))?$/.test(
|
|
22
|
-
pathname,
|
|
23
|
-
) ||
|
|
24
|
-
/^\/api\/v2\/integrations\/[^/]+\/(?:execute|stream)$/.test(pathname)
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function executorTokenFromAuthorizationHeader(
|
|
29
|
-
authorization: string | null,
|
|
30
|
-
): string | null {
|
|
31
|
-
const match = /^Bearer\s+(.+)$/i.exec(authorization?.trim() ?? '');
|
|
32
|
-
const token = match?.[1]?.trim();
|
|
33
|
-
return token || null;
|
|
34
|
-
}
|