deepline 0.3.391 → 0.3.393
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 +156 -24
- package/dist/bundling-sources/sdk/src/compat.ts +9 -0
- package/dist/bundling-sources/sdk/src/http.ts +5 -1
- package/dist/bundling-sources/sdk/src/index.ts +5 -0
- package/dist/bundling-sources/sdk/src/plays/csv-data-input.ts +3 -0
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +182 -6
- package/dist/bundling-sources/sdk/src/release.ts +4 -1
- package/dist/bundling-sources/sdk/src/types.ts +15 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/request-warnings.ts +64 -0
- package/dist/bundling-sources/shared_libs/play-data-plane/runtime-sheet-storage-contract.ts +315 -0
- package/dist/bundling-sources/shared_libs/play-runtime/async-operation.ts +41 -8
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +418 -44
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +36 -3
- package/dist/bundling-sources/shared_libs/play-runtime/durable-invocation-fence.ts +36 -0
- package/dist/bundling-sources/shared_libs/play-runtime/map-execution-frame.ts +11 -3
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/gateway-adapter.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-semantics.ts +19 -1
- package/dist/bundling-sources/shared_libs/play-runtime/run-identity.ts +26 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +158 -10
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +235 -2
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +92 -58
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-pool.ts +7 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +30 -7
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +1161 -316
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +28 -15
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +24 -3
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +31 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +37 -4
- package/dist/bundling-sources/shared_libs/plays/dataset.ts +172 -79
- package/dist/bundling-sources/shared_libs/plays/extension-bridge.ts +57 -0
- package/dist/bundling-sources/shared_libs/plays/run-summary-types.ts +1 -0
- package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +173 -1
- package/dist/cli/{auth-6QET7NFP.mjs → auth-5PXHA232.mjs} +4 -4
- package/dist/cli/auth-P3MVDTXM.js +39 -0
- package/dist/cli/{billing-KJAGTCFR.js → billing-JFB2XLSO.js} +101 -74
- package/dist/cli/{billing-HAQ2VDQX.mjs → billing-Z2N7ZAGM.mjs} +32 -5
- package/dist/cli/{chunk-556BMGEB.js → chunk-2HAD745V.js} +242 -183
- package/dist/cli/{chunk-HFTOOZGN.mjs → chunk-2LGC4EFT.mjs} +3 -3
- package/dist/cli/{chunk-QCWIORKR.mjs → chunk-4PT2VA3A.mjs} +2 -2
- package/dist/cli/{chunk-KA7X75HC.js → chunk-4XX6443T.js} +176 -87
- package/dist/cli/{chunk-YBZY3EZF.mjs → chunk-5KWKZIQR.mjs} +4 -4
- package/dist/cli/{chunk-VH4B5OYM.mjs → chunk-5PRVMXKB.mjs} +27 -2
- package/dist/cli/{chunk-DSWSEHRX.mjs → chunk-6I73X254.mjs} +1 -1
- package/dist/cli/{chunk-6L4P7Z6C.mjs → chunk-7HR7BGZL.mjs} +13 -3
- package/dist/cli/{chunk-4S6X74A3.js → chunk-AARX5L4B.js} +2 -2
- package/dist/cli/{chunk-MHLCMJ2E.js → chunk-CDFH2DYL.js} +20 -19
- package/dist/cli/{chunk-PFPP4BKS.mjs → chunk-FQ6VHPW4.mjs} +2 -2
- package/dist/cli/{chunk-5JLQPVNX.js → chunk-GSK6NHVM.js} +1 -0
- package/dist/cli/{chunk-TLHF54VX.mjs → chunk-HLEESTCH.mjs} +1 -1
- package/dist/cli/{chunk-EDWJY6T4.mjs → chunk-HQXL5526.mjs} +1 -0
- package/dist/cli/{chunk-Q6EOHNRH.mjs → chunk-JI2B4RZP.mjs} +119 -6
- package/dist/cli/{chunk-I3MKXASV.mjs → chunk-KIYU2TGL.mjs} +2 -2
- package/dist/cli/{chunk-Y6VOGHF2.mjs → chunk-KZZC33PY.mjs} +0 -181
- package/dist/cli/{chunk-XBPLTHGB.js → chunk-L2SYLGRP.js} +8 -8
- package/dist/cli/{chunk-K3ODOHOI.mjs → chunk-LMMEAMA7.mjs} +3 -2
- package/dist/cli/{chunk-KWF4HJF7.mjs → chunk-LZPCDB7U.mjs} +3 -2
- package/dist/cli/{chunk-I7EVBLTW.js → chunk-M7Y7JYZX.js} +32 -7
- package/dist/cli/{chunk-QGKPTBRR.js → chunk-MS6GUPBB.js} +3 -3
- package/dist/cli/{chunk-ME2DZAHC.js → chunk-OXNOAD6Y.js} +26 -26
- package/dist/cli/{chunk-XEV5LMS2.js → chunk-PTDECJGP.js} +50 -50
- package/dist/cli/{chunk-5O4B6AUN.js → chunk-PWSWAN7Q.js} +25 -2
- package/dist/cli/{chunk-DRZFTRZJ.mjs → chunk-Q26LUSQ2.mjs} +79 -20
- package/dist/cli/{chunk-3VN4FTE3.js → chunk-RDXFGPJU.js} +1 -182
- package/dist/cli/{chunk-7E66A24V.mjs → chunk-RKMB3N7K.mjs} +25 -2
- package/dist/cli/{chunk-WLODHQ7S.js → chunk-RWHWF5ZJ.js} +3 -2
- package/dist/cli/{chunk-H3DCZOXR.mjs → chunk-STNYIMIV.mjs} +97 -8
- package/dist/cli/chunk-UBKA33KY.mjs +310 -0
- package/dist/cli/{chunk-PAIMOGCM.js → chunk-UHNDVD3P.js} +125 -12
- package/dist/cli/{chunk-H2ER7QWR.mjs → chunk-UOGZUA24.mjs} +180 -18
- package/dist/cli/{chunk-RTH26NF3.js → chunk-VIQJIX2P.js} +73 -63
- package/dist/cli/{chunk-ED42XCOW.js → chunk-VIWE6WRK.js} +629 -467
- package/dist/cli/{chunk-RA2SDTSX.js → chunk-W4WOMXR3.js} +15 -15
- package/dist/cli/chunk-XDVT3GOM.js +310 -0
- package/dist/cli/{chunk-UOSKJIXE.js → chunk-Z3OOZM5L.js} +8 -8
- package/dist/cli/{csv-V7UHOBFE.mjs → csv-KJWZHKCH.mjs} +3 -3
- package/dist/cli/{csv-2WSF5TEM.js → csv-P3Z3YE7H.js} +12 -12
- package/dist/cli/{db-TD375E4N.mjs → db-NCM4CQIS.mjs} +6 -5
- package/dist/cli/{db-42RL4FZD.js → db-NUZGJNQC.js} +31 -30
- package/dist/cli/{describe-GPUKAWOZ.mjs → describe-WT6MM2GO.mjs} +18 -17
- package/dist/cli/{describe-7WFCBZUY.js → describe-YGSEN5WC.js} +25 -24
- package/dist/cli/{executions-LGVG3FPH.js → executions-PCOLHN7Q.js} +8 -7
- package/dist/cli/{executions-M7O63JNA.mjs → executions-XS2IPJ4W.mjs} +6 -5
- package/dist/cli/{feedback-PZZA2M4S.js → feedback-4MSH7TFU.js} +7 -7
- package/dist/cli/{feedback-6PBSKVB2.mjs → feedback-CCLTS5SV.mjs} +3 -3
- package/dist/cli/{git-2VIFM5DI.mjs → git-K2DHPMPC.mjs} +4 -4
- package/dist/cli/git-RNM45FX4.js +23 -0
- package/dist/cli/index.js +96 -92
- package/dist/cli/index.mjs +46 -42
- package/dist/cli/{legacy-noops-DPUBZI7N.mjs → legacy-noops-B5S4AR3P.mjs} +4 -4
- package/dist/cli/{legacy-noops-IQ6QTZNZ.js → legacy-noops-GPNOPFXV.js} +7 -7
- package/dist/cli/{monitors-KBZVQG2U.mjs → monitors-JLMAIPRG.mjs} +6 -5
- package/dist/cli/{monitors-6GWAZFYV.js → monitors-ZAWD7NSN.js} +87 -86
- package/dist/cli/{org-JKGTHXOZ.js → org-P2KN4CES.js} +66 -65
- package/dist/cli/{org-CP3VSJBX.mjs → org-T3JTHP4G.mjs} +6 -5
- package/dist/cli/{play-DD2ME4L4.mjs → play-NK6BLRGL.mjs} +12 -11
- package/dist/cli/play-PDXR6JFB.js +158 -0
- package/dist/cli/{providers-JUNOFKI7.mjs → providers-3NQRA7IT.mjs} +6 -5
- package/dist/cli/{providers-P34QYYG6.js → providers-5QRZN3DT.js} +9 -8
- package/dist/cli/{quickstart-N6SWOK7E.mjs → quickstart-PIA2JGPV.mjs} +3 -3
- package/dist/cli/{quickstart-UL3DEFA4.js → quickstart-R7NUZGNW.js} +5 -5
- package/dist/cli/run-identity-G257GQED.js +25 -0
- package/dist/cli/run-identity-MRNCEGV2.mjs +25 -0
- package/dist/cli/{search-SC7I56HX.mjs → search-AIDIIGLY.mjs} +7 -6
- package/dist/cli/search-QRWL7MFM.js +27 -0
- package/dist/cli/{secrets-6ZJE7ZPM.js → secrets-BT3PGMWN.js} +15 -14
- package/dist/cli/{secrets-RTARNYF5.mjs → secrets-OQNHL45O.mjs} +6 -5
- package/dist/cli/{sessions-6IZ2XHGW.js → sessions-EYXWOSWK.js} +5 -5
- package/dist/cli/{sessions-7RKV2T3O.mjs → sessions-SF7WJPJP.mjs} +4 -4
- package/dist/cli/{settings-YX3XJDXE.js → settings-BA3GHBOD.js} +76 -75
- package/dist/cli/{settings-V6PXA6HY.mjs → settings-Y57JTFDD.mjs} +9 -8
- package/dist/cli/{setup-V2O4UJNT.mjs → setup-7GR5GBHA.mjs} +6 -6
- package/dist/cli/{setup-CQ5VRNNU.js → setup-RERXYC66.js} +41 -41
- package/dist/cli/{skills-VHJZWEHA.mjs → skills-SJWIQAV5.mjs} +4 -4
- package/dist/cli/skills-V7EY75HB.js +28 -0
- package/dist/cli/tools-H5HLBCHH.js +41 -0
- package/dist/cli/{tools-OD5WKEWY.mjs → tools-ZF3JXPNL.mjs} +10 -9
- package/dist/cli/update-472HA3LT.js +28 -0
- package/dist/cli/{update-CRMNOMJ3.mjs → update-FFFYQAOJ.mjs} +6 -6
- package/dist/cli/{workflow-XHORSD5T.js → workflow-SZJVQH4T.js} +17 -16
- package/dist/cli/{workflow-EVDYNCDD.mjs → workflow-XVFEEGAS.mjs} +7 -6
- package/dist/{client-DpzZi4fU.d.mts → client-DU5dtHDy.d.mts} +157 -4
- package/dist/{client-BhK9kix9.d.ts → client-mCE88hC4.d.ts} +157 -4
- package/dist/{compiler-manifest-CY2v8ab0.d.ts → compiler-manifest-DE4RdAiY.d.mts} +61 -1
- package/dist/{compiler-manifest-CY2v8ab0.d.mts → compiler-manifest-DE4RdAiY.d.ts} +61 -1
- package/dist/{index-B9fBZH1g.d.mts → index-BI6nWgaV.d.mts} +1 -1
- package/dist/{index-BZ6uzZJl.d.ts → index-Bi-f7HFT.d.ts} +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +120 -29
- package/dist/index.mjs +111 -20
- package/dist/install-integrity.json +94 -88
- package/dist/plays/bundle-play-file.d.mts +3 -3
- package/dist/plays/bundle-play-file.d.ts +3 -3
- package/dist/plays/bundle-play-file.mjs +2 -2
- package/dist/plays/csv-data-input.d.mts +2 -0
- package/dist/plays/csv-data-input.d.ts +2 -0
- package/dist/plays/csv-data-input.js +2 -2
- package/dist/plays/csv-data-input.mjs +1 -1
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/plays/run-request.js +5 -2
- package/dist/plays/run-request.mjs +4 -1
- package/dist/release.d.mts +4 -1
- package/dist/release.d.ts +4 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/package.json +1 -1
- package/dist/cli/auth-6ZUH42ZA.js +0 -39
- package/dist/cli/git-ZSJD3BID.js +0 -23
- package/dist/cli/play-G5GVMIBN.js +0 -157
- package/dist/cli/search-W4GXWTOM.js +0 -26
- package/dist/cli/skills-LBZPJTPI.js +0 -28
- package/dist/cli/tools-TQNM473H.js +0 -40
- package/dist/cli/update-QY6GAK6B.js +0 -28
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
var _chunkGEJDBXXMjs = require('./cli/chunk-GEJDBXXM.js');
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
|
|
@@ -12,27 +13,28 @@
|
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
|
|
15
|
-
var _chunk3VN4FTE3js = require('./cli/chunk-3VN4FTE3.js');
|
|
16
16
|
|
|
17
|
+
var _chunkRDXFGPJUjs = require('./cli/chunk-RDXFGPJU.js');
|
|
17
18
|
|
|
18
19
|
|
|
19
|
-
var
|
|
20
|
+
var _chunkPWSWAN7Qjs = require('./cli/chunk-PWSWAN7Q.js');
|
|
20
21
|
|
|
21
22
|
|
|
22
|
-
var _chunk5O4B6AUNjs = require('./cli/chunk-5O4B6AUN.js');
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
+
var _chunk2HAD745Vjs = require('./cli/chunk-2HAD745V.js');
|
|
29
30
|
|
|
30
31
|
|
|
31
|
-
var
|
|
32
|
+
var _chunkS6R3OX7Bjs = require('./cli/chunk-S6R3OX7B.js');
|
|
33
|
+
require('./cli/chunk-UHNDVD3P.js');
|
|
32
34
|
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
require('./cli/chunk-
|
|
36
|
+
|
|
37
|
+
var _chunkXDVT3GOMjs = require('./cli/chunk-XDVT3GOM.js');
|
|
36
38
|
|
|
37
39
|
|
|
38
40
|
|
|
@@ -62,7 +64,7 @@ var _chunkIF75RD6Ujs = require('./cli/chunk-IF75RD6U.js');
|
|
|
62
64
|
|
|
63
65
|
|
|
64
66
|
|
|
65
|
-
var
|
|
67
|
+
var _chunkCDFH2DYLjs = require('./cli/chunk-CDFH2DYL.js');
|
|
66
68
|
require('./cli/chunk-XNYIZMNQ.js');
|
|
67
69
|
|
|
68
70
|
|
|
@@ -72,7 +74,7 @@ require('./cli/chunk-XNYIZMNQ.js');
|
|
|
72
74
|
|
|
73
75
|
|
|
74
76
|
var _chunk7P5AA3SNjs = require('./cli/chunk-7P5AA3SN.js');
|
|
75
|
-
require('./cli/chunk-
|
|
77
|
+
require('./cli/chunk-RWHWF5ZJ.js');
|
|
76
78
|
require('./cli/chunk-OG64RBAC.js');
|
|
77
79
|
require('./cli/chunk-COGTRVWW.js');
|
|
78
80
|
|
|
@@ -80,6 +82,54 @@ require('./cli/chunk-COGTRVWW.js');
|
|
|
80
82
|
var PLAY_DATASET_BRAND = Symbol.for("deepline.play.dataset");
|
|
81
83
|
var NODE_INSPECT_CUSTOM = Symbol.for("nodejs.util.inspect.custom");
|
|
82
84
|
var residentRowsByDataset = /* @__PURE__ */ new WeakMap();
|
|
85
|
+
var sourceRowIdentityByRow = /* @__PURE__ */ new WeakMap();
|
|
86
|
+
var sourceRowIdentitiesByRows = /* @__PURE__ */ new WeakMap();
|
|
87
|
+
var sourceOccurrencesByDataset = /* @__PURE__ */ new WeakMap();
|
|
88
|
+
function setPlayDatasetSourceRowIdentity(row, identity) {
|
|
89
|
+
if (row && typeof row === "object") sourceRowIdentityByRow.set(row, identity);
|
|
90
|
+
return row;
|
|
91
|
+
}
|
|
92
|
+
function getPlayDatasetSourceRowIdentity(row) {
|
|
93
|
+
return row && typeof row === "object" ? sourceRowIdentityByRow.get(row) : void 0;
|
|
94
|
+
}
|
|
95
|
+
function getPlayDatasetSourceRowIdentityAt(rows, index) {
|
|
96
|
+
const identities = sourceRowIdentitiesByRows.get(rows);
|
|
97
|
+
return identities ? identities[index] : getPlayDatasetSourceRowIdentity(rows[index]);
|
|
98
|
+
}
|
|
99
|
+
function copySourceOccurrenceToMappedValue(identity, mapped) {
|
|
100
|
+
if (!identity || !mapped || typeof mapped !== "object") return mapped;
|
|
101
|
+
const prototype = Object.getPrototypeOf(mapped);
|
|
102
|
+
const occurrence = Array.isArray(mapped) ? Object.defineProperties([], Object.getOwnPropertyDescriptors(mapped)) : prototype === Object.prototype || prototype === null ? Object.create(prototype, Object.getOwnPropertyDescriptors(mapped)) : mapped;
|
|
103
|
+
return setPlayDatasetSourceRowIdentity(occurrence, identity);
|
|
104
|
+
}
|
|
105
|
+
async function* iterateSourceOccurrences(input) {
|
|
106
|
+
if (isPlayDataset(input)) {
|
|
107
|
+
const occurrences = sourceOccurrencesByDataset.get(input);
|
|
108
|
+
if (occurrences) {
|
|
109
|
+
yield* occurrences();
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
for await (const row of input)
|
|
113
|
+
yield { row, sourceIdentity: getPlayDatasetSourceRowIdentity(row) };
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (Array.isArray(input)) {
|
|
117
|
+
for (let index = 0; index < input.length; index += 1) {
|
|
118
|
+
yield {
|
|
119
|
+
row: input[index],
|
|
120
|
+
sourceIdentity: getPlayDatasetSourceRowIdentityAt(input, index)
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (input != null && typeof input === "object" && Symbol.asyncIterator in input) {
|
|
126
|
+
for await (const row of input)
|
|
127
|
+
yield { row, sourceIdentity: getPlayDatasetSourceRowIdentity(row) };
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
for (const row of input)
|
|
131
|
+
yield { row, sourceIdentity: getPlayDatasetSourceRowIdentity(row) };
|
|
132
|
+
}
|
|
83
133
|
var DEFAULT_MATERIALIZE_LIMIT = 1e4;
|
|
84
134
|
var PLAY_DATASET_EXECUTION_PAGE_BYTES = 64 * 1024 * 1024;
|
|
85
135
|
var DATASET_UTF8_ENCODER = new TextEncoder();
|
|
@@ -272,7 +322,7 @@ function transformDatasetId(input) {
|
|
|
272
322
|
}
|
|
273
323
|
function createTransformedPlayDataset(source, transform, options) {
|
|
274
324
|
const sourceLabel = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _5 => _5.sourceLabel]), () => ( `${_nullishCoalesce(_nullishCoalesce(source.sourceLabel, () => ( source.tableNamespace)), () => ( source.datasetId))}.${transform.kind}`));
|
|
275
|
-
const
|
|
325
|
+
const iterateOccurrences = async function* () {
|
|
276
326
|
if (transform.kind === "slice") {
|
|
277
327
|
const bounds = normalizeSliceBounds({
|
|
278
328
|
start: transform.start,
|
|
@@ -280,10 +330,10 @@ function createTransformedPlayDataset(source, transform, options) {
|
|
|
280
330
|
count: await source.count()
|
|
281
331
|
});
|
|
282
332
|
let index = 0;
|
|
283
|
-
for await (const
|
|
333
|
+
for await (const occurrence of iterateSourceOccurrences(source)) {
|
|
284
334
|
if (index >= bounds.end) break;
|
|
285
335
|
if (index >= bounds.start) {
|
|
286
|
-
yield
|
|
336
|
+
yield occurrence;
|
|
287
337
|
}
|
|
288
338
|
index += 1;
|
|
289
339
|
}
|
|
@@ -291,25 +341,39 @@ function createTransformedPlayDataset(source, transform, options) {
|
|
|
291
341
|
}
|
|
292
342
|
let inputIndex = 0;
|
|
293
343
|
let outputIndex = 0;
|
|
294
|
-
for await (const row of
|
|
344
|
+
for await (const { row, sourceIdentity } of iterateSourceOccurrences(
|
|
345
|
+
source
|
|
346
|
+
)) {
|
|
295
347
|
if (transform.kind === "filter") {
|
|
296
348
|
if (await transform.predicate(row, inputIndex)) {
|
|
297
|
-
yield row;
|
|
349
|
+
yield { row, sourceIdentity };
|
|
298
350
|
outputIndex += 1;
|
|
299
351
|
}
|
|
300
352
|
} else {
|
|
301
|
-
yield
|
|
353
|
+
yield {
|
|
354
|
+
row: copySourceOccurrenceToMappedValue(
|
|
355
|
+
sourceIdentity,
|
|
356
|
+
await transform.mapper(row, outputIndex)
|
|
357
|
+
),
|
|
358
|
+
sourceIdentity
|
|
359
|
+
};
|
|
302
360
|
outputIndex += 1;
|
|
303
361
|
}
|
|
304
362
|
inputIndex += 1;
|
|
305
363
|
}
|
|
306
364
|
};
|
|
365
|
+
const iterate = async function* () {
|
|
366
|
+
for await (const { row } of iterateOccurrences()) yield row;
|
|
367
|
+
};
|
|
307
368
|
const collect = async (limit) => {
|
|
308
369
|
const rows = [];
|
|
370
|
+
const identities = [];
|
|
371
|
+
sourceRowIdentitiesByRows.set(rows, identities);
|
|
309
372
|
const boundedLimit = limit === void 0 ? void 0 : Math.max(0, Math.floor(limit));
|
|
310
373
|
if (boundedLimit === 0) return rows;
|
|
311
|
-
for await (const row of
|
|
374
|
+
for await (const { row, sourceIdentity } of iterateOccurrences()) {
|
|
312
375
|
rows.push(row);
|
|
376
|
+
identities.push(sourceIdentity);
|
|
313
377
|
if (boundedLimit !== void 0 && rows.length >= boundedLimit) break;
|
|
314
378
|
}
|
|
315
379
|
return rows;
|
|
@@ -331,7 +395,7 @@ function createTransformedPlayDataset(source, transform, options) {
|
|
|
331
395
|
}
|
|
332
396
|
return total;
|
|
333
397
|
};
|
|
334
|
-
|
|
398
|
+
const dataset = createDeferredPlayDataset({
|
|
335
399
|
datasetKind: source.datasetKind,
|
|
336
400
|
datasetId: transformDatasetId({
|
|
337
401
|
source,
|
|
@@ -355,6 +419,11 @@ function createTransformedPlayDataset(source, transform, options) {
|
|
|
355
419
|
})
|
|
356
420
|
}
|
|
357
421
|
});
|
|
422
|
+
sourceOccurrencesByDataset.set(
|
|
423
|
+
dataset,
|
|
424
|
+
iterateOccurrences
|
|
425
|
+
);
|
|
426
|
+
return dataset;
|
|
358
427
|
}
|
|
359
428
|
function createDeferredPlayDataset(input) {
|
|
360
429
|
if (input.residentRows && input.knownCount !== null && input.residentRows.length !== (_nullishCoalesce(input.knownCount, () => ( input.count)))) {
|
|
@@ -669,7 +738,10 @@ function toV2RawToolOutputPathPreservingProviderData(path) {
|
|
|
669
738
|
return rawPath ? `toolResponse.raw.${rawPath}` : "toolResponse.raw";
|
|
670
739
|
}
|
|
671
740
|
function candidateResultPaths(path) {
|
|
741
|
+
const normalized = String(path || "").trim().replace(/^\./, "");
|
|
742
|
+
const providerPath = normalized.startsWith("result.data.") ? `toolResponse.raw.${normalized.slice("result.data.".length)}` : normalized === "result.data" ? "toolResponse.raw" : "";
|
|
672
743
|
const candidates = [
|
|
744
|
+
providerPath,
|
|
673
745
|
normalizeResultPath(path),
|
|
674
746
|
toV2RawToolOutputPathPreservingProviderData(path)
|
|
675
747
|
];
|
|
@@ -725,8 +797,27 @@ function acceptedTargetValue(target, value) {
|
|
|
725
797
|
if (target && STRING_CONTACT_TARGETS.has(target) && typeof value === "boolean") {
|
|
726
798
|
return void 0;
|
|
727
799
|
}
|
|
800
|
+
if (target === "email") return _nullishCoalesce(emailTargetValue(value), () => ( void 0));
|
|
728
801
|
return isMeaningfulValue(value) ? value : void 0;
|
|
729
802
|
}
|
|
803
|
+
function emailTargetValue(value) {
|
|
804
|
+
if (typeof value === "string") {
|
|
805
|
+
const email = value.trim();
|
|
806
|
+
return /^[^\s@*]+@[^\s@*]+\.[^\s@*]+$/.test(email) ? email : null;
|
|
807
|
+
}
|
|
808
|
+
if (Array.isArray(value)) {
|
|
809
|
+
for (const entry of value) {
|
|
810
|
+
const email = emailTargetValue(entry);
|
|
811
|
+
if (email) return email;
|
|
812
|
+
}
|
|
813
|
+
} else if (isRecord(value)) {
|
|
814
|
+
for (const key of ["email", "email_address", "address", "value"]) {
|
|
815
|
+
const email = emailTargetValue(value[key]);
|
|
816
|
+
if (email) return email;
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
return null;
|
|
820
|
+
}
|
|
730
821
|
function getFirstMeaningfulValueAtPath(root, path, target) {
|
|
731
822
|
for (const entry of valuesAtSegments(root, parsePath(path))) {
|
|
732
823
|
const value = acceptedTargetValue(target, entry.value);
|
|
@@ -820,7 +911,7 @@ function buildEmailStatusTarget(result, descriptor) {
|
|
|
820
911
|
if (!firstPath) return null;
|
|
821
912
|
return {
|
|
822
913
|
path: firstPath,
|
|
823
|
-
value:
|
|
914
|
+
value: _chunkRDXFGPJUjs.buildEmailStatus.call(void 0, { config, values })
|
|
824
915
|
};
|
|
825
916
|
}
|
|
826
917
|
function findFirstTargetByKey(result, target, depth = 0, path = []) {
|
|
@@ -896,7 +987,7 @@ function normalizeJobChangeStatus(value) {
|
|
|
896
987
|
if (["false", "no", "same", "no_change"].includes(normalized))
|
|
897
988
|
return "no_change";
|
|
898
989
|
if (["left", "left_company"].includes(normalized)) return "left_company";
|
|
899
|
-
if (
|
|
990
|
+
if (_chunkRDXFGPJUjs.JOB_CHANGE_STATUS_VALUES.includes(normalized)) {
|
|
900
991
|
return normalized;
|
|
901
992
|
}
|
|
902
993
|
return "unknown";
|
|
@@ -1185,7 +1276,7 @@ function buildListAccessors(resolved, lists, toolId, executionDiscriminator) {
|
|
|
1185
1276
|
metadata.path,
|
|
1186
1277
|
datasetDiscriminator
|
|
1187
1278
|
),
|
|
1188
|
-
datasetId: `tool-list:${
|
|
1279
|
+
datasetId: `tool-list:${_chunkXDVT3GOMjs.sha256Hex.call(void 0,
|
|
1189
1280
|
`${toolId}:${metadata.path}:${datasetDiscriminator}`
|
|
1190
1281
|
)}`
|
|
1191
1282
|
});
|
|
@@ -1206,7 +1297,7 @@ function buildListAccessors(resolved, lists, toolId, executionDiscriminator) {
|
|
|
1206
1297
|
}
|
|
1207
1298
|
function listRowsFingerprint(rows) {
|
|
1208
1299
|
try {
|
|
1209
|
-
return
|
|
1300
|
+
return _chunkXDVT3GOMjs.sha256Hex.call(void 0,
|
|
1210
1301
|
JSON.stringify(
|
|
1211
1302
|
{
|
|
1212
1303
|
count: rows.length,
|
|
@@ -1216,23 +1307,23 @@ function listRowsFingerprint(rows) {
|
|
|
1216
1307
|
)
|
|
1217
1308
|
).slice(0, 12);
|
|
1218
1309
|
} catch (e) {
|
|
1219
|
-
return
|
|
1310
|
+
return _chunkXDVT3GOMjs.sha256Hex.call(void 0, String(rows.length)).slice(0, 12);
|
|
1220
1311
|
}
|
|
1221
1312
|
}
|
|
1222
1313
|
function listTableNamespace(toolId, name, path, discriminator) {
|
|
1223
|
-
const raw = `${toolId}_${name || path || "rows"}_${
|
|
1314
|
+
const raw = `${toolId}_${name || path || "rows"}_${_chunkXDVT3GOMjs.sha256Hex.call(void 0, discriminator).slice(0, 10)}`;
|
|
1224
1315
|
try {
|
|
1225
|
-
return
|
|
1316
|
+
return _chunkXDVT3GOMjs.normalizeTableNamespace.call(void 0, raw);
|
|
1226
1317
|
} catch (e2) {
|
|
1227
|
-
const hash =
|
|
1318
|
+
const hash = _chunkXDVT3GOMjs.sha256Hex.call(void 0, raw).slice(0, 10);
|
|
1228
1319
|
const leaf = name || path.split(".").filter(Boolean).at(-1) || "rows";
|
|
1229
1320
|
let prefix = "rows";
|
|
1230
1321
|
try {
|
|
1231
|
-
prefix =
|
|
1322
|
+
prefix = _chunkXDVT3GOMjs.normalizeTableNamespace.call(void 0, leaf).slice(0, 52) || "rows";
|
|
1232
1323
|
} catch (e3) {
|
|
1233
1324
|
prefix = "rows";
|
|
1234
1325
|
}
|
|
1235
|
-
return
|
|
1326
|
+
return _chunkXDVT3GOMjs.normalizeTableNamespace.call(void 0, `${prefix}_${hash}`);
|
|
1236
1327
|
}
|
|
1237
1328
|
}
|
|
1238
1329
|
function createToolExecuteResult(input) {
|
|
@@ -1613,7 +1704,7 @@ var DeeplineContext = class {
|
|
|
1613
1704
|
* @param options - Optional SDK client configuration.
|
|
1614
1705
|
*/
|
|
1615
1706
|
constructor(options) {
|
|
1616
|
-
this.client = new (0,
|
|
1707
|
+
this.client = new (0, _chunk2HAD745Vjs.DeeplineClient)(options);
|
|
1617
1708
|
}
|
|
1618
1709
|
/**
|
|
1619
1710
|
* Tool operations namespace.
|
|
@@ -2098,7 +2189,7 @@ function definePlay(nameOrConfig, maybeFn, maybeBindings) {
|
|
|
2098
2189
|
writable: false
|
|
2099
2190
|
});
|
|
2100
2191
|
const handle = createNamedPlayHandle(
|
|
2101
|
-
() => new (0,
|
|
2192
|
+
() => new (0, _chunk2HAD745Vjs.DeeplineClient)(),
|
|
2102
2193
|
name
|
|
2103
2194
|
);
|
|
2104
2195
|
for (const key of [
|
|
@@ -2258,4 +2349,4 @@ var DEEPLINE_TOOL_CATEGORIES = [
|
|
|
2258
2349
|
|
|
2259
2350
|
|
|
2260
2351
|
|
|
2261
|
-
exports.AuthError =
|
|
2352
|
+
exports.AuthError = _chunkCDFH2DYLjs.AuthError; exports.ConfigError = _chunkCDFH2DYLjs.ConfigError; exports.CtxFetchHttpError = _chunkPWSWAN7Qjs.CtxFetchHttpError; exports.CustomerDbQueryOutcomeUnknownError = _chunkCDFH2DYLjs.CustomerDbQueryOutcomeUnknownError; exports.DEEPLINE_EXTRACTOR_TARGETS = _chunkRDXFGPJUjs.DEEPLINE_EXTRACTOR_TARGETS; exports.DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS = _chunkRDXFGPJUjs.DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS; exports.DEEPLINE_TOOL_CATEGORIES = DEEPLINE_TOOL_CATEGORIES; exports.Deepline = Deepline; exports.DeeplineClient = _chunk2HAD745Vjs.DeeplineClient; exports.DeeplineContext = DeeplineContext; exports.DeeplineError = _chunk7P5AA3SNjs.DeeplineError; exports.JOB_CHANGE_STATUS_VALUES = _chunkRDXFGPJUjs.JOB_CHANGE_STATUS_VALUES; exports.MONITOR_FLEET_AUTHORING_CONTRACT_CHANGELOG = _chunkC374C22Yjs.MONITOR_FLEET_AUTHORING_CONTRACT_CHANGELOG; exports.MONITOR_FLEET_AUTHORING_CONTRACT_EDITION = _chunkC374C22Yjs.MONITOR_FLEET_AUTHORING_CONTRACT_EDITION; exports.MONITOR_FLEET_DOCUMENTATION = _chunkC374C22Yjs.MONITOR_FLEET_DOCUMENTATION; exports.MONITOR_FLEET_FRONTIER_MAX_ROWS = _chunkC374C22Yjs.MONITOR_FLEET_FRONTIER_MAX_ROWS; exports.MONITOR_FLEET_MAX_MEMBERS = _chunkC374C22Yjs.MONITOR_FLEET_MAX_MEMBERS; exports.MONITOR_JOB_PHASES = _chunk2HAD745Vjs.MONITOR_JOB_PHASES; exports.MONITOR_JOB_RECONCILIATION_STATES = _chunk2HAD745Vjs.MONITOR_JOB_RECONCILIATION_STATES; exports.MONITOR_JOB_STATES = _chunk2HAD745Vjs.MONITOR_JOB_STATES; exports.PHONE_STATUS_VALUES = _chunkRDXFGPJUjs.PHONE_STATUS_VALUES; exports.PROD_URL = _chunkCDFH2DYLjs.PROD_URL; exports.ProviderTransientError = _chunk7P5AA3SNjs.ProviderTransientError; exports.RateLimitError = _chunkCDFH2DYLjs.RateLimitError; exports.RunEventQueryInputError = _chunk2HAD745Vjs.RunEventQueryInputError; exports.RunObserveTransportUnavailableError = RunObserveTransportUnavailableError; exports.SDK_API_CONTRACT = _chunkCDFH2DYLjs.SDK_API_CONTRACT; exports.SDK_VERSION = _chunkCDFH2DYLjs.SDK_VERSION; exports.ToolExecutionError = _chunk7P5AA3SNjs.ToolExecutionError; exports.ToolRateLimitError = _chunkCDFH2DYLjs.ToolRateLimitError; exports.admitMonitorFleetAuthoringContract = _chunkC374C22Yjs.admitMonitorFleetAuthoringContract; exports.defineInput = defineInput; exports.defineMonitor = defineMonitor; exports.defineMonitorFleet = _chunkC374C22Yjs.defineMonitorFleet; exports.definePlay = definePlay; exports.defineWorkflow = defineWorkflow; exports.extractSummaryFields = _chunkRDXFGPJUjs.extractSummaryFields; exports.fleetColumn = _chunkC374C22Yjs.fleetColumn; exports.fleetKey = _chunkC374C22Yjs.fleetKey; exports.getDefinedPlayMetadata = getDefinedPlayMetadata; exports.getProviderUnavailableReason = _chunk7P5AA3SNjs.getProviderUnavailableReason; exports.isDeeplineExtractorTarget = _chunkRDXFGPJUjs.isDeeplineExtractorTarget; exports.isProviderUnavailable = _chunk7P5AA3SNjs.isProviderUnavailable; exports.isProviderWaterfallUnavailableError = _chunk7P5AA3SNjs.isProviderWaterfallUnavailableError; exports.isStopAllPlayRunsDryRunResult = _chunk2HAD745Vjs.isStopAllPlayRunsDryRunResult; exports.lintMonitorBatchInput = _chunkIF75RD6Ujs.lintMonitorBatchInput; exports.lintMonitorFleetInput = _chunkC374C22Yjs.lintMonitorFleetInput; exports.lintMonitorSpecTemplate = _chunkIF75RD6Ujs.lintMonitorSpecTemplate; exports.pinLocalPlayImports = _chunkGEJDBXXMjs.pinLocalPlayImports; exports.planCustomerDbQuery = _chunk2HAD745Vjs.planCustomerDbQuery; exports.planLocalPlayExecution = _chunkGEJDBXXMjs.planLocalPlayExecution; exports.readList = readList; exports.renderMonitorSpecTemplate = _chunkIF75RD6Ujs.renderMonitorSpecTemplate; exports.resolveConfig = _chunkCDFH2DYLjs.resolveConfig; exports.runIf = runIf; exports.steps = steps; exports.tryConvertToList = _chunkRDXFGPJUjs.tryConvertToList; exports.validateMonitorFleetDefinition = _chunkC374C22Yjs.validateMonitorFleetDefinition; exports.writeCsvOutputFile = _chunkRDXFGPJUjs.writeCsvOutputFile; exports.writeJsonOutputFile = _chunkRDXFGPJUjs.writeJsonOutputFile;
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import "./cli/chunk-EXMLR72R.mjs";
|
|
2
|
+
import {
|
|
3
|
+
pinLocalPlayImports,
|
|
4
|
+
planLocalPlayExecution
|
|
5
|
+
} from "./cli/chunk-ERFN2QY4.mjs";
|
|
2
6
|
import {
|
|
3
7
|
DEEPLINE_EXTRACTOR_TARGETS,
|
|
4
8
|
DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS,
|
|
@@ -7,19 +11,13 @@ import {
|
|
|
7
11
|
buildEmailStatus,
|
|
8
12
|
extractSummaryFields,
|
|
9
13
|
isDeeplineExtractorTarget,
|
|
10
|
-
normalizeTableNamespace,
|
|
11
|
-
sha256Hex,
|
|
12
14
|
tryConvertToList,
|
|
13
15
|
writeCsvOutputFile,
|
|
14
16
|
writeJsonOutputFile
|
|
15
|
-
} from "./cli/chunk-
|
|
16
|
-
import {
|
|
17
|
-
pinLocalPlayImports,
|
|
18
|
-
planLocalPlayExecution
|
|
19
|
-
} from "./cli/chunk-ERFN2QY4.mjs";
|
|
17
|
+
} from "./cli/chunk-KZZC33PY.mjs";
|
|
20
18
|
import {
|
|
21
19
|
CtxFetchHttpError
|
|
22
|
-
} from "./cli/chunk-
|
|
20
|
+
} from "./cli/chunk-RKMB3N7K.mjs";
|
|
23
21
|
import {
|
|
24
22
|
DeeplineClient,
|
|
25
23
|
MONITOR_JOB_PHASES,
|
|
@@ -28,11 +26,15 @@ import {
|
|
|
28
26
|
RunEventQueryInputError,
|
|
29
27
|
isStopAllPlayRunsDryRunResult,
|
|
30
28
|
planCustomerDbQuery
|
|
31
|
-
} from "./cli/chunk-
|
|
29
|
+
} from "./cli/chunk-Q26LUSQ2.mjs";
|
|
32
30
|
import {
|
|
33
31
|
legacyRawFromToolResponseRawV2
|
|
34
32
|
} from "./cli/chunk-6IKARAYD.mjs";
|
|
35
|
-
import "./cli/chunk-
|
|
33
|
+
import "./cli/chunk-JI2B4RZP.mjs";
|
|
34
|
+
import {
|
|
35
|
+
normalizeTableNamespace,
|
|
36
|
+
sha256Hex
|
|
37
|
+
} from "./cli/chunk-UBKA33KY.mjs";
|
|
36
38
|
import {
|
|
37
39
|
MONITOR_FLEET_AUTHORING_CONTRACT_CHANGELOG,
|
|
38
40
|
MONITOR_FLEET_AUTHORING_CONTRACT_EDITION,
|
|
@@ -62,7 +64,7 @@ import {
|
|
|
62
64
|
SDK_VERSION,
|
|
63
65
|
ToolRateLimitError,
|
|
64
66
|
resolveConfig
|
|
65
|
-
} from "./cli/chunk-
|
|
67
|
+
} from "./cli/chunk-LMMEAMA7.mjs";
|
|
66
68
|
import "./cli/chunk-DLIRSHV6.mjs";
|
|
67
69
|
import {
|
|
68
70
|
DeeplineError,
|
|
@@ -72,7 +74,7 @@ import {
|
|
|
72
74
|
isProviderUnavailable,
|
|
73
75
|
isProviderWaterfallUnavailableError
|
|
74
76
|
} from "./cli/chunk-NXGCO4JB.mjs";
|
|
75
|
-
import "./cli/chunk-
|
|
77
|
+
import "./cli/chunk-LZPCDB7U.mjs";
|
|
76
78
|
import "./cli/chunk-WZYKRD7T.mjs";
|
|
77
79
|
import "./cli/chunk-KRD6H754.mjs";
|
|
78
80
|
|
|
@@ -80,6 +82,54 @@ import "./cli/chunk-KRD6H754.mjs";
|
|
|
80
82
|
var PLAY_DATASET_BRAND = Symbol.for("deepline.play.dataset");
|
|
81
83
|
var NODE_INSPECT_CUSTOM = Symbol.for("nodejs.util.inspect.custom");
|
|
82
84
|
var residentRowsByDataset = /* @__PURE__ */ new WeakMap();
|
|
85
|
+
var sourceRowIdentityByRow = /* @__PURE__ */ new WeakMap();
|
|
86
|
+
var sourceRowIdentitiesByRows = /* @__PURE__ */ new WeakMap();
|
|
87
|
+
var sourceOccurrencesByDataset = /* @__PURE__ */ new WeakMap();
|
|
88
|
+
function setPlayDatasetSourceRowIdentity(row, identity) {
|
|
89
|
+
if (row && typeof row === "object") sourceRowIdentityByRow.set(row, identity);
|
|
90
|
+
return row;
|
|
91
|
+
}
|
|
92
|
+
function getPlayDatasetSourceRowIdentity(row) {
|
|
93
|
+
return row && typeof row === "object" ? sourceRowIdentityByRow.get(row) : void 0;
|
|
94
|
+
}
|
|
95
|
+
function getPlayDatasetSourceRowIdentityAt(rows, index) {
|
|
96
|
+
const identities = sourceRowIdentitiesByRows.get(rows);
|
|
97
|
+
return identities ? identities[index] : getPlayDatasetSourceRowIdentity(rows[index]);
|
|
98
|
+
}
|
|
99
|
+
function copySourceOccurrenceToMappedValue(identity, mapped) {
|
|
100
|
+
if (!identity || !mapped || typeof mapped !== "object") return mapped;
|
|
101
|
+
const prototype = Object.getPrototypeOf(mapped);
|
|
102
|
+
const occurrence = Array.isArray(mapped) ? Object.defineProperties([], Object.getOwnPropertyDescriptors(mapped)) : prototype === Object.prototype || prototype === null ? Object.create(prototype, Object.getOwnPropertyDescriptors(mapped)) : mapped;
|
|
103
|
+
return setPlayDatasetSourceRowIdentity(occurrence, identity);
|
|
104
|
+
}
|
|
105
|
+
async function* iterateSourceOccurrences(input) {
|
|
106
|
+
if (isPlayDataset(input)) {
|
|
107
|
+
const occurrences = sourceOccurrencesByDataset.get(input);
|
|
108
|
+
if (occurrences) {
|
|
109
|
+
yield* occurrences();
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
for await (const row of input)
|
|
113
|
+
yield { row, sourceIdentity: getPlayDatasetSourceRowIdentity(row) };
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (Array.isArray(input)) {
|
|
117
|
+
for (let index = 0; index < input.length; index += 1) {
|
|
118
|
+
yield {
|
|
119
|
+
row: input[index],
|
|
120
|
+
sourceIdentity: getPlayDatasetSourceRowIdentityAt(input, index)
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (input != null && typeof input === "object" && Symbol.asyncIterator in input) {
|
|
126
|
+
for await (const row of input)
|
|
127
|
+
yield { row, sourceIdentity: getPlayDatasetSourceRowIdentity(row) };
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
for (const row of input)
|
|
131
|
+
yield { row, sourceIdentity: getPlayDatasetSourceRowIdentity(row) };
|
|
132
|
+
}
|
|
83
133
|
var DEFAULT_MATERIALIZE_LIMIT = 1e4;
|
|
84
134
|
var PLAY_DATASET_EXECUTION_PAGE_BYTES = 64 * 1024 * 1024;
|
|
85
135
|
var DATASET_UTF8_ENCODER = new TextEncoder();
|
|
@@ -272,7 +322,7 @@ function transformDatasetId(input) {
|
|
|
272
322
|
}
|
|
273
323
|
function createTransformedPlayDataset(source, transform, options) {
|
|
274
324
|
const sourceLabel = options?.sourceLabel ?? `${source.sourceLabel ?? source.tableNamespace ?? source.datasetId}.${transform.kind}`;
|
|
275
|
-
const
|
|
325
|
+
const iterateOccurrences = async function* () {
|
|
276
326
|
if (transform.kind === "slice") {
|
|
277
327
|
const bounds = normalizeSliceBounds({
|
|
278
328
|
start: transform.start,
|
|
@@ -280,10 +330,10 @@ function createTransformedPlayDataset(source, transform, options) {
|
|
|
280
330
|
count: await source.count()
|
|
281
331
|
});
|
|
282
332
|
let index = 0;
|
|
283
|
-
for await (const
|
|
333
|
+
for await (const occurrence of iterateSourceOccurrences(source)) {
|
|
284
334
|
if (index >= bounds.end) break;
|
|
285
335
|
if (index >= bounds.start) {
|
|
286
|
-
yield
|
|
336
|
+
yield occurrence;
|
|
287
337
|
}
|
|
288
338
|
index += 1;
|
|
289
339
|
}
|
|
@@ -291,25 +341,39 @@ function createTransformedPlayDataset(source, transform, options) {
|
|
|
291
341
|
}
|
|
292
342
|
let inputIndex = 0;
|
|
293
343
|
let outputIndex = 0;
|
|
294
|
-
for await (const row of
|
|
344
|
+
for await (const { row, sourceIdentity } of iterateSourceOccurrences(
|
|
345
|
+
source
|
|
346
|
+
)) {
|
|
295
347
|
if (transform.kind === "filter") {
|
|
296
348
|
if (await transform.predicate(row, inputIndex)) {
|
|
297
|
-
yield row;
|
|
349
|
+
yield { row, sourceIdentity };
|
|
298
350
|
outputIndex += 1;
|
|
299
351
|
}
|
|
300
352
|
} else {
|
|
301
|
-
yield
|
|
353
|
+
yield {
|
|
354
|
+
row: copySourceOccurrenceToMappedValue(
|
|
355
|
+
sourceIdentity,
|
|
356
|
+
await transform.mapper(row, outputIndex)
|
|
357
|
+
),
|
|
358
|
+
sourceIdentity
|
|
359
|
+
};
|
|
302
360
|
outputIndex += 1;
|
|
303
361
|
}
|
|
304
362
|
inputIndex += 1;
|
|
305
363
|
}
|
|
306
364
|
};
|
|
365
|
+
const iterate = async function* () {
|
|
366
|
+
for await (const { row } of iterateOccurrences()) yield row;
|
|
367
|
+
};
|
|
307
368
|
const collect = async (limit) => {
|
|
308
369
|
const rows = [];
|
|
370
|
+
const identities = [];
|
|
371
|
+
sourceRowIdentitiesByRows.set(rows, identities);
|
|
309
372
|
const boundedLimit = limit === void 0 ? void 0 : Math.max(0, Math.floor(limit));
|
|
310
373
|
if (boundedLimit === 0) return rows;
|
|
311
|
-
for await (const row of
|
|
374
|
+
for await (const { row, sourceIdentity } of iterateOccurrences()) {
|
|
312
375
|
rows.push(row);
|
|
376
|
+
identities.push(sourceIdentity);
|
|
313
377
|
if (boundedLimit !== void 0 && rows.length >= boundedLimit) break;
|
|
314
378
|
}
|
|
315
379
|
return rows;
|
|
@@ -331,7 +395,7 @@ function createTransformedPlayDataset(source, transform, options) {
|
|
|
331
395
|
}
|
|
332
396
|
return total;
|
|
333
397
|
};
|
|
334
|
-
|
|
398
|
+
const dataset = createDeferredPlayDataset({
|
|
335
399
|
datasetKind: source.datasetKind,
|
|
336
400
|
datasetId: transformDatasetId({
|
|
337
401
|
source,
|
|
@@ -355,6 +419,11 @@ function createTransformedPlayDataset(source, transform, options) {
|
|
|
355
419
|
})
|
|
356
420
|
}
|
|
357
421
|
});
|
|
422
|
+
sourceOccurrencesByDataset.set(
|
|
423
|
+
dataset,
|
|
424
|
+
iterateOccurrences
|
|
425
|
+
);
|
|
426
|
+
return dataset;
|
|
358
427
|
}
|
|
359
428
|
function createDeferredPlayDataset(input) {
|
|
360
429
|
if (input.residentRows && input.knownCount !== null && input.residentRows.length !== (input.knownCount ?? input.count)) {
|
|
@@ -669,7 +738,10 @@ function toV2RawToolOutputPathPreservingProviderData(path) {
|
|
|
669
738
|
return rawPath ? `toolResponse.raw.${rawPath}` : "toolResponse.raw";
|
|
670
739
|
}
|
|
671
740
|
function candidateResultPaths(path) {
|
|
741
|
+
const normalized = String(path || "").trim().replace(/^\./, "");
|
|
742
|
+
const providerPath = normalized.startsWith("result.data.") ? `toolResponse.raw.${normalized.slice("result.data.".length)}` : normalized === "result.data" ? "toolResponse.raw" : "";
|
|
672
743
|
const candidates = [
|
|
744
|
+
providerPath,
|
|
673
745
|
normalizeResultPath(path),
|
|
674
746
|
toV2RawToolOutputPathPreservingProviderData(path)
|
|
675
747
|
];
|
|
@@ -725,8 +797,27 @@ function acceptedTargetValue(target, value) {
|
|
|
725
797
|
if (target && STRING_CONTACT_TARGETS.has(target) && typeof value === "boolean") {
|
|
726
798
|
return void 0;
|
|
727
799
|
}
|
|
800
|
+
if (target === "email") return emailTargetValue(value) ?? void 0;
|
|
728
801
|
return isMeaningfulValue(value) ? value : void 0;
|
|
729
802
|
}
|
|
803
|
+
function emailTargetValue(value) {
|
|
804
|
+
if (typeof value === "string") {
|
|
805
|
+
const email = value.trim();
|
|
806
|
+
return /^[^\s@*]+@[^\s@*]+\.[^\s@*]+$/.test(email) ? email : null;
|
|
807
|
+
}
|
|
808
|
+
if (Array.isArray(value)) {
|
|
809
|
+
for (const entry of value) {
|
|
810
|
+
const email = emailTargetValue(entry);
|
|
811
|
+
if (email) return email;
|
|
812
|
+
}
|
|
813
|
+
} else if (isRecord(value)) {
|
|
814
|
+
for (const key of ["email", "email_address", "address", "value"]) {
|
|
815
|
+
const email = emailTargetValue(value[key]);
|
|
816
|
+
if (email) return email;
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
return null;
|
|
820
|
+
}
|
|
730
821
|
function getFirstMeaningfulValueAtPath(root, path, target) {
|
|
731
822
|
for (const entry of valuesAtSegments(root, parsePath(path))) {
|
|
732
823
|
const value = acceptedTargetValue(target, entry.value);
|