deepline 0.2.39 → 0.2.41
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 +147 -7
- package/dist/bundling-sources/sdk/src/http.ts +8 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +42 -0
- package/dist/bundling-sources/shared_libs/integrations/theirstack-execution-policy.ts +21 -0
- package/dist/bundling-sources/shared_libs/play-runtime/receipt-sql.ts +11 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +6 -3
- package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-state-machine.ts +16 -0
- package/dist/bundling-sources/shared_libs/product-notifications/contract.ts +134 -0
- package/dist/cli/index.js +759 -4
- package/dist/cli/index.mjs +759 -4
- package/dist/index.d.mts +133 -0
- package/dist/index.d.ts +133 -0
- package/dist/index.js +160 -4
- package/dist/index.mjs +160 -4
- package/dist/install-integrity.json +1 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -689,7 +689,7 @@ var SDK_RELEASE = {
|
|
|
689
689
|
// 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
|
|
690
690
|
// exposed storage-dependent synchronous access. This deliberate minor
|
|
691
691
|
// release keeps lazy paging semantics independent of row residency.
|
|
692
|
-
version: "0.2.
|
|
692
|
+
version: "0.2.41",
|
|
693
693
|
contracts: {
|
|
694
694
|
api: {
|
|
695
695
|
name: "sdk-http-api",
|
|
@@ -1317,6 +1317,9 @@ var HttpClient = class {
|
|
|
1317
1317
|
headers
|
|
1318
1318
|
});
|
|
1319
1319
|
}
|
|
1320
|
+
async put(path, body, headers) {
|
|
1321
|
+
return this.request(path, { method: "PUT", body, headers });
|
|
1322
|
+
}
|
|
1320
1323
|
/**
|
|
1321
1324
|
* Send a DELETE request.
|
|
1322
1325
|
*
|
|
@@ -1467,6 +1470,61 @@ function withCoworkNetworkHint(message) {
|
|
|
1467
1470
|
${COWORK_NETWORK_HINT}`;
|
|
1468
1471
|
}
|
|
1469
1472
|
|
|
1473
|
+
// ../shared_libs/product-notifications/contract.ts
|
|
1474
|
+
var PRODUCT_NOTIFICATION_EVENT_CATALOG = [
|
|
1475
|
+
{
|
|
1476
|
+
id: "play.cron.succeeded",
|
|
1477
|
+
label: "Cron success",
|
|
1478
|
+
description: "A scheduled Play run completed successfully.",
|
|
1479
|
+
source: "cron",
|
|
1480
|
+
outcome: "succeeded",
|
|
1481
|
+
defaultEnabled: true
|
|
1482
|
+
},
|
|
1483
|
+
{
|
|
1484
|
+
id: "play.cron.failed",
|
|
1485
|
+
label: "Cron failure",
|
|
1486
|
+
description: "A scheduled Play could not start or its run reached a failed terminal state.",
|
|
1487
|
+
source: "cron",
|
|
1488
|
+
outcome: "failed",
|
|
1489
|
+
defaultEnabled: true
|
|
1490
|
+
},
|
|
1491
|
+
{
|
|
1492
|
+
id: "play.webhook.succeeded",
|
|
1493
|
+
label: "Webhook success",
|
|
1494
|
+
description: "An accepted webhook-triggered Play completed successfully.",
|
|
1495
|
+
source: "webhook",
|
|
1496
|
+
outcome: "succeeded",
|
|
1497
|
+
defaultEnabled: true
|
|
1498
|
+
},
|
|
1499
|
+
{
|
|
1500
|
+
id: "play.webhook.failed",
|
|
1501
|
+
label: "Webhook failure",
|
|
1502
|
+
description: "An accepted webhook-triggered Play reached a failed terminal state.",
|
|
1503
|
+
source: "webhook",
|
|
1504
|
+
outcome: "failed",
|
|
1505
|
+
defaultEnabled: true
|
|
1506
|
+
}
|
|
1507
|
+
];
|
|
1508
|
+
var PRODUCT_NOTIFICATION_EVENT_TYPE_SET = new Set(
|
|
1509
|
+
PRODUCT_NOTIFICATION_EVENT_CATALOG.map((event) => event.id)
|
|
1510
|
+
);
|
|
1511
|
+
var PRODUCT_NOTIFICATION_SLACK_OAUTH_SCOPES = [
|
|
1512
|
+
"channels:read",
|
|
1513
|
+
"chat:write",
|
|
1514
|
+
"groups:read"
|
|
1515
|
+
];
|
|
1516
|
+
var PRODUCT_NOTIFICATION_RETRY_DELAYS_MS = [
|
|
1517
|
+
0,
|
|
1518
|
+
6e4,
|
|
1519
|
+
5 * 6e4,
|
|
1520
|
+
15 * 6e4,
|
|
1521
|
+
60 * 6e4
|
|
1522
|
+
];
|
|
1523
|
+
var PRODUCT_NOTIFICATION_MAX_ATTEMPTS = PRODUCT_NOTIFICATION_RETRY_DELAYS_MS.length;
|
|
1524
|
+
var PRODUCT_NOTIFICATION_DELIVERY_LEASE_MS = 2 * 6e4;
|
|
1525
|
+
var PRODUCT_NOTIFICATION_SUCCESS_TTL_MS = 15 * 6e4;
|
|
1526
|
+
var PRODUCT_NOTIFICATION_FAILURE_TTL_MS = 24 * 60 * 6e4;
|
|
1527
|
+
|
|
1470
1528
|
// src/stream-reconnect.ts
|
|
1471
1529
|
var STREAM_RECONNECT_BASE_DELAY_MS = 500;
|
|
1472
1530
|
var STREAM_RECONNECT_MAX_DELAY_MS = 15e3;
|
|
@@ -2859,6 +2917,7 @@ async function* observeRunEvents(options) {
|
|
|
2859
2917
|
// ../shared_libs/integrations/theirstack-execution-policy.ts
|
|
2860
2918
|
var THEIRSTACK_SLOW_JOB_SEARCH_PROVIDER_TIMEOUT_MS = 135e3;
|
|
2861
2919
|
var THEIRSTACK_SLOW_JOB_SEARCH_CLIENT_TIMEOUT_MS = 6e4 + THEIRSTACK_SLOW_JOB_SEARCH_PROVIDER_TIMEOUT_MS + 15e3;
|
|
2920
|
+
var THEIRSTACK_COMPANY_SEARCH_CLIENT_TIMEOUT_MS = 21e4;
|
|
2862
2921
|
var LONG_JOB_SEARCH_WINDOW_MS = 365 * 24 * 60 * 60 * 1e3;
|
|
2863
2922
|
var DATE_ONLY_PATTERN = /^\d{4}-\d{2}-\d{2}$/;
|
|
2864
2923
|
function parseDateOnly(value) {
|
|
@@ -2902,6 +2961,12 @@ function usesExtendedTheirstackJobSearchBudget(endpointId, payload) {
|
|
|
2902
2961
|
const maxAgeDays = parseMaxAgeDays(payload.posted_at_max_age_days);
|
|
2903
2962
|
return maxAgeDays !== null && maxAgeDays >= 365 ? true : usesLongExplicitDateWindow(payload);
|
|
2904
2963
|
}
|
|
2964
|
+
function resolveTheirstackClientTimeoutMs(endpointId, payload) {
|
|
2965
|
+
if (endpointId === "theirstack_company_search") {
|
|
2966
|
+
return THEIRSTACK_COMPANY_SEARCH_CLIENT_TIMEOUT_MS;
|
|
2967
|
+
}
|
|
2968
|
+
return usesExtendedTheirstackJobSearchBudget(endpointId, payload) ? THEIRSTACK_SLOW_JOB_SEARCH_CLIENT_TIMEOUT_MS : null;
|
|
2969
|
+
}
|
|
2905
2970
|
|
|
2906
2971
|
// ../shared_libs/play-runtime/backend.ts
|
|
2907
2972
|
var PLAY_RUNTIME_BACKENDS = {
|
|
@@ -3148,9 +3213,11 @@ function resolveToolExecuteTimeoutMs(toolId, input) {
|
|
|
3148
3213
|
return Math.floor(requestedTimeoutMs) + APIFY_SYNC_RESPONSE_GRACE_MS;
|
|
3149
3214
|
}
|
|
3150
3215
|
}
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3216
|
+
const theirstackTimeoutMs = resolveTheirstackClientTimeoutMs(
|
|
3217
|
+
normalized,
|
|
3218
|
+
input
|
|
3219
|
+
);
|
|
3220
|
+
if (theirstackTimeoutMs !== null) return theirstackTimeoutMs;
|
|
3154
3221
|
return normalized === "deeplineagent" || normalized === "deeplineagent_deeplineagent" || normalized === "ai_inference" || normalized === "deeplineagent_ai_inference" || normalized === "aiinference" ? DEEPLINEAGENT_EXECUTE_TIMEOUT_MS : void 0;
|
|
3155
3222
|
}
|
|
3156
3223
|
var RUNS_FAILED_LOG_LIMIT = 20;
|
|
@@ -5023,6 +5090,95 @@ var DeeplineClient = class {
|
|
|
5023
5090
|
);
|
|
5024
5091
|
return response.plays ?? [];
|
|
5025
5092
|
}
|
|
5093
|
+
/** Read product-notification destinations, subscriptions, event catalog, and DLQ health. */
|
|
5094
|
+
async getNotificationSettings() {
|
|
5095
|
+
return this.http.get("/api/v2/settings/notifications");
|
|
5096
|
+
}
|
|
5097
|
+
/** Start the Slack OAuth flow required by product notifications. */
|
|
5098
|
+
async connectNotificationSlack(options) {
|
|
5099
|
+
return this.http.post("/api/v2/integrations/connect", {
|
|
5100
|
+
provider: "slack",
|
|
5101
|
+
scopes: [...PRODUCT_NOTIFICATION_SLACK_OAUTH_SCOPES],
|
|
5102
|
+
...options?.successUrl ? { success_url: options.successUrl } : {},
|
|
5103
|
+
...options?.failureUrl ? { failure_url: options.failureUrl } : {}
|
|
5104
|
+
});
|
|
5105
|
+
}
|
|
5106
|
+
/** List Slack channels visible to the connected Deepline Slack app. */
|
|
5107
|
+
async listNotificationSlackChannels(query) {
|
|
5108
|
+
const suffix = query ? `?query=${encodeURIComponent(query)}` : "";
|
|
5109
|
+
return this.http.get(`/api/v2/settings/notifications/channels${suffix}`);
|
|
5110
|
+
}
|
|
5111
|
+
/** Select the Slack channel used for product notifications. */
|
|
5112
|
+
async setNotificationSlack(channel) {
|
|
5113
|
+
return this.http.put("/api/v2/settings/notifications", { channel });
|
|
5114
|
+
}
|
|
5115
|
+
/** Send one synchronous test ping and return Slack's delivery result. */
|
|
5116
|
+
async testNotificationSlack() {
|
|
5117
|
+
return this.http.post("/api/v2/settings/notifications/test", {});
|
|
5118
|
+
}
|
|
5119
|
+
/** Disable Slack product notifications without deleting the OAuth connection. */
|
|
5120
|
+
async disableNotificationSlack() {
|
|
5121
|
+
return this.http.delete("/api/v2/settings/notifications");
|
|
5122
|
+
}
|
|
5123
|
+
/** Enable or disable event IDs from the server-provided notification catalog. */
|
|
5124
|
+
async setNotificationSubscriptions(eventTypes, enabled) {
|
|
5125
|
+
return this.http.patch("/api/v2/settings/notifications/subscriptions", {
|
|
5126
|
+
eventTypes,
|
|
5127
|
+
enabled
|
|
5128
|
+
});
|
|
5129
|
+
}
|
|
5130
|
+
/** List exhausted deliveries. Dead-lettered messages never replay automatically. */
|
|
5131
|
+
async listNotificationDlq(limit = 25) {
|
|
5132
|
+
return this.http.get(
|
|
5133
|
+
`/api/v2/settings/notifications/dlq?limit=${encodeURIComponent(String(limit))}`
|
|
5134
|
+
);
|
|
5135
|
+
}
|
|
5136
|
+
/** Inspect one exhausted notification delivery. */
|
|
5137
|
+
async getNotificationDlqDelivery(deliveryId) {
|
|
5138
|
+
return this.http.get(
|
|
5139
|
+
`/api/v2/settings/notifications/dlq/${encodeURIComponent(deliveryId)}`
|
|
5140
|
+
);
|
|
5141
|
+
}
|
|
5142
|
+
/** Explicitly retry or archive one dead-lettered notification delivery. */
|
|
5143
|
+
async updateNotificationDlqDelivery(deliveryId, action) {
|
|
5144
|
+
return this.http.post(
|
|
5145
|
+
`/api/v2/settings/notifications/dlq/${encodeURIComponent(deliveryId)}`,
|
|
5146
|
+
{ action }
|
|
5147
|
+
);
|
|
5148
|
+
}
|
|
5149
|
+
/** List the workspace's named notification rules. */
|
|
5150
|
+
async getNotifications() {
|
|
5151
|
+
return this.http.get("/api/v2/notifications");
|
|
5152
|
+
}
|
|
5153
|
+
/** List Slack channels available to an already-connected Slack integration. */
|
|
5154
|
+
async listNotificationChannels(query) {
|
|
5155
|
+
const suffix = query ? `?search=${encodeURIComponent(query)}` : "";
|
|
5156
|
+
return this.http.get(`/api/v2/notifications/slack/channels${suffix}`);
|
|
5157
|
+
}
|
|
5158
|
+
/** Create a named notification routed through an existing provider integration. */
|
|
5159
|
+
async createNotification(input) {
|
|
5160
|
+
return this.http.post("/api/v2/notifications", input);
|
|
5161
|
+
}
|
|
5162
|
+
/** Update a notification's target, event selection, or enabled state. */
|
|
5163
|
+
async updateNotification(notificationId, input) {
|
|
5164
|
+
return this.http.patch(
|
|
5165
|
+
`/api/v2/notifications/${encodeURIComponent(notificationId)}`,
|
|
5166
|
+
input
|
|
5167
|
+
);
|
|
5168
|
+
}
|
|
5169
|
+
/** Send a validation ping to one notification. */
|
|
5170
|
+
async testNotification(notificationId) {
|
|
5171
|
+
return this.http.post(
|
|
5172
|
+
`/api/v2/notifications/${encodeURIComponent(notificationId)}/test`,
|
|
5173
|
+
{}
|
|
5174
|
+
);
|
|
5175
|
+
}
|
|
5176
|
+
/** Archive one notification without touching its provider integration. */
|
|
5177
|
+
async deleteNotification(notificationId) {
|
|
5178
|
+
return this.http.delete(
|
|
5179
|
+
`/api/v2/notifications/${encodeURIComponent(notificationId)}`
|
|
5180
|
+
);
|
|
5181
|
+
}
|
|
5026
5182
|
/**
|
|
5027
5183
|
* Search callable plays and return compact play descriptions.
|
|
5028
5184
|
*
|
|
@@ -202,6 +202,7 @@
|
|
|
202
202
|
"dist/bundling-sources/shared_libs/plays/static-pipeline.ts",
|
|
203
203
|
"dist/bundling-sources/shared_libs/plays/tool-category-descriptions.ts",
|
|
204
204
|
"dist/bundling-sources/shared_libs/plays/tool-codegen.ts",
|
|
205
|
+
"dist/bundling-sources/shared_libs/product-notifications/contract.ts",
|
|
205
206
|
"dist/bundling-sources/shared_libs/runtime-env.ts",
|
|
206
207
|
"dist/bundling-sources/shared_libs/security/outbound-url-policy.ts",
|
|
207
208
|
"dist/bundling-sources/shared_libs/security/safe-fetch.ts",
|