skedyul 1.5.2 → 1.5.10

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.
@@ -4,7 +4,9 @@ export declare function getRateLimitExecutionContext(): RateLimitExecutionContex
4
4
  export declare function runWithActiveQueuedOperation<T>(operation: ActiveQueuedOperation<T>, fn: () => Promise<T>): Promise<T>;
5
5
  export declare function getActiveQueuedOperation<T>(): ActiveQueuedOperation<T> | undefined;
6
6
  export declare function getActiveQueuedOperationStack(): ActiveQueuedOperation<unknown>[];
7
- /** True when petbooqz_calendar_booking holds a lease in an outer queuedFetch. */
8
- export declare function isInsidePetbooqzCalendarBookingMutex(): boolean;
7
+ /** Active mutex queue names holding a lease in an outer queuedFetch. */
8
+ export declare function getActiveMutexQueueNames(): string[];
9
+ /** True when an active mutex queue suppresses acquire for the target queue name. */
10
+ export declare function shouldSkipNestedAcquire(queueName: string): boolean;
9
11
  export declare function setActiveQueuedOperationLease(lease: ActiveQueuedOperation<unknown>['lease']): void;
10
12
  export declare function updateActiveQueuedOperationAttempt(attempt: number): void;
package/dist/schemas.d.ts CHANGED
@@ -375,6 +375,7 @@ export declare const ChannelCapabilitySchema: z.ZodObject<{
375
375
  icon: z.ZodOptional<z.ZodString>;
376
376
  receive: z.ZodOptional<z.ZodString>;
377
377
  send: z.ZodOptional<z.ZodString>;
378
+ send_batch: z.ZodOptional<z.ZodString>;
378
379
  }, z.core.$strip>;
379
380
  /**
380
381
  * Field definition for channel field mappings.
@@ -455,18 +456,21 @@ export declare const ChannelDefinitionSchema: z.ZodObject<{
455
456
  icon: z.ZodOptional<z.ZodString>;
456
457
  receive: z.ZodOptional<z.ZodString>;
457
458
  send: z.ZodOptional<z.ZodString>;
459
+ send_batch: z.ZodOptional<z.ZodString>;
458
460
  }, z.core.$strip>>;
459
461
  voice: z.ZodOptional<z.ZodObject<{
460
462
  label: z.ZodString;
461
463
  icon: z.ZodOptional<z.ZodString>;
462
464
  receive: z.ZodOptional<z.ZodString>;
463
465
  send: z.ZodOptional<z.ZodString>;
466
+ send_batch: z.ZodOptional<z.ZodString>;
464
467
  }, z.core.$strip>>;
465
468
  video: z.ZodOptional<z.ZodObject<{
466
469
  label: z.ZodString;
467
470
  icon: z.ZodOptional<z.ZodString>;
468
471
  receive: z.ZodOptional<z.ZodString>;
469
472
  send: z.ZodOptional<z.ZodString>;
473
+ send_batch: z.ZodOptional<z.ZodString>;
470
474
  }, z.core.$strip>>;
471
475
  }, z.core.$strip>;
472
476
  }, z.core.$strip>;
@@ -3384,18 +3388,21 @@ export declare const ProvisionConfigSchema: z.ZodObject<{
3384
3388
  icon: z.ZodOptional<z.ZodString>;
3385
3389
  receive: z.ZodOptional<z.ZodString>;
3386
3390
  send: z.ZodOptional<z.ZodString>;
3391
+ send_batch: z.ZodOptional<z.ZodString>;
3387
3392
  }, z.core.$strip>>;
3388
3393
  voice: z.ZodOptional<z.ZodObject<{
3389
3394
  label: z.ZodString;
3390
3395
  icon: z.ZodOptional<z.ZodString>;
3391
3396
  receive: z.ZodOptional<z.ZodString>;
3392
3397
  send: z.ZodOptional<z.ZodString>;
3398
+ send_batch: z.ZodOptional<z.ZodString>;
3393
3399
  }, z.core.$strip>>;
3394
3400
  video: z.ZodOptional<z.ZodObject<{
3395
3401
  label: z.ZodString;
3396
3402
  icon: z.ZodOptional<z.ZodString>;
3397
3403
  receive: z.ZodOptional<z.ZodString>;
3398
3404
  send: z.ZodOptional<z.ZodString>;
3405
+ send_batch: z.ZodOptional<z.ZodString>;
3399
3406
  }, z.core.$strip>>;
3400
3407
  }, z.core.$strip>;
3401
3408
  }, z.core.$strip>>>;
@@ -4107,18 +4114,21 @@ export declare const SkedyulConfigSchema: z.ZodObject<{
4107
4114
  icon: z.ZodOptional<z.ZodString>;
4108
4115
  receive: z.ZodOptional<z.ZodString>;
4109
4116
  send: z.ZodOptional<z.ZodString>;
4117
+ send_batch: z.ZodOptional<z.ZodString>;
4110
4118
  }, z.core.$strip>>;
4111
4119
  voice: z.ZodOptional<z.ZodObject<{
4112
4120
  label: z.ZodString;
4113
4121
  icon: z.ZodOptional<z.ZodString>;
4114
4122
  receive: z.ZodOptional<z.ZodString>;
4115
4123
  send: z.ZodOptional<z.ZodString>;
4124
+ send_batch: z.ZodOptional<z.ZodString>;
4116
4125
  }, z.core.$strip>>;
4117
4126
  video: z.ZodOptional<z.ZodObject<{
4118
4127
  label: z.ZodString;
4119
4128
  icon: z.ZodOptional<z.ZodString>;
4120
4129
  receive: z.ZodOptional<z.ZodString>;
4121
4130
  send: z.ZodOptional<z.ZodString>;
4131
+ send_batch: z.ZodOptional<z.ZodString>;
4122
4132
  }, z.core.$strip>>;
4123
4133
  }, z.core.$strip>;
4124
4134
  }, z.core.$strip>>>;
@@ -4812,6 +4822,44 @@ export type MessageSendAttachment = z.infer<typeof MessageSendAttachmentSchema>;
4812
4822
  export type MessageSendMessage = z.infer<typeof MessageSendMessageSchema>;
4813
4823
  export type MessageSendInput = z.infer<typeof MessageSendInputSchema>;
4814
4824
  export type MessageSendOutput = z.infer<typeof MessageSendOutputSchema>;
4825
+ export declare const MessageBulkRecipientSchema: z.ZodObject<{
4826
+ address: z.ZodString;
4827
+ renderedBody: z.ZodString;
4828
+ instanceId: z.ZodOptional<z.ZodString>;
4829
+ threadId: z.ZodOptional<z.ZodString>;
4830
+ messageId: z.ZodOptional<z.ZodString>;
4831
+ contactId: z.ZodOptional<z.ZodString>;
4832
+ }, z.core.$strip>;
4833
+ export declare const MessageBulkSendInputSchema: z.ZodObject<{
4834
+ channel: z.ZodObject<{
4835
+ id: z.ZodString;
4836
+ handle: z.ZodString;
4837
+ identifierValue: z.ZodString;
4838
+ }, z.core.$strip>;
4839
+ recipients: z.ZodArray<z.ZodObject<{
4840
+ address: z.ZodString;
4841
+ renderedBody: z.ZodString;
4842
+ instanceId: z.ZodOptional<z.ZodString>;
4843
+ threadId: z.ZodOptional<z.ZodString>;
4844
+ messageId: z.ZodOptional<z.ZodString>;
4845
+ contactId: z.ZodOptional<z.ZodString>;
4846
+ }, z.core.$strip>>;
4847
+ schedule: z.ZodOptional<z.ZodObject<{
4848
+ at: z.ZodString;
4849
+ }, z.core.$strip>>;
4850
+ }, z.core.$strip>;
4851
+ export declare const MessageBulkSendOutputSchema: z.ZodObject<{
4852
+ status: z.ZodEnum<{
4853
+ failed: "failed";
4854
+ accepted: "accepted";
4855
+ }>;
4856
+ operationId: z.ZodOptional<z.ZodString>;
4857
+ acceptedCount: z.ZodNumber;
4858
+ rejectedCount: z.ZodOptional<z.ZodNumber>;
4859
+ }, z.core.$strip>;
4860
+ export type MessageBulkRecipient = z.infer<typeof MessageBulkRecipientSchema>;
4861
+ export type MessageBulkSendInput = z.infer<typeof MessageBulkSendInputSchema>;
4862
+ export type MessageBulkSendOutput = z.infer<typeof MessageBulkSendOutputSchema>;
4815
4863
  export declare function isModelDependency(dep: ResourceDependency): dep is ModelDependency;
4816
4864
  export declare function isChannelDependency(dep: ResourceDependency): dep is ChannelDependency;
4817
4865
  export declare function isWorkflowDependency(dep: ResourceDependency): dep is WorkflowDependency;
@@ -1,9 +1,9 @@
1
1
  import * as z from 'zod';
2
- import type { BillingInfo, ToolSchema, ToolSchemaWithJson } from '../../types';
2
+ import type { BillingInfo, ToolBilling, ToolSchema, ToolSchemaWithJson } from '../../types';
3
3
  /**
4
- * Normalizes billing info to ensure credits field exists
4
+ * Normalizes billing info to ensure credits field exists while preserving estimate data.
5
5
  */
6
- export declare function normalizeBilling(billing?: BillingInfo): BillingInfo;
6
+ export declare function normalizeBilling(billing?: BillingInfo | ToolBilling): ToolBilling;
7
7
  /**
8
8
  * Converts a Zod schema to JSON Schema format
9
9
  */
package/dist/server.js CHANGED
@@ -100,9 +100,12 @@ function registerQueueConfig(config) {
100
100
  // src/server/utils/schema.ts
101
101
  var z = __toESM(require("zod"));
102
102
  function normalizeBilling(billing) {
103
- if (!billing || typeof billing.credits !== "number") {
103
+ if (!billing || typeof billing !== "object") {
104
104
  return { credits: 0 };
105
105
  }
106
+ if (typeof billing.credits !== "number") {
107
+ return { ...billing, credits: 0 };
108
+ }
106
109
  return billing;
107
110
  }
108
111
  function toJsonSchema(schema) {
@@ -436,6 +439,7 @@ function buildToolMetadata(registry) {
436
439
  const timeout = typeof rawTimeout === "number" && rawTimeout > 0 ? rawTimeout : 1e4;
437
440
  const retries = typeof rawRetries === "number" && rawRetries >= 1 ? rawRetries : 1;
438
441
  const queueTouchPoints = tool.queueTouchPoints ?? toolConfig.queueTouchPoints;
442
+ const rateLimitHandoff = tool.rateLimitHandoff ?? toolConfig.rateLimitHandoff;
439
443
  return {
440
444
  name: tool.name,
441
445
  displayName: tool.label || tool.name,
@@ -446,11 +450,13 @@ function buildToolMetadata(registry) {
446
450
  timeout,
447
451
  retries,
448
452
  queueTouchPoints,
453
+ rateLimitHandoff,
449
454
  config: {
450
455
  timeout,
451
456
  retries,
452
457
  completionHints: toolConfig.completionHints,
453
- queueTouchPoints
458
+ queueTouchPoints,
459
+ rateLimitHandoff
454
460
  }
455
461
  };
456
462
  });
@@ -492,7 +498,8 @@ function createCallToolHandler(registry, state, onMaxRequests) {
492
498
  }
493
499
  const fn = tool.handler;
494
500
  const args = toolArgsInput ?? {};
495
- const estimateMode = args.estimate === true;
501
+ const rawContextForMode = args.context ?? {};
502
+ const estimateMode = args.estimate === true || rawContextForMode.mode === "estimate";
496
503
  if (!estimateMode) {
497
504
  state.incrementRequestCount();
498
505
  if (state.shouldShutdown()) {
@@ -979,7 +986,8 @@ function serializeConfig(config) {
979
986
  // Read timeout/retries from top-level first, then fallback to config
980
987
  timeout: tool.timeout ?? tool.config?.timeout,
981
988
  retries: tool.retries ?? tool.config?.retries,
982
- queueTouchPoints: tool.queueTouchPoints ?? tool.config?.queueTouchPoints
989
+ queueTouchPoints: tool.queueTouchPoints ?? tool.config?.queueTouchPoints,
990
+ rateLimitHandoff: tool.rateLimitHandoff ?? tool.config?.rateLimitHandoff
983
991
  })) : [],
984
992
  webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
985
993
  name: w.name,
@@ -1674,11 +1682,12 @@ async function handleMcpRoute(req, ctx) {
1674
1682
  async function handleMcpToolsCall(params, id, ctx) {
1675
1683
  const toolName = params?.name;
1676
1684
  const rawArgs = params?.arguments ?? {};
1677
- const hasSkedyulFormat = "inputs" in rawArgs || "env" in rawArgs || "context" in rawArgs || "invocation" in rawArgs;
1685
+ const hasSkedyulFormat = "inputs" in rawArgs || "env" in rawArgs || "context" in rawArgs || "invocation" in rawArgs || "estimate" in rawArgs;
1678
1686
  const toolInputs = hasSkedyulFormat ? rawArgs.inputs ?? {} : rawArgs;
1679
1687
  const toolContext = hasSkedyulFormat ? rawArgs.context : void 0;
1680
1688
  const toolEnv = hasSkedyulFormat ? rawArgs.env : void 0;
1681
1689
  const toolInvocation = hasSkedyulFormat ? rawArgs.invocation : void 0;
1690
+ const estimate = hasSkedyulFormat && rawArgs.estimate === true;
1682
1691
  const found = findToolInRegistry(ctx.registry, toolName);
1683
1692
  if (!found) {
1684
1693
  return {
@@ -1703,7 +1712,8 @@ async function handleMcpToolsCall(params, id, ctx) {
1703
1712
  inputs: validatedInputs,
1704
1713
  context: toolContext,
1705
1714
  env: toolEnv,
1706
- invocation: toolInvocation
1715
+ invocation: toolInvocation,
1716
+ estimate
1707
1717
  });
1708
1718
  let result;
1709
1719
  const isFailure = isToolCallFailure(toolResult);
@@ -61,9 +61,12 @@ function registerQueueConfig(config) {
61
61
  // src/server/utils/schema.ts
62
62
  import * as z from "zod";
63
63
  function normalizeBilling(billing) {
64
- if (!billing || typeof billing.credits !== "number") {
64
+ if (!billing || typeof billing !== "object") {
65
65
  return { credits: 0 };
66
66
  }
67
+ if (typeof billing.credits !== "number") {
68
+ return { ...billing, credits: 0 };
69
+ }
67
70
  return billing;
68
71
  }
69
72
  function toJsonSchema(schema) {
@@ -397,6 +400,7 @@ function buildToolMetadata(registry) {
397
400
  const timeout = typeof rawTimeout === "number" && rawTimeout > 0 ? rawTimeout : 1e4;
398
401
  const retries = typeof rawRetries === "number" && rawRetries >= 1 ? rawRetries : 1;
399
402
  const queueTouchPoints = tool.queueTouchPoints ?? toolConfig.queueTouchPoints;
403
+ const rateLimitHandoff = tool.rateLimitHandoff ?? toolConfig.rateLimitHandoff;
400
404
  return {
401
405
  name: tool.name,
402
406
  displayName: tool.label || tool.name,
@@ -407,11 +411,13 @@ function buildToolMetadata(registry) {
407
411
  timeout,
408
412
  retries,
409
413
  queueTouchPoints,
414
+ rateLimitHandoff,
410
415
  config: {
411
416
  timeout,
412
417
  retries,
413
418
  completionHints: toolConfig.completionHints,
414
- queueTouchPoints
419
+ queueTouchPoints,
420
+ rateLimitHandoff
415
421
  }
416
422
  };
417
423
  });
@@ -453,7 +459,8 @@ function createCallToolHandler(registry, state, onMaxRequests) {
453
459
  }
454
460
  const fn = tool.handler;
455
461
  const args = toolArgsInput ?? {};
456
- const estimateMode = args.estimate === true;
462
+ const rawContextForMode = args.context ?? {};
463
+ const estimateMode = args.estimate === true || rawContextForMode.mode === "estimate";
457
464
  if (!estimateMode) {
458
465
  state.incrementRequestCount();
459
466
  if (state.shouldShutdown()) {
@@ -940,7 +947,8 @@ function serializeConfig(config) {
940
947
  // Read timeout/retries from top-level first, then fallback to config
941
948
  timeout: tool.timeout ?? tool.config?.timeout,
942
949
  retries: tool.retries ?? tool.config?.retries,
943
- queueTouchPoints: tool.queueTouchPoints ?? tool.config?.queueTouchPoints
950
+ queueTouchPoints: tool.queueTouchPoints ?? tool.config?.queueTouchPoints,
951
+ rateLimitHandoff: tool.rateLimitHandoff ?? tool.config?.rateLimitHandoff
944
952
  })) : [],
945
953
  webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
946
954
  name: w.name,
@@ -1635,11 +1643,12 @@ async function handleMcpRoute(req, ctx) {
1635
1643
  async function handleMcpToolsCall(params, id, ctx) {
1636
1644
  const toolName = params?.name;
1637
1645
  const rawArgs = params?.arguments ?? {};
1638
- const hasSkedyulFormat = "inputs" in rawArgs || "env" in rawArgs || "context" in rawArgs || "invocation" in rawArgs;
1646
+ const hasSkedyulFormat = "inputs" in rawArgs || "env" in rawArgs || "context" in rawArgs || "invocation" in rawArgs || "estimate" in rawArgs;
1639
1647
  const toolInputs = hasSkedyulFormat ? rawArgs.inputs ?? {} : rawArgs;
1640
1648
  const toolContext = hasSkedyulFormat ? rawArgs.context : void 0;
1641
1649
  const toolEnv = hasSkedyulFormat ? rawArgs.env : void 0;
1642
1650
  const toolInvocation = hasSkedyulFormat ? rawArgs.invocation : void 0;
1651
+ const estimate = hasSkedyulFormat && rawArgs.estimate === true;
1643
1652
  const found = findToolInRegistry(ctx.registry, toolName);
1644
1653
  if (!found) {
1645
1654
  return {
@@ -1664,7 +1673,8 @@ async function handleMcpToolsCall(params, id, ctx) {
1664
1673
  inputs: validatedInputs,
1665
1674
  context: toolContext,
1666
1675
  env: toolEnv,
1667
- invocation: toolInvocation
1676
+ invocation: toolInvocation,
1677
+ estimate
1668
1678
  });
1669
1679
  let result;
1670
1680
  const isFailure = isToolCallFailure(toolResult);
@@ -0,0 +1,11 @@
1
+ export type SmsEncoding = 'GSM-7' | 'UCS-2';
2
+ export type SmsSegmentEstimate = {
3
+ encoding: SmsEncoding;
4
+ characters: number;
5
+ septets?: number;
6
+ segments: number;
7
+ };
8
+ /** Strip characters that are not encodable in GSM-7. */
9
+ export declare function toGsm7(value: unknown): string;
10
+ /** Estimate SMS segment count for a message body. */
11
+ export declare function estimateSmsSegments(text: string): SmsSegmentEstimate;
@@ -0,0 +1,74 @@
1
+ import { z } from 'zod/v4';
2
+ import type { ToolBilling } from './tool';
3
+ /**
4
+ * Money expressed in a currency's minor unit (e.g. cents, pence).
5
+ * Use ISO 4217 codes so amounts format correctly across locales.
6
+ */
7
+ export interface MoneyMinorUnits {
8
+ /** ISO 4217 currency code (USD, AUD, EUR, …) */
9
+ currency: string;
10
+ /** Amount in the currency's smallest unit */
11
+ minorUnits: number;
12
+ }
13
+ /** Inclusive range of estimated charges in minor currency units. */
14
+ export interface MoneyMinorRange {
15
+ currency: string;
16
+ minorUnitsLow: number;
17
+ minorUnitsHigh: number;
18
+ /** Optional skewed expected charge for single-value display (~$X.XX). */
19
+ minorUnitsExpected?: number;
20
+ }
21
+ /**
22
+ * Standard estimate payload for tool estimate mode and platform estimate APIs.
23
+ * Channel-agnostic — integrations populate `cost` when pricing is known.
24
+ */
25
+ export interface Estimation {
26
+ deliverableCount: number;
27
+ skippedCount?: number;
28
+ cost?: MoneyMinorRange;
29
+ }
30
+ export declare const MoneyMinorRangeSchema: z.ZodObject<{
31
+ currency: z.ZodString;
32
+ minorUnitsLow: z.ZodNumber;
33
+ minorUnitsHigh: z.ZodNumber;
34
+ minorUnitsExpected: z.ZodOptional<z.ZodNumber>;
35
+ }, z.core.$strip>;
36
+ export declare const EstimationSchema: z.ZodObject<{
37
+ deliverableCount: z.ZodNumber;
38
+ skippedCount: z.ZodOptional<z.ZodNumber>;
39
+ cost: z.ZodOptional<z.ZodObject<{
40
+ currency: z.ZodString;
41
+ minorUnitsLow: z.ZodNumber;
42
+ minorUnitsHigh: z.ZodNumber;
43
+ minorUnitsExpected: z.ZodOptional<z.ZodNumber>;
44
+ }, z.core.$strip>>;
45
+ }, z.core.$strip>;
46
+ export declare function createMoneyMinorRange(params: {
47
+ currency: string;
48
+ minorUnitsLow: number;
49
+ minorUnitsHigh: number;
50
+ minorUnitsExpected?: number;
51
+ }): MoneyMinorRange;
52
+ export declare function createEstimation(params: {
53
+ deliverableCount: number;
54
+ skippedCount?: number;
55
+ cost?: MoneyMinorRange;
56
+ }): Estimation;
57
+ /** Skew expected cost toward the typical case when only a range is known. */
58
+ export declare function computeSkewedExpectedMinorUnits(range: MoneyMinorRange): number;
59
+ export type FormatMoneyMinorEstimateOptions = {
60
+ locale?: string;
61
+ /** When set, overrides computed skew for display. */
62
+ expectedMinorUnits?: number;
63
+ /** Show a range instead of ~estimate when high/low ratio exceeds this (default 3). */
64
+ maxSpreadRatio?: number;
65
+ };
66
+ /** Format a minor-unit cost range for display (single amount when low === high). */
67
+ export declare function formatMoneyMinorRange(range: MoneyMinorRange, locale?: string): string;
68
+ /**
69
+ * Format an estimated charge for UI: prefer a single ~$X.XX educated guess.
70
+ * Falls back to a low–high range when the spread is still too wide.
71
+ */
72
+ export declare function formatMoneyMinorEstimate(range: MoneyMinorRange, options?: FormatMoneyMinorEstimateOptions): string;
73
+ /** Read standardized estimation from tool billing (supports legacy flat cost fields). */
74
+ export declare function parseEstimationFromBilling(billing?: ToolBilling | Record<string, unknown>): Estimation | undefined;
@@ -10,6 +10,9 @@ export { createToolCallContext, createServerHookContext, createWebhookContext, c
10
10
  export type { ToolTrigger, ProvisionToolContext, DeveloperPageActionToolContext, DeveloperFormSubmitToolContext, FieldChangeToolContext, PageActionToolContext, FormSubmitToolContext, AgentToolContext, WorkflowToolContext, CronToolContext, CronContext, ToolExecutionContext, } from './tool-context';
11
11
  export { isProvisionContext, isRuntimeContext, isCronContext, isDeveloperContext } from './tool-context';
12
12
  export type { ToolResult, ToolSuccess, ToolFailure, ErrorCode, ErrorCategory, ToolWarning, ToolPagination, ToolBilling, ToolRetry, ToolTiming, ToolCompletionHints, ToolConfig, QueueTouchPoint, BillingInfo, ToolResponseMeta, ToolEffect, ToolError, ToolExecutionResult, ToolSchemaWithJson, ToolSchema, ToolHandler, ToolDefinition, ToolRegistryEntry, ToolRegistry, ToolName, ToolMetadata, ToolCallResponse, ExecutionScope, } from './tool';
13
+ export type { MoneyMinorUnits, MoneyMinorRange, Estimation } from './estimation';
14
+ export { MoneyMinorRangeSchema, EstimationSchema, createMoneyMinorRange, createEstimation, parseEstimationFromBilling, formatMoneyMinorRange, formatMoneyMinorEstimate, computeSkewedExpectedMinorUnits, } from './estimation';
15
+ export type { FormatMoneyMinorEstimateOptions } from './estimation';
13
16
  export { ToolResponseMetaSchema } from './tool';
14
17
  export { createSuccessResponse, createListResponse, createErrorResponse, createValidationError, createNotFoundError, createAuthError, createRateLimitError, createExternalError, createTimeoutError, createPermissionError, createConflictError, isSuccess, isFailure, isRetryable, getRetryDelay, } from './tool-response';
15
18
  export type { HealthStatus, ComputeLayer, DedicatedServerInstance, ServerlessServerInstance, SkedyulServerInstance, } from './server';
@@ -60,9 +60,23 @@ export interface ToolPagination {
60
60
  * Billing/usage information.
61
61
  */
62
62
  export interface ToolBilling {
63
- credits: number;
63
+ credits?: number;
64
64
  tokens?: number;
65
65
  cost?: number;
66
+ /** Standard estimate payload (preferred for estimate-mode tool calls). */
67
+ estimation?: import('./estimation').Estimation;
68
+ /**
69
+ * @deprecated Use `estimation.cost` — legacy flat minor-unit bounds.
70
+ */
71
+ costCentsLow?: number;
72
+ /**
73
+ * @deprecated Use `estimation.cost` — legacy flat minor-unit bounds.
74
+ */
75
+ costCentsHigh?: number;
76
+ /**
77
+ * @deprecated Use `estimation.cost.currency` — legacy ISO 4217 code.
78
+ */
79
+ currency?: string;
66
80
  }
67
81
  /**
68
82
  * Client-side effects to execute after tool completion.
@@ -104,6 +118,11 @@ export interface QueueTouchPoint {
104
118
  /** True for correctness mutexes — excluded from rate-limit probe admission */
105
119
  mutexOnly?: boolean;
106
120
  }
121
+ /** Workflow mutex handoff role for multi-step tool.call sequences. */
122
+ export interface RateLimitHandoff {
123
+ role: 'mutex_reserve' | 'mutex_confirm';
124
+ group?: string;
125
+ }
107
126
  export interface ToolConfig {
108
127
  /** Timeout in milliseconds. Defaults to 10000 (10 seconds) if not specified. */
109
128
  timeout?: number;
@@ -113,6 +132,8 @@ export interface ToolConfig {
113
132
  completionHints?: ToolCompletionHints;
114
133
  /** Rate-limit queue touch points for orchestration admission probes */
115
134
  queueTouchPoints?: QueueTouchPoint[];
135
+ /** Mutex lease handoff between workflow tool.call steps */
136
+ rateLimitHandoff?: RateLimitHandoff;
116
137
  }
117
138
  /**
118
139
  * Successful tool execution result.
@@ -186,7 +207,7 @@ export interface ToolExecutionResult<Output = unknown> {
186
207
  /** Discriminator for new ToolResult shape (true=success, false=failure) */
187
208
  success?: boolean;
188
209
  output: Output | null;
189
- billing: BillingInfo;
210
+ billing: ToolBilling;
190
211
  meta?: ToolResponseMeta;
191
212
  effect?: ToolEffect;
192
213
  error?: ToolError | null;
@@ -230,6 +251,8 @@ export interface ToolDefinition<Input = unknown, Output = unknown, InputSchema e
230
251
  config?: ToolConfig;
231
252
  /** Rate-limit queue touch points (also accepted at top level for ergonomics) */
232
253
  queueTouchPoints?: QueueTouchPoint[];
254
+ /** Mutex lease handoff between workflow tool.call steps */
255
+ rateLimitHandoff?: RateLimitHandoff;
233
256
  /**
234
257
  * Execution scope for this tool.
235
258
  * - `installation` (default): Requires appInstallationId, receives sk_wkp_ token.
@@ -270,6 +293,8 @@ export interface ToolMetadata {
270
293
  config?: ToolConfig;
271
294
  /** Rate-limit queue touch points for orchestration admission probes */
272
295
  queueTouchPoints?: QueueTouchPoint[];
296
+ /** Mutex lease handoff between workflow tool.call steps */
297
+ rateLimitHandoff?: RateLimitHandoff;
273
298
  /** Execution scope for this tool */
274
299
  executionScope?: ExecutionScope;
275
300
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skedyul",
3
- "version": "1.5.2",
3
+ "version": "1.5.10",
4
4
  "description": "The Skedyul SDK for Node.js",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -61,16 +61,22 @@
61
61
  "import": "./dist/scheduling/index.mjs",
62
62
  "require": "./dist/scheduling/index.js",
63
63
  "default": "./dist/scheduling/index.js"
64
+ },
65
+ "./estimation": {
66
+ "types": "./dist/types/estimation.d.ts",
67
+ "import": "./dist/esm/index.mjs",
68
+ "require": "./dist/index.js",
69
+ "default": "./dist/index.js"
64
70
  }
65
71
  },
66
72
  "files": [
67
73
  "dist"
68
74
  ],
69
75
  "scripts": {
70
- "build": "rm -rf dist tsconfig.tsbuildinfo && tsc --emitDeclarationOnly && tsup",
76
+ "build": "rm -rf dist tsconfig.tsbuildinfo && tsc --emitDeclarationOnly && pnpm exec tsup-node",
71
77
  "db:generate": "echo 'No database generation needed for this package'",
72
78
  "dev": "npx nodemon --watch src --ext js,ts --exec \"pnpm run build\"",
73
- "test": "tsc --project tsconfig.tests.json && node --test dist-tests/tests/server.test.js dist-tests/tests/cli.test.js dist-tests/tests/agent-schema-v3.test.js dist-tests/tests/ratelimit.test.js dist-tests/tests/config-loader.test.js"
79
+ "test": "tsc --project tsconfig.tests.json && node --test dist-tests/tests/server.test.js dist-tests/tests/cli.test.js dist-tests/tests/agent-schema-v3.test.js dist-tests/tests/ratelimit.test.js dist-tests/tests/config-loader.test.js dist-tests/tests/gsm7.test.js"
74
80
  },
75
81
  "keywords": [
76
82
  "mcp",