skedyul 1.4.4 → 1.4.7
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/cli/index.js +83 -16
- package/dist/config/app-config.d.ts +5 -0
- package/dist/config/types/app-event.d.ts +40 -0
- package/dist/config/types/index.d.ts +1 -0
- package/dist/dedicated/server.js +38 -2
- package/dist/esm/index.mjs +166 -65
- package/dist/events/types.d.ts +11 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +168 -65
- package/dist/ratelimit/errors.d.ts +6 -0
- package/dist/ratelimit/index.d.ts +1 -1
- package/dist/schemas/agent-schema-v3.d.ts +4 -0
- package/dist/schemas/agent-schema-v3.js +3 -1
- package/dist/schemas/agent-schema-v3.mjs +3 -1
- package/dist/schemas.d.ts +138 -0
- package/dist/server.js +38 -2
- package/dist/serverless/server.mjs +38 -2
- package/dist/triggers/types.d.ts +3 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/tool.d.ts +21 -2
- package/dist/workflows/types.d.ts +8 -0
- package/package.json +1 -1
package/dist/esm/index.mjs
CHANGED
|
@@ -391,7 +391,9 @@ var ThreadEventTypeSchema = z3.enum([
|
|
|
391
391
|
"thread.workflow.completed",
|
|
392
392
|
// Scheduled events
|
|
393
393
|
"thread.follow_up.due",
|
|
394
|
-
"thread.reminder.due"
|
|
394
|
+
"thread.reminder.due",
|
|
395
|
+
// Signal events
|
|
396
|
+
"thread.signal.created"
|
|
395
397
|
]);
|
|
396
398
|
var CustomEventTypeSchema = z3.string().regex(/^custom\.[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)*$/, {
|
|
397
399
|
message: "Custom event type must match pattern: custom.{namespace}.{event}"
|
|
@@ -1483,6 +1485,21 @@ var AlertComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
|
1483
1485
|
variant: z7.enum(["default", "destructive"]).optional()
|
|
1484
1486
|
})
|
|
1485
1487
|
});
|
|
1488
|
+
var EventWiringPanelComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1489
|
+
component: z7.literal("EventWiringPanel"),
|
|
1490
|
+
props: z7.object({
|
|
1491
|
+
eventTypes: z7.array(
|
|
1492
|
+
z7.object({
|
|
1493
|
+
type: z7.string(),
|
|
1494
|
+
label: z7.string(),
|
|
1495
|
+
glofoxType: z7.string().optional(),
|
|
1496
|
+
description: z7.string().optional(),
|
|
1497
|
+
icon: z7.string().optional()
|
|
1498
|
+
})
|
|
1499
|
+
),
|
|
1500
|
+
recommendedWorkflowHandle: z7.string().optional()
|
|
1501
|
+
})
|
|
1502
|
+
});
|
|
1486
1503
|
var ModalFormDefinitionSchema = z7.object({
|
|
1487
1504
|
header: PageFormHeaderSchema,
|
|
1488
1505
|
handler: z7.string(),
|
|
@@ -1523,7 +1540,8 @@ var FormV2ComponentDefinitionSchema = z7.discriminatedUnion("component", [
|
|
|
1523
1540
|
FileSettingComponentDefinitionSchema,
|
|
1524
1541
|
ListComponentDefinitionSchema,
|
|
1525
1542
|
EmptyFormComponentDefinitionSchema,
|
|
1526
|
-
AlertComponentDefinitionSchema
|
|
1543
|
+
AlertComponentDefinitionSchema,
|
|
1544
|
+
EventWiringPanelComponentDefinitionSchema
|
|
1527
1545
|
]);
|
|
1528
1546
|
var FormV2PropsDefinitionSchema = z7.object({
|
|
1529
1547
|
formVersion: z7.literal("v2"),
|
|
@@ -3353,6 +3371,57 @@ var AppAuthInvalidError = class extends Error {
|
|
|
3353
3371
|
}
|
|
3354
3372
|
};
|
|
3355
3373
|
|
|
3374
|
+
// src/ratelimit/errors.ts
|
|
3375
|
+
var QueueContextError = class extends Error {
|
|
3376
|
+
constructor(message) {
|
|
3377
|
+
super(message);
|
|
3378
|
+
this.code = "QUEUE_CONTEXT_ERROR";
|
|
3379
|
+
this.name = "QueueContextError";
|
|
3380
|
+
}
|
|
3381
|
+
};
|
|
3382
|
+
var QueueNotFoundError = class extends Error {
|
|
3383
|
+
constructor(queueName) {
|
|
3384
|
+
super(`Queue "${queueName}" is not defined in skedyul.config queues`);
|
|
3385
|
+
this.code = "QUEUE_NOT_FOUND";
|
|
3386
|
+
this.name = "QueueNotFoundError";
|
|
3387
|
+
}
|
|
3388
|
+
};
|
|
3389
|
+
var QueuedFetchExhaustedError = class extends Error {
|
|
3390
|
+
constructor(attempts, maxRetries, causeError) {
|
|
3391
|
+
super(
|
|
3392
|
+
`queuedFetch exhausted retries after ${attempts} attempts (maxRetries=${maxRetries})`
|
|
3393
|
+
);
|
|
3394
|
+
this.code = "QUEUED_FETCH_EXHAUSTED";
|
|
3395
|
+
this.name = "QueuedFetchExhaustedError";
|
|
3396
|
+
this.attempts = attempts;
|
|
3397
|
+
this.maxRetries = maxRetries;
|
|
3398
|
+
this.causeError = causeError;
|
|
3399
|
+
}
|
|
3400
|
+
};
|
|
3401
|
+
var RequeueOutsideContextError = class extends Error {
|
|
3402
|
+
constructor() {
|
|
3403
|
+
super("requeue() can only be called inside an active queuedFetch operation");
|
|
3404
|
+
this.code = "REQUEUE_OUTSIDE_CONTEXT";
|
|
3405
|
+
this.name = "RequeueOutsideContextError";
|
|
3406
|
+
}
|
|
3407
|
+
};
|
|
3408
|
+
var RateLimitBackendError = class extends Error {
|
|
3409
|
+
constructor(message, statusCode) {
|
|
3410
|
+
super(message);
|
|
3411
|
+
this.code = "RATE_LIMIT_BACKEND_ERROR";
|
|
3412
|
+
this.name = "RateLimitBackendError";
|
|
3413
|
+
this.statusCode = statusCode;
|
|
3414
|
+
}
|
|
3415
|
+
};
|
|
3416
|
+
var RateLimitExceededError = class extends Error {
|
|
3417
|
+
constructor(retryAfterMs, message = "Rate limit exceeded. Please try again later.") {
|
|
3418
|
+
super(message);
|
|
3419
|
+
this.code = "RATE_LIMITED";
|
|
3420
|
+
this.name = "RateLimitExceededError";
|
|
3421
|
+
this.retryAfterMs = retryAfterMs;
|
|
3422
|
+
}
|
|
3423
|
+
};
|
|
3424
|
+
|
|
3356
3425
|
// src/server/context-logger.ts
|
|
3357
3426
|
import { AsyncLocalStorage as AsyncLocalStorage3 } from "async_hooks";
|
|
3358
3427
|
var logContextStorage = new AsyncLocalStorage3();
|
|
@@ -3450,6 +3519,7 @@ function buildToolMetadata(registry) {
|
|
|
3450
3519
|
const rawRetries = tool.retries ?? toolConfig.retries;
|
|
3451
3520
|
const timeout = typeof rawTimeout === "number" && rawTimeout > 0 ? rawTimeout : 1e4;
|
|
3452
3521
|
const retries = typeof rawRetries === "number" && rawRetries >= 1 ? rawRetries : 1;
|
|
3522
|
+
const queueTouchPoints = tool.queueTouchPoints ?? toolConfig.queueTouchPoints;
|
|
3453
3523
|
return {
|
|
3454
3524
|
name: tool.name,
|
|
3455
3525
|
displayName: tool.label || tool.name,
|
|
@@ -3459,10 +3529,12 @@ function buildToolMetadata(registry) {
|
|
|
3459
3529
|
// Include timeout/retries at top-level for tools/list response (used by syncExecutableTools)
|
|
3460
3530
|
timeout,
|
|
3461
3531
|
retries,
|
|
3532
|
+
queueTouchPoints,
|
|
3462
3533
|
config: {
|
|
3463
3534
|
timeout,
|
|
3464
3535
|
retries,
|
|
3465
|
-
completionHints: toolConfig.completionHints
|
|
3536
|
+
completionHints: toolConfig.completionHints,
|
|
3537
|
+
queueTouchPoints
|
|
3466
3538
|
}
|
|
3467
3539
|
};
|
|
3468
3540
|
});
|
|
@@ -3605,6 +3677,27 @@ function createCallToolHandler(registry, state, onMaxRequests) {
|
|
|
3605
3677
|
cursor: functionResult.cursor
|
|
3606
3678
|
};
|
|
3607
3679
|
} catch (error) {
|
|
3680
|
+
if (error instanceof RateLimitExceededError) {
|
|
3681
|
+
return {
|
|
3682
|
+
success: false,
|
|
3683
|
+
output: null,
|
|
3684
|
+
billing: { credits: 0 },
|
|
3685
|
+
meta: {
|
|
3686
|
+
success: false,
|
|
3687
|
+
message: error.message,
|
|
3688
|
+
toolName
|
|
3689
|
+
},
|
|
3690
|
+
error: {
|
|
3691
|
+
code: "RATE_LIMITED",
|
|
3692
|
+
message: error.message,
|
|
3693
|
+
category: "external"
|
|
3694
|
+
},
|
|
3695
|
+
retry: {
|
|
3696
|
+
allowed: true,
|
|
3697
|
+
afterMs: error.retryAfterMs
|
|
3698
|
+
}
|
|
3699
|
+
};
|
|
3700
|
+
}
|
|
3608
3701
|
if (error instanceof AppAuthInvalidError) {
|
|
3609
3702
|
return {
|
|
3610
3703
|
output: null,
|
|
@@ -3968,7 +4061,8 @@ function serializeConfig(config) {
|
|
|
3968
4061
|
description: tool.description,
|
|
3969
4062
|
// Read timeout/retries from top-level first, then fallback to config
|
|
3970
4063
|
timeout: tool.timeout ?? tool.config?.timeout,
|
|
3971
|
-
retries: tool.retries ?? tool.config?.retries
|
|
4064
|
+
retries: tool.retries ?? tool.config?.retries,
|
|
4065
|
+
queueTouchPoints: tool.queueTouchPoints ?? tool.config?.queueTouchPoints
|
|
3972
4066
|
})) : [],
|
|
3973
4067
|
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
3974
4068
|
name: w.name,
|
|
@@ -3978,6 +4072,7 @@ function serializeConfig(config) {
|
|
|
3978
4072
|
})) : [],
|
|
3979
4073
|
provision: isProvisionConfig(config.provision) ? config.provision : void 0,
|
|
3980
4074
|
agents: config.agents,
|
|
4075
|
+
events: config.events,
|
|
3981
4076
|
queues: config.queues
|
|
3982
4077
|
};
|
|
3983
4078
|
}
|
|
@@ -5389,17 +5484,37 @@ var CONFIG_FILE_NAMES = [
|
|
|
5389
5484
|
"skedyul.config.mjs",
|
|
5390
5485
|
"skedyul.config.cjs"
|
|
5391
5486
|
];
|
|
5487
|
+
function loadTypeScriptConfigModule(absolutePath) {
|
|
5488
|
+
try {
|
|
5489
|
+
__require("tsx/cjs");
|
|
5490
|
+
delete __require.cache[absolutePath];
|
|
5491
|
+
const module = __require(absolutePath);
|
|
5492
|
+
return module.default ?? module;
|
|
5493
|
+
} catch (error) {
|
|
5494
|
+
throw new Error(
|
|
5495
|
+
`Cannot load TypeScript config: ${absolutePath}: ${error instanceof Error ? error.message : String(error)}`
|
|
5496
|
+
);
|
|
5497
|
+
}
|
|
5498
|
+
}
|
|
5392
5499
|
async function transpileTypeScript(filePath) {
|
|
5393
5500
|
const content = fs3.readFileSync(filePath, "utf-8");
|
|
5394
5501
|
const configDir = path3.dirname(path3.resolve(filePath));
|
|
5395
5502
|
let transpiled = content.replace(/import\s+type\s+\{[^}]+\}\s+from\s+['"][^'"]+['"]\s*;?\n?/g, "").replace(/import\s+\{\s*defineConfig\s*\}\s+from\s+['"]skedyul['"]\s*;?\n?/g, "").replace(/:\s*SkedyulConfig/g, "").replace(/export\s+default\s+/, "module.exports = ").replace(/defineConfig\s*\(\s*\{/, "{").replace(/\}\s*\)\s*;?\s*$/, "}");
|
|
5396
5503
|
transpiled = transpiled.replace(
|
|
5397
5504
|
/import\s+(\w+)\s+from\s+['"](\.[^'"]+)['"]\s*(?:with\s*\{[^}]*\})?/g,
|
|
5398
|
-
(
|
|
5505
|
+
(_match, varName, relativePath) => {
|
|
5399
5506
|
const absolutePath = path3.resolve(configDir, relativePath);
|
|
5400
5507
|
return `const ${varName} = require('${absolutePath.replace(/\\/g, "/")}')`;
|
|
5401
5508
|
}
|
|
5402
5509
|
);
|
|
5510
|
+
transpiled = transpiled.replace(
|
|
5511
|
+
/import\s+\{\s*([^}]+)\s*\}\s+from\s+['"](\.[^'"]+)['"]\s*;?\n?/g,
|
|
5512
|
+
(_match, namedImports, relativePath) => {
|
|
5513
|
+
const absolutePath = path3.resolve(configDir, relativePath);
|
|
5514
|
+
return `const { ${namedImports.trim()} } = require('${absolutePath.replace(/\\/g, "/")}')
|
|
5515
|
+
`;
|
|
5516
|
+
}
|
|
5517
|
+
);
|
|
5403
5518
|
transpiled = transpiled.replace(/import\s*\(\s*['"][^'"]+['"]\s*\)/g, "null");
|
|
5404
5519
|
return transpiled;
|
|
5405
5520
|
}
|
|
@@ -5410,16 +5525,9 @@ async function loadConfig(configPath) {
|
|
|
5410
5525
|
}
|
|
5411
5526
|
const isTypeScript = absolutePath.endsWith(".ts");
|
|
5412
5527
|
try {
|
|
5413
|
-
let moduleToLoad = absolutePath;
|
|
5414
5528
|
if (isTypeScript) {
|
|
5415
|
-
const transpiled = await transpileTypeScript(absolutePath);
|
|
5416
|
-
const tempDir = os.tmpdir();
|
|
5417
|
-
const tempFile = path3.join(tempDir, `skedyul-config-${Date.now()}.cjs`);
|
|
5418
|
-
fs3.writeFileSync(tempFile, transpiled);
|
|
5419
|
-
moduleToLoad = tempFile;
|
|
5420
5529
|
try {
|
|
5421
|
-
const
|
|
5422
|
-
const config2 = module2.default || module2;
|
|
5530
|
+
const config2 = loadTypeScriptConfigModule(absolutePath);
|
|
5423
5531
|
if (!config2 || typeof config2 !== "object") {
|
|
5424
5532
|
throw new Error("Config file must export a configuration object");
|
|
5425
5533
|
}
|
|
@@ -5427,16 +5535,31 @@ async function loadConfig(configPath) {
|
|
|
5427
5535
|
throw new Error('Config must have a "name" property');
|
|
5428
5536
|
}
|
|
5429
5537
|
return config2;
|
|
5430
|
-
}
|
|
5538
|
+
} catch (tsxError) {
|
|
5539
|
+
const transpiled = await transpileTypeScript(absolutePath);
|
|
5540
|
+
const tempFile = path3.join(os.tmpdir(), `skedyul-config-${Date.now()}.cjs`);
|
|
5541
|
+
fs3.writeFileSync(tempFile, transpiled);
|
|
5431
5542
|
try {
|
|
5432
|
-
|
|
5433
|
-
|
|
5543
|
+
const module2 = __require(tempFile);
|
|
5544
|
+
const config2 = module2.default || module2;
|
|
5545
|
+
if (!config2 || typeof config2 !== "object") {
|
|
5546
|
+
throw new Error("Config file must export a configuration object");
|
|
5547
|
+
}
|
|
5548
|
+
if (!config2.name || typeof config2.name !== "string") {
|
|
5549
|
+
throw new Error('Config must have a "name" property');
|
|
5550
|
+
}
|
|
5551
|
+
return config2;
|
|
5552
|
+
} finally {
|
|
5553
|
+
try {
|
|
5554
|
+
fs3.unlinkSync(tempFile);
|
|
5555
|
+
} catch {
|
|
5556
|
+
}
|
|
5434
5557
|
}
|
|
5435
5558
|
}
|
|
5436
5559
|
}
|
|
5437
5560
|
const module = await import(
|
|
5438
5561
|
/* webpackIgnore: true */
|
|
5439
|
-
|
|
5562
|
+
absolutePath
|
|
5440
5563
|
);
|
|
5441
5564
|
const config = module.default || module;
|
|
5442
5565
|
if (!config || typeof config !== "object") {
|
|
@@ -5487,49 +5610,6 @@ function getRequiredInstallEnvKeys(config) {
|
|
|
5487
5610
|
return Object.entries(provision.env).filter(([, def]) => def.required).map(([key]) => key);
|
|
5488
5611
|
}
|
|
5489
5612
|
|
|
5490
|
-
// src/ratelimit/errors.ts
|
|
5491
|
-
var QueueContextError = class extends Error {
|
|
5492
|
-
constructor(message) {
|
|
5493
|
-
super(message);
|
|
5494
|
-
this.code = "QUEUE_CONTEXT_ERROR";
|
|
5495
|
-
this.name = "QueueContextError";
|
|
5496
|
-
}
|
|
5497
|
-
};
|
|
5498
|
-
var QueueNotFoundError = class extends Error {
|
|
5499
|
-
constructor(queueName) {
|
|
5500
|
-
super(`Queue "${queueName}" is not defined in skedyul.config queues`);
|
|
5501
|
-
this.code = "QUEUE_NOT_FOUND";
|
|
5502
|
-
this.name = "QueueNotFoundError";
|
|
5503
|
-
}
|
|
5504
|
-
};
|
|
5505
|
-
var QueuedFetchExhaustedError = class extends Error {
|
|
5506
|
-
constructor(attempts, maxRetries, causeError) {
|
|
5507
|
-
super(
|
|
5508
|
-
`queuedFetch exhausted retries after ${attempts} attempts (maxRetries=${maxRetries})`
|
|
5509
|
-
);
|
|
5510
|
-
this.code = "QUEUED_FETCH_EXHAUSTED";
|
|
5511
|
-
this.name = "QueuedFetchExhaustedError";
|
|
5512
|
-
this.attempts = attempts;
|
|
5513
|
-
this.maxRetries = maxRetries;
|
|
5514
|
-
this.causeError = causeError;
|
|
5515
|
-
}
|
|
5516
|
-
};
|
|
5517
|
-
var RequeueOutsideContextError = class extends Error {
|
|
5518
|
-
constructor() {
|
|
5519
|
-
super("requeue() can only be called inside an active queuedFetch operation");
|
|
5520
|
-
this.code = "REQUEUE_OUTSIDE_CONTEXT";
|
|
5521
|
-
this.name = "RequeueOutsideContextError";
|
|
5522
|
-
}
|
|
5523
|
-
};
|
|
5524
|
-
var RateLimitBackendError = class extends Error {
|
|
5525
|
-
constructor(message, statusCode) {
|
|
5526
|
-
super(message);
|
|
5527
|
-
this.code = "RATE_LIMIT_BACKEND_ERROR";
|
|
5528
|
-
this.name = "RateLimitBackendError";
|
|
5529
|
-
this.statusCode = statusCode;
|
|
5530
|
-
}
|
|
5531
|
-
};
|
|
5532
|
-
|
|
5533
5613
|
// src/ratelimit/resolve-queue-key.ts
|
|
5534
5614
|
function resolveEndpointHandle(config, invocation) {
|
|
5535
5615
|
if (config.endpoint) {
|
|
@@ -5973,11 +6053,30 @@ async function executeWithRetries(operation, maxRetries) {
|
|
|
5973
6053
|
const timeoutMs = operation.resolved.config.timeout ?? 12e4;
|
|
5974
6054
|
const retryDelayMs = operation.resolved.config.retryDelayMs ?? 1e3;
|
|
5975
6055
|
const shouldRetryFn = getQueueConfigWithRetry(operation.resolved.name)?.shouldRetry ?? defaultShouldRetry;
|
|
5976
|
-
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
|
|
5980
|
-
|
|
6056
|
+
let lease;
|
|
6057
|
+
try {
|
|
6058
|
+
lease = await backend.acquire(
|
|
6059
|
+
operation.resolved.queueKey,
|
|
6060
|
+
operation.resolved.limits,
|
|
6061
|
+
timeoutMs
|
|
6062
|
+
);
|
|
6063
|
+
} catch (acquireError) {
|
|
6064
|
+
if (acquireError instanceof RateLimitBackendError && acquireError.statusCode === 408) {
|
|
6065
|
+
const retryAfterMs = Math.max(
|
|
6066
|
+
operation.resolved.limits.minTime ?? 1e3,
|
|
6067
|
+
operation.resolved.config.retryDelayMs ?? 1e3
|
|
6068
|
+
);
|
|
6069
|
+
throw new RateLimitExceededError(retryAfterMs);
|
|
6070
|
+
}
|
|
6071
|
+
if (acquireError instanceof Error && acquireError.message.includes("timed out")) {
|
|
6072
|
+
const retryAfterMs = Math.max(
|
|
6073
|
+
operation.resolved.limits.minTime ?? 1e3,
|
|
6074
|
+
operation.resolved.config.retryDelayMs ?? 1e3
|
|
6075
|
+
);
|
|
6076
|
+
throw new RateLimitExceededError(retryAfterMs);
|
|
6077
|
+
}
|
|
6078
|
+
throw acquireError;
|
|
6079
|
+
}
|
|
5981
6080
|
operation.lease = lease;
|
|
5982
6081
|
setActiveQueuedOperationLease(lease);
|
|
5983
6082
|
try {
|
|
@@ -7463,6 +7562,7 @@ export {
|
|
|
7463
7562
|
EventSubscriptionSchema,
|
|
7464
7563
|
EventTypeSchema,
|
|
7465
7564
|
EventWaitSchema,
|
|
7565
|
+
EventWiringPanelComponentDefinitionSchema,
|
|
7466
7566
|
EventsConfigSchema,
|
|
7467
7567
|
ExternalDataCacheSchema,
|
|
7468
7568
|
ExternalMemoryConfigSchema2 as ExternalMemoryConfigSchema,
|
|
@@ -7547,6 +7647,7 @@ export {
|
|
|
7547
7647
|
QueueNotFoundError,
|
|
7548
7648
|
QueuedFetchExhaustedError,
|
|
7549
7649
|
RateLimitBackendError,
|
|
7650
|
+
RateLimitExceededError,
|
|
7550
7651
|
RelationshipCardinalitySchema,
|
|
7551
7652
|
RelationshipDefinitionSchema,
|
|
7552
7653
|
RelationshipExtensionSchema,
|
package/dist/events/types.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export declare const ThreadEventTypeSchema: z.ZodEnum<{
|
|
|
17
17
|
"thread.workflow.completed": "thread.workflow.completed";
|
|
18
18
|
"thread.follow_up.due": "thread.follow_up.due";
|
|
19
19
|
"thread.reminder.due": "thread.reminder.due";
|
|
20
|
+
"thread.signal.created": "thread.signal.created";
|
|
20
21
|
}>;
|
|
21
22
|
export type ThreadEventType = z.infer<typeof ThreadEventTypeSchema>;
|
|
22
23
|
/**
|
|
@@ -42,6 +43,7 @@ export declare const EventTypeSchema: z.ZodUnion<readonly [z.ZodEnum<{
|
|
|
42
43
|
"thread.workflow.completed": "thread.workflow.completed";
|
|
43
44
|
"thread.follow_up.due": "thread.follow_up.due";
|
|
44
45
|
"thread.reminder.due": "thread.reminder.due";
|
|
46
|
+
"thread.signal.created": "thread.signal.created";
|
|
45
47
|
}>, z.ZodString]>;
|
|
46
48
|
export type EventType = z.infer<typeof EventTypeSchema>;
|
|
47
49
|
/**
|
|
@@ -283,6 +285,7 @@ export declare const ThreadEventSchema: z.ZodObject<{
|
|
|
283
285
|
"thread.workflow.completed": "thread.workflow.completed";
|
|
284
286
|
"thread.follow_up.due": "thread.follow_up.due";
|
|
285
287
|
"thread.reminder.due": "thread.reminder.due";
|
|
288
|
+
"thread.signal.created": "thread.signal.created";
|
|
286
289
|
}>, z.ZodString]>;
|
|
287
290
|
payload: z.ZodUnion<readonly [z.ZodObject<{
|
|
288
291
|
threadId: z.ZodString;
|
|
@@ -388,6 +391,7 @@ export declare const CreateThreadEventInputSchema: z.ZodObject<{
|
|
|
388
391
|
"thread.workflow.completed": "thread.workflow.completed";
|
|
389
392
|
"thread.follow_up.due": "thread.follow_up.due";
|
|
390
393
|
"thread.reminder.due": "thread.reminder.due";
|
|
394
|
+
"thread.signal.created": "thread.signal.created";
|
|
391
395
|
}>, z.ZodString]>;
|
|
392
396
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
393
397
|
emittedBy: z.ZodOptional<z.ZodString>;
|
|
@@ -411,6 +415,7 @@ export declare const EventSubscriptionSchema: z.ZodObject<{
|
|
|
411
415
|
"thread.workflow.completed": "thread.workflow.completed";
|
|
412
416
|
"thread.follow_up.due": "thread.follow_up.due";
|
|
413
417
|
"thread.reminder.due": "thread.reminder.due";
|
|
418
|
+
"thread.signal.created": "thread.signal.created";
|
|
414
419
|
}>, z.ZodString]>>;
|
|
415
420
|
condition: z.ZodOptional<z.ZodString>;
|
|
416
421
|
cancels: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
@@ -427,6 +432,7 @@ export declare const EventSubscriptionSchema: z.ZodObject<{
|
|
|
427
432
|
"thread.workflow.completed": "thread.workflow.completed";
|
|
428
433
|
"thread.follow_up.due": "thread.follow_up.due";
|
|
429
434
|
"thread.reminder.due": "thread.reminder.due";
|
|
435
|
+
"thread.signal.created": "thread.signal.created";
|
|
430
436
|
}>, z.ZodString]>>>;
|
|
431
437
|
cancelCondition: z.ZodOptional<z.ZodString>;
|
|
432
438
|
}, z.core.$strip>;
|
|
@@ -449,6 +455,7 @@ export declare const EventWaitSchema: z.ZodObject<{
|
|
|
449
455
|
"thread.workflow.completed": "thread.workflow.completed";
|
|
450
456
|
"thread.follow_up.due": "thread.follow_up.due";
|
|
451
457
|
"thread.reminder.due": "thread.reminder.due";
|
|
458
|
+
"thread.signal.created": "thread.signal.created";
|
|
452
459
|
}>, z.ZodString]>;
|
|
453
460
|
timeout: z.ZodOptional<z.ZodString>;
|
|
454
461
|
onTimeout: z.ZodOptional<z.ZodString>;
|
|
@@ -472,6 +479,7 @@ export declare const EventsConfigSchema: z.ZodObject<{
|
|
|
472
479
|
"thread.workflow.completed": "thread.workflow.completed";
|
|
473
480
|
"thread.follow_up.due": "thread.follow_up.due";
|
|
474
481
|
"thread.reminder.due": "thread.reminder.due";
|
|
482
|
+
"thread.signal.created": "thread.signal.created";
|
|
475
483
|
}>, z.ZodString]>>>;
|
|
476
484
|
condition: z.ZodOptional<z.ZodString>;
|
|
477
485
|
emits: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
@@ -488,6 +496,7 @@ export declare const EventsConfigSchema: z.ZodObject<{
|
|
|
488
496
|
"thread.workflow.completed": "thread.workflow.completed";
|
|
489
497
|
"thread.follow_up.due": "thread.follow_up.due";
|
|
490
498
|
"thread.reminder.due": "thread.reminder.due";
|
|
499
|
+
"thread.signal.created": "thread.signal.created";
|
|
491
500
|
}>, z.ZodString]>>>;
|
|
492
501
|
waits: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
493
502
|
event: z.ZodUnion<readonly [z.ZodEnum<{
|
|
@@ -504,6 +513,7 @@ export declare const EventsConfigSchema: z.ZodObject<{
|
|
|
504
513
|
"thread.workflow.completed": "thread.workflow.completed";
|
|
505
514
|
"thread.follow_up.due": "thread.follow_up.due";
|
|
506
515
|
"thread.reminder.due": "thread.reminder.due";
|
|
516
|
+
"thread.signal.created": "thread.signal.created";
|
|
507
517
|
}>, z.ZodString]>;
|
|
508
518
|
timeout: z.ZodOptional<z.ZodString>;
|
|
509
519
|
onTimeout: z.ZodOptional<z.ZodString>;
|
|
@@ -522,6 +532,7 @@ export declare const EventsConfigSchema: z.ZodObject<{
|
|
|
522
532
|
"thread.workflow.completed": "thread.workflow.completed";
|
|
523
533
|
"thread.follow_up.due": "thread.follow_up.due";
|
|
524
534
|
"thread.reminder.due": "thread.reminder.due";
|
|
535
|
+
"thread.signal.created": "thread.signal.created";
|
|
525
536
|
}>, z.ZodString]>>>;
|
|
526
537
|
cancelCondition: z.ZodOptional<z.ZodString>;
|
|
527
538
|
}, z.core.$strip>;
|
package/dist/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ declare const _default: {
|
|
|
15
15
|
};
|
|
16
16
|
export default _default;
|
|
17
17
|
export { defineConfig, defineModel, defineChannel, definePage, defineWorkflow, defineAgent, defineEnv, defineNavigation, loadConfig, validateConfig, CONFIG_FILE_NAMES, getAllEnvKeys, getRequiredInstallEnvKeys, } from './config';
|
|
18
|
-
export { queuedFetch, requeue, resolveQueue, createQueueHandle, queuedFetchResponse, registerQueueConfig, runWithRateLimitExecutionContext, getRateLimitExecutionContext, defaultShouldRetry, QueueContextError, QueueNotFoundError, QueuedFetchExhaustedError, RequeueOutsideContextError, RateLimitBackendError, } from './ratelimit';
|
|
18
|
+
export { queuedFetch, requeue, resolveQueue, createQueueHandle, queuedFetchResponse, registerQueueConfig, runWithRateLimitExecutionContext, getRateLimitExecutionContext, defaultShouldRetry, QueueContextError, QueueNotFoundError, QueuedFetchExhaustedError, RequeueOutsideContextError, RateLimitBackendError, RateLimitExceededError, } from './ratelimit';
|
|
19
19
|
export type { QueueInput, QueueSelector, Lease, QueueLimits, ResolvedQueue, RateLimitExecutionContext, RateLimitBackend, QueueScope, QueueConfig, SerializableQueueConfig, QueueRegistry, } from './ratelimit';
|
|
20
20
|
export { defineSchema, validateCRMSchema, parseCRMSchema, safeParseCRMSchema, } from './schemas';
|
|
21
21
|
export { ThreadEventTypeSchema, CustomEventTypeSchema, EventTypeSchema, ParticipantKindSchema, BaseEventPayloadSchema, MessageEventPayloadSchema, ParticipantEventPayloadSchema, ContextChangedPayloadSchema, StatusChangedPayloadSchema, ScheduledEventPayloadSchema, AgentWorkflowEventPayloadSchema, CustomEventPayloadSchema, ThreadEventPayloadSchema, ThreadEventSchema, CreateThreadEventInputSchema, EventSubscriptionSchema, EventWaitSchema, EventsConfigSchema, } from './events';
|