deepline 0.3.327 → 0.3.329
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/index.ts +1 -0
- package/dist/bundling-sources/sdk/src/play.ts +55 -45
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +16 -0
- package/dist/bundling-sources/shared_libs/observability/queue-health.ts +9 -0
- package/dist/bundling-sources/shared_libs/observability/queue-item-connectors.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +31 -15
- package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-semantics.ts +22 -4
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +29 -11
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +145 -19
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +37 -10
- package/dist/bundling-sources/shared_libs/plays/dataset.ts +3 -0
- package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +59 -10
- package/dist/bundling-sources/shared_libs/security/secret-redaction.ts +4 -0
- package/dist/cli/{auth-EBBDOKNV.mjs → auth-MFFVOITR.mjs} +4 -4
- package/dist/cli/auth-W2MQM6GQ.js +31 -0
- package/dist/cli/{billing-IM2QUFX4.mjs → billing-LRBHWLIQ.mjs} +30 -16
- package/dist/cli/{billing-6AAB7WPJ.js → billing-V4Y4OVQ7.js} +96 -82
- package/dist/cli/{chunk-D6GD5AVN.mjs → chunk-3RZJ3GEG.mjs} +135 -5
- package/dist/cli/{chunk-MOP6D7Z5.js → chunk-4FLEXYUC.js} +141 -11
- package/dist/cli/{chunk-DSDX6EUW.js → chunk-75ZOTF3K.js} +15 -15
- package/dist/cli/{chunk-ZOFARJWH.mjs → chunk-7T6DX5RK.mjs} +21 -14
- package/dist/cli/{chunk-3MXRNPBN.js → chunk-AD23W4S5.js} +1 -1
- package/dist/cli/{chunk-F45425TB.mjs → chunk-EROOAI5G.mjs} +1 -1
- package/dist/cli/{chunk-REP2MYBI.mjs → chunk-ERU2OR6F.mjs} +2 -2
- package/dist/cli/{chunk-YIY74KUF.mjs → chunk-EV4QJE4J.mjs} +1 -1
- package/dist/cli/{chunk-CCRQ2VGJ.mjs → chunk-FK7PW6BP.mjs} +1 -1
- package/dist/cli/{chunk-2HKPAZVJ.js → chunk-FKKNYKDY.js} +14 -3
- package/dist/cli/{chunk-G5774EFF.mjs → chunk-GCNER3HV.mjs} +1 -1
- package/dist/cli/{chunk-4ZARCCPT.js → chunk-GY2EEO2Y.js} +9 -9
- package/dist/cli/{chunk-HOWQKN6J.mjs → chunk-HI7TAWFS.mjs} +79 -26
- package/dist/cli/{chunk-RSEVBSFE.mjs → chunk-HVPRQGF4.mjs} +1 -1
- package/dist/cli/{chunk-CISKBOXD.js → chunk-J2E5R2VH.js} +60 -60
- package/dist/cli/{chunk-7RCJDAJX.js → chunk-KHZQFFOQ.js} +2 -2
- package/dist/cli/{chunk-DVV4FPS7.mjs → chunk-MFQQINUY.mjs} +2 -2
- package/dist/cli/{chunk-DCAU6PND.mjs → chunk-MO2XSC5I.mjs} +4 -4
- package/dist/cli/{chunk-KP7W5NO6.mjs → chunk-NTVTZAVZ.mjs} +13 -2
- package/dist/cli/{chunk-HZZJR2GV.js → chunk-OUTIWGKY.js} +26 -26
- package/dist/cli/{chunk-QZAP5VOS.mjs → chunk-OZGU7P2S.mjs} +1 -1
- package/dist/cli/{chunk-A5SKM3GL.mjs → chunk-SJV5MTOJ.mjs} +1 -1
- package/dist/cli/{chunk-UROXKPND.js → chunk-U2N4CYT7.js} +6 -6
- package/dist/cli/{chunk-4TO56P22.js → chunk-U4CTHVN7.js} +255 -248
- package/dist/cli/{chunk-AGH6YP2T.js → chunk-UQV5M6HN.js} +3 -3
- package/dist/cli/{chunk-DM3SHV6U.js → chunk-VDIHLKGG.js} +4 -4
- package/dist/cli/{chunk-77RAV5XX.js → chunk-VLDLJZ75.js} +48 -48
- package/dist/cli/{chunk-NWIJLTRL.js → chunk-XRYKLK56.js} +119 -66
- package/dist/cli/{chunk-3ITDKXNC.mjs → chunk-YNSCELIJ.mjs} +2 -2
- package/dist/cli/{chunk-TAGHNT5P.js → chunk-ZXGUYTIT.js} +6 -6
- package/dist/cli/client-5AIFBLKQ.js +20 -0
- package/dist/cli/{client-JCMSACT4.mjs → client-BNLD775D.mjs} +3 -3
- package/dist/cli/{csv-NPMWVM5D.mjs → csv-7MVQECWG.mjs} +3 -3
- package/dist/cli/{csv-OILKDKUX.js → csv-ZT6ZRQ3Z.js} +12 -12
- package/dist/cli/{db-AZUAOWPQ.mjs → db-ABLWLMX5.mjs} +4 -4
- package/dist/cli/{db-MNDRYYEX.js → db-C4BMZXJK.js} +29 -29
- package/dist/cli/{describe-KJWOHMKC.mjs → describe-XWOWAR32.mjs} +10 -10
- package/dist/cli/{describe-QENLDLM2.js → describe-YALVN4WH.js} +17 -17
- package/dist/cli/{executions-QZNQWF6F.mjs → executions-7IZVKQ3O.mjs} +4 -4
- package/dist/cli/{executions-P36UHBPG.js → executions-U4TNRP26.js} +6 -6
- package/dist/cli/{feedback-RQ6HSZSG.mjs → feedback-GO5XPEKY.mjs} +3 -3
- package/dist/cli/{feedback-K4UGTLFD.js → feedback-NWMRT5W4.js} +6 -6
- package/dist/cli/{git-PBRMCBMI.mjs → git-R53WS4WA.mjs} +4 -4
- package/dist/cli/git-YWRLAOBY.js +23 -0
- package/dist/cli/index.js +95 -80
- package/dist/cli/index.mjs +54 -39
- package/dist/cli/{legacy-noops-G7GWJ5UC.mjs → legacy-noops-6QAZW7WJ.mjs} +4 -4
- package/dist/cli/{legacy-noops-X74FM35Q.js → legacy-noops-NJWM53DE.js} +7 -7
- package/dist/cli/{monitors-VKURX3YM.js → monitors-2I2MYAPS.js} +85 -85
- package/dist/cli/{monitors-KL2MCR57.mjs → monitors-2N4BRU5M.mjs} +4 -4
- package/dist/cli/{org-DT53KTNW.mjs → org-D3RHK2Q7.mjs} +4 -4
- package/dist/cli/{org-ZYXJDC44.js → org-XVNAE2JV.js} +60 -60
- package/dist/cli/{play-WIJGQYTB.mjs → play-L7MYJZ65.mjs} +9 -9
- package/dist/cli/play-OYRHI7G3.js +153 -0
- package/dist/cli/{providers-GRTW4TXX.js → providers-5BTDAZHN.js} +7 -7
- package/dist/cli/{providers-GYGKGS2J.mjs → providers-YM4E7WZD.mjs} +4 -4
- package/dist/cli/{quickstart-WB26543C.js → quickstart-5A3FHAH3.js} +5 -5
- package/dist/cli/{quickstart-XF3M2M2S.mjs → quickstart-ARPLJOLH.mjs} +3 -3
- package/dist/cli/{search-ANJLTOF2.mjs → search-KKJEVV27.mjs} +5 -5
- package/dist/cli/search-VE3O3ZEM.js +26 -0
- package/dist/cli/{secrets-D6UR5CTW.mjs → secrets-DGRJ4DO5.mjs} +4 -4
- package/dist/cli/{secrets-5KBUGMTK.js → secrets-DVPVCSZD.js} +13 -13
- package/dist/cli/{sessions-S7N4JEWK.mjs → sessions-56EHXLZD.mjs} +4 -4
- package/dist/cli/{sessions-46PXFULL.js → sessions-VG4ATQ5Y.js} +5 -5
- package/dist/cli/{settings-V6U3SRTH.mjs → settings-4U5XG7QI.mjs} +7 -7
- package/dist/cli/{settings-KMNBITSU.js → settings-BLOTIW2G.js} +74 -74
- package/dist/cli/{setup-4K5FY6AU.js → setup-L7AMAXCH.js} +41 -41
- package/dist/cli/{setup-OGITSLTN.mjs → setup-RHJAHPOR.mjs} +6 -6
- package/dist/cli/skills-QB4OQGGP.js +28 -0
- package/dist/cli/{skills-AXWAYPBY.mjs → skills-VU55YFCI.mjs} +4 -4
- package/dist/cli/tools-2CPFYNK7.js +40 -0
- package/dist/cli/{tools-LJCY6B23.mjs → tools-JS3YIDOH.mjs} +7 -6
- package/dist/cli/{update-DDR5XIUB.mjs → update-EHI5QUXM.mjs} +6 -6
- package/dist/cli/update-WXP24GU5.js +28 -0
- package/dist/cli/{workflow-PRNCVANQ.mjs → workflow-BITLTLRF.mjs} +5 -5
- package/dist/cli/{workflow-7CTCDWL3.js → workflow-NE4SYRAT.js} +15 -15
- package/dist/{client-wiWPZhnI.d.mts → client-D5XOQKsA.d.mts} +20 -1
- package/dist/{client-DHq8dJ56.d.ts → client-l-IoLh8Z.d.ts} +20 -1
- package/dist/{compiler-manifest-9TkZ_ykI.d.mts → compiler-manifest-82q4jtfQ.d.mts} +44 -17
- package/dist/{compiler-manifest-9TkZ_ykI.d.ts → compiler-manifest-82q4jtfQ.d.ts} +44 -17
- package/dist/{index-B-5_Xhud.d.mts → index-BPbW2XHF.d.mts} +1 -1
- package/dist/{index-ykksoEyR.d.ts → index-k0rquHIm.d.ts} +1 -1
- package/dist/index.d.mts +14 -8
- package/dist/index.d.ts +14 -8
- package/dist/index.js +194 -69
- package/dist/index.mjs +162 -37
- package/dist/install-integrity.json +84 -84
- 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/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 +2 -1
- package/dist/cli/auth-67YOPQ6M.js +0 -31
- package/dist/cli/client-7LZCG4VD.js +0 -20
- package/dist/cli/git-RPFH3NJ2.js +0 -23
- package/dist/cli/play-BUQV47E2.js +0 -153
- package/dist/cli/search-CR2GZLCM.js +0 -26
- package/dist/cli/skills-4FP2MZKL.js +0 -28
- package/dist/cli/tools-7YZPH6WC.js +0 -39
- package/dist/cli/update-3VUOW6AP.js +0 -28
|
@@ -79,6 +79,7 @@ import { DeeplineError } from './errors.js';
|
|
|
79
79
|
import {
|
|
80
80
|
attachToolResultListDataset,
|
|
81
81
|
createToolExecuteResult,
|
|
82
|
+
projectToolResultListGetters,
|
|
82
83
|
} from '../../shared_libs/play-runtime/tool-result.js';
|
|
83
84
|
export { readValue, readList } from '../../shared_libs/play-runtime/tool-result.js';
|
|
84
85
|
import { createDeferredPlayDataset } from '../../shared_libs/plays/dataset.js';
|
|
@@ -94,7 +95,8 @@ import type {
|
|
|
94
95
|
PlayDatasetRow,
|
|
95
96
|
} from '../../shared_libs/plays/dataset.js';
|
|
96
97
|
import type {
|
|
97
|
-
ToolExecuteResult,
|
|
98
|
+
ToolExecuteResult as CanonicalToolExecuteResult,
|
|
99
|
+
BasicToolExecuteResult,
|
|
98
100
|
ToolResultMetadataInput,
|
|
99
101
|
} from '../../shared_libs/plays/tool-result-types.js';
|
|
100
102
|
import type { EmailStatusExtractorConfig } from '../../shared_libs/plays/email-status.js';
|
|
@@ -277,12 +279,16 @@ export type SecretAwareRequestInit = PlaySecretAwareRequestInit;
|
|
|
277
279
|
export type LoosePlayObject = PlayLooseObject;
|
|
278
280
|
|
|
279
281
|
export type {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
282
|
+
BasicToolExecuteResult,
|
|
283
|
+
BasicToolResultListAccessor,
|
|
284
|
+
BasicToolExecuteResult as ToolExecuteResult,
|
|
285
|
+
BasicToolExecuteResultAccessors as ToolExecuteResultAccessors,
|
|
286
|
+
BasicToolExecuteResultBase as ToolExecuteResultBase,
|
|
287
|
+
ToolExecuteResult as LegacyToolExecuteResult,
|
|
283
288
|
ToolResultBilling,
|
|
284
289
|
ToolResultEnvelope,
|
|
285
|
-
ToolResultListAccessor,
|
|
290
|
+
BasicToolResultListAccessor as ToolResultListAccessor,
|
|
291
|
+
ToolResultListAccessor as LegacyToolResultListAccessor,
|
|
286
292
|
ToolResultTargetAccessor as ToolExtractedValue,
|
|
287
293
|
} from '../../shared_libs/plays/tool-result-types.js';
|
|
288
294
|
export {
|
|
@@ -481,7 +487,7 @@ export type CsvOptions = PlayAuthoringCsvOptions;
|
|
|
481
487
|
* });
|
|
482
488
|
* ```
|
|
483
489
|
*/
|
|
484
|
-
export type DeeplinePlayRuntimeContext = PlayAuthoringRuntimeContext
|
|
490
|
+
export type DeeplinePlayRuntimeContext = PlayAuthoringRuntimeContext<'array'>;
|
|
485
491
|
|
|
486
492
|
/**
|
|
487
493
|
* Handle to a Play execution: inspect status, stream logs, await output, or cancel.
|
|
@@ -680,7 +686,7 @@ export type DeeplineToolsNamespace = {
|
|
|
680
686
|
): Promise<DeeplineToolExecuteResult>;
|
|
681
687
|
};
|
|
682
688
|
|
|
683
|
-
export type DeeplineToolExecuteResult =
|
|
689
|
+
export type DeeplineToolExecuteResult = BasicToolExecuteResult & {
|
|
684
690
|
/** Stable key used to recover this direct tool execution, when enabled. */
|
|
685
691
|
idempotencyKey?: string;
|
|
686
692
|
executionRecovery?: ExecutionRecovery;
|
|
@@ -1413,12 +1419,12 @@ function stableHash(value: string): string {
|
|
|
1413
1419
|
|
|
1414
1420
|
function attachSdkQueryResultDatasetResult(
|
|
1415
1421
|
toolId: string,
|
|
1416
|
-
result:
|
|
1422
|
+
result: CanonicalToolExecuteResult,
|
|
1417
1423
|
options?: {
|
|
1418
1424
|
client: DeeplineClient;
|
|
1419
1425
|
input: Record<string, unknown>;
|
|
1420
1426
|
},
|
|
1421
|
-
):
|
|
1427
|
+
): CanonicalToolExecuteResult {
|
|
1422
1428
|
if (!options || !isQueryResultDatasetTool(toolId)) return result;
|
|
1423
1429
|
const raw = isRecord(result.toolResponse.raw)
|
|
1424
1430
|
? result.toolResponse.raw
|
|
@@ -1559,42 +1565,46 @@ function toolExecutionEnvelopeToResult(
|
|
|
1559
1565
|
: null;
|
|
1560
1566
|
const toolMetadata = isRecord(metadata) ? metadata : {};
|
|
1561
1567
|
|
|
1562
|
-
const result: DeeplineToolExecuteResult =
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
toolMetadata.
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1568
|
+
const result: DeeplineToolExecuteResult = projectToolResultListGetters(
|
|
1569
|
+
attachSdkQueryResultDatasetResult(
|
|
1570
|
+
fallbackToolId,
|
|
1571
|
+
createToolExecuteResult({
|
|
1572
|
+
status:
|
|
1573
|
+
typeof response.status === 'string' ? response.status : 'completed',
|
|
1574
|
+
jobId:
|
|
1575
|
+
typeof response.job_id === 'string' ? response.job_id : undefined,
|
|
1576
|
+
result: {
|
|
1577
|
+
data: raw,
|
|
1578
|
+
...(isRecord(meta) ? { meta } : {}),
|
|
1579
|
+
},
|
|
1580
|
+
response: {
|
|
1581
|
+
...(rawV2 !== undefined ? { rawV2 } : {}),
|
|
1582
|
+
...(view === 'data' || view === 'rawV2' ? { view } : {}),
|
|
1583
|
+
...(isRecord(meta) ? { meta } : {}),
|
|
1584
|
+
},
|
|
1585
|
+
metadata: {
|
|
1586
|
+
toolId:
|
|
1587
|
+
typeof toolMetadata.toolId === 'string'
|
|
1588
|
+
? toolMetadata.toolId
|
|
1589
|
+
: fallbackToolId,
|
|
1590
|
+
extractors: extractorDescriptorRecord(toolMetadata.extractors),
|
|
1591
|
+
targetGetters: stringArrayRecord(toolMetadata.targetGetters),
|
|
1592
|
+
listExtractorPaths: stringArray(toolMetadata.listExtractorPaths),
|
|
1593
|
+
listIdentityGetters: stringArrayRecord(
|
|
1594
|
+
toolMetadata.listIdentityGetters,
|
|
1595
|
+
),
|
|
1596
|
+
},
|
|
1597
|
+
execution: {
|
|
1598
|
+
idempotent: true,
|
|
1599
|
+
cached: false,
|
|
1600
|
+
source: 'live',
|
|
1601
|
+
},
|
|
1602
|
+
meta: isRecord(response.meta) ? response.meta : undefined,
|
|
1603
|
+
billing: response.billing,
|
|
1604
|
+
}),
|
|
1605
|
+
options,
|
|
1606
|
+
),
|
|
1607
|
+
'array',
|
|
1598
1608
|
);
|
|
1599
1609
|
const executionRecovery = isRecord(response.executionRecovery)
|
|
1600
1610
|
? (response.executionRecovery as unknown as ExecutionRecovery)
|
|
@@ -200,7 +200,7 @@ export const SDK_RELEASE = {
|
|
|
200
200
|
// getters keep their established compatibility behavior.
|
|
201
201
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
202
202
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
203
|
-
version: '0.3.
|
|
203
|
+
version: '0.3.329',
|
|
204
204
|
updateSummary:
|
|
205
205
|
'Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.',
|
|
206
206
|
packageCapabilities: {
|
|
@@ -161,6 +161,22 @@ export interface ToolPricingSummary {
|
|
|
161
161
|
summary: string | null;
|
|
162
162
|
/** Additional user-facing pricing notes. */
|
|
163
163
|
details: string[];
|
|
164
|
+
/** Estimated prices for listed single-unit configurations, not a charge ceiling. */
|
|
165
|
+
estimatedRange?: {
|
|
166
|
+
minCreditsPerUnit: number;
|
|
167
|
+
maxCreditsPerUnit: number;
|
|
168
|
+
scope: string;
|
|
169
|
+
configurations: { name: string; creditsPerUnit: number }[];
|
|
170
|
+
};
|
|
171
|
+
/** Historical customer charge, not a guaranteed rate or provider tariff. */
|
|
172
|
+
observedReference?: {
|
|
173
|
+
creditsPerCall: number;
|
|
174
|
+
usdPerCall: number | null;
|
|
175
|
+
source: 'observed';
|
|
176
|
+
observedAt: string;
|
|
177
|
+
sampleSize: number;
|
|
178
|
+
inputMode: string;
|
|
179
|
+
};
|
|
164
180
|
}
|
|
165
181
|
|
|
166
182
|
/** A discoverable provider, returned by {@link DeeplineClient.listProviders}. */
|
|
@@ -307,6 +307,15 @@ export const OPERATIONS_QUEUE_CATALOG = [
|
|
|
307
307
|
120_000,
|
|
308
308
|
300_000,
|
|
309
309
|
),
|
|
310
|
+
queue(
|
|
311
|
+
'inbound-demo-form-submissions',
|
|
312
|
+
'Inbound demo form submissions',
|
|
313
|
+
'leased_workset',
|
|
314
|
+
'inbound-demo',
|
|
315
|
+
'Capture accepted demo requests as HubSpot form submissions',
|
|
316
|
+
60_000,
|
|
317
|
+
300_000,
|
|
318
|
+
),
|
|
310
319
|
queue(
|
|
311
320
|
'usage-rollup-fold',
|
|
312
321
|
'Usage rollup fold',
|
|
@@ -287,6 +287,7 @@ export const QUEUE_CONNECTOR_BACKENDS: Readonly<
|
|
|
287
287
|
'stripe-financial-inbox': 'provider',
|
|
288
288
|
'async-usage-recovery': 'postgres-outbox',
|
|
289
289
|
'notification-deliveries': 'workpool',
|
|
290
|
+
'inbound-demo-form-submissions': 'convex',
|
|
290
291
|
'usage-rollup-fold': 'postgres-outbox',
|
|
291
292
|
'play-deployment-jobs': 'workpool',
|
|
292
293
|
'github-runner-wait': 'provider',
|
|
@@ -164,7 +164,9 @@ import {
|
|
|
164
164
|
attachRelayPublishedToolResultReference,
|
|
165
165
|
attachToolResultListDataset,
|
|
166
166
|
createToolExecuteResult,
|
|
167
|
+
readList,
|
|
167
168
|
projectNativeBatchToolResponse,
|
|
169
|
+
projectToolResultListGetters,
|
|
168
170
|
parseToolExecuteResponse,
|
|
169
171
|
isToolExecuteResult,
|
|
170
172
|
isSerializedToolExecuteResult,
|
|
@@ -3248,7 +3250,9 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
3248
3250
|
'query_customer_db returned an invalid Customer DB rows result.',
|
|
3249
3251
|
);
|
|
3250
3252
|
}
|
|
3251
|
-
|
|
3253
|
+
// SQL results can be paged even when public list getters expose arrays.
|
|
3254
|
+
// The explicit reader retains the backing dataset and its memory guard.
|
|
3255
|
+
const dataset = readList(result);
|
|
3252
3256
|
if (isPlayDataset(dataset)) {
|
|
3253
3257
|
const count = await dataset.count();
|
|
3254
3258
|
const materialized = await dataset.materialize(options?.maxRows);
|
|
@@ -7515,23 +7519,32 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
7515
7519
|
!this.hasPinnedToolResponseContract ||
|
|
7516
7520
|
!Object.prototype.hasOwnProperty.call(result.toolResponse, 'rawV2')
|
|
7517
7521
|
) {
|
|
7518
|
-
return
|
|
7522
|
+
return projectToolResultListGetters(
|
|
7523
|
+
result,
|
|
7524
|
+
this.currentRuntimeContract.semantics.tools.listGetters,
|
|
7525
|
+
);
|
|
7519
7526
|
}
|
|
7520
7527
|
const serialized = serializeToolExecuteResult(result);
|
|
7521
7528
|
if (serialized.__kind !== 'deepline.tool_execute_result.v2') {
|
|
7522
|
-
return
|
|
7529
|
+
return projectToolResultListGetters(
|
|
7530
|
+
result,
|
|
7531
|
+
this.currentRuntimeContract.semantics.tools.listGetters,
|
|
7532
|
+
);
|
|
7523
7533
|
}
|
|
7524
|
-
return
|
|
7525
|
-
|
|
7526
|
-
|
|
7527
|
-
|
|
7528
|
-
|
|
7529
|
-
|
|
7530
|
-
|
|
7531
|
-
|
|
7532
|
-
|
|
7533
|
-
|
|
7534
|
-
|
|
7534
|
+
return projectToolResultListGetters(
|
|
7535
|
+
deserializeToolExecuteResult({
|
|
7536
|
+
...serialized,
|
|
7537
|
+
__kind: 'deepline.tool_execute_result.v1',
|
|
7538
|
+
toolResponse: {
|
|
7539
|
+
raw: legacyRawFromToolResponseRawV2(
|
|
7540
|
+
serialized.toolResponse.rawV2,
|
|
7541
|
+
serialized.toolResponse.view,
|
|
7542
|
+
serialized.toolResponse.responseMeta,
|
|
7543
|
+
),
|
|
7544
|
+
},
|
|
7545
|
+
}),
|
|
7546
|
+
this.currentRuntimeContract.semantics.tools.listGetters,
|
|
7547
|
+
);
|
|
7535
7548
|
}
|
|
7536
7549
|
|
|
7537
7550
|
private attachCustomerDbDatasetResult(
|
|
@@ -12804,13 +12817,16 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
12804
12817
|
|
|
12805
12818
|
const executeTool = async (): Promise<unknown> => {
|
|
12806
12819
|
if (eventWaitHandler) {
|
|
12807
|
-
|
|
12820
|
+
const result = await this.executeIntegrationEventWaitTool(
|
|
12808
12821
|
toolId,
|
|
12809
12822
|
input,
|
|
12810
12823
|
eventWaitHandler,
|
|
12811
12824
|
explicitForce,
|
|
12812
12825
|
logicalCallId,
|
|
12813
12826
|
);
|
|
12827
|
+
return isToolExecuteResult(result)
|
|
12828
|
+
? this.materializeToolExecutionResult(result)
|
|
12829
|
+
: result;
|
|
12814
12830
|
}
|
|
12815
12831
|
if (toolId === 'run_javascript') {
|
|
12816
12832
|
throw new Error(DISALLOWED_RUN_JAVASCRIPT_TOOL_MESSAGE);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizePlayAuthoringContractEdition,
|
|
3
|
+
playToolListGetterMode,
|
|
3
4
|
type PlayAuthoringContractEdition,
|
|
4
5
|
} from '../plays/authoring-contract';
|
|
5
6
|
|
|
@@ -44,6 +45,7 @@ export type PlayRuntimeSemantics = Readonly<{
|
|
|
44
45
|
}>;
|
|
45
46
|
tools: Readonly<{
|
|
46
47
|
nativeBatchResponse: 'legacy_envelope' | 'logical_response';
|
|
48
|
+
listGetters: 'dataset' | 'array';
|
|
47
49
|
}>;
|
|
48
50
|
slackHitl: Readonly<{
|
|
49
51
|
defaultTimeoutMs: number;
|
|
@@ -52,18 +54,23 @@ export type PlayRuntimeSemantics = Readonly<{
|
|
|
52
54
|
|
|
53
55
|
type PlayRuntimeSemanticsTemplate = Omit<
|
|
54
56
|
PlayRuntimeSemantics,
|
|
55
|
-
'authoringContractEdition'
|
|
56
|
-
|
|
57
|
+
'authoringContractEdition' | 'tools'
|
|
58
|
+
> & { tools: Omit<PlayRuntimeSemantics['tools'], 'listGetters'> };
|
|
57
59
|
|
|
58
60
|
function definePlayRuntimeSemantics(
|
|
59
|
-
semantics:
|
|
61
|
+
semantics: PlayRuntimeSemanticsTemplate & {
|
|
62
|
+
authoringContractEdition: PlayAuthoringContractEdition;
|
|
63
|
+
},
|
|
60
64
|
): PlayRuntimeSemantics {
|
|
61
65
|
return Object.freeze({
|
|
62
66
|
...semantics,
|
|
63
67
|
secrets: Object.freeze({ ...semantics.secrets }),
|
|
64
68
|
fetch: Object.freeze({ ...semantics.fetch }),
|
|
65
69
|
inlineChild: Object.freeze({ ...semantics.inlineChild }),
|
|
66
|
-
tools: Object.freeze({
|
|
70
|
+
tools: Object.freeze({
|
|
71
|
+
...semantics.tools,
|
|
72
|
+
listGetters: playToolListGetterMode(semantics.authoringContractEdition),
|
|
73
|
+
}),
|
|
67
74
|
slackHitl: Object.freeze({ ...semantics.slackHitl }),
|
|
68
75
|
});
|
|
69
76
|
}
|
|
@@ -180,6 +187,17 @@ const PLAY_RUNTIME_SEMANTICS_BY_AUTHORING = {
|
|
|
180
187
|
tools: { nativeBatchResponse: 'logical_response' },
|
|
181
188
|
slackHitl: WEEK_LONG_SLACK_HITL_SEMANTICS,
|
|
182
189
|
},
|
|
190
|
+
10: {
|
|
191
|
+
...PLAINTEXT_SECRET_SEMANTICS,
|
|
192
|
+
fetch: {
|
|
193
|
+
httpFailure: 'throw_typed_error',
|
|
194
|
+
persistHttpFailure: false,
|
|
195
|
+
receiptIdentityEdition: FETCH_RECEIPT_IDENTITIES.typedHttpFailure,
|
|
196
|
+
},
|
|
197
|
+
inlineChild: { runtimeOnly: true },
|
|
198
|
+
tools: { nativeBatchResponse: 'logical_response' },
|
|
199
|
+
slackHitl: WEEK_LONG_SLACK_HITL_SEMANTICS,
|
|
200
|
+
},
|
|
183
201
|
} satisfies Record<PlayAuthoringContractEdition, PlayRuntimeSemanticsTemplate>;
|
|
184
202
|
|
|
185
203
|
const PLAY_RUNTIME_SEMANTICS = Object.fromEntries(
|
|
@@ -49,6 +49,7 @@ import {
|
|
|
49
49
|
import { createPlayContext } from '../context';
|
|
50
50
|
import {
|
|
51
51
|
isHtmlErrorBody,
|
|
52
|
+
normalizeToolHttpErrorMessage,
|
|
52
53
|
summarizeHtmlErrorBody,
|
|
53
54
|
} from '../tool-http-errors';
|
|
54
55
|
import { augmentSheetContractWithDatasetFields } from '../../play-data-plane/sheet-contract';
|
|
@@ -132,6 +133,7 @@ import { installPgRuntimePoolDriver } from '../runtime-pg-driver-pg';
|
|
|
132
133
|
import { createRuntimeToolAuthScopeDigestResolver } from '../auth-scope-resolver';
|
|
133
134
|
import { createRunScopedChildPlayResolver } from './child-play-resolver';
|
|
134
135
|
import { normalizePlayContractCompatibility } from '../../plays/contracts';
|
|
136
|
+
import { ToolExecutionError } from '../../plays/tool-execution-error';
|
|
135
137
|
import {
|
|
136
138
|
SLACK_HITL_TIMEOUT_ERROR_CODE,
|
|
137
139
|
SlackHitlTimeoutError,
|
|
@@ -1004,22 +1006,38 @@ function runtimeControlStatusLabel(status: number): string {
|
|
|
1004
1006
|
* A failed runtime-control call as an Error that says WHICH call, HOW it
|
|
1005
1007
|
* failed (`status`) and for WHICH tool — never the raw response body.
|
|
1006
1008
|
*/
|
|
1007
|
-
async function runtimeControlHttpError(input: {
|
|
1009
|
+
export async function runtimeControlHttpError(input: {
|
|
1008
1010
|
description: string;
|
|
1009
1011
|
toolId: string;
|
|
1010
1012
|
response: Response;
|
|
1011
1013
|
}): Promise<Error> {
|
|
1012
1014
|
const bodyText = await input.response.text().catch(() => '');
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1015
|
+
const message = formatRuntimeControlFailure({
|
|
1016
|
+
description: input.description,
|
|
1017
|
+
status: input.response.status,
|
|
1018
|
+
bodyText,
|
|
1019
|
+
});
|
|
1020
|
+
const toolError = normalizeToolHttpErrorMessage({
|
|
1021
|
+
toolId: input.toolId,
|
|
1022
|
+
status: input.response.status,
|
|
1023
|
+
attempt: 1,
|
|
1024
|
+
maxAttempts: 1,
|
|
1025
|
+
bodyText,
|
|
1026
|
+
});
|
|
1027
|
+
// Only the serving route can attribute a control failure to a provider
|
|
1028
|
+
// connection. Older and unclassified responses retain their fatal error.
|
|
1029
|
+
if (
|
|
1030
|
+
toolError instanceof ToolExecutionError &&
|
|
1031
|
+
toolError.origin !== 'unknown' &&
|
|
1032
|
+
toolError.category !== 'unknown'
|
|
1033
|
+
) {
|
|
1034
|
+
toolError.message = message;
|
|
1035
|
+
return toolError;
|
|
1036
|
+
}
|
|
1037
|
+
return Object.assign(new Error(message), {
|
|
1038
|
+
status: input.response.status,
|
|
1039
|
+
toolId: input.toolId,
|
|
1040
|
+
});
|
|
1023
1041
|
}
|
|
1024
1042
|
|
|
1025
1043
|
function runtimeControlSlackHitlTimeoutError(input: {
|