deepline 0.3.45 → 0.3.47
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 +2 -3
- package/dist/bundling-sources/sdk/src/errors.ts +2 -2
- package/dist/bundling-sources/sdk/src/http.ts +1 -1
- package/dist/bundling-sources/sdk/src/play.ts +7 -10
- package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +3 -3
- package/dist/bundling-sources/sdk/src/release.ts +3 -3
- package/dist/bundling-sources/sdk/src/version.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-data-plane/contracts.ts +25 -0
- package/dist/bundling-sources/shared_libs/play-data-plane/index.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-data-plane/sheet-contract.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +19 -19
- package/dist/bundling-sources/shared_libs/play-runtime/backend.ts +5 -6
- package/dist/bundling-sources/shared_libs/play-runtime/cell-staleness.ts +1 -66
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +11 -11
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +3 -3
- package/dist/bundling-sources/shared_libs/play-runtime/dataset-id.ts +4 -3
- package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +3 -4
- package/dist/bundling-sources/shared_libs/play-runtime/durable-receipt-execution.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-runtime/email-status.ts +1 -275
- package/dist/bundling-sources/shared_libs/play-runtime/execution-ledger-store.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/extractor-targets.ts +1 -106
- package/dist/bundling-sources/shared_libs/play-runtime/gateway-postgres-admission.ts +1 -2
- package/dist/bundling-sources/shared_libs/play-runtime/governor/in-memory-rate-state-backend.ts +13 -4
- package/dist/bundling-sources/shared_libs/play-runtime/live-events.ts +1 -5
- package/dist/bundling-sources/shared_libs/play-runtime/map-row-identity.ts +2 -3
- package/dist/bundling-sources/shared_libs/play-runtime/map-row-outcome.ts +2 -1
- package/dist/bundling-sources/shared_libs/play-runtime/modal-runtime-config.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/output-size-limits.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/projection.ts +5 -5
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +3 -3
- package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/run-snapshot-stream.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +4 -4
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-modal-fallback.ts +3 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +8 -8
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-session-execution.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +4 -4
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/local-process.ts +7 -7
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +7 -7
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/bundle.ts +13 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/index.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runner-events.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/types.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-actions.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +6 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-constants.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-constraints.ts +1 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-env.ts +55 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runtime-limits.ts +1 -109
- package/dist/bundling-sources/shared_libs/play-runtime/step-program-dataset-builder.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execution-outcome.ts +6 -5
- package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result-types.ts +1 -206
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +10 -7
- package/dist/bundling-sources/shared_libs/play-runtime/work-receipts.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +8 -3
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +4 -4
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +3 -6
- package/dist/bundling-sources/shared_libs/plays/cell-staleness.ts +66 -0
- package/dist/bundling-sources/shared_libs/plays/compiler-manifest.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/contracts.ts +2 -2
- package/dist/bundling-sources/shared_libs/plays/core.ts +466 -0
- package/dist/bundling-sources/shared_libs/plays/email-status.ts +287 -0
- package/dist/bundling-sources/shared_libs/plays/extractor-targets.ts +106 -0
- package/dist/bundling-sources/shared_libs/plays/row-identity.ts +1 -3
- package/dist/bundling-sources/shared_libs/plays/runtime-constraints.ts +2 -0
- package/dist/bundling-sources/shared_libs/plays/runtime-validation.ts +4 -2
- package/dist/bundling-sources/shared_libs/plays/sandbox-runtime-limits.ts +109 -0
- package/dist/bundling-sources/shared_libs/plays/tool-execution-error.ts +624 -0
- package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +206 -0
- package/dist/bundling-sources/shared_libs/security/safe-outbound-fetch.ts +1 -1
- package/dist/cli/index.js +181 -169
- package/dist/cli/index.mjs +189 -170
- package/dist/{compiler-manifest-DwYe2C2S.d.mts → compiler-manifest-BuoqasqI.d.mts} +585 -540
- package/dist/{compiler-manifest-DwYe2C2S.d.ts → compiler-manifest-BuoqasqI.d.ts} +585 -540
- package/dist/index.d.mts +9 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.js +47 -40
- package/dist/index.mjs +47 -40
- package/dist/install-integrity.json +13 -3
- package/dist/plays/bundle-play-file.d.mts +4 -61
- package/dist/plays/bundle-play-file.d.ts +4 -61
- package/dist/plays/bundle-play-file.mjs +157 -155
- package/package.json +9 -6
- /package/dist/bundling-sources/shared_libs/{play-runtime → plays}/tool-response-contract.ts +0 -0
|
@@ -1,275 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
| 'send'
|
|
3
|
-
| 'send_with_caution'
|
|
4
|
-
| 'verify_next'
|
|
5
|
-
| 'hold'
|
|
6
|
-
| 'drop';
|
|
7
|
-
|
|
8
|
-
export type EmailStatusValue =
|
|
9
|
-
| 'valid'
|
|
10
|
-
| 'invalid'
|
|
11
|
-
| 'catch_all'
|
|
12
|
-
| 'valid_catch_all'
|
|
13
|
-
| 'unknown'
|
|
14
|
-
| 'do_not_mail'
|
|
15
|
-
| 'spamtrap'
|
|
16
|
-
| 'abuse'
|
|
17
|
-
| 'disposable';
|
|
18
|
-
|
|
19
|
-
export type EmailDeliverability = 'high' | 'medium' | 'low' | 'unknown';
|
|
20
|
-
|
|
21
|
-
export type EmailMxClass =
|
|
22
|
-
| 'consumer_mailbox'
|
|
23
|
-
| 'workspace_mailbox'
|
|
24
|
-
| 'security_gateway'
|
|
25
|
-
| 'on_prem'
|
|
26
|
-
| 'unknown';
|
|
27
|
-
|
|
28
|
-
export type EmailStatus = {
|
|
29
|
-
verdict: EmailStatusVerdict;
|
|
30
|
-
status: EmailStatusValue;
|
|
31
|
-
verified: boolean;
|
|
32
|
-
confidence: number | null;
|
|
33
|
-
reasons: string[];
|
|
34
|
-
signals: {
|
|
35
|
-
catch_all: boolean | null;
|
|
36
|
-
deliverability: EmailDeliverability;
|
|
37
|
-
mx_class: EmailMxClass;
|
|
38
|
-
mx_provider: string | null;
|
|
39
|
-
mx_record: string | null;
|
|
40
|
-
fraud_score: number | null;
|
|
41
|
-
disposable: boolean | null;
|
|
42
|
-
role_based: boolean | null;
|
|
43
|
-
free_email: boolean | null;
|
|
44
|
-
abuse: boolean | null;
|
|
45
|
-
spamtrap: boolean | null;
|
|
46
|
-
suspect: boolean | null;
|
|
47
|
-
valid: boolean | null;
|
|
48
|
-
};
|
|
49
|
-
provider: {
|
|
50
|
-
name: string;
|
|
51
|
-
raw_status: string | boolean | number | null;
|
|
52
|
-
raw_score: number | null;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export type EmailStatusMapEntry = {
|
|
57
|
-
status: EmailStatusValue;
|
|
58
|
-
verdict?: EmailStatusVerdict;
|
|
59
|
-
verified?: boolean;
|
|
60
|
-
reason?: string;
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export type EmailStatusRule = EmailStatusMapEntry & {
|
|
64
|
-
when: Record<string, string | number | boolean | null>;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export type EmailStatusExtractorConfig = {
|
|
68
|
-
provider: string;
|
|
69
|
-
rawStatus?: string[];
|
|
70
|
-
rawScore?: string[];
|
|
71
|
-
valid?: string[];
|
|
72
|
-
deliverability?: string[];
|
|
73
|
-
catchAll?: string[];
|
|
74
|
-
mxProvider?: string[];
|
|
75
|
-
mxRecord?: string[];
|
|
76
|
-
fraudScore?: string[];
|
|
77
|
-
disposable?: string[];
|
|
78
|
-
roleBased?: string[];
|
|
79
|
-
freeEmail?: string[];
|
|
80
|
-
abuse?: string[];
|
|
81
|
-
spamtrap?: string[];
|
|
82
|
-
suspect?: string[];
|
|
83
|
-
statusMap?: Record<string, EmailStatusMapEntry>;
|
|
84
|
-
rules?: EmailStatusRule[];
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
export type EmailStatusBuildInput = {
|
|
88
|
-
config: EmailStatusExtractorConfig;
|
|
89
|
-
values: Record<string, unknown>;
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
// There is intentionally NO shared default status map. Each provider must
|
|
93
|
-
// declare its own `statusMap` / `rules` for the raw status strings it emits
|
|
94
|
-
// (see the provider registries under src/lib/integrations/**). A coarse global
|
|
95
|
-
// map silently coerced provider-specific strings ("deliverable", "accept_all",
|
|
96
|
-
// etc.) into canonical verdicts and let validators depend on guesses instead of
|
|
97
|
-
// documented behavior. With it gone, an unmapped raw status falls through to
|
|
98
|
-
// the typed signal inference below (and ultimately to `unknown`/`hold`) rather
|
|
99
|
-
// than being normalized by a global lookup — loud and provider-declared over
|
|
100
|
-
// silent and implicit.
|
|
101
|
-
|
|
102
|
-
function normalizeKey(value: unknown): string | null {
|
|
103
|
-
if (value == null) return null;
|
|
104
|
-
if (typeof value === 'boolean') return String(value);
|
|
105
|
-
const normalized = String(value).trim().toLowerCase().replace(/\s+/g, '_');
|
|
106
|
-
return normalized || null;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function boolish(value: unknown): boolean | null {
|
|
110
|
-
if (typeof value === 'boolean') return value;
|
|
111
|
-
if (typeof value === 'number') return value === 1 ? true : value === 0 ? false : null;
|
|
112
|
-
if (typeof value !== 'string') return null;
|
|
113
|
-
const normalized = value.trim().toLowerCase();
|
|
114
|
-
if (['true', 'yes', 'y', '1'].includes(normalized)) return true;
|
|
115
|
-
if (['false', 'no', 'n', '0'].includes(normalized)) return false;
|
|
116
|
-
return null;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
function numberish(value: unknown): number | null {
|
|
120
|
-
if (typeof value === 'number' && Number.isFinite(value)) return value;
|
|
121
|
-
if (typeof value !== 'string' || value.trim() === '') return null;
|
|
122
|
-
const parsed = Number(value);
|
|
123
|
-
return Number.isFinite(parsed) ? parsed : null;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function stringish(value: unknown): string | null {
|
|
127
|
-
return typeof value === 'string' && value.trim() ? value.trim() : null;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
function deliverability(value: unknown): EmailDeliverability {
|
|
131
|
-
const normalized = normalizeKey(value);
|
|
132
|
-
return normalized === 'high' || normalized === 'medium' || normalized === 'low'
|
|
133
|
-
? normalized
|
|
134
|
-
: 'unknown';
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
function mxClass(mxProvider: unknown, mxRecord: unknown): EmailMxClass {
|
|
138
|
-
const haystack = `${stringish(mxProvider) ?? ''} ${stringish(mxRecord) ?? ''}`.toLowerCase();
|
|
139
|
-
if (!haystack.trim()) return 'unknown';
|
|
140
|
-
if (
|
|
141
|
-
/proofpoint|pphosted|mimecast|barracuda|ess\.barracudanetworks|ironport|cisco|iphmx|messagelabs|symantec/.test(
|
|
142
|
-
haystack,
|
|
143
|
-
)
|
|
144
|
-
) {
|
|
145
|
-
return 'security_gateway';
|
|
146
|
-
}
|
|
147
|
-
if (/aspmx\.l\.google|google|g-suite|google workspace/.test(haystack)) {
|
|
148
|
-
return 'workspace_mailbox';
|
|
149
|
-
}
|
|
150
|
-
if (/protection\.outlook|office365|microsoft|outlook|exchange online/.test(haystack)) {
|
|
151
|
-
return 'workspace_mailbox';
|
|
152
|
-
}
|
|
153
|
-
if (/gmail|yahoo|icloud|aol|hotmail/.test(haystack)) return 'consumer_mailbox';
|
|
154
|
-
if (/postfix|exim|sendmail|zimbra|plesk|cpanel|mail\./.test(haystack)) return 'on_prem';
|
|
155
|
-
return 'unknown';
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
function entryForStatus(
|
|
159
|
-
key: string | null,
|
|
160
|
-
map: Record<string, EmailStatusMapEntry> | undefined,
|
|
161
|
-
): EmailStatusMapEntry | null {
|
|
162
|
-
if (!key) return null;
|
|
163
|
-
return map?.[key] ?? null;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
function read(values: Record<string, unknown>, name: string): unknown {
|
|
167
|
-
return values[name];
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
function matchesRule(
|
|
171
|
-
rule: EmailStatusRule,
|
|
172
|
-
values: Record<string, unknown>,
|
|
173
|
-
): boolean {
|
|
174
|
-
return Object.entries(rule.when).every(([key, expected]) => {
|
|
175
|
-
const actual = read(values, key);
|
|
176
|
-
if (key.endsWith('Lt')) {
|
|
177
|
-
const source = numberish(read(values, key.slice(0, -2)));
|
|
178
|
-
return typeof expected === 'number' && source != null && source < expected;
|
|
179
|
-
}
|
|
180
|
-
if (typeof expected === 'boolean') return boolish(actual) === expected;
|
|
181
|
-
if (typeof expected === 'number') return numberish(actual) === expected;
|
|
182
|
-
return normalizeKey(actual) === normalizeKey(expected);
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
export function buildEmailStatus({
|
|
187
|
-
config,
|
|
188
|
-
values,
|
|
189
|
-
}: EmailStatusBuildInput): EmailStatus {
|
|
190
|
-
const rawStatus = read(values, 'rawStatus');
|
|
191
|
-
const rawScore = numberish(read(values, 'rawScore'));
|
|
192
|
-
const valid = boolish(read(values, 'valid'));
|
|
193
|
-
const catchAll = boolish(read(values, 'catchAll'));
|
|
194
|
-
const disposable = boolish(read(values, 'disposable'));
|
|
195
|
-
const abuse = boolish(read(values, 'abuse'));
|
|
196
|
-
const spamtrap = boolish(read(values, 'spamtrap'));
|
|
197
|
-
const suspect = boolish(read(values, 'suspect'));
|
|
198
|
-
const rawKey = normalizeKey(rawStatus);
|
|
199
|
-
const mapped =
|
|
200
|
-
config.rules?.find((rule) => matchesRule(rule, values)) ??
|
|
201
|
-
entryForStatus(rawKey, config.statusMap) ??
|
|
202
|
-
entryForStatus(valid == null ? null : String(valid), config.statusMap);
|
|
203
|
-
|
|
204
|
-
const status =
|
|
205
|
-
mapped?.status ??
|
|
206
|
-
(disposable
|
|
207
|
-
? 'disposable'
|
|
208
|
-
: abuse
|
|
209
|
-
? 'abuse'
|
|
210
|
-
: spamtrap
|
|
211
|
-
? 'spamtrap'
|
|
212
|
-
: catchAll
|
|
213
|
-
? 'catch_all'
|
|
214
|
-
: valid === true
|
|
215
|
-
? 'valid'
|
|
216
|
-
: valid === false
|
|
217
|
-
? 'invalid'
|
|
218
|
-
: 'unknown');
|
|
219
|
-
const defaultVerdict: EmailStatusVerdict =
|
|
220
|
-
status === 'valid'
|
|
221
|
-
? 'send'
|
|
222
|
-
: status === 'valid_catch_all'
|
|
223
|
-
? 'send_with_caution'
|
|
224
|
-
: status === 'catch_all'
|
|
225
|
-
? 'verify_next'
|
|
226
|
-
: status === 'unknown'
|
|
227
|
-
? 'hold'
|
|
228
|
-
: 'drop';
|
|
229
|
-
const verdict = mapped?.verdict ?? defaultVerdict;
|
|
230
|
-
const verified =
|
|
231
|
-
mapped?.verified ??
|
|
232
|
-
(status === 'valid' || status === 'valid_catch_all' || verdict === 'send');
|
|
233
|
-
const reasons = [
|
|
234
|
-
mapped?.reason,
|
|
235
|
-
catchAll ? 'catch_all_domain' : null,
|
|
236
|
-
mxClass(read(values, 'mxProvider'), read(values, 'mxRecord')) ===
|
|
237
|
-
'security_gateway'
|
|
238
|
-
? 'security_gateway_mx'
|
|
239
|
-
: null,
|
|
240
|
-
suspect ? 'provider_marked_suspect' : null,
|
|
241
|
-
].filter((reason): reason is string => typeof reason === 'string');
|
|
242
|
-
|
|
243
|
-
return {
|
|
244
|
-
verdict,
|
|
245
|
-
status,
|
|
246
|
-
verified,
|
|
247
|
-
confidence: rawScore,
|
|
248
|
-
reasons,
|
|
249
|
-
signals: {
|
|
250
|
-
catch_all: catchAll,
|
|
251
|
-
deliverability: deliverability(read(values, 'deliverability')),
|
|
252
|
-
mx_class: mxClass(read(values, 'mxProvider'), read(values, 'mxRecord')),
|
|
253
|
-
mx_provider: stringish(read(values, 'mxProvider')),
|
|
254
|
-
mx_record: stringish(read(values, 'mxRecord')),
|
|
255
|
-
fraud_score: numberish(read(values, 'fraudScore')),
|
|
256
|
-
disposable,
|
|
257
|
-
role_based: boolish(read(values, 'roleBased')),
|
|
258
|
-
free_email: boolish(read(values, 'freeEmail')),
|
|
259
|
-
abuse,
|
|
260
|
-
spamtrap,
|
|
261
|
-
suspect,
|
|
262
|
-
valid,
|
|
263
|
-
},
|
|
264
|
-
provider: {
|
|
265
|
-
name: config.provider,
|
|
266
|
-
raw_status:
|
|
267
|
-
typeof rawStatus === 'string' ||
|
|
268
|
-
typeof rawStatus === 'boolean' ||
|
|
269
|
-
typeof rawStatus === 'number'
|
|
270
|
-
? rawStatus
|
|
271
|
-
: null,
|
|
272
|
-
raw_score: rawScore,
|
|
273
|
-
},
|
|
274
|
-
};
|
|
275
|
-
}
|
|
1
|
+
export * from '../plays/email-status';
|
|
@@ -9,7 +9,7 @@ import type {
|
|
|
9
9
|
WorkReceiptFailureKind,
|
|
10
10
|
WorkReceiptGetCommand,
|
|
11
11
|
} from './work-receipts';
|
|
12
|
-
import type { ToolExecutionFailureV1 } from '../tool-execution-error';
|
|
12
|
+
import type { ToolExecutionFailureV1 } from '../plays/tool-execution-error';
|
|
13
13
|
|
|
14
14
|
export type WorkReceiptBatchGetCommand = {
|
|
15
15
|
playName: string;
|
|
@@ -1,106 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export const JOB_CHANGE_STATUS_VALUES = [
|
|
4
|
-
'moved',
|
|
5
|
-
'no_change',
|
|
6
|
-
'left_company',
|
|
7
|
-
'unknown',
|
|
8
|
-
'profile_unavailable',
|
|
9
|
-
'no_new_company',
|
|
10
|
-
] as const;
|
|
11
|
-
|
|
12
|
-
export type JobChangeStatus = (typeof JOB_CHANGE_STATUS_VALUES)[number];
|
|
13
|
-
|
|
14
|
-
export type JobChangeGetterValue = {
|
|
15
|
-
status: JobChangeStatus;
|
|
16
|
-
date: string | null;
|
|
17
|
-
new_company: string | null;
|
|
18
|
-
new_title: string | null;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const PHONE_STATUS_VALUES = ['valid', 'invalid', 'unknown'] as const;
|
|
22
|
-
|
|
23
|
-
export type PhoneStatus = (typeof PHONE_STATUS_VALUES)[number];
|
|
24
|
-
|
|
25
|
-
export const DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS = {
|
|
26
|
-
id: { identity: true, valueKind: 'string' },
|
|
27
|
-
name: { identity: true, valueKind: 'string' },
|
|
28
|
-
email: { identity: true, valueKind: 'string' },
|
|
29
|
-
personal_email: { identity: true, valueKind: 'string' },
|
|
30
|
-
phone: { identity: true, valueKind: 'string' },
|
|
31
|
-
linkedin: { identity: true, valueKind: 'string' },
|
|
32
|
-
linkedin_url: { identity: true, valueKind: 'string' },
|
|
33
|
-
domain: { identity: true, valueKind: 'string' },
|
|
34
|
-
website: { identity: true, valueKind: 'string' },
|
|
35
|
-
first_name: { identity: true, valueKind: 'string' },
|
|
36
|
-
last_name: { identity: true, valueKind: 'string' },
|
|
37
|
-
full_name: { identity: true, valueKind: 'string' },
|
|
38
|
-
company: { identity: true, valueKind: 'string' },
|
|
39
|
-
company_name: { identity: true, valueKind: 'string' },
|
|
40
|
-
organization_name: { identity: true, valueKind: 'string' },
|
|
41
|
-
company_domain: { identity: true, valueKind: 'string' },
|
|
42
|
-
company_website: { identity: true, valueKind: 'string' },
|
|
43
|
-
company_linkedin_url: { identity: true, valueKind: 'string' },
|
|
44
|
-
title: { identity: false, valueKind: 'string' },
|
|
45
|
-
industry: { identity: false, valueKind: 'string' },
|
|
46
|
-
status: { identity: false, valueKind: 'string' },
|
|
47
|
-
job_change: { identity: false, valueKind: 'job_change' },
|
|
48
|
-
job_change_status: {
|
|
49
|
-
identity: false,
|
|
50
|
-
valueKind: 'job_change_status',
|
|
51
|
-
enum: JOB_CHANGE_STATUS_VALUES,
|
|
52
|
-
},
|
|
53
|
-
email_status: { identity: false, valueKind: 'email_status' },
|
|
54
|
-
phone_status: {
|
|
55
|
-
identity: false,
|
|
56
|
-
valueKind: 'phone_status',
|
|
57
|
-
enum: PHONE_STATUS_VALUES,
|
|
58
|
-
},
|
|
59
|
-
} as const;
|
|
60
|
-
|
|
61
|
-
export type DeeplineExtractorTarget =
|
|
62
|
-
keyof typeof DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS;
|
|
63
|
-
|
|
64
|
-
export const DEEPLINE_EXTRACTOR_TARGETS = Object.keys(
|
|
65
|
-
DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS,
|
|
66
|
-
) as DeeplineExtractorTarget[];
|
|
67
|
-
|
|
68
|
-
export type DeeplineEmailStatusGetterValue = EmailStatus;
|
|
69
|
-
|
|
70
|
-
export type DeeplineGetterValueMap = {
|
|
71
|
-
id: string;
|
|
72
|
-
name: string;
|
|
73
|
-
email: string;
|
|
74
|
-
personal_email: string;
|
|
75
|
-
phone: string;
|
|
76
|
-
linkedin: string;
|
|
77
|
-
linkedin_url: string;
|
|
78
|
-
domain: string;
|
|
79
|
-
website: string;
|
|
80
|
-
first_name: string;
|
|
81
|
-
last_name: string;
|
|
82
|
-
full_name: string;
|
|
83
|
-
company: string;
|
|
84
|
-
company_name: string;
|
|
85
|
-
organization_name: string;
|
|
86
|
-
company_domain: string;
|
|
87
|
-
company_website: string;
|
|
88
|
-
company_linkedin_url: string;
|
|
89
|
-
title: string;
|
|
90
|
-
industry: string;
|
|
91
|
-
status: string;
|
|
92
|
-
job_change: JobChangeGetterValue;
|
|
93
|
-
job_change_status: JobChangeStatus;
|
|
94
|
-
email_status: EmailStatus;
|
|
95
|
-
phone_status: PhoneStatus;
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
export type DeeplineGetterValue<
|
|
99
|
-
TTarget extends DeeplineExtractorTarget = DeeplineExtractorTarget,
|
|
100
|
-
> = DeeplineGetterValueMap[TTarget];
|
|
101
|
-
|
|
102
|
-
export function isDeeplineExtractorTarget(
|
|
103
|
-
value: string,
|
|
104
|
-
): value is DeeplineExtractorTarget {
|
|
105
|
-
return value in DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS;
|
|
106
|
-
}
|
|
1
|
+
export * from '../plays/extractor-targets';
|
|
@@ -104,8 +104,7 @@ export class GatewayPostgresAdmission {
|
|
|
104
104
|
#canGrant(lane: GatewayPostgresLane): boolean {
|
|
105
105
|
if (this.#activeTotal() >= this.#maxTotalActive()) return false;
|
|
106
106
|
return (
|
|
107
|
-
lane === 'commit' ||
|
|
108
|
-
this.#ordinaryActive < this.#maxOrdinaryActive()
|
|
107
|
+
lane === 'commit' || this.#ordinaryActive < this.#maxOrdinaryActive()
|
|
109
108
|
);
|
|
110
109
|
}
|
|
111
110
|
|
package/dist/bundling-sources/shared_libs/play-runtime/governor/in-memory-rate-state-backend.ts
CHANGED
|
@@ -70,14 +70,21 @@ export class InMemoryRateStateBackend implements RateStateBackend {
|
|
|
70
70
|
const state = this.getRuleState(bucketId, rule, now);
|
|
71
71
|
this.resetExpiredWindow(state, rule.windowMs, now);
|
|
72
72
|
if (state.startedInWindow >= rule.requestsPerWindow) {
|
|
73
|
-
waitMs = Math.max(
|
|
73
|
+
waitMs = Math.max(
|
|
74
|
+
waitMs,
|
|
75
|
+
state.windowStartedAt + rule.windowMs - now,
|
|
76
|
+
);
|
|
74
77
|
}
|
|
75
|
-
if (
|
|
78
|
+
if (
|
|
79
|
+
rule.maxConcurrency != null &&
|
|
80
|
+
state.activeCount >= rule.maxConcurrency
|
|
81
|
+
) {
|
|
76
82
|
waitMs = Math.max(waitMs, MIN_CONCURRENCY_WAIT_MS);
|
|
77
83
|
}
|
|
78
84
|
}
|
|
79
85
|
|
|
80
|
-
if (waitMs > 0)
|
|
86
|
+
if (waitMs > 0)
|
|
87
|
+
return { acquired: false, waitMs: Math.max(1, waitMs) } as const;
|
|
81
88
|
|
|
82
89
|
for (const rule of ordered) {
|
|
83
90
|
const state = this.getRuleState(bucketId, rule, now);
|
|
@@ -99,7 +106,9 @@ export class InMemoryRateStateBackend implements RateStateBackend {
|
|
|
99
106
|
void this.withLock(() => {
|
|
100
107
|
for (const rule of ordered) {
|
|
101
108
|
if (rule.maxConcurrency == null) continue;
|
|
102
|
-
const state = this.ruleStates.get(
|
|
109
|
+
const state = this.ruleStates.get(
|
|
110
|
+
this.key(bucketId, rule.ruleId),
|
|
111
|
+
);
|
|
103
112
|
if (state && state.activeCount > 0) state.activeCount -= 1;
|
|
104
113
|
}
|
|
105
114
|
});
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
derivePlayRowIdentity,
|
|
3
3
|
derivePlayRowIdentityFromKey,
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
// packaged runner entry), where only relative imports resolve.
|
|
4
|
+
// The SDK pack adapter rewrites this workspace import to the preserved
|
|
5
|
+
// relative dist/bundling-sources layout.
|
|
7
6
|
} from '../plays/row-identity';
|
|
8
7
|
import type { MapExecutionScope } from './ctx-types';
|
|
9
8
|
|
|
@@ -39,7 +39,8 @@ export function mapRowOutcomeRuntimeFields(input: {
|
|
|
39
39
|
}): Record<string, unknown> {
|
|
40
40
|
return {
|
|
41
41
|
[MAP_ROW_OUTCOME_RUNTIME_FIELDS.rowKey]: input.key,
|
|
42
|
-
...(typeof input.inputIndex === 'number' &&
|
|
42
|
+
...(typeof input.inputIndex === 'number' &&
|
|
43
|
+
Number.isFinite(input.inputIndex)
|
|
43
44
|
? { [MAP_ROW_OUTCOME_RUNTIME_FIELDS.inputIndex]: input.inputIndex }
|
|
44
45
|
: {}),
|
|
45
46
|
...(input.cellMetaPatch
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
STANDARD_PLAY_SANDBOX_RUNTIME_LIMITS,
|
|
5
5
|
validatePlaySandboxRuntimeLimits,
|
|
6
6
|
type PlaySandboxRuntimeLimits,
|
|
7
|
-
} from '
|
|
7
|
+
} from '../plays/sandbox-runtime-limits';
|
|
8
8
|
|
|
9
9
|
export const MODAL_RUNNER_APP_NAME = 'deepline-play-runner';
|
|
10
10
|
export const MODAL_RUNNER_IMAGE = 'node:20-bookworm-slim';
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
// See docs/extractor-projection-unification.md and CONTEXT.md ("Provider Email
|
|
15
15
|
// Status Contract").
|
|
16
16
|
|
|
17
|
-
import { buildEmailStatus } from '
|
|
18
|
-
import type { EmailStatusExtractorConfig } from '
|
|
17
|
+
import { buildEmailStatus } from '../plays/email-status';
|
|
18
|
+
import type { EmailStatusExtractorConfig } from '../plays/email-status';
|
|
19
19
|
import {
|
|
20
20
|
JOB_CHANGE_STATUS_VALUES,
|
|
21
21
|
type JobChangeGetterValue,
|
|
22
22
|
type JobChangeStatus,
|
|
23
|
-
} from '
|
|
23
|
+
} from '../plays/extractor-targets';
|
|
24
24
|
|
|
25
25
|
/** A located value (value + the concrete path it came from), or null on miss. */
|
|
26
26
|
export type ProjectionHit = { value: unknown; path: string } | null;
|
|
@@ -130,12 +130,12 @@ function normalizeJobChange(value: unknown): JobChangeGetterValue {
|
|
|
130
130
|
return {
|
|
131
131
|
status,
|
|
132
132
|
date: moved
|
|
133
|
-
? normalizeString(
|
|
133
|
+
? (normalizeString(
|
|
134
134
|
output.date ??
|
|
135
135
|
output.job_change_date ??
|
|
136
136
|
output.change_date ??
|
|
137
137
|
output.changed_at,
|
|
138
|
-
) ?? firstExperienceDate(person.experiences)
|
|
138
|
+
) ?? firstExperienceDate(person.experiences))
|
|
139
139
|
: null,
|
|
140
140
|
new_company: moved
|
|
141
141
|
? normalizeString(
|
|
@@ -11,11 +11,11 @@ import type { PlayLiveEventSource } from './live-events';
|
|
|
11
11
|
import type { PreloadedRuntimeDbSession } from './db-session';
|
|
12
12
|
import type { PacingRule } from './governor/rate-state-backend';
|
|
13
13
|
import type { GovernanceSnapshot } from './governor/governor';
|
|
14
|
-
import type { PlaySandboxRuntimeLimits } from '
|
|
14
|
+
import type { PlaySandboxRuntimeLimits } from '../plays/sandbox-runtime-limits';
|
|
15
15
|
import type { PlayRunInputPayload } from './play-input';
|
|
16
16
|
import type { PlayRunFailureDetails } from './run-failure';
|
|
17
|
-
import type { ToolExecutionErrorSchemaVersion } from '../tool-execution-error';
|
|
18
|
-
import type { ToolResponseContract } from '
|
|
17
|
+
import type { ToolExecutionErrorSchemaVersion } from '../plays/tool-execution-error';
|
|
18
|
+
import type { ToolResponseContract } from '../plays/tool-response-contract';
|
|
19
19
|
import type { FixtureBehavior } from './fixture-behavior';
|
|
20
20
|
|
|
21
21
|
export type PlayRunnerRateStateBackendConfig =
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
ToolExecutionError,
|
|
3
3
|
type ToolExecutionErrorCategory,
|
|
4
4
|
type ToolExecutionErrorOrigin,
|
|
5
|
-
} from '../tool-execution-error';
|
|
5
|
+
} from '../plays/tool-execution-error';
|
|
6
6
|
|
|
7
7
|
const CLOUDFLARE_DURABLE_OBJECT_RESET_RE =
|
|
8
8
|
/Durable Object.*(?:code (?:was|has been) updated|storage caused object)/;
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
* the live snapshot shape, plus the differ that turns successive snapshots
|
|
30
30
|
* into incremental `play.*` live events. This module is shared between the
|
|
31
31
|
* Vercel app (legacy SSE shim, dashboard) and the SDK subscription transport
|
|
32
|
-
* (`sdk/src/runs/observe-transport.ts`), so both watchers render identical
|
|
32
|
+
* (`packages/sdk/src/runs/observe-transport.ts`), so both watchers render identical
|
|
33
33
|
* event streams from the same Convex Run Snapshot. See ADR-0008.
|
|
34
34
|
*/
|
|
35
35
|
|
package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts
CHANGED
|
@@ -2,13 +2,13 @@ import { type Daytona } from '@daytonaio/sdk';
|
|
|
2
2
|
import type {
|
|
3
3
|
PlayRunnerExecutionConfig,
|
|
4
4
|
PlayRunnerResult,
|
|
5
|
-
} from '
|
|
6
|
-
import { isIsolatedRuntimeSchedulerSchema } from '
|
|
7
|
-
import { PLAY_RUNNER_TIMEOUT_SECONDS } from '
|
|
5
|
+
} from '../../protocol';
|
|
6
|
+
import { isIsolatedRuntimeSchedulerSchema } from '../../runtime-scheduler-topology';
|
|
7
|
+
import { PLAY_RUNNER_TIMEOUT_SECONDS } from '../../runtime-constants';
|
|
8
8
|
import {
|
|
9
9
|
STANDARD_PLAY_SANDBOX_RUNTIME_LIMITS,
|
|
10
10
|
validatePlaySandboxRuntimeLimits,
|
|
11
|
-
} from '
|
|
11
|
+
} from '../../../plays/sandbox-runtime-limits';
|
|
12
12
|
import type { PlayRunnerRuntimeLifecycleEvent } from '../types';
|
|
13
13
|
import { DAYTONA_PLAY_RUNNER_LABEL_SOURCE } from './daytona-labels';
|
|
14
14
|
|
|
@@ -7,11 +7,11 @@ import type {
|
|
|
7
7
|
import type {
|
|
8
8
|
PlayRunnerExecutionConfig,
|
|
9
9
|
PlayRunnerResult,
|
|
10
|
-
} from '
|
|
10
|
+
} from '../../protocol';
|
|
11
11
|
import { daytonaPlayRunnerBackend } from './daytona';
|
|
12
12
|
import { DaytonaSandboxAcquisitionUnavailableError } from './daytona-lifecycle';
|
|
13
13
|
import { modalPlayRunnerBackend } from './modal';
|
|
14
|
-
import { isPlayRunRecoveryError } from '
|
|
14
|
+
import { isPlayRunRecoveryError } from '../../play-run-recovery-policy';
|
|
15
15
|
import {
|
|
16
16
|
canTransitionRuntimeSandboxPlacement,
|
|
17
17
|
isRuntimeSandboxCanaryProduction,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
type RuntimeSandboxPlacementFailureReason,
|
|
24
24
|
type RuntimeSandboxPlacementPolicy,
|
|
25
25
|
type RuntimeSandboxProvider,
|
|
26
|
-
} from '
|
|
26
|
+
} from '../../runtime-sandbox-placement-policy';
|
|
27
27
|
|
|
28
28
|
type DaytonaFallbackPreparedExecution = PlayRunnerPreparedExecution & {
|
|
29
29
|
kind: 'runtime_sandbox_placement';
|
|
@@ -4,33 +4,33 @@ import { gzipSync } from 'node:zlib';
|
|
|
4
4
|
import {
|
|
5
5
|
RUNNER_TERMINAL_CHECKPOINT_DISPOSITION,
|
|
6
6
|
type PlayRunnerExecutionConfig,
|
|
7
|
-
} from '
|
|
7
|
+
} from '../../protocol';
|
|
8
8
|
import {
|
|
9
9
|
PLAY_RUNTIME_CONTRACT,
|
|
10
10
|
PLAY_RUNTIME_CONTRACT_HEADER,
|
|
11
|
-
} from '
|
|
11
|
+
} from '../../runtime-contract';
|
|
12
12
|
import {
|
|
13
13
|
PLAY_RUNNER_TERMINAL_GRACE_SECONDS,
|
|
14
14
|
PLAY_RUNNER_STARTUP_GRACE_SECONDS,
|
|
15
15
|
STANDARD_PLAY_RUNTIME_LIMIT_SECONDS,
|
|
16
|
-
} from '
|
|
16
|
+
} from '../../runtime-constants';
|
|
17
17
|
import {
|
|
18
18
|
RUNTIME_RELIABILITY_ENV,
|
|
19
19
|
RUNTIME_RELIABILITY_SEV_OVERRIDE_ENV,
|
|
20
|
-
} from '
|
|
20
|
+
} from '../../runtime-reliability-policy';
|
|
21
21
|
import {
|
|
22
22
|
STANDARD_PLAY_SANDBOX_RUNTIME_LIMITS,
|
|
23
23
|
validatePlaySandboxRuntimeLimits,
|
|
24
|
-
} from '
|
|
24
|
+
} from '../../../plays/sandbox-runtime-limits';
|
|
25
25
|
import {
|
|
26
26
|
RUNNER_POST_TERMINAL_DIAGNOSTIC_MAX_BYTES,
|
|
27
27
|
RUNNER_TERMINAL_PUSH_MAX_BODY_BYTES,
|
|
28
|
-
} from '
|
|
28
|
+
} from '../../output-size-limits';
|
|
29
29
|
import {
|
|
30
30
|
RUNTIME_SANDBOX_KILLED_MESSAGE,
|
|
31
31
|
RUNTIME_SANDBOX_OOM_MESSAGE,
|
|
32
|
-
} from '
|
|
33
|
-
import { compactPlayArtifactForRuntimeTransport } from '
|
|
32
|
+
} from '../../run-failure';
|
|
33
|
+
import { compactPlayArtifactForRuntimeTransport } from '../../../plays/artifact-transport';
|
|
34
34
|
import type {
|
|
35
35
|
DaytonaExecutionContext,
|
|
36
36
|
DaytonaSandbox,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DaytonaSandbox } from './daytona-lifecycle';
|
|
2
|
-
import { RUNTIME_RELIABILITY_POLICY } from '
|
|
2
|
+
import { RUNTIME_RELIABILITY_POLICY } from '../../runtime-reliability-policy';
|
|
3
3
|
|
|
4
4
|
export type DetachedDaytonaStartupDiagnostic = {
|
|
5
5
|
schedulerReadinessObserved: boolean;
|