deepline 0.3.88 → 0.3.89
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 +534 -4
- package/dist/bundling-sources/sdk/src/config.ts +77 -0
- package/dist/bundling-sources/sdk/src/http.ts +76 -30
- package/dist/bundling-sources/sdk/src/index.ts +6 -0
- package/dist/bundling-sources/sdk/src/monitor-fleet-contract.ts +1 -1
- package/dist/bundling-sources/sdk/src/play.ts +15 -1
- package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +2 -2
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +83 -4
- package/dist/bundling-sources/shared_libs/integration-contracts/AGENTS.md +9 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/README.md +3 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/index.ts +2 -0
- package/dist/bundling-sources/shared_libs/monitors/analytics-install-guides.ts +77 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/charges.ts +125 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/policy-builders.ts +686 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/pricing.ts +54 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/public-pricing.ts +72 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/session.ts +45 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/state.ts +454 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/tamradar.ts +260 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/types.ts +215 -0
- package/dist/bundling-sources/shared_libs/monitors/callback-security.ts +333 -0
- package/dist/bundling-sources/shared_libs/monitors/cursor-page.ts +42 -0
- package/dist/bundling-sources/shared_libs/monitors/deactivation-reasons.ts +16 -0
- package/dist/bundling-sources/shared_libs/monitors/framework-managed-payload-fields.ts +71 -0
- package/dist/bundling-sources/shared_libs/monitors/generated/provider-monitor-callback-admission-targets.ts +16 -0
- package/dist/bundling-sources/shared_libs/monitors/http-error-response.ts +267 -0
- package/dist/bundling-sources/shared_libs/monitors/inbound-publish-key.ts +39 -0
- package/dist/bundling-sources/shared_libs/monitors/inbound-queue.ts +82 -0
- package/dist/bundling-sources/shared_libs/monitors/lifecycle-notifications.ts +473 -0
- package/dist/bundling-sources/shared_libs/monitors/org-monitor-limits.ts +1 -1
- package/dist/bundling-sources/shared_libs/monitors/package.json +29 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-callback-verification.ts +1125 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +263 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-capability.ts +964 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-consumer-health.ts +56 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-errors.ts +131 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-identity-claims.ts +535 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-legacy-aliases.ts +16 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-priority-execution.ts +56 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-public-aliases.ts +28 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-runtime-read-eligibility.ts +38 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-state.ts +122 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-status.ts +10 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-upstream-identity.ts +112 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-webhook-monitor-runtime.ts +300 -0
- package/dist/bundling-sources/shared_libs/monitors/quickstart-prompts.ts +22 -0
- package/dist/bundling-sources/shared_libs/monitors/snitcher-install-validation.ts +93 -0
- package/dist/bundling-sources/shared_libs/monitors/snitcher-ip2company.ts +332 -0
- package/dist/bundling-sources/shared_libs/monitors/snitcher-radar.ts +221 -0
- package/dist/bundling-sources/shared_libs/monitors/starter-templates.ts +105 -0
- package/dist/bundling-sources/shared_libs/monitors/tracking-provider-guidance.ts +73 -0
- package/dist/bundling-sources/shared_libs/monitors/tracking-provider-integrations.ts +81 -0
- package/dist/bundling-sources/shared_libs/monitors/tsconfig.json +10 -0
- package/dist/bundling-sources/shared_libs/play-runtime/activity-observation.ts +6 -11
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +90 -12
- package/dist/bundling-sources/shared_libs/play-runtime/async-play-invocation.ts +78 -0
- package/dist/bundling-sources/shared_libs/play-runtime/checkpoint-boundaries.ts +70 -0
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +407 -53
- package/dist/bundling-sources/shared_libs/play-runtime/coordinator-headers.ts +1 -32
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +57 -0
- package/dist/bundling-sources/shared_libs/play-runtime/default-batch-strategies.ts +20 -1
- package/dist/bundling-sources/shared_libs/play-runtime/execution-capabilities.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/execution-protocol.ts +7 -1
- package/dist/bundling-sources/shared_libs/play-runtime/lane-retirement-gate.ts +189 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-semantics.ts +28 -0
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +23 -0
- 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 +18 -4
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-start-admission.ts +68 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +10 -8
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-capacity-policy.ts +20 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-contract.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-env.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-scheduler-topology.ts +24 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +30 -1
- package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +6 -3
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +454 -17
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +19 -4
- package/dist/bundling-sources/shared_libs/plays/contracts.ts +6 -14
- package/dist/bundling-sources/shared_libs/plays/core.ts +11 -6
- package/dist/bundling-sources/shared_libs/plays/docflow-binding-owner.ts +16 -11
- package/dist/bundling-sources/shared_libs/plays/email-status.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/resolve-static-pipeline.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/slug.ts +115 -0
- package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +44 -14
- package/dist/bundling-sources/shared_libs/plays/tool-category-descriptions.ts +2 -2
- package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +877 -0
- package/dist/bundling-sources/shared_libs/product-notifications/configuration-draft.ts +456 -0
- package/dist/bundling-sources/shared_libs/product-notifications/configuration.ts +560 -0
- package/dist/bundling-sources/shared_libs/product-notifications/content.ts +28 -0
- package/dist/bundling-sources/shared_libs/product-notifications/default-policy.ts +59 -0
- package/dist/bundling-sources/shared_libs/product-notifications/email.ts +246 -0
- package/dist/bundling-sources/shared_libs/product-notifications/evaluation.ts +280 -0
- package/dist/bundling-sources/shared_libs/product-notifications/events.ts +433 -0
- package/dist/bundling-sources/shared_libs/product-notifications/legacy-slack.ts +80 -0
- package/dist/bundling-sources/shared_libs/product-notifications/workspace.ts +38 -0
- package/dist/bundling-sources/shared_libs/runtime-env.ts +6 -0
- package/dist/bundling-sources/shared_libs/security/header-safe-env.ts +28 -0
- package/dist/bundling-sources/shared_libs/security/internal-actor.ts +50 -0
- package/dist/bundling-sources/shared_libs/security/secret-redaction.ts +267 -0
- package/dist/cli/index.js +1070 -193
- package/dist/cli/index.mjs +1057 -180
- package/dist/{compiler-manifest-Dbov16F7.d.mts → compiler-manifest-DsLbQaew.d.mts} +132 -8
- package/dist/{compiler-manifest-Dbov16F7.d.ts → compiler-manifest-DsLbQaew.d.ts} +132 -8
- package/dist/index.d.mts +834 -12
- package/dist/index.d.ts +834 -12
- package/dist/index.js +469 -40
- package/dist/index.mjs +469 -40
- package/dist/install-integrity.json +65 -4
- package/dist/plays/bundle-play-file.d.mts +8 -3
- package/dist/plays/bundle-play-file.d.ts +8 -3
- package/dist/plays/bundle-play-file.mjs +100 -20
- package/package.json +3 -1
- /package/dist/bundling-sources/shared_libs/{integrations/bettercontact-execution-policy.ts → integration-contracts/bettercontact/execution-policy.ts} +0 -0
- /package/dist/bundling-sources/shared_libs/{integrations/theirstack-execution-policy.ts → integration-contracts/theirstack/execution-policy.ts} +0 -0
package/dist/index.js
CHANGED
|
@@ -779,7 +779,10 @@ function resolveConfig(options) {
|
|
|
779
779
|
apiKey,
|
|
780
780
|
baseUrl,
|
|
781
781
|
timeout: options?.timeout ?? DEFAULT_TIMEOUT,
|
|
782
|
-
maxRetries: options?.maxRetries ?? DEFAULT_MAX_RETRIES
|
|
782
|
+
maxRetries: options?.maxRetries ?? DEFAULT_MAX_RETRIES,
|
|
783
|
+
// Pass through untouched: the transport owns case-insensitive merging so
|
|
784
|
+
// there is exactly one place that decides which header wins.
|
|
785
|
+
...options?.headers ? { headers: { ...options.headers } } : {}
|
|
783
786
|
};
|
|
784
787
|
}
|
|
785
788
|
|
|
@@ -832,7 +835,7 @@ var SDK_RELEASE = {
|
|
|
832
835
|
// available at toolResponse.rawV2 while toolResponse.raw and all declared
|
|
833
836
|
// getters keep their established compatibility behavior.
|
|
834
837
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
835
|
-
version: "0.3.
|
|
838
|
+
version: "0.3.89",
|
|
836
839
|
updateSummary: "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.",
|
|
837
840
|
packageCapabilities: {
|
|
838
841
|
updatePreferences: 1
|
|
@@ -1377,11 +1380,33 @@ function normalizeRequestAbortError(error, input) {
|
|
|
1377
1380
|
}
|
|
1378
1381
|
return normalized;
|
|
1379
1382
|
}
|
|
1383
|
+
function applyExplicitHeaders(headers, explicit) {
|
|
1384
|
+
if (!explicit) return headers;
|
|
1385
|
+
for (const [rawName, value] of Object.entries(explicit)) {
|
|
1386
|
+
const name = rawName.trim().toLowerCase();
|
|
1387
|
+
if (!name) continue;
|
|
1388
|
+
for (const existing of Object.keys(headers)) {
|
|
1389
|
+
if (existing.toLowerCase() === name) delete headers[existing];
|
|
1390
|
+
}
|
|
1391
|
+
headers[name] = value;
|
|
1392
|
+
}
|
|
1393
|
+
return headers;
|
|
1394
|
+
}
|
|
1380
1395
|
function isAbortLikeError(error) {
|
|
1381
1396
|
const name = error.name.toLowerCase();
|
|
1382
1397
|
const message = error.message.toLowerCase();
|
|
1383
1398
|
return name === "aborterror" || message.includes("operation was aborted") || message === "aborted";
|
|
1384
1399
|
}
|
|
1400
|
+
function withErrorCause(error, cause) {
|
|
1401
|
+
if (cause !== null && cause !== void 0) {
|
|
1402
|
+
Object.defineProperty(error, "cause", {
|
|
1403
|
+
value: cause,
|
|
1404
|
+
configurable: true,
|
|
1405
|
+
writable: true
|
|
1406
|
+
});
|
|
1407
|
+
}
|
|
1408
|
+
return error;
|
|
1409
|
+
}
|
|
1385
1410
|
function mapNetworkError(baseUrl, error, targetLabel2) {
|
|
1386
1411
|
const tagged = error;
|
|
1387
1412
|
const timeoutMs = tagged?.[REQUEST_TIMEOUT_MARKER];
|
|
@@ -1498,7 +1523,7 @@ var HttpClient = class {
|
|
|
1498
1523
|
if (coordinatorInternalToken?.trim() && (coordinatorUrl?.trim() || workerCallbackUrl?.trim() || runtimeTestFault?.trim() || absurdReleaseOverride?.trim() || preferredReceiptGatewayMachineId?.trim())) {
|
|
1499
1524
|
headers[COORDINATOR_INTERNAL_TOKEN_HEADER] = coordinatorInternalToken.trim();
|
|
1500
1525
|
}
|
|
1501
|
-
return headers;
|
|
1526
|
+
return applyExplicitHeaders(headers, this.config.headers);
|
|
1502
1527
|
}
|
|
1503
1528
|
/**
|
|
1504
1529
|
* Send an HTTP request with automatic retries and error handling.
|
|
@@ -1652,32 +1677,38 @@ var HttpClient = class {
|
|
|
1652
1677
|
);
|
|
1653
1678
|
if (options?.toolId) {
|
|
1654
1679
|
const code = mappedNetworkError.code;
|
|
1655
|
-
throw
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1680
|
+
throw withErrorCause(
|
|
1681
|
+
new ToolExecutionError(
|
|
1682
|
+
withCoworkNetworkHint(mappedNetworkError.message),
|
|
1683
|
+
{
|
|
1684
|
+
toolId: options.toolId,
|
|
1685
|
+
provider: providerLabelFromToolId(options.toolId),
|
|
1686
|
+
operation: options.toolId,
|
|
1687
|
+
code,
|
|
1688
|
+
origin: "deepline",
|
|
1689
|
+
category: "network",
|
|
1690
|
+
// A direct client timeout has ambiguous delivery. Fail closed unless
|
|
1691
|
+
// the server returns the authoritative action delivery contract.
|
|
1692
|
+
retryable: false,
|
|
1693
|
+
statusCode: null,
|
|
1694
|
+
requestId: null,
|
|
1695
|
+
retryAfterMs: null,
|
|
1696
|
+
networkKind: code === "NETWORK_TIMEOUT" ? "timeout" : code === "NETWORK_ABORTED" ? "unknown" : "unavailable",
|
|
1697
|
+
networkScope: "client_to_deepline",
|
|
1698
|
+
details: mappedNetworkError.details
|
|
1699
|
+
}
|
|
1700
|
+
),
|
|
1701
|
+
lastError
|
|
1674
1702
|
);
|
|
1675
1703
|
}
|
|
1676
|
-
throw
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1704
|
+
throw withErrorCause(
|
|
1705
|
+
new DeeplineError(
|
|
1706
|
+
withCoworkNetworkHint(mappedNetworkError.message),
|
|
1707
|
+
void 0,
|
|
1708
|
+
mappedNetworkError.code,
|
|
1709
|
+
mappedNetworkError.details
|
|
1710
|
+
),
|
|
1711
|
+
lastError
|
|
1681
1712
|
);
|
|
1682
1713
|
}
|
|
1683
1714
|
/**
|
|
@@ -2026,6 +2057,13 @@ var PRODUCT_NOTIFICATION_DELIVERY_LEASE_MS = 2 * 6e4;
|
|
|
2026
2057
|
var PRODUCT_NOTIFICATION_SUCCESS_TTL_MS = 15 * 6e4;
|
|
2027
2058
|
var PRODUCT_NOTIFICATION_FAILURE_TTL_MS = 24 * 60 * 6e4;
|
|
2028
2059
|
|
|
2060
|
+
// ../product-notifications/configuration.ts
|
|
2061
|
+
var PRODUCT_NOTIFICATION_EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
2062
|
+
function normalizeProductNotificationEmail(value) {
|
|
2063
|
+
const email = typeof value === "string" ? value.trim().toLowerCase() : "";
|
|
2064
|
+
return email && email.length <= 320 && PRODUCT_NOTIFICATION_EMAIL_PATTERN.test(email) ? email : null;
|
|
2065
|
+
}
|
|
2066
|
+
|
|
2029
2067
|
// src/stream-reconnect.ts
|
|
2030
2068
|
var STREAM_RECONNECT_BASE_DELAY_MS = 500;
|
|
2031
2069
|
var STREAM_RECONNECT_MAX_DELAY_MS = 15e3;
|
|
@@ -2554,7 +2592,7 @@ function isRecord4(value) {
|
|
|
2554
2592
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
2555
2593
|
}
|
|
2556
2594
|
function isPlayActivityObservation(value) {
|
|
2557
|
-
if (!isRecord4(value) || value.schemaVersion !== 1 || typeof value.activityId !== "string" || !value.activityId.trim() || typeof value.observedAt !== "number" || !Number.isFinite(value.observedAt) || !isRecord4(value.target) || !isRecord4(value.state)) {
|
|
2595
|
+
if (!isRecord4(value) || value.schemaVersion !== void 0 && value.schemaVersion !== 1 || typeof value.activityId !== "string" || !value.activityId.trim() || typeof value.observedAt !== "number" || !Number.isFinite(value.observedAt) || !isRecord4(value.target) || !isRecord4(value.state)) {
|
|
2558
2596
|
return false;
|
|
2559
2597
|
}
|
|
2560
2598
|
const targetKinds = /* @__PURE__ */ new Set([
|
|
@@ -2661,7 +2699,6 @@ function projectPlayRunActivity(input) {
|
|
|
2661
2699
|
if (input.waitKind === "detached_runner") {
|
|
2662
2700
|
return projection(
|
|
2663
2701
|
{
|
|
2664
|
-
schemaVersion: 1,
|
|
2665
2702
|
activityId: "runner:managed",
|
|
2666
2703
|
target: {
|
|
2667
2704
|
kind: "runner",
|
|
@@ -2677,7 +2714,6 @@ function projectPlayRunActivity(input) {
|
|
|
2677
2714
|
if (input.waitKind === "sleep") {
|
|
2678
2715
|
return projection(
|
|
2679
2716
|
{
|
|
2680
|
-
schemaVersion: 1,
|
|
2681
2717
|
activityId: "run:sleep",
|
|
2682
2718
|
target: {
|
|
2683
2719
|
kind: "step",
|
|
@@ -2697,7 +2733,6 @@ function projectPlayRunActivity(input) {
|
|
|
2697
2733
|
if (input.waitKind === "integration_event" || input.waitKind === "integration_event_batch") {
|
|
2698
2734
|
return projection(
|
|
2699
2735
|
{
|
|
2700
|
-
schemaVersion: 1,
|
|
2701
2736
|
activityId: `event:${input.activeNodeId ?? "run"}`,
|
|
2702
2737
|
stepId: input.activeNodeId ?? void 0,
|
|
2703
2738
|
target: {
|
|
@@ -2721,7 +2756,6 @@ function projectPlayRunActivity(input) {
|
|
|
2721
2756
|
if (normalizedStatus === "waiting") {
|
|
2722
2757
|
return projection(
|
|
2723
2758
|
{
|
|
2724
|
-
schemaVersion: 1,
|
|
2725
2759
|
activityId: "run:legacy-wait",
|
|
2726
2760
|
target: {
|
|
2727
2761
|
kind: "step",
|
|
@@ -2748,7 +2782,6 @@ function projectPlayRunActivity(input) {
|
|
|
2748
2782
|
const datasetProgress = datasetStep?.progress ?? null;
|
|
2749
2783
|
return projection(
|
|
2750
2784
|
{
|
|
2751
|
-
schemaVersion: 1,
|
|
2752
2785
|
activityId: `dataset:${pendingDataset.datasetId ?? pendingDataset.tableNamespace}`,
|
|
2753
2786
|
target: {
|
|
2754
2787
|
kind: "dataset",
|
|
@@ -2776,7 +2809,6 @@ function projectPlayRunActivity(input) {
|
|
|
2776
2809
|
const provider = toolId?.split(/[._]/)[0]?.trim() || null;
|
|
2777
2810
|
return projection(
|
|
2778
2811
|
{
|
|
2779
|
-
schemaVersion: 1,
|
|
2780
2812
|
activityId: `step:${activeStep.nodeId}`,
|
|
2781
2813
|
stepId: activeStep.nodeId,
|
|
2782
2814
|
target: toolId && provider ? {
|
|
@@ -2801,7 +2833,6 @@ function projectPlayRunActivity(input) {
|
|
|
2801
2833
|
if (normalizedStatus === "queued") {
|
|
2802
2834
|
return projection(
|
|
2803
2835
|
{
|
|
2804
|
-
schemaVersion: 1,
|
|
2805
2836
|
activityId: "capacity:worker",
|
|
2806
2837
|
target: { kind: "capacity", pool: "worker" },
|
|
2807
2838
|
state: { kind: "queued", reason: "capacity" },
|
|
@@ -2811,7 +2842,6 @@ function projectPlayRunActivity(input) {
|
|
|
2811
2842
|
);
|
|
2812
2843
|
}
|
|
2813
2844
|
const fallback = {
|
|
2814
|
-
schemaVersion: 1,
|
|
2815
2845
|
activityId: "run:legacy",
|
|
2816
2846
|
target: {
|
|
2817
2847
|
kind: "step",
|
|
@@ -3826,7 +3856,7 @@ async function* observeRunEvents(options) {
|
|
|
3826
3856
|
}
|
|
3827
3857
|
}
|
|
3828
3858
|
|
|
3829
|
-
//
|
|
3859
|
+
// ../integration-contracts/theirstack/execution-policy.ts
|
|
3830
3860
|
var THEIRSTACK_SLOW_JOB_SEARCH_PROVIDER_TIMEOUT_MS = 135e3;
|
|
3831
3861
|
var THEIRSTACK_SLOW_JOB_SEARCH_CLIENT_TIMEOUT_MS = 6e4 + THEIRSTACK_SLOW_JOB_SEARCH_PROVIDER_TIMEOUT_MS + 15e3;
|
|
3832
3862
|
var THEIRSTACK_COMPANY_SEARCH_CLIENT_TIMEOUT_MS = 21e4;
|
|
@@ -3880,7 +3910,7 @@ function resolveTheirstackClientTimeoutMs(endpointId, payload) {
|
|
|
3880
3910
|
return usesExtendedTheirstackJobSearchBudget(endpointId, payload) ? THEIRSTACK_SLOW_JOB_SEARCH_CLIENT_TIMEOUT_MS : null;
|
|
3881
3911
|
}
|
|
3882
3912
|
|
|
3883
|
-
//
|
|
3913
|
+
// ../integration-contracts/bettercontact/execution-policy.ts
|
|
3884
3914
|
var BETTERCONTACT_LAUNCHER_CLIENT_TIMEOUT_MS = 12e4;
|
|
3885
3915
|
var BETTERCONTACT_LAUNCHER_TOOL_IDS = /* @__PURE__ */ new Set([
|
|
3886
3916
|
"bettercontact_enrich",
|
|
@@ -3971,6 +4001,42 @@ function providerMetaFromToolResponseRawV2(rawV2, view) {
|
|
|
3971
4001
|
}
|
|
3972
4002
|
|
|
3973
4003
|
// src/client.ts
|
|
4004
|
+
var MAX_NOTIFICATION_GROUP_CREATE_TARGETS = 50;
|
|
4005
|
+
function parseNotificationGroupTarget(value) {
|
|
4006
|
+
const normalized = value.trim();
|
|
4007
|
+
if (normalized.toLowerCase().startsWith("email:")) {
|
|
4008
|
+
const email = normalizeProductNotificationEmail(normalized.slice(6));
|
|
4009
|
+
if (!email) {
|
|
4010
|
+
throw new Error(
|
|
4011
|
+
`Invalid email notification target "${value}". Use --to email:name@example.com.`
|
|
4012
|
+
);
|
|
4013
|
+
}
|
|
4014
|
+
return { kind: "email", email };
|
|
4015
|
+
}
|
|
4016
|
+
const slack = /^slack:(.+)$/i.exec(normalized)?.[1]?.trim();
|
|
4017
|
+
if (!slack) {
|
|
4018
|
+
const provider = normalized.split(":", 1)[0] || normalized;
|
|
4019
|
+
throw new Error(
|
|
4020
|
+
`Unsupported notification destination "${provider}". Use email: or slack:.`
|
|
4021
|
+
);
|
|
4022
|
+
}
|
|
4023
|
+
const member = /^member:([UW][A-Z0-9]{8,})$/i.exec(slack);
|
|
4024
|
+
if (member?.[1]) {
|
|
4025
|
+
return { kind: "slack", memberId: member[1].toUpperCase() };
|
|
4026
|
+
}
|
|
4027
|
+
if (slack.toLowerCase().startsWith("member:")) {
|
|
4028
|
+
throw new Error(
|
|
4029
|
+
"Slack member IDs must look like slack:member:U0123456789."
|
|
4030
|
+
);
|
|
4031
|
+
}
|
|
4032
|
+
if (!slack.replace(/^#/, "").trim()) {
|
|
4033
|
+
throw new Error("Use --to slack:#channel.");
|
|
4034
|
+
}
|
|
4035
|
+
return { kind: "slack", channel: slack };
|
|
4036
|
+
}
|
|
4037
|
+
function notificationObjectKey(kind) {
|
|
4038
|
+
return `${kind}.${globalThis.crypto.randomUUID()}`;
|
|
4039
|
+
}
|
|
3974
4040
|
var TERMINAL_PLAY_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "cancelled"]);
|
|
3975
4041
|
var INCLUDE_TOOL_METADATA_HEADER = "x-deepline-include-tool-metadata";
|
|
3976
4042
|
var EXECUTE_RESPONSE_CONTRACT_HEADER = "x-deepline-execute-response-contract";
|
|
@@ -4540,6 +4606,10 @@ var DeeplineClient = class {
|
|
|
4540
4606
|
audit: (options2) => this.auditMonitors(options2),
|
|
4541
4607
|
repair: (options2) => this.repairMonitors(options2),
|
|
4542
4608
|
health: (options2) => this.readMonitorsHealth(options2),
|
|
4609
|
+
batch: {
|
|
4610
|
+
submit: (options2) => this.submitMonitorBatch(options2),
|
|
4611
|
+
get: (operationId, options2) => this.getMonitorBatch(operationId, options2)
|
|
4612
|
+
},
|
|
4543
4613
|
fleets: {
|
|
4544
4614
|
sync: (definitionOrId, options2) => this.syncMonitorFleet(definitionOrId, options2),
|
|
4545
4615
|
get: (fleetId, options2) => fleetId === void 0 ? this.listMonitorFleets() : this.getMonitorFleet(fleetId, options2),
|
|
@@ -4672,6 +4742,16 @@ var DeeplineClient = class {
|
|
|
4672
4742
|
(secret) => secret.name === normalized && secret.status === "active" && secret.hasValue
|
|
4673
4743
|
) ?? null;
|
|
4674
4744
|
}
|
|
4745
|
+
/** Check effective scope and active-version health without reading the value.
|
|
4746
|
+
* Without playName, checks the organization-scoped secret only. With a Play
|
|
4747
|
+
* name, an active Play secret takes precedence; a deleted/disabled Play
|
|
4748
|
+
* secret falls back to the organization-scoped secret.
|
|
4749
|
+
*/
|
|
4750
|
+
async inspectSecret(name, options = {}) {
|
|
4751
|
+
const params = new URLSearchParams({ name: name.trim().toUpperCase() });
|
|
4752
|
+
if (options.playName !== void 0) params.set("play", options.playName);
|
|
4753
|
+
return this.http.get(`/api/v2/secrets?${params.toString()}`);
|
|
4754
|
+
}
|
|
4675
4755
|
// ——————————————————————————————————————————————————————————
|
|
4676
4756
|
// Tools
|
|
4677
4757
|
// ——————————————————————————————————————————————————————————
|
|
@@ -4763,6 +4843,10 @@ var DeeplineClient = class {
|
|
|
4763
4843
|
`/api/v2/integrations/${encodeURIComponent(toolId)}/get`,
|
|
4764
4844
|
{
|
|
4765
4845
|
method: "GET",
|
|
4846
|
+
// Tool metadata is a read-only catalog lookup. Keep the metadata
|
|
4847
|
+
// header while opting into the same transient edge-response retries as
|
|
4848
|
+
// other GET catalog methods such as searchTools().
|
|
4849
|
+
retryApiErrors: true,
|
|
4766
4850
|
headers: {
|
|
4767
4851
|
"x-deepline-tool-meta-only": "1"
|
|
4768
4852
|
}
|
|
@@ -6218,6 +6302,197 @@ var DeeplineClient = class {
|
|
|
6218
6302
|
async getNotifications() {
|
|
6219
6303
|
return this.http.get("/api/v2/notifications");
|
|
6220
6304
|
}
|
|
6305
|
+
/** Read the group-based product-notification configuration and rule catalog. */
|
|
6306
|
+
async getNotificationConfiguration() {
|
|
6307
|
+
return this.http.get("/api/v2/notifications/configuration");
|
|
6308
|
+
}
|
|
6309
|
+
/** Atomically apply one retry-safe desired configuration change. */
|
|
6310
|
+
async changeNotificationConfiguration(expectedWorkspaceVersion, change) {
|
|
6311
|
+
return this.http.put("/api/v2/notifications/configuration", {
|
|
6312
|
+
expectedWorkspaceVersion,
|
|
6313
|
+
change
|
|
6314
|
+
});
|
|
6315
|
+
}
|
|
6316
|
+
/** Create one notification group and its destinations as a retry-safe unit. */
|
|
6317
|
+
async createNotificationGroup(input) {
|
|
6318
|
+
const name = input.name.trim().replace(/\s+/g, " ");
|
|
6319
|
+
if (!name) throw new Error("Notification group name is required.");
|
|
6320
|
+
if (input.targets.length < 1 || input.targets.length > MAX_NOTIFICATION_GROUP_CREATE_TARGETS) {
|
|
6321
|
+
throw new Error(
|
|
6322
|
+
`Choose between 1 and ${MAX_NOTIFICATION_GROUP_CREATE_TARGETS} notification targets.`
|
|
6323
|
+
);
|
|
6324
|
+
}
|
|
6325
|
+
const targets = input.targets.map(parseNotificationGroupTarget);
|
|
6326
|
+
const legacyEvents = input.legacyEvents ?? [];
|
|
6327
|
+
const legacyTarget = targets.length === 1 && targets[0]?.kind === "slack" && legacyEvents.length > 0 ? targets[0] : null;
|
|
6328
|
+
if (legacyEvents.length > 0 && !legacyTarget) {
|
|
6329
|
+
throw new Error(
|
|
6330
|
+
"--for is supported only by the legacy one-Slack-target form. Create the group first, then add rules in notification configuration."
|
|
6331
|
+
);
|
|
6332
|
+
}
|
|
6333
|
+
if (!legacyTarget && name.toLowerCase() === "default") {
|
|
6334
|
+
throw new Error(
|
|
6335
|
+
"Default is reserved for the workspace default notification group."
|
|
6336
|
+
);
|
|
6337
|
+
}
|
|
6338
|
+
const normalizedTargets = targets.map(
|
|
6339
|
+
(target) => target.kind === "email" ? `email:${target.email}` : "memberId" in target ? `slack:member:${target.memberId}` : `slack:${target.channel}`
|
|
6340
|
+
);
|
|
6341
|
+
if (input.dryRun) {
|
|
6342
|
+
return {
|
|
6343
|
+
mode: "dry_run",
|
|
6344
|
+
compatibilityMode: legacyTarget !== null,
|
|
6345
|
+
name: legacyTarget ? input.name : name,
|
|
6346
|
+
targets: normalizedTargets,
|
|
6347
|
+
legacyEvents
|
|
6348
|
+
};
|
|
6349
|
+
}
|
|
6350
|
+
if (legacyTarget) {
|
|
6351
|
+
const notification = await this.createNotification({
|
|
6352
|
+
name: input.name,
|
|
6353
|
+
provider: "slack",
|
|
6354
|
+
..."channel" in legacyTarget ? { channel: legacyTarget.channel } : { memberId: legacyTarget.memberId },
|
|
6355
|
+
eventTypes: legacyEvents
|
|
6356
|
+
});
|
|
6357
|
+
return { mode: "legacy", notification };
|
|
6358
|
+
}
|
|
6359
|
+
const current = await this.getNotificationConfiguration();
|
|
6360
|
+
const existingGroup = current.configuration.groups.find(
|
|
6361
|
+
(candidate) => candidate.name.toLowerCase() === name.toLowerCase()
|
|
6362
|
+
);
|
|
6363
|
+
const groupKey = existingGroup?.groupKey ?? notificationObjectKey("group");
|
|
6364
|
+
const group = existingGroup ?? {
|
|
6365
|
+
groupKey,
|
|
6366
|
+
name,
|
|
6367
|
+
enabled: true,
|
|
6368
|
+
deliveryTiming: { mode: "immediate" },
|
|
6369
|
+
source: "workspace",
|
|
6370
|
+
configMode: "custom",
|
|
6371
|
+
version: 0
|
|
6372
|
+
};
|
|
6373
|
+
const destinations = current.configuration.destinations.filter(
|
|
6374
|
+
(destination) => destination.groupKey === groupKey
|
|
6375
|
+
);
|
|
6376
|
+
const emails = [
|
|
6377
|
+
...new Set(
|
|
6378
|
+
targets.flatMap(
|
|
6379
|
+
(target) => target.kind === "email" ? [target.email] : []
|
|
6380
|
+
)
|
|
6381
|
+
)
|
|
6382
|
+
].sort();
|
|
6383
|
+
const existingEmails = new Set(
|
|
6384
|
+
destinations.flatMap(
|
|
6385
|
+
(destination) => destination.settings.kind === "email_addresses" ? destination.settings.to : []
|
|
6386
|
+
)
|
|
6387
|
+
);
|
|
6388
|
+
const newEmails = emails.filter((email) => !existingEmails.has(email));
|
|
6389
|
+
if (newEmails.length > 0) {
|
|
6390
|
+
destinations.push({
|
|
6391
|
+
destinationKey: notificationObjectKey("destination"),
|
|
6392
|
+
groupKey,
|
|
6393
|
+
name: "Email recipients",
|
|
6394
|
+
enabled: true,
|
|
6395
|
+
source: "workspace",
|
|
6396
|
+
configMode: "custom",
|
|
6397
|
+
version: 0,
|
|
6398
|
+
status: "active",
|
|
6399
|
+
settings: { kind: "email_addresses", to: newEmails }
|
|
6400
|
+
});
|
|
6401
|
+
}
|
|
6402
|
+
const slackTargets = /* @__PURE__ */ new Map();
|
|
6403
|
+
for (const target of targets) {
|
|
6404
|
+
if (target.kind !== "slack") continue;
|
|
6405
|
+
const targetKey = "memberId" in target ? `member:${target.memberId}` : `channel:${target.channel.replace(/^#/, "").toLowerCase()}`;
|
|
6406
|
+
slackTargets.set(targetKey, target);
|
|
6407
|
+
}
|
|
6408
|
+
const connectionId = current.slackConnection.connectionId;
|
|
6409
|
+
if (slackTargets.size > 0 && !connectionId) {
|
|
6410
|
+
throw new Error(
|
|
6411
|
+
"Slack is not connected to this workspace. Connect it in Dashboard \u2192 Integrations, then retry."
|
|
6412
|
+
);
|
|
6413
|
+
}
|
|
6414
|
+
const resolvedSlackTargets = await Promise.all(
|
|
6415
|
+
[...slackTargets.values()].map(async (target) => {
|
|
6416
|
+
if ("memberId" in target) {
|
|
6417
|
+
return {
|
|
6418
|
+
targetKind: "member",
|
|
6419
|
+
targetId: target.memberId,
|
|
6420
|
+
targetName: target.memberId
|
|
6421
|
+
};
|
|
6422
|
+
}
|
|
6423
|
+
const channel = target.channel;
|
|
6424
|
+
const requested = channel.replace(/^#/, "");
|
|
6425
|
+
const response = await this.listNotificationChannels(channel);
|
|
6426
|
+
const matches = response.channels.filter(
|
|
6427
|
+
(candidate) => candidate.id === requested || candidate.name.toLowerCase() === requested.toLowerCase()
|
|
6428
|
+
);
|
|
6429
|
+
if (matches.length !== 1) {
|
|
6430
|
+
throw new Error(
|
|
6431
|
+
matches.length === 0 ? `Slack channel ${channel} was not found or is not visible to the Deepline app.` : `Slack channel ${channel} is ambiguous. Use its channel ID.`
|
|
6432
|
+
);
|
|
6433
|
+
}
|
|
6434
|
+
return {
|
|
6435
|
+
targetKind: "channel",
|
|
6436
|
+
targetId: matches[0].id,
|
|
6437
|
+
targetName: matches[0].name
|
|
6438
|
+
};
|
|
6439
|
+
})
|
|
6440
|
+
);
|
|
6441
|
+
const uniqueSlackTargets = new Map(
|
|
6442
|
+
resolvedSlackTargets.map((target) => [
|
|
6443
|
+
`${target.targetKind}:${target.targetId}`,
|
|
6444
|
+
target
|
|
6445
|
+
])
|
|
6446
|
+
);
|
|
6447
|
+
for (const target of uniqueSlackTargets.values()) {
|
|
6448
|
+
if (destinations.some(
|
|
6449
|
+
(destination) => destination.settings.kind === "slack" && destination.settings.targetKind === target.targetKind && destination.settings.targetId === target.targetId
|
|
6450
|
+
)) {
|
|
6451
|
+
continue;
|
|
6452
|
+
}
|
|
6453
|
+
destinations.push({
|
|
6454
|
+
destinationKey: notificationObjectKey("destination"),
|
|
6455
|
+
groupKey,
|
|
6456
|
+
name: `${target.targetKind === "channel" ? "#" : "@"}${target.targetName}`,
|
|
6457
|
+
enabled: true,
|
|
6458
|
+
source: "workspace",
|
|
6459
|
+
configMode: "custom",
|
|
6460
|
+
version: 0,
|
|
6461
|
+
status: "pending_verification",
|
|
6462
|
+
settings: {
|
|
6463
|
+
kind: "slack",
|
|
6464
|
+
...target,
|
|
6465
|
+
oauthConnectionId: connectionId
|
|
6466
|
+
}
|
|
6467
|
+
});
|
|
6468
|
+
}
|
|
6469
|
+
const draft = {
|
|
6470
|
+
group,
|
|
6471
|
+
destinations,
|
|
6472
|
+
rules: current.configuration.rules.filter(
|
|
6473
|
+
(rule) => rule.groupKey === groupKey
|
|
6474
|
+
)
|
|
6475
|
+
};
|
|
6476
|
+
const result = await this.changeNotificationConfiguration(
|
|
6477
|
+
current.configuration.workspaceVersion,
|
|
6478
|
+
{ kind: "save_group", draft }
|
|
6479
|
+
);
|
|
6480
|
+
const storedGroup = result.configuration.groups.find(
|
|
6481
|
+
(candidate) => candidate.groupKey === groupKey
|
|
6482
|
+
);
|
|
6483
|
+
if (!storedGroup) {
|
|
6484
|
+
throw new Error("Notification group creation returned no saved group.");
|
|
6485
|
+
}
|
|
6486
|
+
return {
|
|
6487
|
+
mode: "native",
|
|
6488
|
+
groupKey,
|
|
6489
|
+
targets: normalizedTargets,
|
|
6490
|
+
group: storedGroup,
|
|
6491
|
+
destinations: result.configuration.destinations.filter(
|
|
6492
|
+
(destination) => destination.groupKey === groupKey
|
|
6493
|
+
)
|
|
6494
|
+
};
|
|
6495
|
+
}
|
|
6221
6496
|
/** List Slack channels available to an already-connected Slack integration. */
|
|
6222
6497
|
async listNotificationChannels(query) {
|
|
6223
6498
|
const suffix = query ? `?search=${encodeURIComponent(query)}` : "";
|
|
@@ -6762,6 +7037,78 @@ var DeeplineClient = class {
|
|
|
6762
7037
|
{ method: "GET" }
|
|
6763
7038
|
);
|
|
6764
7039
|
}
|
|
7040
|
+
/** Submit durable monitor work; transport retries use the same idempotency key. */
|
|
7041
|
+
async submitMonitorBatch(options) {
|
|
7042
|
+
const idempotencyKey = options.idempotencyKey.trim();
|
|
7043
|
+
if (!idempotencyKey) {
|
|
7044
|
+
throw new DeeplineError(
|
|
7045
|
+
"Monitor batch idempotencyKey is required.",
|
|
7046
|
+
void 0,
|
|
7047
|
+
"INVALID_MONITOR_BATCH_IDEMPOTENCY_KEY"
|
|
7048
|
+
);
|
|
7049
|
+
}
|
|
7050
|
+
if (options.kind === "deploy") {
|
|
7051
|
+
if (!options.manifestNdjson.trim()) {
|
|
7052
|
+
throw new DeeplineError(
|
|
7053
|
+
"Monitor batch deploy requires a non-empty NDJSON manifest.",
|
|
7054
|
+
void 0,
|
|
7055
|
+
"INVALID_MONITOR_BATCH_MANIFEST"
|
|
7056
|
+
);
|
|
7057
|
+
}
|
|
7058
|
+
return this.http.request(
|
|
7059
|
+
"/api/v2/monitors/batch",
|
|
7060
|
+
{
|
|
7061
|
+
method: "POST",
|
|
7062
|
+
body: {
|
|
7063
|
+
kind: "deploy",
|
|
7064
|
+
manifest_ndjson: options.manifestNdjson,
|
|
7065
|
+
dry_run: options.dryRun === true,
|
|
7066
|
+
idempotency_key: idempotencyKey
|
|
7067
|
+
},
|
|
7068
|
+
headers: { "Idempotency-Key": idempotencyKey },
|
|
7069
|
+
maxRetries: 0,
|
|
7070
|
+
exactUrlOnly: true
|
|
7071
|
+
}
|
|
7072
|
+
);
|
|
7073
|
+
}
|
|
7074
|
+
const scope = options.scope.kind === "keys" ? { kind: "keys", monitor_keys: options.scope.monitorKeys } : options.scope.kind === "fleet" ? { kind: "fleet", fleet_id: options.scope.fleetId } : { kind: "target", target: options.scope.target };
|
|
7075
|
+
return this.http.request(
|
|
7076
|
+
"/api/v2/monitors/batch",
|
|
7077
|
+
{
|
|
7078
|
+
method: "POST",
|
|
7079
|
+
body: {
|
|
7080
|
+
kind: options.kind,
|
|
7081
|
+
scope,
|
|
7082
|
+
dry_run: options.dryRun === true,
|
|
7083
|
+
idempotency_key: idempotencyKey,
|
|
7084
|
+
...options.deactivationReason === void 0 ? {} : { deactivation_reason: options.deactivationReason }
|
|
7085
|
+
},
|
|
7086
|
+
headers: { "Idempotency-Key": idempotencyKey },
|
|
7087
|
+
// Durable submission is itself idempotent, but an ambiguous local retry
|
|
7088
|
+
// must retain the exact key and never turn a CLI attempt into two runs.
|
|
7089
|
+
maxRetries: 0,
|
|
7090
|
+
exactUrlOnly: true
|
|
7091
|
+
}
|
|
7092
|
+
);
|
|
7093
|
+
}
|
|
7094
|
+
/** Get durable batch progress and a bounded retained evidence page. */
|
|
7095
|
+
async getMonitorBatch(operationId, options) {
|
|
7096
|
+
const runId = operationId.trim();
|
|
7097
|
+
if (!runId) {
|
|
7098
|
+
throw new DeeplineError(
|
|
7099
|
+
"Monitor batch operation id is required.",
|
|
7100
|
+
void 0,
|
|
7101
|
+
"INVALID_MONITOR_BATCH_OPERATION_ID"
|
|
7102
|
+
);
|
|
7103
|
+
}
|
|
7104
|
+
const params = new URLSearchParams();
|
|
7105
|
+
if (options?.cursor) params.set("cursor", options.cursor);
|
|
7106
|
+
const suffix = params.size > 0 ? `?${params}` : "";
|
|
7107
|
+
return this.http.request(
|
|
7108
|
+
`/api/v2/monitors/batch/${encodeURIComponent(runId)}${suffix}`,
|
|
7109
|
+
{ method: "GET" }
|
|
7110
|
+
);
|
|
7111
|
+
}
|
|
6765
7112
|
/**
|
|
6766
7113
|
* The deployable monitor tools catalog. Pass a tool id (positional or
|
|
6767
7114
|
* `{ tool }`) to describe one tool's full payload/stream contract, or no tool
|
|
@@ -9642,6 +9989,82 @@ var PLAY_AUTHORING_FIELD_REGISTRY = {
|
|
|
9642
9989
|
description: "Unsupported legacy child-workflow timeout.",
|
|
9643
9990
|
errorMessage: "ctx.runPlay timeoutMs is unsupported because child Plays execute inline."
|
|
9644
9991
|
},
|
|
9992
|
+
"ctx.runPlayAsync.key": {
|
|
9993
|
+
schema: import_typebox.Type.String({ minLength: 1 }),
|
|
9994
|
+
fixtures: {
|
|
9995
|
+
valid: "request-approval",
|
|
9996
|
+
invalid: "",
|
|
9997
|
+
absent: void 0,
|
|
9998
|
+
unresolved: { expression: "callKey" },
|
|
9999
|
+
edition1: "request-approval"
|
|
10000
|
+
},
|
|
10001
|
+
referenceType: "string",
|
|
10002
|
+
required: true,
|
|
10003
|
+
resolution: "runtime-dynamic",
|
|
10004
|
+
issueCode: "play_authoring_run_play_option_invalid",
|
|
10005
|
+
description: "Stable identity for one independent child Play Run.",
|
|
10006
|
+
errorMessage: "ctx.runPlayAsync key must be a non-empty string."
|
|
10007
|
+
},
|
|
10008
|
+
"ctx.runPlayAsync.playRef": {
|
|
10009
|
+
schema: import_typebox.Type.Union([
|
|
10010
|
+
import_typebox.Type.String({ minLength: 1 }),
|
|
10011
|
+
import_typebox.Type.Union([
|
|
10012
|
+
import_typebox.Type.Object(
|
|
10013
|
+
{ playName: import_typebox.Type.String({ minLength: 1 }) },
|
|
10014
|
+
{ additionalProperties: true }
|
|
10015
|
+
),
|
|
10016
|
+
import_typebox.Type.Object(
|
|
10017
|
+
{ name: import_typebox.Type.String({ minLength: 1 }) },
|
|
10018
|
+
{ additionalProperties: true }
|
|
10019
|
+
)
|
|
10020
|
+
])
|
|
10021
|
+
]),
|
|
10022
|
+
fixtures: {
|
|
10023
|
+
valid: "request-approval",
|
|
10024
|
+
invalid: {},
|
|
10025
|
+
absent: void 0,
|
|
10026
|
+
unresolved: { expression: "playRef" },
|
|
10027
|
+
edition1: "request-approval"
|
|
10028
|
+
},
|
|
10029
|
+
referenceType: "string | PlayReferenceLike",
|
|
10030
|
+
required: true,
|
|
10031
|
+
resolution: "runtime-dynamic",
|
|
10032
|
+
issueCode: "play_authoring_run_play_option_invalid",
|
|
10033
|
+
description: "Independently published scalar child Play name or strongly typed definition handle.",
|
|
10034
|
+
errorMessage: "ctx.runPlayAsync playRef must be a non-empty Play name or definition handle."
|
|
10035
|
+
},
|
|
10036
|
+
"ctx.runPlayAsync.input": {
|
|
10037
|
+
schema: import_typebox.Type.Record(import_typebox.Type.String(), import_typebox.Type.Unknown()),
|
|
10038
|
+
fixtures: {
|
|
10039
|
+
valid: { draftId: "draft-1" },
|
|
10040
|
+
invalid: "draft-1",
|
|
10041
|
+
absent: void 0,
|
|
10042
|
+
unresolved: "childInput",
|
|
10043
|
+
edition1: {}
|
|
10044
|
+
},
|
|
10045
|
+
referenceType: "Record<string, unknown>",
|
|
10046
|
+
required: true,
|
|
10047
|
+
resolution: "runtime-dynamic",
|
|
10048
|
+
issueCode: "play_authoring_run_play_option_invalid",
|
|
10049
|
+
description: "Scalar input object submitted to the independent child Run.",
|
|
10050
|
+
errorMessage: "ctx.runPlayAsync input must be an object."
|
|
10051
|
+
},
|
|
10052
|
+
"ctx.runPlayAsync.options.description": {
|
|
10053
|
+
schema: import_typebox.Type.String({ minLength: 1 }),
|
|
10054
|
+
fixtures: {
|
|
10055
|
+
valid: "Request approval.",
|
|
10056
|
+
invalid: "",
|
|
10057
|
+
absent: void 0,
|
|
10058
|
+
unresolved: { expression: "description" },
|
|
10059
|
+
edition1: "Request approval."
|
|
10060
|
+
},
|
|
10061
|
+
referenceType: "string",
|
|
10062
|
+
required: true,
|
|
10063
|
+
resolution: "runtime-dynamic",
|
|
10064
|
+
issueCode: "play_authoring_run_play_option_invalid",
|
|
10065
|
+
description: "Non-empty purpose for one independent child Play Run.",
|
|
10066
|
+
errorMessage: "ctx.runPlayAsync options.description must be non-empty."
|
|
10067
|
+
},
|
|
9645
10068
|
"runtime.timeout": {
|
|
9646
10069
|
schema: import_typebox.Type.String({ pattern: "^\\d+\\s*[mh]$" }),
|
|
9647
10070
|
fixtures: {
|
|
@@ -9929,6 +10352,10 @@ var PLAY_AUTHORING_CLOUD_TYPE_DECLARATIONS = [
|
|
|
9929
10352
|
`export type CsvOptions = { description?: ${cloudReferenceType("ctx.csv.options.description")}; columns?: ${cloudReferenceType("ctx.csv.options.columns")}; rename?: ${cloudReferenceType("ctx.csv.options.rename")}; required?: ${cloudReferenceType("ctx.csv.options.required")} };`,
|
|
9930
10353
|
"export type PlayCallExecution = 'inline';",
|
|
9931
10354
|
`export type PlayCallOptions = { description: ${cloudReferenceType("ctx.runPlay.options.description")}; execution?: ${cloudReferenceType("ctx.runPlay.options.execution")}; timeoutMs?: ${cloudReferenceType("ctx.runPlay.options.timeoutMs")} };`,
|
|
10355
|
+
`export type PlayAsyncCallOptions = { description: ${cloudReferenceType("ctx.runPlayAsync.options.description")} };`,
|
|
10356
|
+
"declare const PLAY_RUN_ID_BRAND: unique symbol;",
|
|
10357
|
+
"export type PlayRunId = string & { readonly [PLAY_RUN_ID_BRAND]: 'PlayRunId' };",
|
|
10358
|
+
"export type AsyncPlayRunRef = Readonly<{ runId: PlayRunId }>;",
|
|
9932
10359
|
`export type RuntimeStepOptions = { semanticKey?: ${cloudReferenceType("ctx.step.semanticKey")}; staleAfterSeconds?: ${cloudReferenceType("ctx.step.staleAfterSeconds")} };`,
|
|
9933
10360
|
`export type FetchOptions = { staleAfterSeconds?: ${cloudReferenceType("ctx.fetch.staleAfterSeconds")}; transient?: boolean };`,
|
|
9934
10361
|
"export type PlayFetchResponse = { ok: boolean; status: number; statusText: string; url: string; headers: Record<string, string>; bodyText: string; json: unknown | null };",
|
|
@@ -9954,11 +10381,11 @@ var PLAY_AUTHORING_CLOUD_TYPE_DECLARATIONS = [
|
|
|
9954
10381
|
" withColumn<Name extends string, Value>(name: Name, definition: DatasetColumnDefinition<OutputRow, Value> & { readonly runIf: (row: OutputRow, index: number) => boolean | Promise<boolean> }): DatasetBuilder<InputRow, OutputRow & Record<Name, Value | null>>;",
|
|
9955
10382
|
" withColumn<Name extends string, Value>(name: Name, definition: DatasetColumnDefinition<OutputRow, Value>): DatasetBuilder<InputRow, OutputRow & Record<Name, Value>>;",
|
|
9956
10383
|
" withColumn<Name extends string, Value>(name: Name, resolver: StepResolver<OutputRow, Value> | RunnableColumnStepProgram<Value>, options: StepOptions<OutputRow, Value>): DatasetBuilder<InputRow, OutputRow & Record<Name, Value | null>>;",
|
|
9957
|
-
" withColumns<
|
|
10384
|
+
" withColumns<ProgramOutput extends OutputRow, Return>(program: StepProgram<OutputRow, ProgramOutput, Return>): DatasetBuilder<InputRow, ProgramOutput>;",
|
|
9958
10385
|
" step<Name extends string, Value>(name: Name, resolver: ColumnResolver<OutputRow, Value>): never;",
|
|
9959
10386
|
" run(options?: DatasetRunOptions<InputRow>): Promise<PlayDataset<OutputRow>>;",
|
|
9960
10387
|
"};",
|
|
9961
|
-
"export type PlayReferenceLike = { readonly playName: string; readonly name?: string } | { readonly name: string; readonly playName?: string };",
|
|
10388
|
+
"export type PlayReferenceLike<TInput extends Record<string, unknown> = Record<string, unknown>> = ({ readonly playName: string; readonly name?: string } | { readonly name: string; readonly playName?: string }) & { readonly __inputType?: TInput };",
|
|
9962
10389
|
"export interface DeeplinePlayRuntimeContext {",
|
|
9963
10390
|
" csv<T = Record<string, unknown>>(path: string | CsvInput<T & object>, options?: CsvOptions): Promise<PlayDataset<T>>;",
|
|
9964
10391
|
" dataset<TSource extends PlayDatasetInput<object>>(key: string, items: TSource): DatasetBuilder<PlayDatasetRow<TSource> & object, PlayDatasetRow<TSource> & object>;",
|
|
@@ -9972,6 +10399,8 @@ var PLAY_AUTHORING_CLOUD_TYPE_DECLARATIONS = [
|
|
|
9972
10399
|
" fetch(key: string, url: string | URL, init?: RequestInit & { headers?: HeadersInit & { 'Idempotency-Key'?: string; 'X-Idempotency-Key'?: string }; auth?: SecretAuthInput }, options?: FetchOptions): Promise<PlayFetchResponse>;",
|
|
9973
10400
|
" secrets: { get(name: string): SecretPromise; bearer(secret: string | SecretPromise | SecretHandle): SecretAuth; header(header: string, secret: string | SecretPromise | SecretHandle): SecretAuth };",
|
|
9974
10401
|
` runPlay<TOutput = unknown>(key: string, playRef: ${cloudReferenceType("ctx.runPlay.playRef")}, input: ${cloudReferenceType("ctx.runPlay.input")}, options: PlayCallOptions): Promise<TOutput>;`,
|
|
10402
|
+
" runPlayAsync<TInput extends Record<string, unknown>>(key: string, playRef: PlayReferenceLike<TInput>, input: NoInfer<TInput>, options: PlayAsyncCallOptions): Promise<AsyncPlayRunRef>;",
|
|
10403
|
+
" runPlayAsync(key: string, playRef: string, input: Record<string, unknown>, options: PlayAsyncCallOptions): Promise<AsyncPlayRunRef>;",
|
|
9975
10404
|
" log(message: string, options?: { level?: 'debug' | 'info' | 'warn' | 'error' }): void;",
|
|
9976
10405
|
` sleep(ms: ${cloudReferenceType("ctx.sleep.ms")}): Promise<void>;`,
|
|
9977
10406
|
"}",
|