deepline 0.3.325 → 0.3.326
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 +23 -25
- package/dist/bundling-sources/sdk/src/compat.ts +11 -6
- package/dist/bundling-sources/sdk/src/db/query.ts +172 -0
- package/dist/bundling-sources/sdk/src/errors.ts +35 -0
- package/dist/bundling-sources/sdk/src/index.ts +13 -0
- package/dist/bundling-sources/sdk/src/play.ts +34 -31
- package/dist/bundling-sources/sdk/src/plays/authoring-graph-path.ts +13 -0
- package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +2 -1
- package/dist/bundling-sources/sdk/src/plays/local-play-execution.ts +189 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/tool-calls.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +84 -10
- package/dist/cli/auth-6STWK6UK.js +31 -0
- package/dist/cli/{auth-PIZESRPC.mjs → auth-VON5FFUK.mjs} +4 -4
- package/dist/cli/{billing-HSL6VTCM.mjs → billing-X6JUEFRE.mjs} +4 -4
- package/dist/cli/{billing-DQKFCQV5.js → billing-YI4RZI2O.js} +70 -70
- package/dist/cli/{chunk-UYFWTIKF.js → chunk-3NGWGFVL.js} +26 -26
- package/dist/cli/{chunk-PWV2M4LW.mjs → chunk-4AB4Y6FF.mjs} +1 -1
- package/dist/cli/{chunk-DLW7X2UK.js → chunk-4LNBSQM4.js} +5928 -5730
- package/dist/cli/{chunk-OOPSX57I.js → chunk-5NXHSRRE.js} +6 -6
- package/dist/cli/{chunk-XNL3SEMC.js → chunk-AFNEQ43J.js} +8 -3
- package/dist/cli/{chunk-XSEMQ4II.js → chunk-AGH6YP2T.js} +2 -1
- package/dist/cli/chunk-AID3OYVJ.js +8 -0
- package/dist/cli/{chunk-NWBARG3F.mjs → chunk-BQJVMKWL.mjs} +1 -1
- package/dist/cli/{chunk-YE3O2UHM.mjs → chunk-BR7GGTAE.mjs} +24 -1
- package/dist/cli/{chunk-K7FC5IUU.js → chunk-BUYZEUY4.js} +1 -1
- package/dist/cli/{chunk-QQ2FG5W3.js → chunk-CUUHQ3AO.js} +6 -6
- package/dist/cli/{chunk-H5TJBRSC.mjs → chunk-DFDXKOLR.mjs} +98 -113
- package/dist/cli/{chunk-HPTQEWCF.js → chunk-EMZ7Y5SW.js} +70 -67
- package/dist/cli/chunk-GVESPYSY.mjs +234 -0
- package/dist/cli/{chunk-MNKDSR2J.js → chunk-GVYKY6T6.js} +344 -254
- package/dist/cli/{chunk-6RMKHN7S.mjs → chunk-IQCCGOQH.mjs} +4 -20
- package/dist/cli/{chunk-76VKBPOC.mjs → chunk-JOA6IKDE.mjs} +7 -2
- package/dist/cli/{chunk-XIVUB36F.mjs → chunk-KLWBAQ5A.mjs} +104 -14
- package/dist/cli/{chunk-CV5GDCKN.js → chunk-KZ4PCK4O.js} +29 -45
- package/dist/cli/chunk-LVEDPCLJ.js +234 -0
- package/dist/cli/{chunk-AQUNQJ5Y.mjs → chunk-M7CPVMDB.mjs} +1 -1
- package/dist/cli/{chunk-HUKWYHBG.js → chunk-MDQZQ3NY.js} +2 -2
- package/dist/cli/{chunk-PBNZXZCW.js → chunk-MKHSZA2X.js} +48 -48
- package/dist/cli/{chunk-5TYU3UIS.mjs → chunk-MOBZS4F3.mjs} +1 -1
- package/dist/cli/chunk-OVDNJAJN.mjs +8 -0
- package/dist/cli/{chunk-KZNFYOHX.js → chunk-T33W6JUJ.js} +6 -6
- package/dist/cli/{chunk-6VZDSBK6.mjs → chunk-TDSNAC3C.mjs} +2 -2
- package/dist/cli/{chunk-PVDQ55PS.js → chunk-TXVOB5J2.js} +29 -6
- package/dist/cli/{chunk-YXRPWMGN.js → chunk-TZQMFWLF.js} +147 -162
- package/dist/cli/{chunk-OPERWJR6.mjs → chunk-VGKVLADU.mjs} +3 -3
- package/dist/cli/{chunk-7MD453WV.mjs → chunk-VKXGOQG5.mjs} +5674 -5476
- package/dist/cli/{chunk-WW4XZIVM.mjs → chunk-W74E5ETE.mjs} +12 -9
- package/dist/cli/{chunk-7PZFGB7L.mjs → chunk-YIY74KUF.mjs} +2 -1
- package/dist/cli/{chunk-5FHU7TV4.mjs → chunk-ZRN6YOF2.mjs} +2 -2
- package/dist/cli/client-TEBW2P24.js +20 -0
- package/dist/cli/{client-57SR4KVM.mjs → client-ZMOKUNL2.mjs} +3 -3
- package/dist/cli/{csv-5DJSC6BD.js → csv-HZRKEI7J.js} +12 -12
- package/dist/cli/{csv-G2FRMOXL.mjs → csv-IICJHJZ4.mjs} +3 -3
- package/dist/cli/{db-NVO7P4VO.js → db-TM5NZF73.js} +226 -149
- package/dist/cli/{db-WWZEXM3N.mjs → db-X4B7YFNY.mjs} +214 -137
- package/dist/cli/{describe-M26LHDBQ.js → describe-BDBARWZJ.js} +28 -27
- package/dist/cli/{describe-26OMF3A4.mjs → describe-GMVS3LFC.mjs} +12 -11
- package/dist/cli/{executions-2LLHY3IL.mjs → executions-447ZJMN4.mjs} +4 -4
- package/dist/cli/{executions-KI47LPKE.js → executions-QX25UOQM.js} +6 -6
- package/dist/cli/{feedback-2Y26C2BZ.js → feedback-4IXUTBX7.js} +6 -6
- package/dist/cli/{feedback-O26VL2OF.mjs → feedback-JB7HHIC6.mjs} +3 -3
- package/dist/cli/git-C7C7DTEH.js +23 -0
- package/dist/cli/{git-UVPGZN3K.mjs → git-VID6KGAA.mjs} +4 -4
- package/dist/cli/index.js +105 -87
- package/dist/cli/index.mjs +65 -47
- package/dist/cli/{legacy-noops-H6Y3SEVB.js → legacy-noops-3FYTCOZO.js} +7 -7
- package/dist/cli/{legacy-noops-IK5CH72U.mjs → legacy-noops-SGR3G5WS.mjs} +4 -4
- package/dist/cli/{monitors-SFVVMAJT.mjs → monitors-SH4FOMBM.mjs} +4 -4
- package/dist/cli/{monitors-JL6TTQCI.js → monitors-SP52UHS4.js} +85 -85
- package/dist/cli/{org-SSDONL57.mjs → org-B32MMIQT.mjs} +4 -4
- package/dist/cli/{org-OVMAZCQS.js → org-UQMX7JOR.js} +60 -60
- package/dist/cli/play-UCIWBN7U.js +153 -0
- package/dist/cli/{play-X6NPACUO.mjs → play-XTE4LUP7.mjs} +11 -10
- package/dist/cli/{providers-E24JDWSR.js → providers-JNMJJ2OH.js} +7 -7
- package/dist/cli/{providers-ONUBYYY4.mjs → providers-RWLN6FUR.mjs} +4 -4
- package/dist/cli/{quickstart-TB7C3DLG.js → quickstart-HK6WZ342.js} +5 -5
- package/dist/cli/{quickstart-B7NIXACV.mjs → quickstart-IDB3Y375.mjs} +3 -3
- package/dist/cli/{search-N3QUIATW.mjs → search-6D3IFNPT.mjs} +5 -5
- package/dist/cli/search-LUZ2S7DH.js +26 -0
- package/dist/cli/{secrets-CPCVFDYB.js → secrets-JOQB57IE.js} +13 -13
- package/dist/cli/{secrets-V7Z4M67T.mjs → secrets-TZ53CQ3D.mjs} +4 -4
- package/dist/cli/{sessions-PDOBKAKO.mjs → sessions-4MBDC4EK.mjs} +4 -4
- package/dist/cli/{sessions-E4FIZLQP.js → sessions-QSAICDXX.js} +5 -5
- package/dist/cli/{settings-UVM2WDE4.js → settings-OTOCW7L7.js} +74 -74
- package/dist/cli/{settings-QYHYHZDI.mjs → settings-RKQFMLDU.mjs} +7 -7
- package/dist/cli/{setup-4RLAETDW.mjs → setup-2S5TNTUB.mjs} +6 -6
- package/dist/cli/{setup-3JFAXQLJ.js → setup-AKZUDVYY.js} +41 -41
- package/dist/cli/skills-26LASHZF.js +28 -0
- package/dist/cli/{skills-ZX2JSWOZ.mjs → skills-AGZXDLSA.mjs} +4 -4
- package/dist/cli/{tools-EGXCVIPJ.mjs → tools-7Y6RD6FY.mjs} +8 -7
- package/dist/cli/tools-L5VIJQWX.js +39 -0
- package/dist/cli/{update-7FEKRQFE.mjs → update-M7YGF67I.mjs} +6 -6
- package/dist/cli/update-MNHF6M2F.js +28 -0
- package/dist/cli/{workflow-7V7TTTKK.mjs → workflow-CTVE7S7W.mjs} +5 -5
- package/dist/cli/{workflow-54VCKIG2.js → workflow-NGMY425T.js} +15 -15
- package/dist/{client-Bb4Jjzmj.d.ts → client-DHq8dJ56.d.ts} +39 -11
- package/dist/{client-COa-3GHK.d.mts → client-wiWPZhnI.d.mts} +39 -11
- package/dist/{compiler-manifest-CsnWj-AK.d.mts → compiler-manifest-9TkZ_ykI.d.mts} +711 -711
- package/dist/{compiler-manifest-CsnWj-AK.d.ts → compiler-manifest-9TkZ_ykI.d.ts} +711 -711
- package/dist/index-B-5_Xhud.d.mts +75 -0
- package/dist/index-ykksoEyR.d.ts +75 -0
- package/dist/index.d.mts +52 -13
- package/dist/index.d.ts +52 -13
- package/dist/index.js +92 -28
- package/dist/index.mjs +91 -27
- package/dist/install-integrity.json +91 -84
- package/dist/plays/bundle-play-file.d.mts +7 -75
- package/dist/plays/bundle-play-file.d.ts +7 -75
- package/dist/plays/bundle-play-file.mjs +1 -1
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/package.json +1 -1
- package/dist/cli/auth-RXCD4GOV.js +0 -31
- package/dist/cli/chunk-OWJZUE3Y.mjs +0 -103
- package/dist/cli/chunk-SDK3ZA2C.js +0 -103
- package/dist/cli/client-562MULXK.js +0 -20
- package/dist/cli/git-KGPX5YPD.js +0 -23
- package/dist/cli/play-3DB4MSHN.js +0 -152
- package/dist/cli/search-NJ637YGQ.js +0 -26
- package/dist/cli/skills-BYRYG64R.js +0 -28
- package/dist/cli/tools-TAWOAY5X.js +0 -38
- package/dist/cli/update-H24GEBXM.js +0 -28
|
@@ -2,765 +2,765 @@
|
|
|
2
2
|
import * as _sinclair_typebox from '@sinclair/typebox';
|
|
3
3
|
import { Static } from '@sinclair/typebox';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
type
|
|
8
|
-
type EmailMxClass = 'consumer_mailbox' | 'workspace_mailbox' | 'security_gateway' | 'on_prem' | 'unknown';
|
|
9
|
-
type EmailStatus = {
|
|
10
|
-
verdict: EmailStatusVerdict;
|
|
11
|
-
status: EmailStatusValue;
|
|
12
|
-
verified: boolean;
|
|
13
|
-
confidence: number | null;
|
|
14
|
-
reasons: string[];
|
|
15
|
-
signals: {
|
|
16
|
-
catch_all: boolean | null;
|
|
17
|
-
deliverability: EmailDeliverability;
|
|
18
|
-
mx_class: EmailMxClass;
|
|
19
|
-
mx_provider: string | null;
|
|
20
|
-
mx_record: string | null;
|
|
21
|
-
fraud_score: number | null;
|
|
22
|
-
disposable: boolean | null;
|
|
23
|
-
role_based: boolean | null;
|
|
24
|
-
free_email: boolean | null;
|
|
25
|
-
abuse: boolean | null;
|
|
26
|
-
spamtrap: boolean | null;
|
|
27
|
-
suspect: boolean | null;
|
|
28
|
-
valid: boolean | null;
|
|
29
|
-
};
|
|
30
|
-
provider: {
|
|
31
|
-
name: string;
|
|
32
|
-
raw_status: string | boolean | number | null;
|
|
33
|
-
raw_score: number | null;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
type EmailStatusMapEntry = {
|
|
37
|
-
status: EmailStatusValue;
|
|
38
|
-
verdict?: EmailStatusVerdict;
|
|
39
|
-
verified?: boolean;
|
|
40
|
-
reason?: string;
|
|
41
|
-
};
|
|
42
|
-
type EmailStatusRule = EmailStatusMapEntry & {
|
|
43
|
-
when: Record<string, string | number | boolean | null>;
|
|
44
|
-
};
|
|
45
|
-
type EmailStatusExtractorConfig = {
|
|
46
|
-
provider: string;
|
|
47
|
-
rawStatus?: string[];
|
|
48
|
-
rawScore?: string[];
|
|
49
|
-
valid?: string[];
|
|
50
|
-
deliverability?: string[];
|
|
51
|
-
catchAll?: string[];
|
|
52
|
-
mxProvider?: string[];
|
|
53
|
-
mxRecord?: string[];
|
|
54
|
-
fraudScore?: string[];
|
|
55
|
-
disposable?: string[];
|
|
56
|
-
roleBased?: string[];
|
|
57
|
-
freeEmail?: string[];
|
|
58
|
-
abuse?: string[];
|
|
59
|
-
spamtrap?: string[];
|
|
60
|
-
suspect?: string[];
|
|
61
|
-
statusMap?: Record<string, EmailStatusMapEntry>;
|
|
62
|
-
rules?: EmailStatusRule[];
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
declare const JOB_CHANGE_STATUS_VALUES: readonly ["moved", "no_change", "left_company", "unknown", "profile_unavailable", "no_new_company"];
|
|
66
|
-
type JobChangeStatus = (typeof JOB_CHANGE_STATUS_VALUES)[number];
|
|
67
|
-
type JobChangeGetterValue = {
|
|
68
|
-
status: JobChangeStatus;
|
|
69
|
-
date: string | null;
|
|
70
|
-
new_company: string | null;
|
|
71
|
-
new_title: string | null;
|
|
72
|
-
};
|
|
73
|
-
declare const PHONE_STATUS_VALUES: readonly ["valid", "invalid", "unknown"];
|
|
74
|
-
type PhoneStatus = (typeof PHONE_STATUS_VALUES)[number];
|
|
75
|
-
declare const DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS: {
|
|
76
|
-
readonly id: {
|
|
77
|
-
readonly identity: true;
|
|
78
|
-
readonly valueKind: "string";
|
|
79
|
-
};
|
|
80
|
-
readonly name: {
|
|
81
|
-
readonly identity: true;
|
|
82
|
-
readonly valueKind: "string";
|
|
83
|
-
};
|
|
84
|
-
readonly email: {
|
|
85
|
-
readonly identity: true;
|
|
86
|
-
readonly valueKind: "string";
|
|
87
|
-
};
|
|
88
|
-
readonly personal_email: {
|
|
89
|
-
readonly identity: true;
|
|
90
|
-
readonly valueKind: "string";
|
|
91
|
-
};
|
|
92
|
-
readonly phone: {
|
|
93
|
-
readonly identity: true;
|
|
94
|
-
readonly valueKind: "string";
|
|
95
|
-
};
|
|
96
|
-
readonly linkedin: {
|
|
97
|
-
readonly identity: true;
|
|
98
|
-
readonly valueKind: "string";
|
|
99
|
-
};
|
|
100
|
-
readonly linkedin_url: {
|
|
101
|
-
readonly identity: true;
|
|
102
|
-
readonly valueKind: "string";
|
|
103
|
-
};
|
|
104
|
-
readonly domain: {
|
|
105
|
-
readonly identity: true;
|
|
106
|
-
readonly valueKind: "string";
|
|
107
|
-
};
|
|
108
|
-
readonly website: {
|
|
109
|
-
readonly identity: true;
|
|
110
|
-
readonly valueKind: "string";
|
|
111
|
-
};
|
|
112
|
-
readonly first_name: {
|
|
113
|
-
readonly identity: true;
|
|
114
|
-
readonly valueKind: "string";
|
|
115
|
-
};
|
|
116
|
-
readonly last_name: {
|
|
117
|
-
readonly identity: true;
|
|
118
|
-
readonly valueKind: "string";
|
|
119
|
-
};
|
|
120
|
-
readonly full_name: {
|
|
121
|
-
readonly identity: true;
|
|
122
|
-
readonly valueKind: "string";
|
|
123
|
-
};
|
|
124
|
-
readonly company: {
|
|
125
|
-
readonly identity: true;
|
|
126
|
-
readonly valueKind: "string";
|
|
127
|
-
};
|
|
128
|
-
readonly company_name: {
|
|
129
|
-
readonly identity: true;
|
|
130
|
-
readonly valueKind: "string";
|
|
131
|
-
};
|
|
132
|
-
readonly organization_name: {
|
|
133
|
-
readonly identity: true;
|
|
134
|
-
readonly valueKind: "string";
|
|
135
|
-
};
|
|
136
|
-
readonly company_domain: {
|
|
137
|
-
readonly identity: true;
|
|
138
|
-
readonly valueKind: "string";
|
|
139
|
-
};
|
|
140
|
-
readonly company_website: {
|
|
141
|
-
readonly identity: true;
|
|
142
|
-
readonly valueKind: "string";
|
|
143
|
-
};
|
|
144
|
-
readonly company_linkedin_url: {
|
|
145
|
-
readonly identity: true;
|
|
146
|
-
readonly valueKind: "string";
|
|
147
|
-
};
|
|
148
|
-
readonly title: {
|
|
149
|
-
readonly identity: false;
|
|
150
|
-
readonly valueKind: "string";
|
|
151
|
-
};
|
|
152
|
-
readonly industry: {
|
|
153
|
-
readonly identity: false;
|
|
154
|
-
readonly valueKind: "string";
|
|
155
|
-
};
|
|
156
|
-
readonly status: {
|
|
157
|
-
readonly identity: false;
|
|
158
|
-
readonly valueKind: "string";
|
|
159
|
-
};
|
|
160
|
-
readonly job_change: {
|
|
161
|
-
readonly identity: false;
|
|
162
|
-
readonly valueKind: "job_change";
|
|
163
|
-
};
|
|
164
|
-
readonly job_change_status: {
|
|
165
|
-
readonly identity: false;
|
|
166
|
-
readonly valueKind: "job_change_status";
|
|
167
|
-
readonly enum: readonly ["moved", "no_change", "left_company", "unknown", "profile_unavailable", "no_new_company"];
|
|
168
|
-
};
|
|
169
|
-
readonly email_status: {
|
|
170
|
-
readonly identity: false;
|
|
171
|
-
readonly valueKind: "email_status";
|
|
172
|
-
};
|
|
173
|
-
readonly phone_status: {
|
|
174
|
-
readonly identity: false;
|
|
175
|
-
readonly valueKind: "phone_status";
|
|
176
|
-
readonly enum: readonly ["valid", "invalid", "unknown"];
|
|
177
|
-
};
|
|
178
|
-
};
|
|
179
|
-
type DeeplineExtractorTarget = keyof typeof DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS;
|
|
180
|
-
declare const DEEPLINE_EXTRACTOR_TARGETS: DeeplineExtractorTarget[];
|
|
181
|
-
type DeeplineEmailStatusGetterValue = EmailStatus;
|
|
182
|
-
type DeeplineGetterValueMap = {
|
|
183
|
-
id: string;
|
|
184
|
-
name: string;
|
|
185
|
-
email: string;
|
|
186
|
-
personal_email: string;
|
|
187
|
-
phone: string;
|
|
188
|
-
linkedin: string;
|
|
189
|
-
linkedin_url: string;
|
|
190
|
-
domain: string;
|
|
191
|
-
website: string;
|
|
192
|
-
first_name: string;
|
|
193
|
-
last_name: string;
|
|
194
|
-
full_name: string;
|
|
195
|
-
company: string;
|
|
196
|
-
company_name: string;
|
|
197
|
-
organization_name: string;
|
|
198
|
-
company_domain: string;
|
|
199
|
-
company_website: string;
|
|
200
|
-
company_linkedin_url: string;
|
|
201
|
-
title: string;
|
|
202
|
-
industry: string;
|
|
203
|
-
status: string;
|
|
204
|
-
job_change: JobChangeGetterValue;
|
|
205
|
-
job_change_status: JobChangeStatus;
|
|
206
|
-
email_status: EmailStatus;
|
|
207
|
-
phone_status: PhoneStatus;
|
|
208
|
-
};
|
|
209
|
-
type DeeplineGetterValue<TTarget extends DeeplineExtractorTarget = DeeplineExtractorTarget> = DeeplineGetterValueMap[TTarget];
|
|
210
|
-
declare function isDeeplineExtractorTarget(value: string): value is DeeplineExtractorTarget;
|
|
211
|
-
|
|
212
|
-
interface PlayR2FileRef {
|
|
213
|
-
storageKind: 'r2';
|
|
214
|
-
storageKey: string;
|
|
215
|
-
logicalPath: string;
|
|
216
|
-
fileName: string;
|
|
217
|
-
contentHash: string;
|
|
218
|
-
contentType: string;
|
|
219
|
-
bytes: number;
|
|
220
|
-
}
|
|
221
|
-
type PlayExecutionFileRef = PlayR2FileRef;
|
|
222
|
-
|
|
223
|
-
/** Source evidence is advisory; stored values determine lossless SQL encoding. */
|
|
224
|
-
interface PlayDatasetColumnTypeEvidence {
|
|
225
|
-
postgresTypeId: number;
|
|
226
|
-
valueType: 'boolean' | 'number' | 'string' | 'json';
|
|
227
|
-
}
|
|
228
|
-
type PlayDatasetColumnTypes = Record<string, PlayDatasetColumnTypeEvidence>;
|
|
229
|
-
type PlaySheetColumnSource = 'input' | 'datasetColumn' | 'waterfallStep' | 'childPlayColumn';
|
|
230
|
-
interface PlaySheetColumnContract {
|
|
231
|
-
id: string;
|
|
232
|
-
sqlName: string;
|
|
233
|
-
source: PlaySheetColumnSource;
|
|
234
|
-
field?: string;
|
|
235
|
-
parentField?: string;
|
|
236
|
-
playId?: string;
|
|
237
|
-
waterfallId?: string;
|
|
238
|
-
outputField?: string;
|
|
239
|
-
outputSqlName?: string;
|
|
240
|
-
stepId?: string;
|
|
241
|
-
toolId?: string;
|
|
242
|
-
isRowKey?: boolean;
|
|
243
|
-
typeEvidence?: PlayDatasetColumnTypeEvidence;
|
|
244
|
-
}
|
|
245
|
-
interface PlaySheetContract {
|
|
246
|
-
tableNamespace: string;
|
|
247
|
-
columns: PlaySheetColumnContract[];
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
declare const PLAY_DATASET_BRAND: unique symbol;
|
|
251
|
-
type PlayDatasetKind = 'csv' | 'map';
|
|
252
|
-
type PlayDatasetBacking = {
|
|
253
|
-
storage: 'neon_sheet';
|
|
254
|
-
sheet: {
|
|
255
|
-
playName: string;
|
|
256
|
-
tableNamespace: string;
|
|
257
|
-
};
|
|
258
|
-
} | {
|
|
259
|
-
storage: 'r2_file';
|
|
260
|
-
file: PlayExecutionFileRef;
|
|
261
|
-
};
|
|
262
|
-
type PlayDatasetWorkProgressSummary = {
|
|
263
|
-
total: number;
|
|
264
|
-
executed: number;
|
|
265
|
-
reused: number;
|
|
266
|
-
skipped: number;
|
|
267
|
-
pending: number;
|
|
268
|
-
failed: number;
|
|
269
|
-
degraded?: boolean;
|
|
270
|
-
duplicates?: {
|
|
271
|
-
exact?: number;
|
|
272
|
-
semantic?: number;
|
|
273
|
-
rejected?: number;
|
|
274
|
-
};
|
|
275
|
-
};
|
|
276
|
-
type PlayDatasetInput<T> = ReadonlyArray<T> | Iterable<T> | AsyncIterable<T> | PlayDataset<T>;
|
|
277
|
-
type PlayDatasetRow<TInput> = TInput extends PlayDataset<infer Row> ? Row : TInput extends ReadonlyArray<infer Row> ? Row : TInput extends Iterable<infer Row> ? Row : TInput extends AsyncIterable<infer Row> ? Row : never;
|
|
278
|
-
type PlayDatasetTransformOptions = {
|
|
279
|
-
key?: string;
|
|
280
|
-
sourceLabel?: string | null;
|
|
281
|
-
};
|
|
5
|
+
declare const TOOL_EXECUTION_ERROR_SCHEMA_VERSION: 1;
|
|
6
|
+
declare const SUPPORTED_TOOL_EXECUTION_ERROR_SCHEMA_VERSIONS: readonly [0, 1];
|
|
7
|
+
type ToolExecutionErrorSchemaVersion = (typeof SUPPORTED_TOOL_EXECUTION_ERROR_SCHEMA_VERSIONS)[number];
|
|
282
8
|
/**
|
|
283
|
-
*
|
|
9
|
+
* The boundary responsible for a failed tool call.
|
|
284
10
|
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
*
|
|
11
|
+
* Use `provider` to distinguish a provider answer from caller input and
|
|
12
|
+
* Deepline infrastructure. `unknown` fails closed and must not trigger a
|
|
13
|
+
* waterfall fallback.
|
|
288
14
|
*
|
|
289
|
-
*
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
*
|
|
294
|
-
* `.toArray()`, `.length`, numeric indexing, spread, or synchronous iteration;
|
|
295
|
-
* these hide loading costs or make behavior depend on row residency.
|
|
15
|
+
* @sdkReference errors 020
|
|
16
|
+
*/
|
|
17
|
+
type ToolExecutionErrorOrigin = 'caller' | 'provider' | 'deepline' | 'unknown';
|
|
18
|
+
/**
|
|
19
|
+
* The stable reason family for a failed tool call.
|
|
296
20
|
*
|
|
297
|
-
*
|
|
21
|
+
* Branch on this field only after narrowing to `ToolExecutionError`. Catch
|
|
22
|
+
* `ProviderTransientError` when the policy is simply “try the next read
|
|
23
|
+
* provider”; it is the safer and shorter waterfall contract.
|
|
24
|
+
*
|
|
25
|
+
* @sdkReference errors 030
|
|
298
26
|
*/
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
27
|
+
type ToolExecutionErrorCategory = 'validation' | 'authentication' | 'authorization' | 'rate_limit' | 'network' | 'upstream' | 'billing' | 'conflict' | 'internal' | 'unknown';
|
|
28
|
+
/**
|
|
29
|
+
* The transport failure observed when `category` is `network`.
|
|
30
|
+
*
|
|
31
|
+
* This is `null` for failures that are not network failures.
|
|
32
|
+
*
|
|
33
|
+
* @sdkReference errors 040
|
|
34
|
+
*/
|
|
35
|
+
type ToolExecutionNetworkKind = 'timeout' | 'dns' | 'connect' | 'reset' | 'unavailable' | 'unknown';
|
|
36
|
+
/**
|
|
37
|
+
* The request boundary on which a network failure occurred.
|
|
38
|
+
*
|
|
39
|
+
* `deepline_to_provider` is provider-side. Client and runtime scopes are
|
|
40
|
+
* Deepline transport failures and never qualify as provider fallthrough.
|
|
41
|
+
*
|
|
42
|
+
* @sdkReference errors 050
|
|
43
|
+
*/
|
|
44
|
+
type ToolExecutionNetworkScope = 'client_to_deepline' | 'runtime_to_deepline' | 'deepline_to_provider';
|
|
45
|
+
/**
|
|
46
|
+
* Bounded, primitive-only diagnostics explicitly approved for customers.
|
|
47
|
+
* Raw provider bodies, credentials, prompts, stacks, and causes never belong
|
|
48
|
+
* in this shared API/SDK/Play contract.
|
|
49
|
+
*
|
|
50
|
+
* @sdkReference errors 063
|
|
51
|
+
*/
|
|
52
|
+
type ToolExecutionPublicDetails = Readonly<Record<string, string | number | boolean | null>>;
|
|
53
|
+
/**
|
|
54
|
+
* Portable version-1 `tool_error` payload.
|
|
55
|
+
*
|
|
56
|
+
* This allowlisted shape crosses the API, runtime, and SDK boundaries.
|
|
57
|
+
* `message` remains on the Error object and is deliberately not a policy
|
|
58
|
+
* field.
|
|
59
|
+
*
|
|
60
|
+
* @sdkReference errors 064
|
|
61
|
+
*/
|
|
62
|
+
type ToolExecutionFailureV1 = {
|
|
63
|
+
/** Payload version. */
|
|
64
|
+
schemaVersion: typeof TOOL_EXECUTION_ERROR_SCHEMA_VERSION;
|
|
65
|
+
/** Public tool id passed to `tools.execute`. */
|
|
66
|
+
toolId: string;
|
|
67
|
+
/** Provider responsible for the operation, or `null`. */
|
|
68
|
+
provider: string | null;
|
|
69
|
+
/** Provider operation name, or `null`. */
|
|
70
|
+
operation: string | null;
|
|
71
|
+
/** Stable machine-readable failure code, or `null`. */
|
|
72
|
+
code: string | null;
|
|
73
|
+
/** Boundary responsible for the failure. */
|
|
74
|
+
origin: ToolExecutionErrorOrigin;
|
|
75
|
+
/** Stable reason family. */
|
|
76
|
+
category: ToolExecutionErrorCategory;
|
|
77
|
+
/** Whether repeating the same semantic call is delivery-safe. */
|
|
78
|
+
retryable: boolean;
|
|
79
|
+
/** HTTP status when one exists, or `null`. */
|
|
80
|
+
statusCode: number | null;
|
|
81
|
+
/** Provider or Deepline request id, or `null`. */
|
|
82
|
+
requestId: string | null;
|
|
83
|
+
/** Suggested same-call retry delay in milliseconds, or `null`. */
|
|
84
|
+
retryAfterMs: number | null;
|
|
85
|
+
/** Network failure kind, or `null`. */
|
|
86
|
+
networkKind: ToolExecutionNetworkKind | null;
|
|
87
|
+
/** Network boundary that failed, or `null`. */
|
|
88
|
+
networkScope: ToolExecutionNetworkScope | null;
|
|
89
|
+
/** Explicitly allowlisted customer diagnostics, when present. */
|
|
90
|
+
publicDetails?: ToolExecutionPublicDetails | null;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Constructor input for a structured tool failure.
|
|
94
|
+
*
|
|
95
|
+
* Deepline creates these values while decoding the versioned wire payload.
|
|
96
|
+
* Customer code normally reads `ToolExecutionError` fields instead of
|
|
97
|
+
* constructing an error.
|
|
98
|
+
*
|
|
99
|
+
* @sdkReference errors 065
|
|
100
|
+
*/
|
|
101
|
+
type ToolExecutionErrorOptions = Omit<ToolExecutionFailureV1, 'schemaVersion'> & {
|
|
325
102
|
/**
|
|
326
|
-
*
|
|
327
|
-
*
|
|
328
|
-
* through worker memory as giant arrays.
|
|
103
|
+
* Local diagnostic context inherited from DeeplineError. This is not part of
|
|
104
|
+
* the portable failure payload and is intentionally omitted by serialization.
|
|
329
105
|
*/
|
|
330
|
-
|
|
331
|
-
toJSON(): {
|
|
332
|
-
kind: 'dataset';
|
|
333
|
-
datasetKind: PlayDatasetKind;
|
|
334
|
-
datasetId: string;
|
|
335
|
-
count: number;
|
|
336
|
-
backing?: PlayDatasetBacking;
|
|
337
|
-
sourceLabel?: string | null;
|
|
338
|
-
tableNamespace?: string | null;
|
|
339
|
-
columns?: string[];
|
|
340
|
-
columnTypes?: PlayDatasetColumnTypes;
|
|
341
|
-
_metadata?: {
|
|
342
|
-
workProgress?: PlayDatasetWorkProgressSummary;
|
|
343
|
-
};
|
|
344
|
-
preview: T[];
|
|
345
|
-
};
|
|
346
|
-
}
|
|
347
|
-
type PlayDatasetMaterializeScope = 'result' | 'full_persisted_dataset';
|
|
348
|
-
type PlayDatasetMaterializeOptions = {
|
|
349
|
-
/** Rows returned by this operation, or every current row in its persisted dataset. */
|
|
350
|
-
scope?: PlayDatasetMaterializeScope;
|
|
351
|
-
/** Maximum number of rows to load into memory. */
|
|
352
|
-
limit?: number;
|
|
106
|
+
details?: Record<string, unknown>;
|
|
353
107
|
};
|
|
354
|
-
|
|
355
108
|
/**
|
|
356
|
-
*
|
|
357
|
-
*
|
|
358
|
-
*
|
|
359
|
-
*
|
|
109
|
+
* Provider-owned failure categories that may fall through to another read
|
|
110
|
+
* provider.
|
|
111
|
+
*
|
|
112
|
+
* @sdkReference errors 060
|
|
360
113
|
*/
|
|
361
|
-
type
|
|
362
|
-
credits_charged?: number;
|
|
363
|
-
cost_usd?: number;
|
|
364
|
-
/** Missing on historical responses. Pending pricing has no final amount. */
|
|
365
|
-
pricing_status?: 'final' | 'pending';
|
|
366
|
-
settlement_status?: 'pending' | 'queued' | 'settled' | 'released' | 'requires_recovery';
|
|
367
|
-
billing_outcome_reason?: 'free_operation' | 'provider_no_billable_result' | 'provider_reported_zero_usage' | 'zero_price';
|
|
368
|
-
estimated_credits?: number;
|
|
369
|
-
estimated_cost_usd?: number;
|
|
370
|
-
/** Preserve additive public pricing details across runtime/deployment skew. */
|
|
371
|
-
[key: string]: unknown;
|
|
372
|
-
};
|
|
373
|
-
type ToolResultExecutionMetadata = {
|
|
374
|
-
idempotent: true;
|
|
375
|
-
cached: boolean;
|
|
376
|
-
source: 'live' | 'checkpoint' | 'cache' | 'in_flight' | 'source_run';
|
|
377
|
-
cacheKey?: string;
|
|
378
|
-
receiptRole?: 'owner' | 'follower';
|
|
379
|
-
receiptKey?: string;
|
|
380
|
-
/** Canonical saved result identity; receiptKey may name a transport alias. */
|
|
381
|
-
resultReceiptKey?: string;
|
|
382
|
-
attachedToReceiptKey?: string;
|
|
383
|
-
};
|
|
384
|
-
type ToolResultTargetMetadata = {
|
|
385
|
-
value: unknown;
|
|
386
|
-
path: string;
|
|
387
|
-
};
|
|
388
|
-
type ToolResultListMetadata = {
|
|
389
|
-
path: string;
|
|
390
|
-
count: number | null;
|
|
391
|
-
keys: Record<string, string>;
|
|
392
|
-
};
|
|
393
|
-
type ToolResultExtractorDescriptor = {
|
|
394
|
-
paths: readonly string[];
|
|
395
|
-
transforms?: readonly string[];
|
|
396
|
-
enum?: readonly string[];
|
|
397
|
-
overrides?: readonly ToolResultExtractorOverride[];
|
|
398
|
-
emailStatus?: EmailStatusExtractorConfig;
|
|
399
|
-
};
|
|
400
|
-
type ToolResultExtractorOverride = {
|
|
401
|
-
paths: readonly string[];
|
|
402
|
-
equals?: string | number | boolean | null;
|
|
403
|
-
value: string | number | boolean | null;
|
|
404
|
-
};
|
|
405
|
-
type ToolResultTargetAccessor<T = unknown> = ToolResultTargetMetadata & {
|
|
406
|
-
get(): T | null;
|
|
407
|
-
};
|
|
408
|
-
type ToolResultListAccessor<T = Record<string, unknown>, TKey extends string = string> = Omit<ToolResultListMetadata, 'keys'> & {
|
|
409
|
-
keys: Partial<Record<TKey, string>> & Record<string, string>;
|
|
410
|
-
get(): PlayDataset<T>;
|
|
411
|
-
};
|
|
412
|
-
type ToolResponseEnvelope<TData = unknown, TMeta = Record<string, unknown>> = {
|
|
413
|
-
/** @deprecated Use declared getters or toolResponse.rawV2. */
|
|
414
|
-
raw: TData;
|
|
415
|
-
/** Complete parsed and scrubbed provider response, materialized from raw-v2. */
|
|
416
|
-
rawV2?: unknown;
|
|
417
|
-
/** Durable descriptor for deriving the legacy raw view from `rawV2`. */
|
|
418
|
-
view?: 'data' | 'rawV2';
|
|
419
|
-
meta?: TMeta;
|
|
420
|
-
};
|
|
421
|
-
type ToolExecuteResultBase<TResult = unknown, TMeta = Record<string, unknown>> = {
|
|
422
|
-
status: string;
|
|
423
|
-
job_id?: string;
|
|
424
|
-
/** Deepline-owned execution/result metadata. */
|
|
425
|
-
meta?: Record<string, unknown>;
|
|
426
|
-
billing?: ToolResultBilling;
|
|
427
|
-
toolResponse: ToolResponseEnvelope<TResult, TMeta>;
|
|
428
|
-
extractedValues: Record<string, ToolResultTargetAccessor>;
|
|
429
|
-
extractedLists: Record<string, ToolResultListAccessor>;
|
|
430
|
-
/** Convenience alias for play code. Serialized output uses toolResponse. */
|
|
431
|
-
toolOutput: ToolResponseEnvelope<TResult, TMeta>;
|
|
432
|
-
_metadata: {
|
|
433
|
-
toolId: string;
|
|
434
|
-
execution: ToolResultExecutionMetadata;
|
|
435
|
-
targets: Record<string, {
|
|
436
|
-
value: unknown;
|
|
437
|
-
path: string;
|
|
438
|
-
}>;
|
|
439
|
-
extractors?: Record<string, ToolResultExtractorDescriptor>;
|
|
440
|
-
lists: Record<string, {
|
|
441
|
-
path: string;
|
|
442
|
-
count: number | null;
|
|
443
|
-
keys: Record<string, string>;
|
|
444
|
-
}>;
|
|
445
|
-
/** Original declarations preserve semantic accessor names across replay. */
|
|
446
|
-
listExtractorPaths?: readonly string[];
|
|
447
|
-
};
|
|
448
|
-
};
|
|
449
|
-
type ToolExecuteResultAccessors<TExtracted extends Record<string, unknown> = Partial<DeeplineGetterValueMap>, TLists extends Record<string, Record<string, unknown>> = Record<string, Record<string, unknown>>> = {
|
|
450
|
-
extractedValues: {
|
|
451
|
-
[K in keyof TExtracted]: ToolResultTargetAccessor<TExtracted[K]>;
|
|
452
|
-
};
|
|
453
|
-
extractedLists: {
|
|
454
|
-
[K in keyof TLists]: ToolResultListAccessor<TLists[K]>;
|
|
455
|
-
};
|
|
456
|
-
};
|
|
114
|
+
type ProviderTransientErrorCategory = 'rate_limit' | 'network' | 'upstream';
|
|
457
115
|
/**
|
|
458
|
-
*
|
|
116
|
+
* Base error class shared by the SDK and play runtime.
|
|
459
117
|
*
|
|
460
|
-
* The
|
|
461
|
-
*
|
|
462
|
-
* `toolResponse.rawV2`. Response metadata lives under `toolResponse.meta`. Semantic single-value
|
|
463
|
-
* getters live under `extractedValues.<name>.get()`, and list getters live
|
|
464
|
-
* under `extractedLists.<name>.get()`.
|
|
118
|
+
* The global brand preserves `instanceof DeeplineError` when a bundled play
|
|
119
|
+
* and the runtime load separate physical copies of this module.
|
|
465
120
|
*
|
|
466
|
-
*
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
121
|
+
* @sdkReference errors 010
|
|
122
|
+
*/
|
|
123
|
+
declare class DeeplineError extends Error {
|
|
124
|
+
/** HTTP status when the failure crossed an HTTP boundary. */
|
|
125
|
+
statusCode?: number;
|
|
126
|
+
/** Stable machine-readable error code when one exists. */
|
|
127
|
+
code?: string;
|
|
128
|
+
/** Local diagnostic context; not a portable error contract. */
|
|
129
|
+
details?: Record<string, unknown>;
|
|
130
|
+
/**
|
|
131
|
+
* Construct a Deepline error.
|
|
132
|
+
*
|
|
133
|
+
* SDK and runtime code construct these errors. Application and Play code
|
|
134
|
+
* normally catches the public subclasses instead.
|
|
135
|
+
*
|
|
136
|
+
* @param message Human-readable failure summary.
|
|
137
|
+
* @param statusCode HTTP status when one exists.
|
|
138
|
+
* @param code Stable machine-readable code when one exists.
|
|
139
|
+
* @param details Local diagnostic context; never a portable error contract.
|
|
140
|
+
*/
|
|
141
|
+
constructor(message: string, statusCode?: number, code?: string, details?: Record<string, unknown>);
|
|
142
|
+
static [Symbol.hasInstance](value: unknown): boolean;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* A failed `tools.execute` call with stable, allowlisted provenance.
|
|
471
146
|
*
|
|
472
|
-
*
|
|
147
|
+
* `retryable` means Deepline's delivery/idempotency contract says it is safe
|
|
148
|
+
* to repeat the same semantic call. It does not describe durable receipt
|
|
149
|
+
* repairability and does not make arbitrary side-effecting fallbacks safe.
|
|
150
|
+
*
|
|
151
|
+
* In a Play, catch `ProviderTransientError` to continue a read waterfall and
|
|
152
|
+
* let every other `ToolExecutionError` remain loud. In an SDK client, catch
|
|
153
|
+
* this base class when you need structured diagnostics for every tool failure.
|
|
154
|
+
*
|
|
155
|
+
* @sdkReference errors 070
|
|
473
156
|
*/
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
157
|
+
declare class ToolExecutionError extends DeeplineError {
|
|
158
|
+
/** Public tool id passed to `tools.execute`. */
|
|
159
|
+
readonly toolId: string;
|
|
160
|
+
/** Provider responsible for the operation, or `null` when unattributed. */
|
|
161
|
+
readonly provider: string | null;
|
|
162
|
+
/** Provider operation name, or `null` when unavailable. */
|
|
163
|
+
readonly operation: string | null;
|
|
164
|
+
/** Boundary responsible for the failure. */
|
|
165
|
+
readonly origin: ToolExecutionErrorOrigin;
|
|
166
|
+
/** Stable reason family for policy and diagnostics. */
|
|
167
|
+
readonly category: ToolExecutionErrorCategory;
|
|
168
|
+
/**
|
|
169
|
+
* Whether repeating the same semantic call is delivery-safe.
|
|
170
|
+
*
|
|
171
|
+
* This does not mean the error may be ignored. Waterfall fallthrough is
|
|
172
|
+
* represented by `ProviderTransientError`.
|
|
173
|
+
*/
|
|
174
|
+
readonly retryable: boolean;
|
|
175
|
+
/** Provider or Deepline request id, or `null` when unavailable. */
|
|
176
|
+
readonly requestId: string | null;
|
|
177
|
+
/** Suggested same-call retry delay in milliseconds, or `null`. */
|
|
178
|
+
readonly retryAfterMs: number | null;
|
|
179
|
+
/** Network failure kind, or `null` for non-network failures. */
|
|
180
|
+
readonly networkKind: ToolExecutionNetworkKind | null;
|
|
181
|
+
/** Network boundary that failed, or `null` for non-network failures. */
|
|
182
|
+
readonly networkScope: ToolExecutionNetworkScope | null;
|
|
183
|
+
/** Explicitly allowlisted diagnostics safe for SDK and Play callers. */
|
|
184
|
+
readonly publicDetails: ToolExecutionPublicDetails | null;
|
|
185
|
+
/**
|
|
186
|
+
* Construct a structured tool error.
|
|
187
|
+
*
|
|
188
|
+
* Deepline constructs this from the versioned `tool_error` payload.
|
|
189
|
+
* Application and Play code should catch it rather than create it.
|
|
190
|
+
*/
|
|
191
|
+
constructor(message: string, options: ToolExecutionErrorOptions);
|
|
192
|
+
static [Symbol.hasInstance](value: unknown): boolean;
|
|
193
|
+
}
|
|
479
194
|
/**
|
|
480
|
-
*
|
|
195
|
+
* A provider-owned transient failure that is safe to handle as an empty
|
|
196
|
+
* waterfall leg. Validation, auth, billing, Deepline, and unknown failures
|
|
197
|
+
* never satisfy this type.
|
|
481
198
|
*
|
|
482
|
-
*
|
|
483
|
-
*
|
|
484
|
-
*
|
|
199
|
+
* `retryable` remains independent: it says whether the same semantic call may
|
|
200
|
+
* be repeated safely. Falling through to a different read provider depends on
|
|
201
|
+
* this class, not on `retryable`.
|
|
485
202
|
*
|
|
486
|
-
* @sdkReference errors
|
|
203
|
+
* @sdkReference errors 080
|
|
487
204
|
*/
|
|
488
|
-
|
|
205
|
+
declare class ProviderTransientError extends ToolExecutionError {
|
|
206
|
+
/** Provider attribution is guaranteed for this subtype. */
|
|
207
|
+
readonly origin: "provider";
|
|
208
|
+
/** Provider failure category that made this error eligible for fallthrough. */
|
|
209
|
+
readonly category: ProviderTransientErrorCategory;
|
|
210
|
+
/** Constructed by Deepline when a provider-owned transient failure arrives. */
|
|
211
|
+
constructor(message: string, options: Omit<ToolExecutionErrorOptions, 'origin' | 'category'> & {
|
|
212
|
+
category: ProviderTransientErrorCategory;
|
|
213
|
+
});
|
|
214
|
+
static [Symbol.hasInstance](value: unknown): boolean;
|
|
215
|
+
}
|
|
216
|
+
/** Why a provider cannot serve the current read request. */
|
|
217
|
+
type ProviderUnavailableReason = ProviderTransientErrorCategory | 'account_capacity' | 'credentials_missing';
|
|
489
218
|
/**
|
|
490
|
-
*
|
|
491
|
-
*
|
|
492
|
-
*
|
|
493
|
-
*
|
|
494
|
-
* provider”; it is the safer and shorter waterfall contract.
|
|
495
|
-
*
|
|
496
|
-
* @sdkReference errors 030
|
|
219
|
+
* A provider failure that permits a read waterfall to try its next provider.
|
|
220
|
+
* A missing provider connection is included because another provider may still
|
|
221
|
+
* serve the read. Invalid credentials, caller input, and Deepline billing
|
|
222
|
+
* failures remain loud.
|
|
497
223
|
*/
|
|
498
|
-
type
|
|
224
|
+
type ProviderUnavailableError = ProviderTransientError | (ToolExecutionError & {
|
|
225
|
+
readonly origin: 'provider';
|
|
226
|
+
readonly code: 'PROVIDER_ACCOUNT_CAPACITY';
|
|
227
|
+
}) | (ToolExecutionError & {
|
|
228
|
+
readonly origin: 'caller';
|
|
229
|
+
readonly code: 'INTEGRATION_CREDENTIALS_MISSING';
|
|
230
|
+
});
|
|
499
231
|
/**
|
|
500
|
-
*
|
|
501
|
-
*
|
|
502
|
-
* This is `null` for failures that are not network failures.
|
|
232
|
+
* Return the provider-specific reason a read cannot run right now.
|
|
503
233
|
*
|
|
504
|
-
*
|
|
234
|
+
* `null` means this error must stay loud: it is caller input, an invalid
|
|
235
|
+
* customer credential, Deepline billing, or an internal failure. A missing
|
|
236
|
+
* provider connection is different: an explicit read waterfall may continue
|
|
237
|
+
* to a configured fallback and record the unavailable leg.
|
|
505
238
|
*/
|
|
506
|
-
|
|
239
|
+
declare function getProviderUnavailableReason(error: unknown): ProviderUnavailableReason | null;
|
|
507
240
|
/**
|
|
508
|
-
*
|
|
509
|
-
*
|
|
510
|
-
* `deepline_to_provider` is provider-side. Client and runtime scopes are
|
|
511
|
-
* Deepline transport failures and never qualify as provider fallthrough.
|
|
241
|
+
* Whether a provider cannot serve this read right now.
|
|
512
242
|
*
|
|
513
|
-
*
|
|
243
|
+
* Use this in an explicit `catch` to advance a read-only waterfall. For
|
|
244
|
+
* diagnostics, use `getProviderUnavailableReason(error)`.
|
|
514
245
|
*/
|
|
515
|
-
|
|
246
|
+
declare function isProviderUnavailable(error: unknown): error is ProviderUnavailableError;
|
|
247
|
+
/** @deprecated Use isProviderUnavailable. */
|
|
248
|
+
declare const isProviderWaterfallUnavailableError: typeof isProviderUnavailable;
|
|
249
|
+
|
|
516
250
|
/**
|
|
517
|
-
*
|
|
518
|
-
*
|
|
519
|
-
*
|
|
520
|
-
*
|
|
521
|
-
*
|
|
251
|
+
* Public tool-response contracts shared by the API, SDK, Play bundler, and
|
|
252
|
+
* runtime. This is a versioned response transformation contract: a change to
|
|
253
|
+
* the persisted public tool-result shape must introduce a new value here and
|
|
254
|
+
* have newly built Play artifacts select it. Receipt-cache revisions are
|
|
255
|
+
* intentionally separate: ordinary response-contract changes do not refresh
|
|
256
|
+
* durable receipts unless the response transformation changed as well.
|
|
522
257
|
*/
|
|
523
|
-
|
|
258
|
+
declare const V2_TOOL_RESPONSE_CONTRACT: "v2-tool-response";
|
|
259
|
+
declare const RAW_V2_TOOL_RESPONSE_CONTRACT: "raw-v2";
|
|
260
|
+
type ToolResponseContract = typeof V2_TOOL_RESPONSE_CONTRACT | typeof RAW_V2_TOOL_RESPONSE_CONTRACT;
|
|
261
|
+
|
|
524
262
|
/**
|
|
525
|
-
*
|
|
263
|
+
* Previous durable cell value passed to object-column resolvers.
|
|
526
264
|
*
|
|
527
|
-
*
|
|
528
|
-
* `
|
|
529
|
-
*
|
|
265
|
+
* The runtime supplies this when a row+column is being recomputed after a
|
|
266
|
+
* previous value existed. `value` has the same type that the column returns;
|
|
267
|
+
* freshness metadata lives beside it.
|
|
530
268
|
*
|
|
531
|
-
* @sdkReference
|
|
269
|
+
* @sdkReference runtime 120
|
|
532
270
|
*/
|
|
533
|
-
type
|
|
534
|
-
/**
|
|
535
|
-
|
|
536
|
-
/**
|
|
537
|
-
|
|
538
|
-
/**
|
|
539
|
-
|
|
540
|
-
/**
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
271
|
+
type PreviousCell<Value = unknown> = {
|
|
272
|
+
/** Previous completed value for this row+column. */
|
|
273
|
+
value: Value;
|
|
274
|
+
/** Millisecond timestamp when the previous value completed. */
|
|
275
|
+
completedAt?: number;
|
|
276
|
+
/** Millisecond timestamp when the previous value becomes stale; `null` means no expiry. */
|
|
277
|
+
staleAt?: number | null;
|
|
278
|
+
/** Resolved numeric TTL in seconds for the previous value, when present. */
|
|
279
|
+
staleAfterSeconds?: number;
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
type PlaySandboxRuntimeLimits = {
|
|
283
|
+
timeoutSeconds: number;
|
|
284
|
+
memoryGiB: number;
|
|
285
|
+
cpu: number;
|
|
286
|
+
diskGiB: number;
|
|
287
|
+
};
|
|
288
|
+
type PlaySandboxSize = 'standard';
|
|
289
|
+
type PlaySandboxRuntimeDeclaration = {
|
|
290
|
+
timeout?: string;
|
|
291
|
+
size?: PlaySandboxSize;
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
type EmailStatusVerdict = 'send' | 'send_with_caution' | 'verify_next' | 'hold' | 'drop';
|
|
295
|
+
type EmailStatusValue = 'valid' | 'invalid' | 'catch_all' | 'valid_catch_all' | 'unknown' | 'do_not_mail' | 'spamtrap' | 'abuse' | 'disposable';
|
|
296
|
+
type EmailDeliverability = 'high' | 'medium' | 'low' | 'unknown';
|
|
297
|
+
type EmailMxClass = 'consumer_mailbox' | 'workspace_mailbox' | 'security_gateway' | 'on_prem' | 'unknown';
|
|
298
|
+
type EmailStatus = {
|
|
299
|
+
verdict: EmailStatusVerdict;
|
|
300
|
+
status: EmailStatusValue;
|
|
301
|
+
verified: boolean;
|
|
302
|
+
confidence: number | null;
|
|
303
|
+
reasons: string[];
|
|
304
|
+
signals: {
|
|
305
|
+
catch_all: boolean | null;
|
|
306
|
+
deliverability: EmailDeliverability;
|
|
307
|
+
mx_class: EmailMxClass;
|
|
308
|
+
mx_provider: string | null;
|
|
309
|
+
mx_record: string | null;
|
|
310
|
+
fraud_score: number | null;
|
|
311
|
+
disposable: boolean | null;
|
|
312
|
+
role_based: boolean | null;
|
|
313
|
+
free_email: boolean | null;
|
|
314
|
+
abuse: boolean | null;
|
|
315
|
+
spamtrap: boolean | null;
|
|
316
|
+
suspect: boolean | null;
|
|
317
|
+
valid: boolean | null;
|
|
318
|
+
};
|
|
319
|
+
provider: {
|
|
320
|
+
name: string;
|
|
321
|
+
raw_status: string | boolean | number | null;
|
|
322
|
+
raw_score: number | null;
|
|
323
|
+
};
|
|
324
|
+
};
|
|
325
|
+
type EmailStatusMapEntry = {
|
|
326
|
+
status: EmailStatusValue;
|
|
327
|
+
verdict?: EmailStatusVerdict;
|
|
328
|
+
verified?: boolean;
|
|
329
|
+
reason?: string;
|
|
330
|
+
};
|
|
331
|
+
type EmailStatusRule = EmailStatusMapEntry & {
|
|
332
|
+
when: Record<string, string | number | boolean | null>;
|
|
333
|
+
};
|
|
334
|
+
type EmailStatusExtractorConfig = {
|
|
335
|
+
provider: string;
|
|
336
|
+
rawStatus?: string[];
|
|
337
|
+
rawScore?: string[];
|
|
338
|
+
valid?: string[];
|
|
339
|
+
deliverability?: string[];
|
|
340
|
+
catchAll?: string[];
|
|
341
|
+
mxProvider?: string[];
|
|
342
|
+
mxRecord?: string[];
|
|
343
|
+
fraudScore?: string[];
|
|
344
|
+
disposable?: string[];
|
|
345
|
+
roleBased?: string[];
|
|
346
|
+
freeEmail?: string[];
|
|
347
|
+
abuse?: string[];
|
|
348
|
+
spamtrap?: string[];
|
|
349
|
+
suspect?: string[];
|
|
350
|
+
statusMap?: Record<string, EmailStatusMapEntry>;
|
|
351
|
+
rules?: EmailStatusRule[];
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
declare const JOB_CHANGE_STATUS_VALUES: readonly ["moved", "no_change", "left_company", "unknown", "profile_unavailable", "no_new_company"];
|
|
355
|
+
type JobChangeStatus = (typeof JOB_CHANGE_STATUS_VALUES)[number];
|
|
356
|
+
type JobChangeGetterValue = {
|
|
357
|
+
status: JobChangeStatus;
|
|
358
|
+
date: string | null;
|
|
359
|
+
new_company: string | null;
|
|
360
|
+
new_title: string | null;
|
|
361
|
+
};
|
|
362
|
+
declare const PHONE_STATUS_VALUES: readonly ["valid", "invalid", "unknown"];
|
|
363
|
+
type PhoneStatus = (typeof PHONE_STATUS_VALUES)[number];
|
|
364
|
+
declare const DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS: {
|
|
365
|
+
readonly id: {
|
|
366
|
+
readonly identity: true;
|
|
367
|
+
readonly valueKind: "string";
|
|
368
|
+
};
|
|
369
|
+
readonly name: {
|
|
370
|
+
readonly identity: true;
|
|
371
|
+
readonly valueKind: "string";
|
|
372
|
+
};
|
|
373
|
+
readonly email: {
|
|
374
|
+
readonly identity: true;
|
|
375
|
+
readonly valueKind: "string";
|
|
376
|
+
};
|
|
377
|
+
readonly personal_email: {
|
|
378
|
+
readonly identity: true;
|
|
379
|
+
readonly valueKind: "string";
|
|
380
|
+
};
|
|
381
|
+
readonly phone: {
|
|
382
|
+
readonly identity: true;
|
|
383
|
+
readonly valueKind: "string";
|
|
384
|
+
};
|
|
385
|
+
readonly linkedin: {
|
|
386
|
+
readonly identity: true;
|
|
387
|
+
readonly valueKind: "string";
|
|
388
|
+
};
|
|
389
|
+
readonly linkedin_url: {
|
|
390
|
+
readonly identity: true;
|
|
391
|
+
readonly valueKind: "string";
|
|
392
|
+
};
|
|
393
|
+
readonly domain: {
|
|
394
|
+
readonly identity: true;
|
|
395
|
+
readonly valueKind: "string";
|
|
396
|
+
};
|
|
397
|
+
readonly website: {
|
|
398
|
+
readonly identity: true;
|
|
399
|
+
readonly valueKind: "string";
|
|
400
|
+
};
|
|
401
|
+
readonly first_name: {
|
|
402
|
+
readonly identity: true;
|
|
403
|
+
readonly valueKind: "string";
|
|
404
|
+
};
|
|
405
|
+
readonly last_name: {
|
|
406
|
+
readonly identity: true;
|
|
407
|
+
readonly valueKind: "string";
|
|
408
|
+
};
|
|
409
|
+
readonly full_name: {
|
|
410
|
+
readonly identity: true;
|
|
411
|
+
readonly valueKind: "string";
|
|
412
|
+
};
|
|
413
|
+
readonly company: {
|
|
414
|
+
readonly identity: true;
|
|
415
|
+
readonly valueKind: "string";
|
|
416
|
+
};
|
|
417
|
+
readonly company_name: {
|
|
418
|
+
readonly identity: true;
|
|
419
|
+
readonly valueKind: "string";
|
|
420
|
+
};
|
|
421
|
+
readonly organization_name: {
|
|
422
|
+
readonly identity: true;
|
|
423
|
+
readonly valueKind: "string";
|
|
424
|
+
};
|
|
425
|
+
readonly company_domain: {
|
|
426
|
+
readonly identity: true;
|
|
427
|
+
readonly valueKind: "string";
|
|
428
|
+
};
|
|
429
|
+
readonly company_website: {
|
|
430
|
+
readonly identity: true;
|
|
431
|
+
readonly valueKind: "string";
|
|
432
|
+
};
|
|
433
|
+
readonly company_linkedin_url: {
|
|
434
|
+
readonly identity: true;
|
|
435
|
+
readonly valueKind: "string";
|
|
436
|
+
};
|
|
437
|
+
readonly title: {
|
|
438
|
+
readonly identity: false;
|
|
439
|
+
readonly valueKind: "string";
|
|
440
|
+
};
|
|
441
|
+
readonly industry: {
|
|
442
|
+
readonly identity: false;
|
|
443
|
+
readonly valueKind: "string";
|
|
444
|
+
};
|
|
445
|
+
readonly status: {
|
|
446
|
+
readonly identity: false;
|
|
447
|
+
readonly valueKind: "string";
|
|
448
|
+
};
|
|
449
|
+
readonly job_change: {
|
|
450
|
+
readonly identity: false;
|
|
451
|
+
readonly valueKind: "job_change";
|
|
452
|
+
};
|
|
453
|
+
readonly job_change_status: {
|
|
454
|
+
readonly identity: false;
|
|
455
|
+
readonly valueKind: "job_change_status";
|
|
456
|
+
readonly enum: readonly ["moved", "no_change", "left_company", "unknown", "profile_unavailable", "no_new_company"];
|
|
457
|
+
};
|
|
458
|
+
readonly email_status: {
|
|
459
|
+
readonly identity: false;
|
|
460
|
+
readonly valueKind: "email_status";
|
|
461
|
+
};
|
|
462
|
+
readonly phone_status: {
|
|
463
|
+
readonly identity: false;
|
|
464
|
+
readonly valueKind: "phone_status";
|
|
465
|
+
readonly enum: readonly ["valid", "invalid", "unknown"];
|
|
466
|
+
};
|
|
562
467
|
};
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
468
|
+
type DeeplineExtractorTarget = keyof typeof DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS;
|
|
469
|
+
declare const DEEPLINE_EXTRACTOR_TARGETS: DeeplineExtractorTarget[];
|
|
470
|
+
type DeeplineEmailStatusGetterValue = EmailStatus;
|
|
471
|
+
type DeeplineGetterValueMap = {
|
|
472
|
+
id: string;
|
|
473
|
+
name: string;
|
|
474
|
+
email: string;
|
|
475
|
+
personal_email: string;
|
|
476
|
+
phone: string;
|
|
477
|
+
linkedin: string;
|
|
478
|
+
linkedin_url: string;
|
|
479
|
+
domain: string;
|
|
480
|
+
website: string;
|
|
481
|
+
first_name: string;
|
|
482
|
+
last_name: string;
|
|
483
|
+
full_name: string;
|
|
484
|
+
company: string;
|
|
485
|
+
company_name: string;
|
|
486
|
+
organization_name: string;
|
|
487
|
+
company_domain: string;
|
|
488
|
+
company_website: string;
|
|
489
|
+
company_linkedin_url: string;
|
|
490
|
+
title: string;
|
|
491
|
+
industry: string;
|
|
492
|
+
status: string;
|
|
493
|
+
job_change: JobChangeGetterValue;
|
|
494
|
+
job_change_status: JobChangeStatus;
|
|
495
|
+
email_status: EmailStatus;
|
|
496
|
+
phone_status: PhoneStatus;
|
|
578
497
|
};
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
* and the runtime load separate physical copies of this module.
|
|
591
|
-
*
|
|
592
|
-
* @sdkReference errors 010
|
|
593
|
-
*/
|
|
594
|
-
declare class DeeplineError extends Error {
|
|
595
|
-
/** HTTP status when the failure crossed an HTTP boundary. */
|
|
596
|
-
statusCode?: number;
|
|
597
|
-
/** Stable machine-readable error code when one exists. */
|
|
598
|
-
code?: string;
|
|
599
|
-
/** Local diagnostic context; not a portable error contract. */
|
|
600
|
-
details?: Record<string, unknown>;
|
|
601
|
-
/**
|
|
602
|
-
* Construct a Deepline error.
|
|
603
|
-
*
|
|
604
|
-
* SDK and runtime code construct these errors. Application and Play code
|
|
605
|
-
* normally catches the public subclasses instead.
|
|
606
|
-
*
|
|
607
|
-
* @param message Human-readable failure summary.
|
|
608
|
-
* @param statusCode HTTP status when one exists.
|
|
609
|
-
* @param code Stable machine-readable code when one exists.
|
|
610
|
-
* @param details Local diagnostic context; never a portable error contract.
|
|
611
|
-
*/
|
|
612
|
-
constructor(message: string, statusCode?: number, code?: string, details?: Record<string, unknown>);
|
|
613
|
-
static [Symbol.hasInstance](value: unknown): boolean;
|
|
498
|
+
type DeeplineGetterValue<TTarget extends DeeplineExtractorTarget = DeeplineExtractorTarget> = DeeplineGetterValueMap[TTarget];
|
|
499
|
+
declare function isDeeplineExtractorTarget(value: string): value is DeeplineExtractorTarget;
|
|
500
|
+
|
|
501
|
+
interface PlayR2FileRef {
|
|
502
|
+
storageKind: 'r2';
|
|
503
|
+
storageKey: string;
|
|
504
|
+
logicalPath: string;
|
|
505
|
+
fileName: string;
|
|
506
|
+
contentHash: string;
|
|
507
|
+
contentType: string;
|
|
508
|
+
bytes: number;
|
|
614
509
|
}
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
*
|
|
622
|
-
* In a Play, catch `ProviderTransientError` to continue a read waterfall and
|
|
623
|
-
* let every other `ToolExecutionError` remain loud. In an SDK client, catch
|
|
624
|
-
* this base class when you need structured diagnostics for every tool failure.
|
|
625
|
-
*
|
|
626
|
-
* @sdkReference errors 070
|
|
627
|
-
*/
|
|
628
|
-
declare class ToolExecutionError extends DeeplineError {
|
|
629
|
-
/** Public tool id passed to `tools.execute`. */
|
|
630
|
-
readonly toolId: string;
|
|
631
|
-
/** Provider responsible for the operation, or `null` when unattributed. */
|
|
632
|
-
readonly provider: string | null;
|
|
633
|
-
/** Provider operation name, or `null` when unavailable. */
|
|
634
|
-
readonly operation: string | null;
|
|
635
|
-
/** Boundary responsible for the failure. */
|
|
636
|
-
readonly origin: ToolExecutionErrorOrigin;
|
|
637
|
-
/** Stable reason family for policy and diagnostics. */
|
|
638
|
-
readonly category: ToolExecutionErrorCategory;
|
|
639
|
-
/**
|
|
640
|
-
* Whether repeating the same semantic call is delivery-safe.
|
|
641
|
-
*
|
|
642
|
-
* This does not mean the error may be ignored. Waterfall fallthrough is
|
|
643
|
-
* represented by `ProviderTransientError`.
|
|
644
|
-
*/
|
|
645
|
-
readonly retryable: boolean;
|
|
646
|
-
/** Provider or Deepline request id, or `null` when unavailable. */
|
|
647
|
-
readonly requestId: string | null;
|
|
648
|
-
/** Suggested same-call retry delay in milliseconds, or `null`. */
|
|
649
|
-
readonly retryAfterMs: number | null;
|
|
650
|
-
/** Network failure kind, or `null` for non-network failures. */
|
|
651
|
-
readonly networkKind: ToolExecutionNetworkKind | null;
|
|
652
|
-
/** Network boundary that failed, or `null` for non-network failures. */
|
|
653
|
-
readonly networkScope: ToolExecutionNetworkScope | null;
|
|
654
|
-
/** Explicitly allowlisted diagnostics safe for SDK and Play callers. */
|
|
655
|
-
readonly publicDetails: ToolExecutionPublicDetails | null;
|
|
656
|
-
/**
|
|
657
|
-
* Construct a structured tool error.
|
|
658
|
-
*
|
|
659
|
-
* Deepline constructs this from the versioned `tool_error` payload.
|
|
660
|
-
* Application and Play code should catch it rather than create it.
|
|
661
|
-
*/
|
|
662
|
-
constructor(message: string, options: ToolExecutionErrorOptions);
|
|
663
|
-
static [Symbol.hasInstance](value: unknown): boolean;
|
|
510
|
+
type PlayExecutionFileRef = PlayR2FileRef;
|
|
511
|
+
|
|
512
|
+
/** Source evidence is advisory; stored values determine lossless SQL encoding. */
|
|
513
|
+
interface PlayDatasetColumnTypeEvidence {
|
|
514
|
+
postgresTypeId: number;
|
|
515
|
+
valueType: 'boolean' | 'number' | 'string' | 'json';
|
|
664
516
|
}
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
/** Constructed by Deepline when a provider-owned transient failure arrives. */
|
|
682
|
-
constructor(message: string, options: Omit<ToolExecutionErrorOptions, 'origin' | 'category'> & {
|
|
683
|
-
category: ProviderTransientErrorCategory;
|
|
684
|
-
});
|
|
685
|
-
static [Symbol.hasInstance](value: unknown): boolean;
|
|
517
|
+
type PlayDatasetColumnTypes = Record<string, PlayDatasetColumnTypeEvidence>;
|
|
518
|
+
type PlaySheetColumnSource = 'input' | 'datasetColumn' | 'waterfallStep' | 'childPlayColumn';
|
|
519
|
+
interface PlaySheetColumnContract {
|
|
520
|
+
id: string;
|
|
521
|
+
sqlName: string;
|
|
522
|
+
source: PlaySheetColumnSource;
|
|
523
|
+
field?: string;
|
|
524
|
+
parentField?: string;
|
|
525
|
+
playId?: string;
|
|
526
|
+
waterfallId?: string;
|
|
527
|
+
outputField?: string;
|
|
528
|
+
outputSqlName?: string;
|
|
529
|
+
stepId?: string;
|
|
530
|
+
toolId?: string;
|
|
531
|
+
isRowKey?: boolean;
|
|
532
|
+
typeEvidence?: PlayDatasetColumnTypeEvidence;
|
|
686
533
|
}
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
534
|
+
interface PlaySheetContract {
|
|
535
|
+
tableNamespace: string;
|
|
536
|
+
columns: PlaySheetColumnContract[];
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
declare const PLAY_DATASET_BRAND: unique symbol;
|
|
540
|
+
type PlayDatasetKind = 'csv' | 'map';
|
|
541
|
+
type PlayDatasetBacking = {
|
|
542
|
+
storage: 'neon_sheet';
|
|
543
|
+
sheet: {
|
|
544
|
+
playName: string;
|
|
545
|
+
tableNamespace: string;
|
|
546
|
+
};
|
|
547
|
+
} | {
|
|
548
|
+
storage: 'r2_file';
|
|
549
|
+
file: PlayExecutionFileRef;
|
|
550
|
+
};
|
|
551
|
+
type PlayDatasetWorkProgressSummary = {
|
|
552
|
+
total: number;
|
|
553
|
+
executed: number;
|
|
554
|
+
reused: number;
|
|
555
|
+
skipped: number;
|
|
556
|
+
pending: number;
|
|
557
|
+
failed: number;
|
|
558
|
+
degraded?: boolean;
|
|
559
|
+
duplicates?: {
|
|
560
|
+
exact?: number;
|
|
561
|
+
semantic?: number;
|
|
562
|
+
rejected?: number;
|
|
563
|
+
};
|
|
564
|
+
};
|
|
565
|
+
type PlayDatasetInput<T> = ReadonlyArray<T> | Iterable<T> | AsyncIterable<T> | PlayDataset<T>;
|
|
566
|
+
type PlayDatasetRow<TInput> = TInput extends PlayDataset<infer Row> ? Row : TInput extends ReadonlyArray<infer Row> ? Row : TInput extends Iterable<infer Row> ? Row : TInput extends AsyncIterable<infer Row> ? Row : never;
|
|
567
|
+
type PlayDatasetTransformOptions = {
|
|
568
|
+
key?: string;
|
|
569
|
+
sourceLabel?: string | null;
|
|
570
|
+
};
|
|
702
571
|
/**
|
|
703
|
-
*
|
|
572
|
+
* Durable handle for rows produced by `ctx.csv(...)` or `ctx.dataset(...).run()`.
|
|
704
573
|
*
|
|
705
|
-
* `
|
|
706
|
-
*
|
|
707
|
-
*
|
|
708
|
-
* to a configured fallback and record the unavailable leg.
|
|
709
|
-
*/
|
|
710
|
-
declare function getProviderUnavailableReason(error: unknown): ProviderUnavailableReason | null;
|
|
711
|
-
/**
|
|
712
|
-
* Whether a provider cannot serve this read right now.
|
|
574
|
+
* A `PlayDataset` is not a normal in-memory array. It points at runtime-managed
|
|
575
|
+
* rows, usually backed by persisted sheet storage, and carries metadata such as
|
|
576
|
+
* dataset kind, dataset id, table namespace, count, and preview rows.
|
|
713
577
|
*
|
|
714
|
-
*
|
|
715
|
-
*
|
|
578
|
+
* Pass dataset handles directly into later `ctx.dataset(...)` stages by default so
|
|
579
|
+
* Deepline keeps row progress, retries, memory use, and table output under
|
|
580
|
+
* runtime control. Use `count()` and `peek()` for bounded inspection. Use
|
|
581
|
+
* `materialize(limit)` or async iteration only when the dataset is intentionally
|
|
582
|
+
* small and bounded. `PlayDataset` intentionally does not expose `.rows`,
|
|
583
|
+
* `.toArray()`, `.length`, numeric indexing, spread, or synchronous iteration;
|
|
584
|
+
* these hide loading costs or make behavior depend on row residency.
|
|
585
|
+
*
|
|
586
|
+
* @sdkReference runtime 190
|
|
716
587
|
*/
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
588
|
+
interface PlayDataset<T> extends AsyncIterable<T> {
|
|
589
|
+
readonly [PLAY_DATASET_BRAND]: true;
|
|
590
|
+
/** Dataset kind. */
|
|
591
|
+
readonly datasetKind: PlayDatasetKind;
|
|
592
|
+
/** Dataset id. */
|
|
593
|
+
readonly datasetId: string;
|
|
594
|
+
/** Backing store info. */
|
|
595
|
+
readonly backing?: PlayDatasetBacking;
|
|
596
|
+
/** Display label. */
|
|
597
|
+
readonly sourceLabel?: string | null;
|
|
598
|
+
/** Runtime table name. */
|
|
599
|
+
readonly tableNamespace?: string | null;
|
|
600
|
+
/** Advisory source types; transformed fields must infer from their values. */
|
|
601
|
+
readonly columnTypes?: PlayDatasetColumnTypes;
|
|
602
|
+
/** Row count. */
|
|
603
|
+
count(): Promise<number>;
|
|
604
|
+
/** Preview rows. */
|
|
605
|
+
peek(limit?: number): Promise<T[]>;
|
|
606
|
+
/** First row, loading it asynchronously when necessary. */
|
|
607
|
+
first(): Promise<T | undefined>;
|
|
608
|
+
/** Row at an array-style index, loading it asynchronously when necessary. */
|
|
609
|
+
at(index: number): Promise<T | undefined>;
|
|
610
|
+
map<U>(mapper: (row: T, index: number) => U | Promise<U>, options?: PlayDatasetTransformOptions): PlayDataset<U>;
|
|
611
|
+
filter(predicate: (row: T, index: number) => boolean | Promise<boolean>, options?: PlayDatasetTransformOptions): PlayDataset<T>;
|
|
612
|
+
slice(start?: number, end?: number, options?: PlayDatasetTransformOptions): PlayDataset<T>;
|
|
613
|
+
take(limit: number, options?: PlayDatasetTransformOptions): PlayDataset<T>;
|
|
614
|
+
/**
|
|
615
|
+
* Explicit escape hatch for bounded result sets.
|
|
616
|
+
* Large datasets should flow by handle through Neon-backed storage, not
|
|
617
|
+
* through worker memory as giant arrays.
|
|
618
|
+
*/
|
|
619
|
+
materialize(options?: number | PlayDatasetMaterializeOptions): Promise<T[]>;
|
|
620
|
+
toJSON(): {
|
|
621
|
+
kind: 'dataset';
|
|
622
|
+
datasetKind: PlayDatasetKind;
|
|
623
|
+
datasetId: string;
|
|
624
|
+
count: number;
|
|
625
|
+
backing?: PlayDatasetBacking;
|
|
626
|
+
sourceLabel?: string | null;
|
|
627
|
+
tableNamespace?: string | null;
|
|
628
|
+
columns?: string[];
|
|
629
|
+
columnTypes?: PlayDatasetColumnTypes;
|
|
630
|
+
_metadata?: {
|
|
631
|
+
workProgress?: PlayDatasetWorkProgressSummary;
|
|
632
|
+
};
|
|
633
|
+
preview: T[];
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
type PlayDatasetMaterializeScope = 'result' | 'full_persisted_dataset';
|
|
637
|
+
type PlayDatasetMaterializeOptions = {
|
|
638
|
+
/** Rows returned by this operation, or every current row in its persisted dataset. */
|
|
639
|
+
scope?: PlayDatasetMaterializeScope;
|
|
640
|
+
/** Maximum number of rows to load into memory. */
|
|
641
|
+
limit?: number;
|
|
642
|
+
};
|
|
720
643
|
|
|
721
644
|
/**
|
|
722
|
-
*
|
|
723
|
-
*
|
|
724
|
-
*
|
|
725
|
-
*
|
|
726
|
-
* intentionally separate: ordinary response-contract changes do not refresh
|
|
727
|
-
* durable receipts unless the response transformation changed as well.
|
|
645
|
+
* Customer pricing reported by the execution API, never provider spend.
|
|
646
|
+
* `credits_charged` and `cost_usd` describe the price of the original call;
|
|
647
|
+
* they do not acknowledge durable handoff or wallet posting. Receipt replay
|
|
648
|
+
* preserves this observation and does not imply a new charge or fresher state.
|
|
728
649
|
*/
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
650
|
+
type ToolResultBilling = {
|
|
651
|
+
credits_charged?: number;
|
|
652
|
+
cost_usd?: number;
|
|
653
|
+
/** Missing on historical responses. Pending pricing has no final amount. */
|
|
654
|
+
pricing_status?: 'final' | 'pending';
|
|
655
|
+
settlement_status?: 'pending' | 'queued' | 'settled' | 'released' | 'requires_recovery';
|
|
656
|
+
billing_outcome_reason?: 'free_operation' | 'provider_no_billable_result' | 'provider_reported_zero_usage' | 'zero_price';
|
|
657
|
+
estimated_credits?: number;
|
|
658
|
+
estimated_cost_usd?: number;
|
|
659
|
+
/** Preserve additive public pricing details across runtime/deployment skew. */
|
|
660
|
+
[key: string]: unknown;
|
|
661
|
+
};
|
|
662
|
+
type ToolResultExecutionMetadata = {
|
|
663
|
+
idempotent: true;
|
|
664
|
+
cached: boolean;
|
|
665
|
+
source: 'live' | 'checkpoint' | 'cache' | 'in_flight' | 'source_run';
|
|
666
|
+
cacheKey?: string;
|
|
667
|
+
receiptRole?: 'owner' | 'follower';
|
|
668
|
+
receiptKey?: string;
|
|
669
|
+
/** Canonical saved result identity; receiptKey may name a transport alias. */
|
|
670
|
+
resultReceiptKey?: string;
|
|
671
|
+
attachedToReceiptKey?: string;
|
|
672
|
+
};
|
|
673
|
+
type ToolResultTargetMetadata = {
|
|
674
|
+
value: unknown;
|
|
675
|
+
path: string;
|
|
676
|
+
};
|
|
677
|
+
type ToolResultListMetadata = {
|
|
678
|
+
path: string;
|
|
679
|
+
count: number | null;
|
|
680
|
+
keys: Record<string, string>;
|
|
681
|
+
};
|
|
682
|
+
type ToolResultExtractorDescriptor = {
|
|
683
|
+
paths: readonly string[];
|
|
684
|
+
transforms?: readonly string[];
|
|
685
|
+
enum?: readonly string[];
|
|
686
|
+
overrides?: readonly ToolResultExtractorOverride[];
|
|
687
|
+
emailStatus?: EmailStatusExtractorConfig;
|
|
688
|
+
};
|
|
689
|
+
type ToolResultExtractorOverride = {
|
|
690
|
+
paths: readonly string[];
|
|
691
|
+
equals?: string | number | boolean | null;
|
|
692
|
+
value: string | number | boolean | null;
|
|
693
|
+
};
|
|
694
|
+
type ToolResultTargetAccessor<T = unknown> = ToolResultTargetMetadata & {
|
|
695
|
+
get(): T | null;
|
|
696
|
+
};
|
|
697
|
+
type ToolResultListAccessor<T = Record<string, unknown>, TKey extends string = string> = Omit<ToolResultListMetadata, 'keys'> & {
|
|
698
|
+
keys: Partial<Record<TKey, string>> & Record<string, string>;
|
|
699
|
+
get(): PlayDataset<T>;
|
|
700
|
+
};
|
|
701
|
+
type ToolResponseEnvelope<TData = unknown, TMeta = Record<string, unknown>> = {
|
|
702
|
+
/** @deprecated Use declared getters or toolResponse.rawV2. */
|
|
703
|
+
raw: TData;
|
|
704
|
+
/** Complete parsed and scrubbed provider response, materialized from raw-v2. */
|
|
705
|
+
rawV2?: unknown;
|
|
706
|
+
/** Durable descriptor for deriving the legacy raw view from `rawV2`. */
|
|
707
|
+
view?: 'data' | 'rawV2';
|
|
708
|
+
meta?: TMeta;
|
|
709
|
+
};
|
|
710
|
+
type ToolExecuteResultBase<TResult = unknown, TMeta = Record<string, unknown>> = {
|
|
711
|
+
status: string;
|
|
712
|
+
job_id?: string;
|
|
713
|
+
/** Deepline-owned execution/result metadata. */
|
|
714
|
+
meta?: Record<string, unknown>;
|
|
715
|
+
billing?: ToolResultBilling;
|
|
716
|
+
toolResponse: ToolResponseEnvelope<TResult, TMeta>;
|
|
717
|
+
extractedValues: Record<string, ToolResultTargetAccessor>;
|
|
718
|
+
extractedLists: Record<string, ToolResultListAccessor>;
|
|
719
|
+
/** Convenience alias for play code. Serialized output uses toolResponse. */
|
|
720
|
+
toolOutput: ToolResponseEnvelope<TResult, TMeta>;
|
|
721
|
+
_metadata: {
|
|
722
|
+
toolId: string;
|
|
723
|
+
execution: ToolResultExecutionMetadata;
|
|
724
|
+
targets: Record<string, {
|
|
725
|
+
value: unknown;
|
|
726
|
+
path: string;
|
|
727
|
+
}>;
|
|
728
|
+
extractors?: Record<string, ToolResultExtractorDescriptor>;
|
|
729
|
+
lists: Record<string, {
|
|
730
|
+
path: string;
|
|
731
|
+
count: number | null;
|
|
732
|
+
keys: Record<string, string>;
|
|
733
|
+
}>;
|
|
734
|
+
/** Original declarations preserve semantic accessor names across replay. */
|
|
735
|
+
listExtractorPaths?: readonly string[];
|
|
736
|
+
};
|
|
737
|
+
};
|
|
738
|
+
type ToolExecuteResultAccessors<TExtracted extends Record<string, unknown> = Partial<DeeplineGetterValueMap>, TLists extends Record<string, Record<string, unknown>> = Record<string, Record<string, unknown>>> = {
|
|
739
|
+
extractedValues: {
|
|
740
|
+
[K in keyof TExtracted]: ToolResultTargetAccessor<TExtracted[K]>;
|
|
741
|
+
};
|
|
742
|
+
extractedLists: {
|
|
743
|
+
[K in keyof TLists]: ToolResultListAccessor<TLists[K]>;
|
|
744
|
+
};
|
|
745
|
+
};
|
|
733
746
|
/**
|
|
734
|
-
*
|
|
747
|
+
* Canonical result returned by Deepline tool execution.
|
|
735
748
|
*
|
|
736
|
-
* The
|
|
737
|
-
*
|
|
738
|
-
*
|
|
749
|
+
* The top-level object is Deepline-owned execution metadata and semantic
|
|
750
|
+
* extraction state. The canonical provider response lives under
|
|
751
|
+
* `toolResponse.rawV2`. Response metadata lives under `toolResponse.meta`. Semantic single-value
|
|
752
|
+
* getters live under `extractedValues.<name>.get()`, and list getters live
|
|
753
|
+
* under `extractedLists.<name>.get()`.
|
|
739
754
|
*
|
|
740
|
-
*
|
|
755
|
+
* Use extractors first when a tool contract exposes them. Use list getters for
|
|
756
|
+
* row-shaped data. Use `toolResponse.rawV2` for provider-specific fields or
|
|
757
|
+
* debugging. Inspect the observed response before selecting a nested field;
|
|
758
|
+
* provider envelopes are preserved, including pagination and sibling resources.
|
|
759
|
+
* This is parsed, scrubbed data, not the original HTTP bytes or headers.
|
|
760
|
+
*
|
|
761
|
+
* @sdkReference runtime 200
|
|
741
762
|
*/
|
|
742
|
-
type
|
|
743
|
-
/** Previous completed value for this row+column. */
|
|
744
|
-
value: Value;
|
|
745
|
-
/** Millisecond timestamp when the previous value completed. */
|
|
746
|
-
completedAt?: number;
|
|
747
|
-
/** Millisecond timestamp when the previous value becomes stale; `null` means no expiry. */
|
|
748
|
-
staleAt?: number | null;
|
|
749
|
-
/** Resolved numeric TTL in seconds for the previous value, when present. */
|
|
750
|
-
staleAfterSeconds?: number;
|
|
751
|
-
};
|
|
752
|
-
|
|
753
|
-
type PlaySandboxRuntimeLimits = {
|
|
754
|
-
timeoutSeconds: number;
|
|
755
|
-
memoryGiB: number;
|
|
756
|
-
cpu: number;
|
|
757
|
-
diskGiB: number;
|
|
758
|
-
};
|
|
759
|
-
type PlaySandboxSize = 'standard';
|
|
760
|
-
type PlaySandboxRuntimeDeclaration = {
|
|
761
|
-
timeout?: string;
|
|
762
|
-
size?: PlaySandboxSize;
|
|
763
|
-
};
|
|
763
|
+
type ToolExecuteResult<TResult = unknown, TMeta = Record<string, unknown>, TExtracted extends Record<string, unknown> = Partial<DeeplineGetterValueMap>, TLists extends Record<string, Record<string, unknown>> = Record<string, Record<string, unknown>>> = ToolExecuteResultBase<TResult, TMeta> & ToolExecuteResultAccessors<TExtracted, TLists>;
|
|
764
764
|
|
|
765
765
|
declare const SUPPORTED_PLAY_AUTHORING_CONTRACT_EDITIONS: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
766
766
|
type PlayAuthoringContractEdition = (typeof SUPPORTED_PLAY_AUTHORING_CONTRACT_EDITIONS)[number];
|
|
@@ -3283,4 +3283,4 @@ type PlayCompilerManifest = {
|
|
|
3283
3283
|
authoringContract?: AdmittedPlayAuthoringContract;
|
|
3284
3284
|
};
|
|
3285
3285
|
|
|
3286
|
-
export { type DeeplineGetterValue as $, type AsyncPlayRunRef as A, type PlayAuthoringCallOptions as B, type PlayAuthoringFetchResponse as C, type PlayAuthoringInputContract as D, type PlayRunId as E, type PlayAuthoringStepProgramStep as F, type PlayAuthoringRuntimeStepOptions as G, type PlaySqlListenerDeclaration as H, type PlaySqlListenerEvent as I, type PlaySqlListenerOperation as J, type PlaySqlQuery as K, type PlayAuthoringStepOptions as L, type PlayAuthoringStepProgram as M, type PlayAuthoringStepProgramResolver as N, type PlayAuthoringStepResolver as O,
|
|
3286
|
+
export { type DeeplineGetterValue as $, type AsyncPlayRunRef as A, type PlayAuthoringCallOptions as B, type PlayAuthoringFetchResponse as C, type PlayAuthoringInputContract as D, type PlayRunId as E, type PlayAuthoringStepProgramStep as F, type PlayAuthoringRuntimeStepOptions as G, type PlaySqlListenerDeclaration as H, type PlaySqlListenerEvent as I, type PlaySqlListenerOperation as J, type PlaySqlQuery as K, type PlayAuthoringStepOptions as L, type PlayAuthoringStepProgram as M, type PlayAuthoringStepProgramResolver as N, type PlayAuthoringStepResolver as O, PLAY_ARTIFACT_KINDS as P, type PlayToolExecutionRequest as Q, type PlayAuthoringStepProgramOptions as R, DeeplineError as S, type ToolExecuteResult as T, ToolExecutionError as U, type ToolExecutionErrorOptions as V, CtxFetchHttpError as W, DEEPLINE_EXTRACTOR_TARGETS as X, DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS as Y, type DeeplineEmailStatusGetterValue as Z, type DeeplineExtractorTarget as _, type PlayArtifactCompatibility as a, type DeeplineGetterValueMap as a0, JOB_CHANGE_STATUS_VALUES as a1, type JobChangeStatus as a2, PHONE_STATUS_VALUES as a3, type PhoneStatus as a4, type PlayDataset as a5, type PlayDatasetInput as a6, type PreviousCell as a7, ProviderTransientError as a8, type ProviderTransientErrorCategory as a9, type ProviderUnavailableError as aa, type ProviderUnavailableReason as ab, type ToolExecutionErrorCategory as ac, type ToolExecutionErrorOrigin as ad, type ToolExecutionFailureV1 as ae, type ToolExecutionNetworkKind as af, type ToolExecutionNetworkScope as ag, type ToolExecutionPublicDetails as ah, type ToolResultBilling as ai, getProviderUnavailableReason as aj, isDeeplineExtractorTarget as ak, isProviderUnavailable as al, isProviderWaterfallUnavailableError as am, type PlayBundleArtifact as b, type PlayImportPolicy as c, type PlayPackageImport as d, type PlayRuntimeFeature as e, type PlaySandboxRuntimeDeclaration as f, type PlayCompilerManifest as g, type PlayArtifactKind as h, type PlayAuthoringColumnMap as i, type PlayAuthoringColumnResolver as j, type PlayAuthoringRuntimeContext as k, type PlayAuthoringConditionalStepResolver as l, type PlayAuthoringCsvInput as m, type PlayAuthoringCsvOptions as n, type PlayAuthoringDatasetBuilder as o, type PlayAuthoringDatasetColumnDefinition as p, type PlayAuthoringDatasetColumnRunInput as q, type PlayAuthoringReferenceLike as r, type PlayReturnObject as s, type PlayAuthoringDefineConfig as t, type PlayAuthoringDefinedPlay as u, type PlayAuthoringFetchOptions as v, type PlayAuthoringFileInput as w, type PlayAuthoringAsyncCallOptions as x, type PlayAuthoringBindings as y, type PlayAuthoringCallExecution as z };
|