deepline 0.3.45 → 0.3.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundling-sources/sdk/src/client.ts +2 -3
- package/dist/bundling-sources/sdk/src/errors.ts +2 -2
- package/dist/bundling-sources/sdk/src/http.ts +1 -1
- package/dist/bundling-sources/sdk/src/play.ts +7 -10
- package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +3 -3
- package/dist/bundling-sources/sdk/src/release.ts +3 -3
- package/dist/bundling-sources/sdk/src/version.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-data-plane/contracts.ts +25 -0
- package/dist/bundling-sources/shared_libs/play-data-plane/index.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-data-plane/sheet-contract.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +19 -19
- package/dist/bundling-sources/shared_libs/play-runtime/backend.ts +5 -6
- package/dist/bundling-sources/shared_libs/play-runtime/cell-staleness.ts +1 -66
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +11 -11
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +3 -3
- package/dist/bundling-sources/shared_libs/play-runtime/dataset-id.ts +4 -3
- package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +3 -4
- package/dist/bundling-sources/shared_libs/play-runtime/durable-receipt-execution.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-runtime/email-status.ts +1 -275
- package/dist/bundling-sources/shared_libs/play-runtime/execution-ledger-store.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/extractor-targets.ts +1 -106
- package/dist/bundling-sources/shared_libs/play-runtime/gateway-postgres-admission.ts +1 -2
- package/dist/bundling-sources/shared_libs/play-runtime/governor/in-memory-rate-state-backend.ts +13 -4
- package/dist/bundling-sources/shared_libs/play-runtime/live-events.ts +1 -5
- package/dist/bundling-sources/shared_libs/play-runtime/map-row-identity.ts +2 -3
- package/dist/bundling-sources/shared_libs/play-runtime/map-row-outcome.ts +2 -1
- package/dist/bundling-sources/shared_libs/play-runtime/modal-runtime-config.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/output-size-limits.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/projection.ts +5 -5
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +3 -3
- package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/run-snapshot-stream.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +4 -4
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-modal-fallback.ts +3 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +8 -8
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-session-execution.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +4 -4
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/local-process.ts +7 -7
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +7 -7
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/bundle.ts +13 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/index.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runner-events.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/types.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-actions.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +6 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-constants.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-constraints.ts +1 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-env.ts +55 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runtime-limits.ts +1 -109
- package/dist/bundling-sources/shared_libs/play-runtime/step-program-dataset-builder.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execution-outcome.ts +6 -5
- package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result-types.ts +1 -206
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +10 -7
- package/dist/bundling-sources/shared_libs/play-runtime/work-receipts.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +8 -3
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +4 -4
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +3 -6
- package/dist/bundling-sources/shared_libs/plays/cell-staleness.ts +66 -0
- package/dist/bundling-sources/shared_libs/plays/compiler-manifest.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/contracts.ts +2 -2
- package/dist/bundling-sources/shared_libs/plays/core.ts +466 -0
- package/dist/bundling-sources/shared_libs/plays/email-status.ts +287 -0
- package/dist/bundling-sources/shared_libs/plays/extractor-targets.ts +106 -0
- package/dist/bundling-sources/shared_libs/plays/row-identity.ts +1 -3
- package/dist/bundling-sources/shared_libs/plays/runtime-constraints.ts +2 -0
- package/dist/bundling-sources/shared_libs/plays/runtime-validation.ts +4 -2
- package/dist/bundling-sources/shared_libs/plays/sandbox-runtime-limits.ts +109 -0
- package/dist/bundling-sources/shared_libs/plays/tool-execution-error.ts +624 -0
- package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +206 -0
- package/dist/bundling-sources/shared_libs/security/safe-outbound-fetch.ts +1 -1
- package/dist/cli/index.js +181 -169
- package/dist/cli/index.mjs +189 -170
- package/dist/{compiler-manifest-DwYe2C2S.d.mts → compiler-manifest-BuoqasqI.d.mts} +585 -540
- package/dist/{compiler-manifest-DwYe2C2S.d.ts → compiler-manifest-BuoqasqI.d.ts} +585 -540
- package/dist/index.d.mts +9 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.js +47 -40
- package/dist/index.mjs +47 -40
- package/dist/install-integrity.json +13 -3
- package/dist/plays/bundle-play-file.d.mts +4 -61
- package/dist/plays/bundle-play-file.d.ts +4 -61
- package/dist/plays/bundle-play-file.mjs +157 -155
- package/package.json +9 -6
- /package/dist/bundling-sources/shared_libs/{play-runtime → plays}/tool-response-contract.ts +0 -0
|
@@ -101,14 +101,13 @@ import {
|
|
|
101
101
|
import {
|
|
102
102
|
TOOL_EXECUTION_ERROR_SCHEMA_HEADER,
|
|
103
103
|
TOOL_EXECUTION_ERROR_SCHEMA_VERSION,
|
|
104
|
-
} from '../../shared_libs/tool-execution-error
|
|
105
|
-
|
|
104
|
+
} from '../../shared_libs/plays/tool-execution-error';
|
|
106
105
|
import { decodePlayRunPublicStatus } from '../../shared_libs/play-runtime/run-lifecycle-policy.js';
|
|
107
106
|
import {
|
|
108
107
|
legacyRawFromToolResponseRawV2,
|
|
109
108
|
providerMetaFromToolResponseRawV2,
|
|
110
109
|
RAW_V2_TOOL_RESPONSE_CONTRACT,
|
|
111
|
-
} from '../../shared_libs/
|
|
110
|
+
} from '../../shared_libs/plays/tool-response-contract.js';
|
|
112
111
|
|
|
113
112
|
export type SlackNotificationTarget =
|
|
114
113
|
| { channel: string; memberId?: never }
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
type ToolExecutionErrorOptions,
|
|
16
16
|
type ToolExecutionNetworkKind,
|
|
17
17
|
type ToolExecutionNetworkScope,
|
|
18
|
-
} from '../../shared_libs/tool-execution-error
|
|
18
|
+
} from '../../shared_libs/plays/tool-execution-error';
|
|
19
19
|
|
|
20
20
|
export {
|
|
21
21
|
DeeplineError,
|
|
@@ -33,7 +33,7 @@ export {
|
|
|
33
33
|
type ToolExecutionErrorOptions,
|
|
34
34
|
type ToolExecutionNetworkKind,
|
|
35
35
|
type ToolExecutionNetworkScope,
|
|
36
|
-
} from '../../shared_libs/tool-execution-error
|
|
36
|
+
} from '../../shared_libs/plays/tool-execution-error';
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* Thrown when the API rejects the request due to an invalid or missing API key.
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
deserializeToolExecutionFailure,
|
|
31
31
|
serializeToolExecutionFailure,
|
|
32
32
|
TOOL_EXECUTION_ERROR_SCHEMA_VERSION,
|
|
33
|
-
} from '../../shared_libs/tool-execution-error
|
|
33
|
+
} from '../../shared_libs/plays/tool-execution-error';
|
|
34
34
|
import { SDK_API_CONTRACT, SDK_VERSION } from './version.js';
|
|
35
35
|
import type { LiveEventEnvelope } from './types.js';
|
|
36
36
|
import { detectAgentRuntime, isCoworkLikeSandbox } from './agent-runtime.js';
|
|
@@ -78,10 +78,7 @@ import {
|
|
|
78
78
|
attachToolResultListDataset,
|
|
79
79
|
createToolExecuteResult,
|
|
80
80
|
} from '../../shared_libs/play-runtime/tool-result.js';
|
|
81
|
-
export {
|
|
82
|
-
readValue,
|
|
83
|
-
readList,
|
|
84
|
-
} from '../../shared_libs/play-runtime/tool-result.js';
|
|
81
|
+
export { readValue, readList } from '../../shared_libs/play-runtime/tool-result.js';
|
|
85
82
|
import { createDeferredPlayDataset } from '../../shared_libs/plays/dataset.js';
|
|
86
83
|
import {
|
|
87
84
|
QUERY_RESULT_DATASET_PAGE_SIZE,
|
|
@@ -96,8 +93,8 @@ import type {
|
|
|
96
93
|
import type {
|
|
97
94
|
ToolExecuteResult,
|
|
98
95
|
ToolResultMetadataInput,
|
|
99
|
-
} from '../../shared_libs/
|
|
100
|
-
import type { EmailStatusExtractorConfig } from '../../shared_libs/
|
|
96
|
+
} from '../../shared_libs/plays/tool-result-types.js';
|
|
97
|
+
import type { EmailStatusExtractorConfig } from '../../shared_libs/plays/email-status.js';
|
|
101
98
|
import type {
|
|
102
99
|
DeeplineClientOptions,
|
|
103
100
|
PlayDetail,
|
|
@@ -269,14 +266,14 @@ export type {
|
|
|
269
266
|
ToolResultEnvelope,
|
|
270
267
|
ToolResultListAccessor,
|
|
271
268
|
ToolResultTargetAccessor as ToolExtractedValue,
|
|
272
|
-
} from '../../shared_libs/
|
|
269
|
+
} from '../../shared_libs/plays/tool-result-types.js';
|
|
273
270
|
export {
|
|
274
271
|
DEEPLINE_EXTRACTOR_TARGETS,
|
|
275
272
|
DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS,
|
|
276
273
|
JOB_CHANGE_STATUS_VALUES,
|
|
277
274
|
PHONE_STATUS_VALUES,
|
|
278
275
|
isDeeplineExtractorTarget,
|
|
279
|
-
} from '../../shared_libs/
|
|
276
|
+
} from '../../shared_libs/plays/extractor-targets.js';
|
|
280
277
|
export type {
|
|
281
278
|
DeeplineEmailStatusGetterValue,
|
|
282
279
|
DeeplineExtractorTarget,
|
|
@@ -284,8 +281,8 @@ export type {
|
|
|
284
281
|
DeeplineGetterValueMap,
|
|
285
282
|
JobChangeStatus,
|
|
286
283
|
PhoneStatus,
|
|
287
|
-
} from '../../shared_libs/
|
|
288
|
-
export type { PreviousCell } from '../../shared_libs/
|
|
284
|
+
} from '../../shared_libs/plays/extractor-targets.js';
|
|
285
|
+
export type { PreviousCell } from '../../shared_libs/plays/cell-staleness.js';
|
|
289
286
|
|
|
290
287
|
/**
|
|
291
288
|
* Keyword-style request object for `ctx.tools.execute(...)`.
|
|
@@ -43,9 +43,9 @@ export { extractDefinedPlayName } from '../../../shared_libs/plays/bundling/inde
|
|
|
43
43
|
const PLAY_BUNDLE_CACHE_VERSION = 35;
|
|
44
44
|
const MODULE_DIR = dirname(fileURLToPath(import.meta.url));
|
|
45
45
|
const SDK_PACKAGE_ROOT = resolve(MODULE_DIR, '..', '..');
|
|
46
|
-
const SOURCE_REPO_ROOT = resolve(SDK_PACKAGE_ROOT, '..');
|
|
46
|
+
const SOURCE_REPO_ROOT = resolve(SDK_PACKAGE_ROOT, '..', '..');
|
|
47
47
|
const HAS_SOURCE_BUNDLING_SOURCES = existsSync(
|
|
48
|
-
resolve(SOURCE_REPO_ROOT, '
|
|
48
|
+
resolve(SOURCE_REPO_ROOT, 'packages', 'plays', 'bundling', 'index.ts'),
|
|
49
49
|
);
|
|
50
50
|
const PACKAGED_BUNDLING_SOURCE_ROOT = resolve(
|
|
51
51
|
SDK_PACKAGE_ROOT,
|
|
@@ -67,7 +67,7 @@ const PROJECT_ROOT = HAS_SOURCE_BUNDLING_SOURCES
|
|
|
67
67
|
? PACKAGED_BUNDLING_SOURCE_ROOT
|
|
68
68
|
: resolve(SDK_PACKAGE_ROOT, '..');
|
|
69
69
|
const SDK_SOURCE_ROOT = HAS_SOURCE_BUNDLING_SOURCES
|
|
70
|
-
? resolve(
|
|
70
|
+
? resolve(SDK_PACKAGE_ROOT, 'src')
|
|
71
71
|
: HAS_PACKAGED_BUNDLING_SOURCES
|
|
72
72
|
? resolve(PACKAGED_BUNDLING_SOURCE_ROOT, 'sdk', 'src')
|
|
73
73
|
: resolve(SDK_PACKAGE_ROOT, 'src');
|
|
@@ -22,9 +22,9 @@ import { CURRENT_PLAY_ARTIFACT_CONTRACT_VERSION } from '../../shared_libs/plays/
|
|
|
22
22
|
*
|
|
23
23
|
* Everything else derives from these values:
|
|
24
24
|
*
|
|
25
|
-
* - `sdk/src/version.ts` re-exports `SDK_VERSION` and `SDK_API_CONTRACT`.
|
|
25
|
+
* - `packages/sdk/src/version.ts` re-exports `SDK_VERSION` and `SDK_API_CONTRACT`.
|
|
26
26
|
* - `src/lib/sdk/release-policy.ts` re-exports `SDK_RELEASE_POLICY`.
|
|
27
|
-
* - `sdk/package.json` `version` is stamped from `SDK_RELEASE.version` by
|
|
27
|
+
* - `packages/sdk/package.json` `version` is stamped from `SDK_RELEASE.version` by
|
|
28
28
|
* `scripts/sync-sdk-package-version.ts`, which runs as part of
|
|
29
29
|
* `bun run sdk:build`.
|
|
30
30
|
* - `contracts/sdk-api.manifest.json` is regenerated at build time from
|
|
@@ -199,7 +199,7 @@ export const SDK_RELEASE = {
|
|
|
199
199
|
// available at toolResponse.rawV2 while toolResponse.raw and all declared
|
|
200
200
|
// getters keep their established compatibility behavior.
|
|
201
201
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
202
|
-
version: '0.3.
|
|
202
|
+
version: '0.3.47',
|
|
203
203
|
updateSummary:
|
|
204
204
|
'Automatic CLI updates are now enabled by default. To opt out, run `deepline settings autoupdate off`; use `deepline settings autoupdate on` to re-enable updates or `deepline settings autoupdate pin <version>` to hold an exact release. This release also adds raw-v2 tool responses at toolResponse.rawV2 while preserving existing toolResponse.raw and declared getters.',
|
|
205
205
|
packageCapabilities: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// Derived from sdk/src/release.ts. Do not edit by hand.
|
|
2
|
-
// Bump the version in sdk/src/release.ts; this file follows.
|
|
1
|
+
// Derived from packages/sdk/src/release.ts. Do not edit by hand.
|
|
2
|
+
// Bump the version in packages/sdk/src/release.ts; this file follows.
|
|
3
3
|
import { SDK_RELEASE } from './release.js';
|
|
4
4
|
|
|
5
5
|
export const SDK_VERSION: string = SDK_RELEASE.version;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type PlaySheetColumnSource =
|
|
2
|
+
| 'input'
|
|
3
|
+
| 'datasetColumn'
|
|
4
|
+
| 'waterfallStep'
|
|
5
|
+
| 'childPlayColumn';
|
|
6
|
+
|
|
7
|
+
export interface PlaySheetColumnContract {
|
|
8
|
+
id: string;
|
|
9
|
+
sqlName: string;
|
|
10
|
+
source: PlaySheetColumnSource;
|
|
11
|
+
field?: string;
|
|
12
|
+
parentField?: string;
|
|
13
|
+
playId?: string;
|
|
14
|
+
waterfallId?: string;
|
|
15
|
+
outputField?: string;
|
|
16
|
+
outputSqlName?: string;
|
|
17
|
+
stepId?: string;
|
|
18
|
+
toolId?: string;
|
|
19
|
+
isRowKey?: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface PlaySheetContract {
|
|
23
|
+
tableNamespace: string;
|
|
24
|
+
columns: PlaySheetColumnContract[];
|
|
25
|
+
}
|
|
@@ -3,14 +3,14 @@ import { randomUUID } from 'node:crypto';
|
|
|
3
3
|
import { stat } from 'node:fs/promises';
|
|
4
4
|
import { Readable } from 'node:stream';
|
|
5
5
|
import { pipeline } from 'node:stream/promises';
|
|
6
|
-
import type { PlaySheetContract } from '
|
|
7
|
-
import type { PlayRowUpdate } from '
|
|
8
|
-
import type { PlayRunTimelineEntry } from '
|
|
9
|
-
import type { PlayDatasetBornFrom } from '
|
|
6
|
+
import type { PlaySheetContract } from '../plays/static-pipeline';
|
|
7
|
+
import type { PlayRowUpdate } from './/ctx-types';
|
|
8
|
+
import type { PlayRunTimelineEntry } from './/live-events';
|
|
9
|
+
import type { PlayDatasetBornFrom } from './/cell-provenance';
|
|
10
10
|
import {
|
|
11
11
|
routePlayActivityObservation,
|
|
12
12
|
type PlayActivityObservation,
|
|
13
|
-
} from '
|
|
13
|
+
} from './/activity-observation';
|
|
14
14
|
import {
|
|
15
15
|
buildPlayRunLedgerEventsFromStatusPatch,
|
|
16
16
|
buildTerminalLogReplayEvents,
|
|
@@ -19,18 +19,18 @@ import {
|
|
|
19
19
|
slicePositionalLogLines,
|
|
20
20
|
type PlayRunLedgerEvent,
|
|
21
21
|
type PlayRunLedgerSnapshot,
|
|
22
|
-
} from '
|
|
22
|
+
} from './/run-ledger';
|
|
23
23
|
import type {
|
|
24
24
|
ComputeBillingItem,
|
|
25
25
|
PlayStagedFileRef,
|
|
26
26
|
PlayVisualNodeProgressMap,
|
|
27
|
-
} from '
|
|
28
|
-
import type { RuntimeStepReceipt } from '
|
|
27
|
+
} from './/worker-api-types';
|
|
28
|
+
import type { RuntimeStepReceipt } from './/ctx-types';
|
|
29
29
|
import type {
|
|
30
30
|
CreateDbSessionRequest,
|
|
31
31
|
CreateDbSessionResponse,
|
|
32
|
-
} from '
|
|
33
|
-
import type { PlayBundleArtifact } from '
|
|
32
|
+
} from './/db-session';
|
|
33
|
+
import type { PlayBundleArtifact } from '../plays/artifact-types';
|
|
34
34
|
import type {
|
|
35
35
|
PlayRunnerRateStateAcquireInput,
|
|
36
36
|
PlayRunnerRateStateAcquireResult,
|
|
@@ -38,29 +38,29 @@ import type {
|
|
|
38
38
|
PlayRunnerBudgetChargeResult,
|
|
39
39
|
PlayRunnerRateStatePenalizeInput,
|
|
40
40
|
PlayRunnerRateStateReleaseInput,
|
|
41
|
-
} from '
|
|
41
|
+
} from './/protocol';
|
|
42
42
|
import {
|
|
43
43
|
PLAY_RUNTIME_TRANSPORT_ATTEMPT_HEADER,
|
|
44
44
|
PLAY_RUNTIME_CONTRACT,
|
|
45
45
|
PLAY_RUNTIME_CONTRACT_HEADER,
|
|
46
|
-
} from '
|
|
47
|
-
import { PLAY_RUNTIME_API_COMPAT_PATH } from '
|
|
46
|
+
} from './/runtime-contract';
|
|
47
|
+
import { PLAY_RUNTIME_API_COMPAT_PATH } from './/runtime-api-paths';
|
|
48
48
|
import {
|
|
49
49
|
PLAY_RUNTIME_TEST_FAULT_HEADER,
|
|
50
50
|
recognizedRuntimeTestFaultCount,
|
|
51
|
-
} from '
|
|
51
|
+
} from './/test-runtime-seams';
|
|
52
52
|
import {
|
|
53
53
|
isVercelSecurityCheckpointResponse,
|
|
54
54
|
vercelProtectionBypassHeaders,
|
|
55
|
-
} from '
|
|
56
|
-
import type { RuntimeReceiptAction } from '
|
|
57
|
-
import { RUNTIME_CAPACITY_POLICY } from '
|
|
58
|
-
import { RUNTIME_RELIABILITY_POLICY } from '
|
|
55
|
+
} from './/vercel-protection';
|
|
56
|
+
import type { RuntimeReceiptAction } from './/runtime-actions';
|
|
57
|
+
import { RUNTIME_CAPACITY_POLICY } from './/runtime-capacity-policy';
|
|
58
|
+
import { RUNTIME_RELIABILITY_POLICY } from './/runtime-reliability-policy';
|
|
59
59
|
import {
|
|
60
60
|
DEFAULT_RUNTIME_TRAFFIC_POLICY,
|
|
61
61
|
isRuntimeTrafficPolicy,
|
|
62
62
|
type RuntimeTrafficPolicy,
|
|
63
|
-
} from '
|
|
63
|
+
} from './/runtime-traffic-policy';
|
|
64
64
|
|
|
65
65
|
export type StoredPlayArtifactPayload = {
|
|
66
66
|
sourceCode: string;
|
|
@@ -11,12 +11,7 @@ export type PlayRuntimeBackendId =
|
|
|
11
11
|
* The one executable Play artifact contract. Daytona and local-process both
|
|
12
12
|
* load CommonJS under Node 20.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
15
|
-
cjsNode20: 'cjs_node20',
|
|
16
|
-
} as const;
|
|
17
|
-
|
|
18
|
-
export type PlayArtifactKind =
|
|
19
|
-
(typeof PLAY_ARTIFACT_KINDS)[keyof typeof PLAY_ARTIFACT_KINDS];
|
|
14
|
+
export { PLAY_ARTIFACT_KINDS, type PlayArtifactKind };
|
|
20
15
|
|
|
21
16
|
export type PlayBackendDescriptor = {
|
|
22
17
|
id: PlayRuntimeBackendId;
|
|
@@ -137,3 +132,7 @@ export function isManagedSandboxRuntimeBackend(
|
|
|
137
132
|
value === PLAY_RUNTIME_BACKENDS.modal
|
|
138
133
|
);
|
|
139
134
|
}
|
|
135
|
+
import {
|
|
136
|
+
PLAY_ARTIFACT_KINDS,
|
|
137
|
+
type PlayArtifactKind,
|
|
138
|
+
} from '../plays/artifact-types';
|
|
@@ -1,66 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export type CellStalenessMeta = {
|
|
3
|
-
status?: string | null;
|
|
4
|
-
completedAt?: number | null;
|
|
5
|
-
staleAt?: number | null;
|
|
6
|
-
staleAfterSeconds?: number | null;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Previous durable cell value passed to object-column resolvers.
|
|
11
|
-
*
|
|
12
|
-
* The runtime supplies this when a row+column is being recomputed after a
|
|
13
|
-
* previous value existed. `value` has the same type that the column returns;
|
|
14
|
-
* freshness metadata lives beside it.
|
|
15
|
-
*
|
|
16
|
-
* @sdkReference runtime 120
|
|
17
|
-
*/
|
|
18
|
-
export type PreviousCell<Value = unknown> = {
|
|
19
|
-
/** Previous completed value for this row+column. */
|
|
20
|
-
value: Value;
|
|
21
|
-
/** Millisecond timestamp when the previous value completed. */
|
|
22
|
-
completedAt?: number;
|
|
23
|
-
/** Millisecond timestamp when the previous value becomes stale; `null` means no expiry. */
|
|
24
|
-
staleAt?: number | null;
|
|
25
|
-
/** Resolved numeric TTL in seconds for the previous value, when present. */
|
|
26
|
-
staleAfterSeconds?: number;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const DEEPLINE_CELL_META_FIELD = '__deeplineCellMeta';
|
|
30
|
-
|
|
31
|
-
export function previousCellFromValue<Value>(input: {
|
|
32
|
-
hasValue: boolean;
|
|
33
|
-
value: Value;
|
|
34
|
-
meta?: CellStalenessMeta | null;
|
|
35
|
-
}): PreviousCell<Value> | undefined {
|
|
36
|
-
if (!input.hasValue) {
|
|
37
|
-
return undefined;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const previous: PreviousCell<Value> = {
|
|
41
|
-
value: input.value,
|
|
42
|
-
};
|
|
43
|
-
if (
|
|
44
|
-
typeof input.meta?.completedAt === 'number' &&
|
|
45
|
-
Number.isFinite(input.meta.completedAt)
|
|
46
|
-
) {
|
|
47
|
-
previous.completedAt = input.meta.completedAt;
|
|
48
|
-
}
|
|
49
|
-
if (
|
|
50
|
-
input.meta &&
|
|
51
|
-
Object.prototype.hasOwnProperty.call(input.meta, 'staleAt')
|
|
52
|
-
) {
|
|
53
|
-
previous.staleAt =
|
|
54
|
-
typeof input.meta.staleAt === 'number' &&
|
|
55
|
-
Number.isFinite(input.meta.staleAt)
|
|
56
|
-
? input.meta.staleAt
|
|
57
|
-
: null;
|
|
58
|
-
}
|
|
59
|
-
if (
|
|
60
|
-
typeof input.meta?.staleAfterSeconds === 'number' &&
|
|
61
|
-
Number.isFinite(input.meta.staleAfterSeconds)
|
|
62
|
-
) {
|
|
63
|
-
previous.staleAfterSeconds = input.meta.staleAfterSeconds;
|
|
64
|
-
}
|
|
65
|
-
return previous;
|
|
66
|
-
}
|
|
1
|
+
export * from '../plays/cell-staleness';
|
|
@@ -24,8 +24,8 @@ import {
|
|
|
24
24
|
materializePlayDatasetInput,
|
|
25
25
|
resolveMaterializeLimitCap,
|
|
26
26
|
serializePlayDatasetCell,
|
|
27
|
-
} from '
|
|
28
|
-
import type { PlayDataset, PlayDatasetInput } from '
|
|
27
|
+
} from '../plays/dataset';
|
|
28
|
+
import type { PlayDataset, PlayDatasetInput } from '../plays/dataset';
|
|
29
29
|
import {
|
|
30
30
|
compileRequestsWithStrategy,
|
|
31
31
|
executeChunkedRequests,
|
|
@@ -103,12 +103,12 @@ import {
|
|
|
103
103
|
RAW_V2_TOOL_RESPONSE_CONTRACT,
|
|
104
104
|
type ToolResponseContract,
|
|
105
105
|
type ToolResponseView,
|
|
106
|
-
} from '
|
|
106
|
+
} from '../plays/tool-response-contract';
|
|
107
107
|
import { ProviderExhaustedError } from './run-failure';
|
|
108
108
|
import {
|
|
109
109
|
buildPlayContractCompatibility,
|
|
110
110
|
normalizePlayContractCompatibility,
|
|
111
|
-
} from '
|
|
111
|
+
} from '../plays/contracts';
|
|
112
112
|
import {
|
|
113
113
|
isProviderUnavailable,
|
|
114
114
|
serializeToolExecutionFailure,
|
|
@@ -116,7 +116,7 @@ import {
|
|
|
116
116
|
TOOL_EXECUTION_ERROR_SCHEMA_HEADER,
|
|
117
117
|
type ToolExecutionErrorSchemaVersion,
|
|
118
118
|
type ToolExecutionFailureV1,
|
|
119
|
-
} from '../tool-execution-error';
|
|
119
|
+
} from '../plays/tool-execution-error';
|
|
120
120
|
import { InMemoryRateStateBackend } from './governor/in-memory-rate-state-backend';
|
|
121
121
|
import { pacingPolicyForTool } from './pacing';
|
|
122
122
|
import {
|
|
@@ -232,13 +232,13 @@ import {
|
|
|
232
232
|
normalizeTableNamespace,
|
|
233
233
|
sha256Hex,
|
|
234
234
|
stableStringify,
|
|
235
|
-
} from '
|
|
236
|
-
import { sqlSafePlayColumnName } from '
|
|
235
|
+
} from '../plays/row-identity';
|
|
236
|
+
import { sqlSafePlayColumnName } from '../plays/static-pipeline';
|
|
237
237
|
import {
|
|
238
238
|
DEEPLINE_CELL_META_FIELD,
|
|
239
239
|
previousCellFromValue,
|
|
240
240
|
type PreviousCell,
|
|
241
|
-
} from '
|
|
241
|
+
} from '../plays/cell-staleness';
|
|
242
242
|
import {
|
|
243
243
|
cloneCsvAliasedRow,
|
|
244
244
|
stripCsvProjectedFields,
|
|
@@ -257,7 +257,7 @@ import {
|
|
|
257
257
|
RuntimeMapMemoryLimitError,
|
|
258
258
|
} from './map-memory-limits';
|
|
259
259
|
import { setSpanAttributes, withActiveSpan } from './tracing';
|
|
260
|
-
import { DISALLOWED_RUN_JAVASCRIPT_TOOL_MESSAGE } from '
|
|
260
|
+
import { DISALLOWED_RUN_JAVASCRIPT_TOOL_MESSAGE } from '../plays/runtime-constraints';
|
|
261
261
|
import {
|
|
262
262
|
PlayExecutionSuspendedError,
|
|
263
263
|
PlayRowExecutionSuspendedError,
|
|
@@ -927,7 +927,7 @@ export function chunkArrayForReceiptRequest<T>(items: readonly T[]): T[][] {
|
|
|
927
927
|
return chunks;
|
|
928
928
|
}
|
|
929
929
|
|
|
930
|
-
type SafeFetchModule = typeof import('
|
|
930
|
+
type SafeFetchModule = typeof import('../security/safe-fetch');
|
|
931
931
|
let safeFetchModule: Promise<SafeFetchModule> | null = null;
|
|
932
932
|
|
|
933
933
|
export async function waitForNodeRuntimeMapRowsVisible(input: {
|
|
@@ -1132,7 +1132,7 @@ function isUnmarkedExecutionGateway502(input: {
|
|
|
1132
1132
|
}
|
|
1133
1133
|
|
|
1134
1134
|
function loadSafeFetch(): Promise<SafeFetchModule> {
|
|
1135
|
-
safeFetchModule ??= import('
|
|
1135
|
+
safeFetchModule ??= import('../security/safe-fetch');
|
|
1136
1136
|
return safeFetchModule;
|
|
1137
1137
|
}
|
|
1138
1138
|
|
|
@@ -39,7 +39,7 @@ import type { DocflowObservationUpsert } from './docflow-observation';
|
|
|
39
39
|
import type { RuntimeMapMemoryLimits } from './map-memory-limits';
|
|
40
40
|
import type { AnyBatchOperationStrategy } from './batching-types';
|
|
41
41
|
import type { ToolResultMetadataInput } from './tool-result';
|
|
42
|
-
import type { PreviousCell } from '
|
|
42
|
+
import type { PreviousCell } from '../plays/cell-staleness';
|
|
43
43
|
import type { MapRowOutcome } from './durability-store';
|
|
44
44
|
import type { WorkReceiptFailureKind } from './work-receipts';
|
|
45
45
|
import type { RunExecutionScope } from './run-execution-scope';
|
|
@@ -49,9 +49,9 @@ import type { PlayActivityEvent } from './activity-observation';
|
|
|
49
49
|
import type {
|
|
50
50
|
ToolExecutionErrorSchemaVersion,
|
|
51
51
|
ToolExecutionFailureV1,
|
|
52
|
-
} from '../tool-execution-error';
|
|
52
|
+
} from '../plays/tool-execution-error';
|
|
53
53
|
import type { FixtureBehavior } from './fixture-behavior';
|
|
54
|
-
import type { ToolResponseContract } from '
|
|
54
|
+
import type { ToolResponseContract } from '../plays/tool-response-contract';
|
|
55
55
|
|
|
56
56
|
export interface RowState {
|
|
57
57
|
results: Map<string, unknown>;
|
|
@@ -10,7 +10,8 @@ export function createRuntimeDatasetId(
|
|
|
10
10
|
): string {
|
|
11
11
|
const normalizedPlayName = normalizePlayNameForSheet(playName);
|
|
12
12
|
const normalizedTableNamespace = normalizeTableNamespace(tableNamespace);
|
|
13
|
-
return sha256Hex(
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
return sha256Hex(`${normalizedPlayName}:${normalizedTableNamespace}`).slice(
|
|
14
|
+
0,
|
|
15
|
+
40,
|
|
16
|
+
);
|
|
16
17
|
}
|
|
@@ -2,12 +2,11 @@ import {
|
|
|
2
2
|
normalizeTableNamespace,
|
|
3
3
|
sha256Hex,
|
|
4
4
|
stableStringify,
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
// resolve.
|
|
5
|
+
// The SDK pack adapter rewrites this workspace import to the preserved
|
|
6
|
+
// relative dist/bundling-sources layout.
|
|
8
7
|
} from '../plays/row-identity';
|
|
9
8
|
import { resolveDurableCallCachePolicy } from './durable-call-policy';
|
|
10
|
-
import { normalizeToolResponseReceiptRevision } from '
|
|
9
|
+
import { normalizeToolResponseReceiptRevision } from '../plays/tool-response-contract';
|
|
11
10
|
|
|
12
11
|
export {
|
|
13
12
|
DURABLE_CALL_STALE_AFTER_SECONDS_ERROR,
|
|
@@ -22,11 +22,11 @@ import {
|
|
|
22
22
|
deserializeToolExecutionFailure,
|
|
23
23
|
serializeToolExecutionFailure,
|
|
24
24
|
TOOL_EXECUTION_ERROR_SCHEMA_VERSION,
|
|
25
|
-
} from '../tool-execution-error';
|
|
25
|
+
} from '../plays/tool-execution-error';
|
|
26
26
|
import type {
|
|
27
27
|
ToolExecutionErrorSchemaVersion,
|
|
28
28
|
ToolExecutionFailureV1,
|
|
29
|
-
} from '../tool-execution-error';
|
|
29
|
+
} from '../plays/tool-execution-error';
|
|
30
30
|
|
|
31
31
|
export const DURABLE_RECEIPT_WAIT_MAX_ATTEMPTS = 240;
|
|
32
32
|
export const DURABLE_RECEIPT_WAIT_DELAY_MS = 250;
|