@agenticmail/core 0.9.28 → 0.9.29

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/index.cjs CHANGED
@@ -1459,6 +1459,8 @@ __export(index_exports, {
1459
1459
  CloudflareClient: () => CloudflareClient,
1460
1460
  DEFAULT_AGENT_NAME: () => DEFAULT_AGENT_NAME,
1461
1461
  DEFAULT_AGENT_ROLE: () => DEFAULT_AGENT_ROLE,
1462
+ DEFAULT_CALLBACK_POLICY: () => DEFAULT_CALLBACK_POLICY,
1463
+ DEFAULT_EXTENSION_POLICY: () => DEFAULT_EXTENSION_POLICY,
1462
1464
  DEFAULT_REALTIME_AUDIO_FORMAT: () => DEFAULT_REALTIME_AUDIO_FORMAT,
1463
1465
  DEFAULT_REALTIME_MODEL: () => DEFAULT_REALTIME_MODEL,
1464
1466
  DEFAULT_REALTIME_VOICE: () => DEFAULT_REALTIME_VOICE,
@@ -1471,8 +1473,11 @@ __export(index_exports, {
1471
1473
  DomainPurchaser: () => DomainPurchaser,
1472
1474
  ELKS_REALTIME_AUDIO_FORMATS: () => ELKS_REALTIME_AUDIO_FORMATS,
1473
1475
  ELKS_REALTIME_WS_PATH: () => ELKS_REALTIME_WS_PATH,
1476
+ END_CALL_TOOL: () => END_CALL_TOOL,
1477
+ EXTEND_CALL_TIME_TOOL: () => EXTEND_CALL_TIME_TOOL,
1474
1478
  ElksRealtimeTransport: () => ElksRealtimeTransport,
1475
1479
  EmailSearchIndex: () => EmailSearchIndex,
1480
+ GET_CALL_STATUS_TOOL: () => GET_CALL_STATUS_TOOL,
1476
1481
  GET_DATETIME_TOOL: () => GET_DATETIME_TOOL,
1477
1482
  GatewayManager: () => GatewayManager,
1478
1483
  InboxWatcher: () => InboxWatcher,
@@ -1487,6 +1492,8 @@ __export(index_exports, {
1487
1492
  OPERATOR_QUERY_SUBJECT_TAG: () => OPERATOR_QUERY_SUBJECT_TAG,
1488
1493
  OPERATOR_QUERY_TIMEOUT_MS: () => OPERATOR_QUERY_TIMEOUT_MS,
1489
1494
  OPERATOR_QUERY_TIMEOUT_SENTINEL: () => OPERATOR_QUERY_TIMEOUT_SENTINEL,
1495
+ PHONE_CALLBACK_MAX_DELAY_SECONDS: () => PHONE_CALLBACK_MAX_DELAY_SECONDS,
1496
+ PHONE_CALLBACK_MIN_DELAY_SECONDS: () => PHONE_CALLBACK_MIN_DELAY_SECONDS,
1490
1497
  PHONE_CALL_CONTROL_PROVIDERS: () => PHONE_CALL_CONTROL_PROVIDERS,
1491
1498
  PHONE_MAX_CONCURRENT_MISSIONS: () => PHONE_MAX_CONCURRENT_MISSIONS,
1492
1499
  PHONE_MIN_WEBHOOK_SECRET_LENGTH: () => PHONE_MIN_WEBHOOK_SECRET_LENGTH,
@@ -1495,8 +1502,12 @@ __export(index_exports, {
1495
1502
  PHONE_RATE_LIMIT_PER_MINUTE: () => PHONE_RATE_LIMIT_PER_MINUTE,
1496
1503
  PHONE_REGION_SCOPES: () => PHONE_REGION_SCOPES,
1497
1504
  PHONE_SERVER_MAX_ATTEMPTS: () => PHONE_SERVER_MAX_ATTEMPTS,
1505
+ PHONE_SERVER_MAX_CALLBACK_CHAIN: () => PHONE_SERVER_MAX_CALLBACK_CHAIN,
1498
1506
  PHONE_SERVER_MAX_CALL_DURATION_SECONDS: () => PHONE_SERVER_MAX_CALL_DURATION_SECONDS,
1499
1507
  PHONE_SERVER_MAX_COST_PER_MISSION: () => PHONE_SERVER_MAX_COST_PER_MISSION,
1508
+ PHONE_SERVER_MAX_EXTENSION_REQUESTS_PER_CALL: () => PHONE_SERVER_MAX_EXTENSION_REQUESTS_PER_CALL,
1509
+ PHONE_SERVER_MAX_EXTENSION_SECONDS_PER_REQUEST: () => PHONE_SERVER_MAX_EXTENSION_SECONDS_PER_REQUEST,
1510
+ PHONE_SERVER_MAX_TOTAL_EXTENSION_SECONDS: () => PHONE_SERVER_MAX_TOTAL_EXTENSION_SECONDS,
1500
1511
  PHONE_TASK_MAX_LENGTH: () => PHONE_TASK_MAX_LENGTH,
1501
1512
  PathTraversalError: () => PathTraversalError,
1502
1513
  PhoneManager: () => PhoneManager,
@@ -1512,6 +1523,7 @@ __export(index_exports, {
1512
1523
  RealtimeVoiceBridge: () => RealtimeVoiceBridge,
1513
1524
  RelayBridge: () => RelayBridge,
1514
1525
  RelayGateway: () => RelayGateway,
1526
+ SCHEDULE_CALLBACK_TOOL: () => SCHEDULE_CALLBACK_TOOL,
1515
1527
  SEARCH_EMAIL_TOOL: () => SEARCH_EMAIL_TOOL,
1516
1528
  SEARCH_SKILLS_TOOL: () => SEARCH_SKILLS_TOOL,
1517
1529
  SPAM_THRESHOLD: () => SPAM_THRESHOLD,
@@ -1632,7 +1644,9 @@ __export(index_exports, {
1632
1644
  renderSkillAsPrompt: () => renderSkillAsPrompt,
1633
1645
  requireBinary: () => requireBinary,
1634
1646
  requireWhisperModel: () => requireWhisperModel,
1647
+ resolveCallbackPolicy: () => resolveCallbackPolicy,
1635
1648
  resolveConfig: () => resolveConfig,
1649
+ resolveExtensionPolicy: () => resolveExtensionPolicy,
1636
1650
  resolveTlsRejectUnauthorized: () => resolveTlsRejectUnauthorized,
1637
1651
  safeJoin: () => safeJoin,
1638
1652
  sanitizeEmail: () => sanitizeEmail,
@@ -7533,6 +7547,7 @@ var DEFAULT_CALLBACK_POLICY = {
7533
7547
  allowAutoCallback: true,
7534
7548
  maxCallbackChain: 2
7535
7549
  };
7550
+ var PHONE_CALLBACK_MIN_DELAY_SECONDS = 30;
7536
7551
  var PHONE_CALLBACK_MAX_DELAY_SECONDS = 7 * 24 * 60 * 60;
7537
7552
  var EU_DIAL_PREFIXES = [
7538
7553
  "+30",
@@ -16105,6 +16120,8 @@ init_skills();
16105
16120
  CloudflareClient,
16106
16121
  DEFAULT_AGENT_NAME,
16107
16122
  DEFAULT_AGENT_ROLE,
16123
+ DEFAULT_CALLBACK_POLICY,
16124
+ DEFAULT_EXTENSION_POLICY,
16108
16125
  DEFAULT_REALTIME_AUDIO_FORMAT,
16109
16126
  DEFAULT_REALTIME_MODEL,
16110
16127
  DEFAULT_REALTIME_VOICE,
@@ -16117,8 +16134,11 @@ init_skills();
16117
16134
  DomainPurchaser,
16118
16135
  ELKS_REALTIME_AUDIO_FORMATS,
16119
16136
  ELKS_REALTIME_WS_PATH,
16137
+ END_CALL_TOOL,
16138
+ EXTEND_CALL_TIME_TOOL,
16120
16139
  ElksRealtimeTransport,
16121
16140
  EmailSearchIndex,
16141
+ GET_CALL_STATUS_TOOL,
16122
16142
  GET_DATETIME_TOOL,
16123
16143
  GatewayManager,
16124
16144
  InboxWatcher,
@@ -16133,6 +16153,8 @@ init_skills();
16133
16153
  OPERATOR_QUERY_SUBJECT_TAG,
16134
16154
  OPERATOR_QUERY_TIMEOUT_MS,
16135
16155
  OPERATOR_QUERY_TIMEOUT_SENTINEL,
16156
+ PHONE_CALLBACK_MAX_DELAY_SECONDS,
16157
+ PHONE_CALLBACK_MIN_DELAY_SECONDS,
16136
16158
  PHONE_CALL_CONTROL_PROVIDERS,
16137
16159
  PHONE_MAX_CONCURRENT_MISSIONS,
16138
16160
  PHONE_MIN_WEBHOOK_SECRET_LENGTH,
@@ -16141,8 +16163,12 @@ init_skills();
16141
16163
  PHONE_RATE_LIMIT_PER_MINUTE,
16142
16164
  PHONE_REGION_SCOPES,
16143
16165
  PHONE_SERVER_MAX_ATTEMPTS,
16166
+ PHONE_SERVER_MAX_CALLBACK_CHAIN,
16144
16167
  PHONE_SERVER_MAX_CALL_DURATION_SECONDS,
16145
16168
  PHONE_SERVER_MAX_COST_PER_MISSION,
16169
+ PHONE_SERVER_MAX_EXTENSION_REQUESTS_PER_CALL,
16170
+ PHONE_SERVER_MAX_EXTENSION_SECONDS_PER_REQUEST,
16171
+ PHONE_SERVER_MAX_TOTAL_EXTENSION_SECONDS,
16146
16172
  PHONE_TASK_MAX_LENGTH,
16147
16173
  PathTraversalError,
16148
16174
  PhoneManager,
@@ -16158,6 +16184,7 @@ init_skills();
16158
16184
  RealtimeVoiceBridge,
16159
16185
  RelayBridge,
16160
16186
  RelayGateway,
16187
+ SCHEDULE_CALLBACK_TOOL,
16161
16188
  SEARCH_EMAIL_TOOL,
16162
16189
  SEARCH_SKILLS_TOOL,
16163
16190
  SPAM_THRESHOLD,
@@ -16278,7 +16305,9 @@ init_skills();
16278
16305
  renderSkillAsPrompt,
16279
16306
  requireBinary,
16280
16307
  requireWhisperModel,
16308
+ resolveCallbackPolicy,
16281
16309
  resolveConfig,
16310
+ resolveExtensionPolicy,
16282
16311
  resolveTlsRejectUnauthorized,
16283
16312
  safeJoin,
16284
16313
  sanitizeEmail,
package/dist/index.d.cts CHANGED
@@ -2623,6 +2623,51 @@ declare const PHONE_SERVER_MAX_COST_PER_MISSION = 5;
2623
2623
  declare const PHONE_SERVER_MAX_ATTEMPTS = 3;
2624
2624
  /** Hard cap on the free-text `task` fed to the voice runtime. */
2625
2625
  declare const PHONE_TASK_MAX_LENGTH = 2000;
2626
+ /**
2627
+ * Server-side ceilings for the extension policy. Like the duration /
2628
+ * cost caps above, these are the financial blast-radius bound — a
2629
+ * caller can ask for a stricter extension policy but never a looser
2630
+ * one. The defaults err on the side of "give the agent a fighting
2631
+ * chance to finish a real call" without letting it sit on the line
2632
+ * forever. v0.9.82 bumped these substantially after field reports of
2633
+ * agents running out of time on legitimately long calls (15-25 min
2634
+ * hold queues, 30 min explanations from the rep):
2635
+ *
2636
+ * - per-request cap raised 5 min → 15 min so a single "I need more
2637
+ * time on hold" request can carry the agent through a queue
2638
+ * - per-call cap raised 4 → 8 so chained extensions don't run dry
2639
+ * on a long bureaucracy call
2640
+ * - total cap raised 10 min → 1 hour so the absolute add can match
2641
+ * a long-tail call without artificial chunking
2642
+ *
2643
+ * The TOTAL also can't push the call past
2644
+ * PHONE_SERVER_MAX_CALL_DURATION_SECONDS — that ceiling still wins.
2645
+ */
2646
+ declare const PHONE_SERVER_MAX_EXTENSION_SECONDS_PER_REQUEST = 900;
2647
+ declare const PHONE_SERVER_MAX_EXTENSION_REQUESTS_PER_CALL = 8;
2648
+ declare const PHONE_SERVER_MAX_TOTAL_EXTENSION_SECONDS = 3600;
2649
+ /** Default per-call extension envelope when the caller doesn't set one.
2650
+ * Bumped in v0.9.82 — 5 min × 4 = 20 min of headroom is a much more
2651
+ * realistic out-of-the-box budget for the kinds of calls operators
2652
+ * actually use this for (bills, bookings, customer support). */
2653
+ declare const DEFAULT_EXTENSION_POLICY: PhoneExtensionPolicy;
2654
+ /**
2655
+ * Server-side ceiling on how deep a callback chain can go. Each call
2656
+ * counts; a brand-new mission is depth 0, its callback is depth 1, the
2657
+ * callback's callback is depth 2. Prevents an agent + bot operator on
2658
+ * the other end from getting stuck in an infinite re-dial loop.
2659
+ */
2660
+ declare const PHONE_SERVER_MAX_CALLBACK_CHAIN = 3;
2661
+ /** Default callback envelope when the caller doesn't set one. */
2662
+ declare const DEFAULT_CALLBACK_POLICY: PhoneCallbackPolicy;
2663
+ /**
2664
+ * Floor + ceiling on how far into the future a `schedule_callback` may
2665
+ * defer. Lower bound prevents instant re-dial loops (give the human a
2666
+ * breath); upper bound bounds the staging window so a scheduled
2667
+ * callback can't sit in the DB forever.
2668
+ */
2669
+ declare const PHONE_CALLBACK_MIN_DELAY_SECONDS = 30;
2670
+ declare const PHONE_CALLBACK_MAX_DELAY_SECONDS: number;
2626
2671
  interface PhoneConfirmPolicy {
2627
2672
  paymentDetails: 'never';
2628
2673
  contractCommitment: 'never';
@@ -2746,6 +2791,15 @@ type PhoneMissionStartValidationResult = {
2746
2791
  ok: false;
2747
2792
  issues: PhoneMissionValidationIssue[];
2748
2793
  };
2794
+ /**
2795
+ * Resolve the effective extension policy: caller's value (if any),
2796
+ * clamped DOWN to the server ceiling on each field. The server cap
2797
+ * always wins — a caller asking for `maxSecondsPerRequest: 999_999`
2798
+ * gets {@link PHONE_SERVER_MAX_EXTENSION_SECONDS_PER_REQUEST}.
2799
+ */
2800
+ declare function resolveExtensionPolicy(input: PhoneExtensionPolicy | undefined): PhoneExtensionPolicy;
2801
+ /** Resolve the effective callback policy with server-ceiling clamping. */
2802
+ declare function resolveCallbackPolicy(input: PhoneCallbackPolicy | undefined): PhoneCallbackPolicy;
2749
2803
  declare function validatePhoneMissionPolicy(policy: unknown): PhoneMissionValidationResult;
2750
2804
  declare function validatePhoneTransportProfile(transport: unknown): PhoneTransportValidationResult;
2751
2805
  declare function inferPhoneRegion(phoneNumber: string): PhoneRegionScope | null;
@@ -2902,6 +2956,48 @@ declare const SEARCH_SKILLS_TOOL: RealtimeToolDefinition;
2902
2956
  * oldest (the bridge enforces this).
2903
2957
  */
2904
2958
  declare const LOAD_SKILL_TOOL: RealtimeToolDefinition;
2959
+ /**
2960
+ * v0.9.81 — time-budget self-awareness. The voice model on a live call
2961
+ * needs to know HOW LONG IT HAS, get reminded as that window closes,
2962
+ * and have a graceful exit when it runs out. This tool returns a
2963
+ * snapshot the model can read at any point. Cheap: pure function over
2964
+ * bridge state, returns in microseconds.
2965
+ */
2966
+ declare const GET_CALL_STATUS_TOOL: RealtimeToolDefinition;
2967
+ /**
2968
+ * v0.9.81 — ask for more time on the current call. Auto-approved up to
2969
+ * the per-call extension policy (per-request cap, per-call request cap,
2970
+ * total seconds cap). On partial / refused grants the message field
2971
+ * explains exactly what the agent has left so it can adapt rather than
2972
+ * retry-loop.
2973
+ */
2974
+ declare const EXTEND_CALL_TIME_TOOL: RealtimeToolDefinition;
2975
+ /**
2976
+ * v0.9.81 — arrange an automatic callback when you cannot finish in
2977
+ * this session (time, context, conversation needs a break, etc.). The
2978
+ * bridge captures the agent's summary + a transcript digest now; the
2979
+ * scheduler dials back at `delaySeconds` with full context loaded into
2980
+ * the next call's task. Each call can schedule AT MOST ONE callback,
2981
+ * and only within the mission's callbackPolicy.
2982
+ */
2983
+ declare const SCHEDULE_CALLBACK_TOOL: RealtimeToolDefinition;
2984
+ /**
2985
+ * v0.9.82 — the hang-up tool the agent must call when it's done.
2986
+ *
2987
+ * Before v0.9.82 the realtime voice model could SAY "Goodbye, I'll
2988
+ * hang up now" but had no way to actually drop the call — the bridge
2989
+ * only ended on a carrier-side bye (human hung up), OpenAI socket
2990
+ * close, time-budget grace expiry, or programmatic teardown from the
2991
+ * API layer. So the agent would say goodbye and then sit silently
2992
+ * waiting for the human to hang up, racking up minutes.
2993
+ *
2994
+ * end_call wires the model to {@link RealtimeVoiceBridge.endByAgentRequest}
2995
+ * which sends the carrier its end-of-call frame and closes both
2996
+ * sockets. The model is instructed (in {@link buildRealtimeToolGuidance})
2997
+ * to ALWAYS call this after it has said goodbye — verbal acknowledgement
2998
+ * is not enough.
2999
+ */
3000
+ declare const END_CALL_TOOL: RealtimeToolDefinition;
2905
3001
  /** Every tool defined in this module, keyed by name. */
2906
3002
  declare const REALTIME_TOOL_DEFINITIONS: Record<string, RealtimeToolDefinition>;
2907
3003
  /**
@@ -3821,6 +3917,38 @@ interface PhoneWebhookResult {
3821
3917
  mission: PhoneCallMission;
3822
3918
  action: Record<string, unknown>;
3823
3919
  }
3920
+ /**
3921
+ * Persisted shape of a `schedule_callback` request. Stored verbatim
3922
+ * on `mission.metadata.scheduledCallback`; the scheduler reads it back
3923
+ * when the wall-clock reaches `at`.
3924
+ *
3925
+ * - `at` — when to dial back, ISO timestamp
3926
+ * - `reason` — short audit string
3927
+ * - `agentSummary` — what the next call needs to know (model-provided)
3928
+ * - `transcriptDigest` — bridge-built rolling transcript snapshot
3929
+ * - `chainDepth` — 0 for first scheduled callback, 1 if THIS mission
3930
+ * was itself a callback, 2 if its parent was too, …
3931
+ * Used to enforce `policy.callbackPolicy.maxCallbackChain`
3932
+ * without re-walking the chain at dial time.
3933
+ * - `status` — pending → dialing → fired (mission spawned) | failed
3934
+ * - `callbackMissionId` — id of the new mission once dialing happens
3935
+ * - `armedAt` — when this record was written, audit only
3936
+ * - `firedAt` — when the scheduler actually dialed
3937
+ * - `lastError` — last dial-failure message (the scheduler retries
3938
+ * inside the manager; this is the visibility hook)
3939
+ */
3940
+ interface PhoneScheduledCallback {
3941
+ at: string;
3942
+ reason: string;
3943
+ agentSummary: string;
3944
+ transcriptDigest: string;
3945
+ chainDepth: number;
3946
+ status: 'pending' | 'dialing' | 'fired' | 'failed';
3947
+ callbackMissionId?: string;
3948
+ armedAt: string;
3949
+ firedAt?: string;
3950
+ lastError?: string;
3951
+ }
3824
3952
  declare function redactPhoneTransportConfig(config: PhoneTransportConfig): PhoneTransportConfig;
3825
3953
  declare class PhoneManager {
3826
3954
  private db;
@@ -5968,4 +6096,4 @@ declare function userSkillsDir(): string;
5968
6096
  */
5969
6097
  declare function renderSkillAsPrompt(skill: Skill): string;
5970
6098
 
5971
- export { AGENT_ROLES, ASK_OPERATOR_TOOL, AccountManager, type AddressInfo, type Agent, AgentDeletionService, type AgentMemoryEntry, type AgentMemoryFields, AgentMemoryManager, type AgentMemoryOptions, type AgentMemoryRead, AgentMemoryStore, type AgentRole, AgenticMailClient, type AgenticMailClientOptions, type AgenticMailConfig, type ArchiveAndDeleteOptions, type ArchivedEmail, type Attachment, type AttachmentAdvisory, type AudioAction, type AudioEditOptions, BRIDGE_OPERATOR_LIVE_WINDOW_MS, type BridgeMailContext, type BridgeWakeError, type BridgeWakePromptArgs, type BridgeWakeResult, type BridgeWakeRoute, type CachedMessage, CloudflareClient, type CreateAgentOptions, type CreateMemoryInput, DEFAULT_AGENT_NAME, DEFAULT_AGENT_ROLE, DEFAULT_REALTIME_AUDIO_FORMAT, DEFAULT_REALTIME_MODEL, DEFAULT_REALTIME_VOICE, DEFAULT_SESSION_MAX_AGE_MS, DEFAULT_WEB_SEARCH_ENDPOINT, DNSConfigurator, type Database, type DeletionReport, type DeletionSummary, DependencyChecker, DependencyInstaller, type DependencyStatus, type DnsRecord, type DnsSetupResult, type DomainInfo, DomainManager, type DomainModeConfig, type DomainPurchaseResult, DomainPurchaser, type DomainSearchResult, type DomainSetupResult, ELKS_REALTIME_AUDIO_FORMATS, ELKS_REALTIME_WS_PATH, type ElksRealtimeAudioFormat, type ElksRealtimeAudioMessage, type ElksRealtimeByeMessage, type ElksRealtimeHelloMessage, type ElksRealtimeInboundMessage, type ElksRealtimeOutboundMessage, ElksRealtimeTransport, type EmailEnvelope, type EmailRouteAction, type EmailRouteClass, type EmailRouteClassification, type EmailRouteInput, EmailSearchIndex, type FolderInfo, GET_DATETIME_TOOL, type GatewayConfig, GatewayManager, type GatewayManagerOptions, type GatewayMode, type GatewayStatus, type GetDatetimeOptions, type GetUpdatesOptions, type HostName, type HostSession, type HostSessionResumeMode, type ImageAction, type ImageEditOptions, type InboundEmail, type InboundSmsEvent, type InboxEvent, type InboxExpungeEvent, type InboxFlagsEvent, type InboxNewEvent, InboxWatcher, type InboxWatcherOptions, type InstallProgress, LOAD_SKILL_TOOL, type LinkAdvisory, type LocalSmtpConfig, MEMORY_CATEGORIES, MailReceiver, type MailReceiverOptions, MailSender, type MailSenderOptions, type MailboxInfo, type MediaBinary, type MediaCapability, type MediaCapabilityReport, type MediaFileResult, type MediaInfoResult, MediaManager, type MediaManagerOptions, type MediaStreamInfo, type MemoryCategory, type MemoryImportance, type MemoryQueryOptions, type MemoryRecaller, MemorySearchIndex, type MemorySource, type MemoryStats, OPENAI_REALTIME_URL, OPERATOR_QUERY_POLL_INTERVAL_MS, OPERATOR_QUERY_SUBJECT_TAG, OPERATOR_QUERY_TIMEOUT_MS, OPERATOR_QUERY_TIMEOUT_SENTINEL, type OpenClawPhoneMissionPolicy, type OperatorQueryNotificationInput, type OperatorQueryPollOptions, type OperatorQueryUrgency, type OperatorReplyKind, type OutboundCategory, type OutboundScanInput, type OutboundScanResult, type OutboundWarning, PHONE_CALL_CONTROL_PROVIDERS, PHONE_MAX_CONCURRENT_MISSIONS, PHONE_MIN_WEBHOOK_SECRET_LENGTH, PHONE_MISSION_STATES, PHONE_RATE_LIMIT_PER_HOUR, PHONE_RATE_LIMIT_PER_MINUTE, PHONE_REGION_SCOPES, PHONE_SERVER_MAX_ATTEMPTS, PHONE_SERVER_MAX_CALL_DURATION_SECONDS, PHONE_SERVER_MAX_COST_PER_MISSION, PHONE_TASK_MAX_LENGTH, type ParsedAttachment, type ParsedEmail, type ParsedOperatorReply, type ParsedSms, type ParsedTelegramMessage, PathTraversalError, type PhoneAlternativePolicy, type PhoneCallMission, type PhoneConfirmPolicy, PhoneManager, type PhoneMissionStartValidationResult, type PhoneMissionState, type PhoneMissionTranscriptEntry, type PhoneMissionValidationIssue, type PhoneMissionValidationResult, type PhoneNumberRisk, type PhoneOperatorQuery, PhoneRateLimitError, type PhoneRegionScope, type PhoneTransportConfig, type PhoneTransportProfile, type PhoneTransportProvider, type PhoneTransportValidationResult, PhoneWebhookAuthError, type PhoneWebhookResult, type PlanBridgeWakeArgs, type PurchasedDomain, REALTIME_AUDIO_SAMPLE_RATE, REALTIME_MAX_AUDIO_FRAME_BASE64, REALTIME_TOOL_CALL_TIMEOUT_MS, REALTIME_TOOL_DEFINITIONS, RECALL_MEMORY_TOOL, REDACTED, RELAY_PRESETS, type RealtimeBridgePort, type RealtimeBridgeTranscriptEntry, type RealtimeInboundEvent, type RealtimeInstructionOptions, type RealtimeSessionConfigOptions, type RealtimeToolCall, type RealtimeToolDefinition, type RealtimeToolHandler, type RealtimeToolResult, type RealtimeTransportAdapter, type RealtimeTransportProvider, RealtimeVoiceBridge, type RealtimeVoiceBridgeOptions, RelayBridge, type RelayBridgeOptions, type RelayConfig, RelayGateway, type RelayProvider, type RelaySearchResult, type ResumeErrorClassificationOptions, SEARCH_EMAIL_TOOL, SEARCH_SKILLS_TOOL, SPAM_THRESHOLD, type SafeJoinOptions, type SanitizeDetection, type SanitizeResult, type SearchCriteria, type SearchableEmail, type SecurityAdvisory, type SendMailOptions, type SendResult, type SendResultWithRaw, type SendSmsInput, type SendSmsResult, type SendTelegramMessageOptions, type SendTelegramMessageResult, ServiceManager, type ServiceStatus, type SetWebhookOptions, type SetupConfig, SetupManager, type SetupResult, type Severity, type Skill, type SkillCategory, type SkillContext, type SkillExitStrategy, type SkillSummary, type SkillTactic, type SkillValidationError, type SmsConfig, SmsManager, type SmsMessage, SmsPoller, type SmsProvider, type SpamCategory, type SpamResult, type SpamRuleMatch, StalwartAdmin, type StalwartAdminOptions, type StalwartPrincipal, type StartPhoneCallOptions, type StartPhoneCallResult, type StartPhoneMissionInput, TELEGRAM_API_BASE, TELEGRAM_CHUNK_SIZE, TELEGRAM_MESSAGE_LIMIT, TELEGRAM_MIN_WEBHOOK_SECRET_LENGTH, TELEGRAM_OPERATOR_QUERY_TAG, TELEGRAM_STOP_WORDS, TELEGRAM_WEBHOOK_SECRET_RE, TELEPHONY_TRANSPORT_CAPABILITIES, TWILIO_MEDIA_SAMPLE_RATE, TWILIO_REALTIME_WS_PATH, TelegramApiError, type TelegramApiOptions, type TelegramBotInfo, type TelegramChatType, type TelegramConfig, TelegramManager, type TelegramMessage, type TelegramMode, type TelephonyTransportCapability, ThreadCache, type ThreadCacheEntry, type ThreadCacheOptions, type ThreadIdInput, type ToolExecutor, type TtsGenerateOptions, type TunnelConfig, TunnelManager, type TwilioConnectedMessage, type TwilioMarkMessage, type TwilioMediaMessage, type TwilioRealtimeInboundMessage, type TwilioRealtimeOutboundMessage, TwilioRealtimeTransport, type TwilioStartMessage, type TwilioStopMessage, type TwilioStreamTwiMLOptions, UnsafeApiUrlError, type UpdateMemoryInput, type ValidatedPhoneMissionStart, type VideoAction, type VideoEditOptions, type VideoTimelineEntry, type VideoUnderstandOptions, type VideoUnderstandResult, type VoiceCloneOptions, WARNING_THRESHOLD, WEB_SEARCH_TOOL, WEB_SEARCH_UNTRUSTED_PREFIX, type WatcherOptions, type WebSearchOptions, assertWithinBase, bridgeWakeErrorMessage, bridgeWakeLastSeenAgeMs, buildApiUrl, buildElksAudioMessage, buildElksByeMessage, buildElksHandshakeMessages, buildElksInterruptMessage, buildElksListeningMessage, buildElksSendingMessage, buildInboundSecurityAdvisory, buildOpenAIRealtimeUrl, buildPhoneTransportConfig, buildRealtimeInstructions, buildRealtimeSessionConfig, buildRealtimeToolGuidance, buildTwilioClearMessage, buildTwilioMarkMessage, buildTwilioMediaMessage, buildTwilioSayTwiML, buildTwilioSignature, buildTwilioStreamTwiML, callTelegramApi, classifyEmailRoute, classifyPhoneNumberRisk, classifyResumeError, clearMediaCapabilityCache, closeDatabase, composeBridgeWakePrompt, createRealtimeTransport, createTestDatabase, createToolExecutor, debug, debugWarn, deleteTelegramWebhook, detectBinary, ensureDataDir, escapeXml, extractEmailAddress, extractVerificationCode, flushTelemetry, forgetHostSession, formatOperatorQueryTelegramMessage, getDatabase, getDatetime, getMediaCapabilities, getOperatorEmail, getSmsProvider, getTelegramChat, getTelegramMe, getTelegramUpdates, getTelegramWebhookInfo, hostSessionStoragePath, inferPhoneRegion, invalidateSkillCache, isInternalEmail, isLoopbackMailHost, isOperatorReplySender, isPhoneRegionAllowed, isSessionFresh, isTelegramChatAllowed, isTelegramStopCommand, isValidPhoneNumber, listSkills, loadHostSession, loadSkill, mapProviderSmsStatus, nextTelegramOffset, normalizeAddress, normalizePhoneNumber, normalizeSubject, operatorPrefsStoragePath, operatorQuerySubject, parseElksRealtimeMessage, parseEmail, parseGoogleVoiceSms, parseOperatorQueryReply, parseTelegramOperatorReply, parseTelegramUpdate, parseTwilioRealtimeMessage, planBridgeWake, pollForOperatorAnswer, recallMemory, recordToolCall, redactBotToken, redactObject, redactPhoneTransportConfig, redactSecret, redactSmsConfig, redactTelegramConfig, renderSkillAsPrompt, requireBinary, requireWhisperModel, resolveConfig, resolveTlsRejectUnauthorized, safeJoin, sanitizeEmail, saveConfig, saveHostSession, saveUserSkill, scanOutboundEmail, scoreEmail, searchSkills, sendTelegramMessage, setOperatorEmail, setTelegramWebhook, setTelemetryVersion, shouldSkipBridgeWakeForLiveOperator, splitTelegramMessage, startRelayBridge, stem, stripTelegramMarkdown, threadIdFor, tokenize, tryJoin, userSkillsDir, validateApiUrl, validatePhoneMissionPolicy, validatePhoneMissionStart, validatePhoneTransportProfile, validateSkill, validateTwilioSignature, webSearch };
6099
+ export { AGENT_ROLES, ASK_OPERATOR_TOOL, AccountManager, type AddressInfo, type Agent, AgentDeletionService, type AgentMemoryEntry, type AgentMemoryFields, AgentMemoryManager, type AgentMemoryOptions, type AgentMemoryRead, AgentMemoryStore, type AgentRole, AgenticMailClient, type AgenticMailClientOptions, type AgenticMailConfig, type ArchiveAndDeleteOptions, type ArchivedEmail, type Attachment, type AttachmentAdvisory, type AudioAction, type AudioEditOptions, BRIDGE_OPERATOR_LIVE_WINDOW_MS, type BridgeMailContext, type BridgeWakeError, type BridgeWakePromptArgs, type BridgeWakeResult, type BridgeWakeRoute, type CachedMessage, CloudflareClient, type CreateAgentOptions, type CreateMemoryInput, DEFAULT_AGENT_NAME, DEFAULT_AGENT_ROLE, DEFAULT_CALLBACK_POLICY, DEFAULT_EXTENSION_POLICY, DEFAULT_REALTIME_AUDIO_FORMAT, DEFAULT_REALTIME_MODEL, DEFAULT_REALTIME_VOICE, DEFAULT_SESSION_MAX_AGE_MS, DEFAULT_WEB_SEARCH_ENDPOINT, DNSConfigurator, type Database, type DeletionReport, type DeletionSummary, DependencyChecker, DependencyInstaller, type DependencyStatus, type DnsRecord, type DnsSetupResult, type DomainInfo, DomainManager, type DomainModeConfig, type DomainPurchaseResult, DomainPurchaser, type DomainSearchResult, type DomainSetupResult, ELKS_REALTIME_AUDIO_FORMATS, ELKS_REALTIME_WS_PATH, END_CALL_TOOL, EXTEND_CALL_TIME_TOOL, type ElksRealtimeAudioFormat, type ElksRealtimeAudioMessage, type ElksRealtimeByeMessage, type ElksRealtimeHelloMessage, type ElksRealtimeInboundMessage, type ElksRealtimeOutboundMessage, ElksRealtimeTransport, type EmailEnvelope, type EmailRouteAction, type EmailRouteClass, type EmailRouteClassification, type EmailRouteInput, EmailSearchIndex, type FolderInfo, GET_CALL_STATUS_TOOL, GET_DATETIME_TOOL, type GatewayConfig, GatewayManager, type GatewayManagerOptions, type GatewayMode, type GatewayStatus, type GetDatetimeOptions, type GetUpdatesOptions, type HostName, type HostSession, type HostSessionResumeMode, type ImageAction, type ImageEditOptions, type InboundEmail, type InboundSmsEvent, type InboxEvent, type InboxExpungeEvent, type InboxFlagsEvent, type InboxNewEvent, InboxWatcher, type InboxWatcherOptions, type InstallProgress, LOAD_SKILL_TOOL, type LinkAdvisory, type LocalSmtpConfig, MEMORY_CATEGORIES, MailReceiver, type MailReceiverOptions, MailSender, type MailSenderOptions, type MailboxInfo, type MediaBinary, type MediaCapability, type MediaCapabilityReport, type MediaFileResult, type MediaInfoResult, MediaManager, type MediaManagerOptions, type MediaStreamInfo, type MemoryCategory, type MemoryImportance, type MemoryQueryOptions, type MemoryRecaller, MemorySearchIndex, type MemorySource, type MemoryStats, OPENAI_REALTIME_URL, OPERATOR_QUERY_POLL_INTERVAL_MS, OPERATOR_QUERY_SUBJECT_TAG, OPERATOR_QUERY_TIMEOUT_MS, OPERATOR_QUERY_TIMEOUT_SENTINEL, type OpenClawPhoneMissionPolicy, type OperatorQueryNotificationInput, type OperatorQueryPollOptions, type OperatorQueryUrgency, type OperatorReplyKind, type OutboundCategory, type OutboundScanInput, type OutboundScanResult, type OutboundWarning, PHONE_CALLBACK_MAX_DELAY_SECONDS, PHONE_CALLBACK_MIN_DELAY_SECONDS, PHONE_CALL_CONTROL_PROVIDERS, PHONE_MAX_CONCURRENT_MISSIONS, PHONE_MIN_WEBHOOK_SECRET_LENGTH, PHONE_MISSION_STATES, PHONE_RATE_LIMIT_PER_HOUR, PHONE_RATE_LIMIT_PER_MINUTE, PHONE_REGION_SCOPES, PHONE_SERVER_MAX_ATTEMPTS, PHONE_SERVER_MAX_CALLBACK_CHAIN, PHONE_SERVER_MAX_CALL_DURATION_SECONDS, PHONE_SERVER_MAX_COST_PER_MISSION, PHONE_SERVER_MAX_EXTENSION_REQUESTS_PER_CALL, PHONE_SERVER_MAX_EXTENSION_SECONDS_PER_REQUEST, PHONE_SERVER_MAX_TOTAL_EXTENSION_SECONDS, PHONE_TASK_MAX_LENGTH, type ParsedAttachment, type ParsedEmail, type ParsedOperatorReply, type ParsedSms, type ParsedTelegramMessage, PathTraversalError, type PhoneAlternativePolicy, type PhoneCallMission, type PhoneCallbackPolicy, type PhoneConfirmPolicy, type PhoneExtensionPolicy, PhoneManager, type PhoneMissionStartValidationResult, type PhoneMissionState, type PhoneMissionTranscriptEntry, type PhoneMissionValidationIssue, type PhoneMissionValidationResult, type PhoneNumberRisk, type PhoneOperatorQuery, PhoneRateLimitError, type PhoneRegionScope, type PhoneScheduledCallback, type PhoneTransportConfig, type PhoneTransportProfile, type PhoneTransportProvider, type PhoneTransportValidationResult, PhoneWebhookAuthError, type PhoneWebhookResult, type PlanBridgeWakeArgs, type PurchasedDomain, REALTIME_AUDIO_SAMPLE_RATE, REALTIME_MAX_AUDIO_FRAME_BASE64, REALTIME_TOOL_CALL_TIMEOUT_MS, REALTIME_TOOL_DEFINITIONS, RECALL_MEMORY_TOOL, REDACTED, RELAY_PRESETS, type RealtimeBridgePort, type RealtimeBridgeTranscriptEntry, type RealtimeInboundEvent, type RealtimeInstructionOptions, type RealtimeSessionConfigOptions, type RealtimeToolCall, type RealtimeToolDefinition, type RealtimeToolHandler, type RealtimeToolResult, type RealtimeTransportAdapter, type RealtimeTransportProvider, RealtimeVoiceBridge, type RealtimeVoiceBridgeOptions, RelayBridge, type RelayBridgeOptions, type RelayConfig, RelayGateway, type RelayProvider, type RelaySearchResult, type ResumeErrorClassificationOptions, SCHEDULE_CALLBACK_TOOL, SEARCH_EMAIL_TOOL, SEARCH_SKILLS_TOOL, SPAM_THRESHOLD, type SafeJoinOptions, type SanitizeDetection, type SanitizeResult, type ScheduledCallbackRequest, type SearchCriteria, type SearchableEmail, type SecurityAdvisory, type SendMailOptions, type SendResult, type SendResultWithRaw, type SendSmsInput, type SendSmsResult, type SendTelegramMessageOptions, type SendTelegramMessageResult, ServiceManager, type ServiceStatus, type SetWebhookOptions, type SetupConfig, SetupManager, type SetupResult, type Severity, type Skill, type SkillCategory, type SkillContext, type SkillExitStrategy, type SkillSummary, type SkillTactic, type SkillValidationError, type SmsConfig, SmsManager, type SmsMessage, SmsPoller, type SmsProvider, type SpamCategory, type SpamResult, type SpamRuleMatch, StalwartAdmin, type StalwartAdminOptions, type StalwartPrincipal, type StartPhoneCallOptions, type StartPhoneCallResult, type StartPhoneMissionInput, TELEGRAM_API_BASE, TELEGRAM_CHUNK_SIZE, TELEGRAM_MESSAGE_LIMIT, TELEGRAM_MIN_WEBHOOK_SECRET_LENGTH, TELEGRAM_OPERATOR_QUERY_TAG, TELEGRAM_STOP_WORDS, TELEGRAM_WEBHOOK_SECRET_RE, TELEPHONY_TRANSPORT_CAPABILITIES, TWILIO_MEDIA_SAMPLE_RATE, TWILIO_REALTIME_WS_PATH, TelegramApiError, type TelegramApiOptions, type TelegramBotInfo, type TelegramChatType, type TelegramConfig, TelegramManager, type TelegramMessage, type TelegramMode, type TelephonyTransportCapability, ThreadCache, type ThreadCacheEntry, type ThreadCacheOptions, type ThreadIdInput, type ToolExecutor, type TtsGenerateOptions, type TunnelConfig, TunnelManager, type TwilioConnectedMessage, type TwilioMarkMessage, type TwilioMediaMessage, type TwilioRealtimeInboundMessage, type TwilioRealtimeOutboundMessage, TwilioRealtimeTransport, type TwilioStartMessage, type TwilioStopMessage, type TwilioStreamTwiMLOptions, UnsafeApiUrlError, type UpdateMemoryInput, type ValidatedPhoneMissionStart, type VideoAction, type VideoEditOptions, type VideoTimelineEntry, type VideoUnderstandOptions, type VideoUnderstandResult, type VoiceCloneOptions, WARNING_THRESHOLD, WEB_SEARCH_TOOL, WEB_SEARCH_UNTRUSTED_PREFIX, type WatcherOptions, type WebSearchOptions, assertWithinBase, bridgeWakeErrorMessage, bridgeWakeLastSeenAgeMs, buildApiUrl, buildElksAudioMessage, buildElksByeMessage, buildElksHandshakeMessages, buildElksInterruptMessage, buildElksListeningMessage, buildElksSendingMessage, buildInboundSecurityAdvisory, buildOpenAIRealtimeUrl, buildPhoneTransportConfig, buildRealtimeInstructions, buildRealtimeSessionConfig, buildRealtimeToolGuidance, buildTwilioClearMessage, buildTwilioMarkMessage, buildTwilioMediaMessage, buildTwilioSayTwiML, buildTwilioSignature, buildTwilioStreamTwiML, callTelegramApi, classifyEmailRoute, classifyPhoneNumberRisk, classifyResumeError, clearMediaCapabilityCache, closeDatabase, composeBridgeWakePrompt, createRealtimeTransport, createTestDatabase, createToolExecutor, debug, debugWarn, deleteTelegramWebhook, detectBinary, ensureDataDir, escapeXml, extractEmailAddress, extractVerificationCode, flushTelemetry, forgetHostSession, formatOperatorQueryTelegramMessage, getDatabase, getDatetime, getMediaCapabilities, getOperatorEmail, getSmsProvider, getTelegramChat, getTelegramMe, getTelegramUpdates, getTelegramWebhookInfo, hostSessionStoragePath, inferPhoneRegion, invalidateSkillCache, isInternalEmail, isLoopbackMailHost, isOperatorReplySender, isPhoneRegionAllowed, isSessionFresh, isTelegramChatAllowed, isTelegramStopCommand, isValidPhoneNumber, listSkills, loadHostSession, loadSkill, mapProviderSmsStatus, nextTelegramOffset, normalizeAddress, normalizePhoneNumber, normalizeSubject, operatorPrefsStoragePath, operatorQuerySubject, parseElksRealtimeMessage, parseEmail, parseGoogleVoiceSms, parseOperatorQueryReply, parseTelegramOperatorReply, parseTelegramUpdate, parseTwilioRealtimeMessage, planBridgeWake, pollForOperatorAnswer, recallMemory, recordToolCall, redactBotToken, redactObject, redactPhoneTransportConfig, redactSecret, redactSmsConfig, redactTelegramConfig, renderSkillAsPrompt, requireBinary, requireWhisperModel, resolveCallbackPolicy, resolveConfig, resolveExtensionPolicy, resolveTlsRejectUnauthorized, safeJoin, sanitizeEmail, saveConfig, saveHostSession, saveUserSkill, scanOutboundEmail, scoreEmail, searchSkills, sendTelegramMessage, setOperatorEmail, setTelegramWebhook, setTelemetryVersion, shouldSkipBridgeWakeForLiveOperator, splitTelegramMessage, startRelayBridge, stem, stripTelegramMarkdown, threadIdFor, tokenize, tryJoin, userSkillsDir, validateApiUrl, validatePhoneMissionPolicy, validatePhoneMissionStart, validatePhoneTransportProfile, validateSkill, validateTwilioSignature, webSearch };
package/dist/index.d.ts CHANGED
@@ -2623,6 +2623,51 @@ declare const PHONE_SERVER_MAX_COST_PER_MISSION = 5;
2623
2623
  declare const PHONE_SERVER_MAX_ATTEMPTS = 3;
2624
2624
  /** Hard cap on the free-text `task` fed to the voice runtime. */
2625
2625
  declare const PHONE_TASK_MAX_LENGTH = 2000;
2626
+ /**
2627
+ * Server-side ceilings for the extension policy. Like the duration /
2628
+ * cost caps above, these are the financial blast-radius bound — a
2629
+ * caller can ask for a stricter extension policy but never a looser
2630
+ * one. The defaults err on the side of "give the agent a fighting
2631
+ * chance to finish a real call" without letting it sit on the line
2632
+ * forever. v0.9.82 bumped these substantially after field reports of
2633
+ * agents running out of time on legitimately long calls (15-25 min
2634
+ * hold queues, 30 min explanations from the rep):
2635
+ *
2636
+ * - per-request cap raised 5 min → 15 min so a single "I need more
2637
+ * time on hold" request can carry the agent through a queue
2638
+ * - per-call cap raised 4 → 8 so chained extensions don't run dry
2639
+ * on a long bureaucracy call
2640
+ * - total cap raised 10 min → 1 hour so the absolute add can match
2641
+ * a long-tail call without artificial chunking
2642
+ *
2643
+ * The TOTAL also can't push the call past
2644
+ * PHONE_SERVER_MAX_CALL_DURATION_SECONDS — that ceiling still wins.
2645
+ */
2646
+ declare const PHONE_SERVER_MAX_EXTENSION_SECONDS_PER_REQUEST = 900;
2647
+ declare const PHONE_SERVER_MAX_EXTENSION_REQUESTS_PER_CALL = 8;
2648
+ declare const PHONE_SERVER_MAX_TOTAL_EXTENSION_SECONDS = 3600;
2649
+ /** Default per-call extension envelope when the caller doesn't set one.
2650
+ * Bumped in v0.9.82 — 5 min × 4 = 20 min of headroom is a much more
2651
+ * realistic out-of-the-box budget for the kinds of calls operators
2652
+ * actually use this for (bills, bookings, customer support). */
2653
+ declare const DEFAULT_EXTENSION_POLICY: PhoneExtensionPolicy;
2654
+ /**
2655
+ * Server-side ceiling on how deep a callback chain can go. Each call
2656
+ * counts; a brand-new mission is depth 0, its callback is depth 1, the
2657
+ * callback's callback is depth 2. Prevents an agent + bot operator on
2658
+ * the other end from getting stuck in an infinite re-dial loop.
2659
+ */
2660
+ declare const PHONE_SERVER_MAX_CALLBACK_CHAIN = 3;
2661
+ /** Default callback envelope when the caller doesn't set one. */
2662
+ declare const DEFAULT_CALLBACK_POLICY: PhoneCallbackPolicy;
2663
+ /**
2664
+ * Floor + ceiling on how far into the future a `schedule_callback` may
2665
+ * defer. Lower bound prevents instant re-dial loops (give the human a
2666
+ * breath); upper bound bounds the staging window so a scheduled
2667
+ * callback can't sit in the DB forever.
2668
+ */
2669
+ declare const PHONE_CALLBACK_MIN_DELAY_SECONDS = 30;
2670
+ declare const PHONE_CALLBACK_MAX_DELAY_SECONDS: number;
2626
2671
  interface PhoneConfirmPolicy {
2627
2672
  paymentDetails: 'never';
2628
2673
  contractCommitment: 'never';
@@ -2746,6 +2791,15 @@ type PhoneMissionStartValidationResult = {
2746
2791
  ok: false;
2747
2792
  issues: PhoneMissionValidationIssue[];
2748
2793
  };
2794
+ /**
2795
+ * Resolve the effective extension policy: caller's value (if any),
2796
+ * clamped DOWN to the server ceiling on each field. The server cap
2797
+ * always wins — a caller asking for `maxSecondsPerRequest: 999_999`
2798
+ * gets {@link PHONE_SERVER_MAX_EXTENSION_SECONDS_PER_REQUEST}.
2799
+ */
2800
+ declare function resolveExtensionPolicy(input: PhoneExtensionPolicy | undefined): PhoneExtensionPolicy;
2801
+ /** Resolve the effective callback policy with server-ceiling clamping. */
2802
+ declare function resolveCallbackPolicy(input: PhoneCallbackPolicy | undefined): PhoneCallbackPolicy;
2749
2803
  declare function validatePhoneMissionPolicy(policy: unknown): PhoneMissionValidationResult;
2750
2804
  declare function validatePhoneTransportProfile(transport: unknown): PhoneTransportValidationResult;
2751
2805
  declare function inferPhoneRegion(phoneNumber: string): PhoneRegionScope | null;
@@ -2902,6 +2956,48 @@ declare const SEARCH_SKILLS_TOOL: RealtimeToolDefinition;
2902
2956
  * oldest (the bridge enforces this).
2903
2957
  */
2904
2958
  declare const LOAD_SKILL_TOOL: RealtimeToolDefinition;
2959
+ /**
2960
+ * v0.9.81 — time-budget self-awareness. The voice model on a live call
2961
+ * needs to know HOW LONG IT HAS, get reminded as that window closes,
2962
+ * and have a graceful exit when it runs out. This tool returns a
2963
+ * snapshot the model can read at any point. Cheap: pure function over
2964
+ * bridge state, returns in microseconds.
2965
+ */
2966
+ declare const GET_CALL_STATUS_TOOL: RealtimeToolDefinition;
2967
+ /**
2968
+ * v0.9.81 — ask for more time on the current call. Auto-approved up to
2969
+ * the per-call extension policy (per-request cap, per-call request cap,
2970
+ * total seconds cap). On partial / refused grants the message field
2971
+ * explains exactly what the agent has left so it can adapt rather than
2972
+ * retry-loop.
2973
+ */
2974
+ declare const EXTEND_CALL_TIME_TOOL: RealtimeToolDefinition;
2975
+ /**
2976
+ * v0.9.81 — arrange an automatic callback when you cannot finish in
2977
+ * this session (time, context, conversation needs a break, etc.). The
2978
+ * bridge captures the agent's summary + a transcript digest now; the
2979
+ * scheduler dials back at `delaySeconds` with full context loaded into
2980
+ * the next call's task. Each call can schedule AT MOST ONE callback,
2981
+ * and only within the mission's callbackPolicy.
2982
+ */
2983
+ declare const SCHEDULE_CALLBACK_TOOL: RealtimeToolDefinition;
2984
+ /**
2985
+ * v0.9.82 — the hang-up tool the agent must call when it's done.
2986
+ *
2987
+ * Before v0.9.82 the realtime voice model could SAY "Goodbye, I'll
2988
+ * hang up now" but had no way to actually drop the call — the bridge
2989
+ * only ended on a carrier-side bye (human hung up), OpenAI socket
2990
+ * close, time-budget grace expiry, or programmatic teardown from the
2991
+ * API layer. So the agent would say goodbye and then sit silently
2992
+ * waiting for the human to hang up, racking up minutes.
2993
+ *
2994
+ * end_call wires the model to {@link RealtimeVoiceBridge.endByAgentRequest}
2995
+ * which sends the carrier its end-of-call frame and closes both
2996
+ * sockets. The model is instructed (in {@link buildRealtimeToolGuidance})
2997
+ * to ALWAYS call this after it has said goodbye — verbal acknowledgement
2998
+ * is not enough.
2999
+ */
3000
+ declare const END_CALL_TOOL: RealtimeToolDefinition;
2905
3001
  /** Every tool defined in this module, keyed by name. */
2906
3002
  declare const REALTIME_TOOL_DEFINITIONS: Record<string, RealtimeToolDefinition>;
2907
3003
  /**
@@ -3821,6 +3917,38 @@ interface PhoneWebhookResult {
3821
3917
  mission: PhoneCallMission;
3822
3918
  action: Record<string, unknown>;
3823
3919
  }
3920
+ /**
3921
+ * Persisted shape of a `schedule_callback` request. Stored verbatim
3922
+ * on `mission.metadata.scheduledCallback`; the scheduler reads it back
3923
+ * when the wall-clock reaches `at`.
3924
+ *
3925
+ * - `at` — when to dial back, ISO timestamp
3926
+ * - `reason` — short audit string
3927
+ * - `agentSummary` — what the next call needs to know (model-provided)
3928
+ * - `transcriptDigest` — bridge-built rolling transcript snapshot
3929
+ * - `chainDepth` — 0 for first scheduled callback, 1 if THIS mission
3930
+ * was itself a callback, 2 if its parent was too, …
3931
+ * Used to enforce `policy.callbackPolicy.maxCallbackChain`
3932
+ * without re-walking the chain at dial time.
3933
+ * - `status` — pending → dialing → fired (mission spawned) | failed
3934
+ * - `callbackMissionId` — id of the new mission once dialing happens
3935
+ * - `armedAt` — when this record was written, audit only
3936
+ * - `firedAt` — when the scheduler actually dialed
3937
+ * - `lastError` — last dial-failure message (the scheduler retries
3938
+ * inside the manager; this is the visibility hook)
3939
+ */
3940
+ interface PhoneScheduledCallback {
3941
+ at: string;
3942
+ reason: string;
3943
+ agentSummary: string;
3944
+ transcriptDigest: string;
3945
+ chainDepth: number;
3946
+ status: 'pending' | 'dialing' | 'fired' | 'failed';
3947
+ callbackMissionId?: string;
3948
+ armedAt: string;
3949
+ firedAt?: string;
3950
+ lastError?: string;
3951
+ }
3824
3952
  declare function redactPhoneTransportConfig(config: PhoneTransportConfig): PhoneTransportConfig;
3825
3953
  declare class PhoneManager {
3826
3954
  private db;
@@ -5968,4 +6096,4 @@ declare function userSkillsDir(): string;
5968
6096
  */
5969
6097
  declare function renderSkillAsPrompt(skill: Skill): string;
5970
6098
 
5971
- export { AGENT_ROLES, ASK_OPERATOR_TOOL, AccountManager, type AddressInfo, type Agent, AgentDeletionService, type AgentMemoryEntry, type AgentMemoryFields, AgentMemoryManager, type AgentMemoryOptions, type AgentMemoryRead, AgentMemoryStore, type AgentRole, AgenticMailClient, type AgenticMailClientOptions, type AgenticMailConfig, type ArchiveAndDeleteOptions, type ArchivedEmail, type Attachment, type AttachmentAdvisory, type AudioAction, type AudioEditOptions, BRIDGE_OPERATOR_LIVE_WINDOW_MS, type BridgeMailContext, type BridgeWakeError, type BridgeWakePromptArgs, type BridgeWakeResult, type BridgeWakeRoute, type CachedMessage, CloudflareClient, type CreateAgentOptions, type CreateMemoryInput, DEFAULT_AGENT_NAME, DEFAULT_AGENT_ROLE, DEFAULT_REALTIME_AUDIO_FORMAT, DEFAULT_REALTIME_MODEL, DEFAULT_REALTIME_VOICE, DEFAULT_SESSION_MAX_AGE_MS, DEFAULT_WEB_SEARCH_ENDPOINT, DNSConfigurator, type Database, type DeletionReport, type DeletionSummary, DependencyChecker, DependencyInstaller, type DependencyStatus, type DnsRecord, type DnsSetupResult, type DomainInfo, DomainManager, type DomainModeConfig, type DomainPurchaseResult, DomainPurchaser, type DomainSearchResult, type DomainSetupResult, ELKS_REALTIME_AUDIO_FORMATS, ELKS_REALTIME_WS_PATH, type ElksRealtimeAudioFormat, type ElksRealtimeAudioMessage, type ElksRealtimeByeMessage, type ElksRealtimeHelloMessage, type ElksRealtimeInboundMessage, type ElksRealtimeOutboundMessage, ElksRealtimeTransport, type EmailEnvelope, type EmailRouteAction, type EmailRouteClass, type EmailRouteClassification, type EmailRouteInput, EmailSearchIndex, type FolderInfo, GET_DATETIME_TOOL, type GatewayConfig, GatewayManager, type GatewayManagerOptions, type GatewayMode, type GatewayStatus, type GetDatetimeOptions, type GetUpdatesOptions, type HostName, type HostSession, type HostSessionResumeMode, type ImageAction, type ImageEditOptions, type InboundEmail, type InboundSmsEvent, type InboxEvent, type InboxExpungeEvent, type InboxFlagsEvent, type InboxNewEvent, InboxWatcher, type InboxWatcherOptions, type InstallProgress, LOAD_SKILL_TOOL, type LinkAdvisory, type LocalSmtpConfig, MEMORY_CATEGORIES, MailReceiver, type MailReceiverOptions, MailSender, type MailSenderOptions, type MailboxInfo, type MediaBinary, type MediaCapability, type MediaCapabilityReport, type MediaFileResult, type MediaInfoResult, MediaManager, type MediaManagerOptions, type MediaStreamInfo, type MemoryCategory, type MemoryImportance, type MemoryQueryOptions, type MemoryRecaller, MemorySearchIndex, type MemorySource, type MemoryStats, OPENAI_REALTIME_URL, OPERATOR_QUERY_POLL_INTERVAL_MS, OPERATOR_QUERY_SUBJECT_TAG, OPERATOR_QUERY_TIMEOUT_MS, OPERATOR_QUERY_TIMEOUT_SENTINEL, type OpenClawPhoneMissionPolicy, type OperatorQueryNotificationInput, type OperatorQueryPollOptions, type OperatorQueryUrgency, type OperatorReplyKind, type OutboundCategory, type OutboundScanInput, type OutboundScanResult, type OutboundWarning, PHONE_CALL_CONTROL_PROVIDERS, PHONE_MAX_CONCURRENT_MISSIONS, PHONE_MIN_WEBHOOK_SECRET_LENGTH, PHONE_MISSION_STATES, PHONE_RATE_LIMIT_PER_HOUR, PHONE_RATE_LIMIT_PER_MINUTE, PHONE_REGION_SCOPES, PHONE_SERVER_MAX_ATTEMPTS, PHONE_SERVER_MAX_CALL_DURATION_SECONDS, PHONE_SERVER_MAX_COST_PER_MISSION, PHONE_TASK_MAX_LENGTH, type ParsedAttachment, type ParsedEmail, type ParsedOperatorReply, type ParsedSms, type ParsedTelegramMessage, PathTraversalError, type PhoneAlternativePolicy, type PhoneCallMission, type PhoneConfirmPolicy, PhoneManager, type PhoneMissionStartValidationResult, type PhoneMissionState, type PhoneMissionTranscriptEntry, type PhoneMissionValidationIssue, type PhoneMissionValidationResult, type PhoneNumberRisk, type PhoneOperatorQuery, PhoneRateLimitError, type PhoneRegionScope, type PhoneTransportConfig, type PhoneTransportProfile, type PhoneTransportProvider, type PhoneTransportValidationResult, PhoneWebhookAuthError, type PhoneWebhookResult, type PlanBridgeWakeArgs, type PurchasedDomain, REALTIME_AUDIO_SAMPLE_RATE, REALTIME_MAX_AUDIO_FRAME_BASE64, REALTIME_TOOL_CALL_TIMEOUT_MS, REALTIME_TOOL_DEFINITIONS, RECALL_MEMORY_TOOL, REDACTED, RELAY_PRESETS, type RealtimeBridgePort, type RealtimeBridgeTranscriptEntry, type RealtimeInboundEvent, type RealtimeInstructionOptions, type RealtimeSessionConfigOptions, type RealtimeToolCall, type RealtimeToolDefinition, type RealtimeToolHandler, type RealtimeToolResult, type RealtimeTransportAdapter, type RealtimeTransportProvider, RealtimeVoiceBridge, type RealtimeVoiceBridgeOptions, RelayBridge, type RelayBridgeOptions, type RelayConfig, RelayGateway, type RelayProvider, type RelaySearchResult, type ResumeErrorClassificationOptions, SEARCH_EMAIL_TOOL, SEARCH_SKILLS_TOOL, SPAM_THRESHOLD, type SafeJoinOptions, type SanitizeDetection, type SanitizeResult, type SearchCriteria, type SearchableEmail, type SecurityAdvisory, type SendMailOptions, type SendResult, type SendResultWithRaw, type SendSmsInput, type SendSmsResult, type SendTelegramMessageOptions, type SendTelegramMessageResult, ServiceManager, type ServiceStatus, type SetWebhookOptions, type SetupConfig, SetupManager, type SetupResult, type Severity, type Skill, type SkillCategory, type SkillContext, type SkillExitStrategy, type SkillSummary, type SkillTactic, type SkillValidationError, type SmsConfig, SmsManager, type SmsMessage, SmsPoller, type SmsProvider, type SpamCategory, type SpamResult, type SpamRuleMatch, StalwartAdmin, type StalwartAdminOptions, type StalwartPrincipal, type StartPhoneCallOptions, type StartPhoneCallResult, type StartPhoneMissionInput, TELEGRAM_API_BASE, TELEGRAM_CHUNK_SIZE, TELEGRAM_MESSAGE_LIMIT, TELEGRAM_MIN_WEBHOOK_SECRET_LENGTH, TELEGRAM_OPERATOR_QUERY_TAG, TELEGRAM_STOP_WORDS, TELEGRAM_WEBHOOK_SECRET_RE, TELEPHONY_TRANSPORT_CAPABILITIES, TWILIO_MEDIA_SAMPLE_RATE, TWILIO_REALTIME_WS_PATH, TelegramApiError, type TelegramApiOptions, type TelegramBotInfo, type TelegramChatType, type TelegramConfig, TelegramManager, type TelegramMessage, type TelegramMode, type TelephonyTransportCapability, ThreadCache, type ThreadCacheEntry, type ThreadCacheOptions, type ThreadIdInput, type ToolExecutor, type TtsGenerateOptions, type TunnelConfig, TunnelManager, type TwilioConnectedMessage, type TwilioMarkMessage, type TwilioMediaMessage, type TwilioRealtimeInboundMessage, type TwilioRealtimeOutboundMessage, TwilioRealtimeTransport, type TwilioStartMessage, type TwilioStopMessage, type TwilioStreamTwiMLOptions, UnsafeApiUrlError, type UpdateMemoryInput, type ValidatedPhoneMissionStart, type VideoAction, type VideoEditOptions, type VideoTimelineEntry, type VideoUnderstandOptions, type VideoUnderstandResult, type VoiceCloneOptions, WARNING_THRESHOLD, WEB_SEARCH_TOOL, WEB_SEARCH_UNTRUSTED_PREFIX, type WatcherOptions, type WebSearchOptions, assertWithinBase, bridgeWakeErrorMessage, bridgeWakeLastSeenAgeMs, buildApiUrl, buildElksAudioMessage, buildElksByeMessage, buildElksHandshakeMessages, buildElksInterruptMessage, buildElksListeningMessage, buildElksSendingMessage, buildInboundSecurityAdvisory, buildOpenAIRealtimeUrl, buildPhoneTransportConfig, buildRealtimeInstructions, buildRealtimeSessionConfig, buildRealtimeToolGuidance, buildTwilioClearMessage, buildTwilioMarkMessage, buildTwilioMediaMessage, buildTwilioSayTwiML, buildTwilioSignature, buildTwilioStreamTwiML, callTelegramApi, classifyEmailRoute, classifyPhoneNumberRisk, classifyResumeError, clearMediaCapabilityCache, closeDatabase, composeBridgeWakePrompt, createRealtimeTransport, createTestDatabase, createToolExecutor, debug, debugWarn, deleteTelegramWebhook, detectBinary, ensureDataDir, escapeXml, extractEmailAddress, extractVerificationCode, flushTelemetry, forgetHostSession, formatOperatorQueryTelegramMessage, getDatabase, getDatetime, getMediaCapabilities, getOperatorEmail, getSmsProvider, getTelegramChat, getTelegramMe, getTelegramUpdates, getTelegramWebhookInfo, hostSessionStoragePath, inferPhoneRegion, invalidateSkillCache, isInternalEmail, isLoopbackMailHost, isOperatorReplySender, isPhoneRegionAllowed, isSessionFresh, isTelegramChatAllowed, isTelegramStopCommand, isValidPhoneNumber, listSkills, loadHostSession, loadSkill, mapProviderSmsStatus, nextTelegramOffset, normalizeAddress, normalizePhoneNumber, normalizeSubject, operatorPrefsStoragePath, operatorQuerySubject, parseElksRealtimeMessage, parseEmail, parseGoogleVoiceSms, parseOperatorQueryReply, parseTelegramOperatorReply, parseTelegramUpdate, parseTwilioRealtimeMessage, planBridgeWake, pollForOperatorAnswer, recallMemory, recordToolCall, redactBotToken, redactObject, redactPhoneTransportConfig, redactSecret, redactSmsConfig, redactTelegramConfig, renderSkillAsPrompt, requireBinary, requireWhisperModel, resolveConfig, resolveTlsRejectUnauthorized, safeJoin, sanitizeEmail, saveConfig, saveHostSession, saveUserSkill, scanOutboundEmail, scoreEmail, searchSkills, sendTelegramMessage, setOperatorEmail, setTelegramWebhook, setTelemetryVersion, shouldSkipBridgeWakeForLiveOperator, splitTelegramMessage, startRelayBridge, stem, stripTelegramMarkdown, threadIdFor, tokenize, tryJoin, userSkillsDir, validateApiUrl, validatePhoneMissionPolicy, validatePhoneMissionStart, validatePhoneTransportProfile, validateSkill, validateTwilioSignature, webSearch };
6099
+ export { AGENT_ROLES, ASK_OPERATOR_TOOL, AccountManager, type AddressInfo, type Agent, AgentDeletionService, type AgentMemoryEntry, type AgentMemoryFields, AgentMemoryManager, type AgentMemoryOptions, type AgentMemoryRead, AgentMemoryStore, type AgentRole, AgenticMailClient, type AgenticMailClientOptions, type AgenticMailConfig, type ArchiveAndDeleteOptions, type ArchivedEmail, type Attachment, type AttachmentAdvisory, type AudioAction, type AudioEditOptions, BRIDGE_OPERATOR_LIVE_WINDOW_MS, type BridgeMailContext, type BridgeWakeError, type BridgeWakePromptArgs, type BridgeWakeResult, type BridgeWakeRoute, type CachedMessage, CloudflareClient, type CreateAgentOptions, type CreateMemoryInput, DEFAULT_AGENT_NAME, DEFAULT_AGENT_ROLE, DEFAULT_CALLBACK_POLICY, DEFAULT_EXTENSION_POLICY, DEFAULT_REALTIME_AUDIO_FORMAT, DEFAULT_REALTIME_MODEL, DEFAULT_REALTIME_VOICE, DEFAULT_SESSION_MAX_AGE_MS, DEFAULT_WEB_SEARCH_ENDPOINT, DNSConfigurator, type Database, type DeletionReport, type DeletionSummary, DependencyChecker, DependencyInstaller, type DependencyStatus, type DnsRecord, type DnsSetupResult, type DomainInfo, DomainManager, type DomainModeConfig, type DomainPurchaseResult, DomainPurchaser, type DomainSearchResult, type DomainSetupResult, ELKS_REALTIME_AUDIO_FORMATS, ELKS_REALTIME_WS_PATH, END_CALL_TOOL, EXTEND_CALL_TIME_TOOL, type ElksRealtimeAudioFormat, type ElksRealtimeAudioMessage, type ElksRealtimeByeMessage, type ElksRealtimeHelloMessage, type ElksRealtimeInboundMessage, type ElksRealtimeOutboundMessage, ElksRealtimeTransport, type EmailEnvelope, type EmailRouteAction, type EmailRouteClass, type EmailRouteClassification, type EmailRouteInput, EmailSearchIndex, type FolderInfo, GET_CALL_STATUS_TOOL, GET_DATETIME_TOOL, type GatewayConfig, GatewayManager, type GatewayManagerOptions, type GatewayMode, type GatewayStatus, type GetDatetimeOptions, type GetUpdatesOptions, type HostName, type HostSession, type HostSessionResumeMode, type ImageAction, type ImageEditOptions, type InboundEmail, type InboundSmsEvent, type InboxEvent, type InboxExpungeEvent, type InboxFlagsEvent, type InboxNewEvent, InboxWatcher, type InboxWatcherOptions, type InstallProgress, LOAD_SKILL_TOOL, type LinkAdvisory, type LocalSmtpConfig, MEMORY_CATEGORIES, MailReceiver, type MailReceiverOptions, MailSender, type MailSenderOptions, type MailboxInfo, type MediaBinary, type MediaCapability, type MediaCapabilityReport, type MediaFileResult, type MediaInfoResult, MediaManager, type MediaManagerOptions, type MediaStreamInfo, type MemoryCategory, type MemoryImportance, type MemoryQueryOptions, type MemoryRecaller, MemorySearchIndex, type MemorySource, type MemoryStats, OPENAI_REALTIME_URL, OPERATOR_QUERY_POLL_INTERVAL_MS, OPERATOR_QUERY_SUBJECT_TAG, OPERATOR_QUERY_TIMEOUT_MS, OPERATOR_QUERY_TIMEOUT_SENTINEL, type OpenClawPhoneMissionPolicy, type OperatorQueryNotificationInput, type OperatorQueryPollOptions, type OperatorQueryUrgency, type OperatorReplyKind, type OutboundCategory, type OutboundScanInput, type OutboundScanResult, type OutboundWarning, PHONE_CALLBACK_MAX_DELAY_SECONDS, PHONE_CALLBACK_MIN_DELAY_SECONDS, PHONE_CALL_CONTROL_PROVIDERS, PHONE_MAX_CONCURRENT_MISSIONS, PHONE_MIN_WEBHOOK_SECRET_LENGTH, PHONE_MISSION_STATES, PHONE_RATE_LIMIT_PER_HOUR, PHONE_RATE_LIMIT_PER_MINUTE, PHONE_REGION_SCOPES, PHONE_SERVER_MAX_ATTEMPTS, PHONE_SERVER_MAX_CALLBACK_CHAIN, PHONE_SERVER_MAX_CALL_DURATION_SECONDS, PHONE_SERVER_MAX_COST_PER_MISSION, PHONE_SERVER_MAX_EXTENSION_REQUESTS_PER_CALL, PHONE_SERVER_MAX_EXTENSION_SECONDS_PER_REQUEST, PHONE_SERVER_MAX_TOTAL_EXTENSION_SECONDS, PHONE_TASK_MAX_LENGTH, type ParsedAttachment, type ParsedEmail, type ParsedOperatorReply, type ParsedSms, type ParsedTelegramMessage, PathTraversalError, type PhoneAlternativePolicy, type PhoneCallMission, type PhoneCallbackPolicy, type PhoneConfirmPolicy, type PhoneExtensionPolicy, PhoneManager, type PhoneMissionStartValidationResult, type PhoneMissionState, type PhoneMissionTranscriptEntry, type PhoneMissionValidationIssue, type PhoneMissionValidationResult, type PhoneNumberRisk, type PhoneOperatorQuery, PhoneRateLimitError, type PhoneRegionScope, type PhoneScheduledCallback, type PhoneTransportConfig, type PhoneTransportProfile, type PhoneTransportProvider, type PhoneTransportValidationResult, PhoneWebhookAuthError, type PhoneWebhookResult, type PlanBridgeWakeArgs, type PurchasedDomain, REALTIME_AUDIO_SAMPLE_RATE, REALTIME_MAX_AUDIO_FRAME_BASE64, REALTIME_TOOL_CALL_TIMEOUT_MS, REALTIME_TOOL_DEFINITIONS, RECALL_MEMORY_TOOL, REDACTED, RELAY_PRESETS, type RealtimeBridgePort, type RealtimeBridgeTranscriptEntry, type RealtimeInboundEvent, type RealtimeInstructionOptions, type RealtimeSessionConfigOptions, type RealtimeToolCall, type RealtimeToolDefinition, type RealtimeToolHandler, type RealtimeToolResult, type RealtimeTransportAdapter, type RealtimeTransportProvider, RealtimeVoiceBridge, type RealtimeVoiceBridgeOptions, RelayBridge, type RelayBridgeOptions, type RelayConfig, RelayGateway, type RelayProvider, type RelaySearchResult, type ResumeErrorClassificationOptions, SCHEDULE_CALLBACK_TOOL, SEARCH_EMAIL_TOOL, SEARCH_SKILLS_TOOL, SPAM_THRESHOLD, type SafeJoinOptions, type SanitizeDetection, type SanitizeResult, type ScheduledCallbackRequest, type SearchCriteria, type SearchableEmail, type SecurityAdvisory, type SendMailOptions, type SendResult, type SendResultWithRaw, type SendSmsInput, type SendSmsResult, type SendTelegramMessageOptions, type SendTelegramMessageResult, ServiceManager, type ServiceStatus, type SetWebhookOptions, type SetupConfig, SetupManager, type SetupResult, type Severity, type Skill, type SkillCategory, type SkillContext, type SkillExitStrategy, type SkillSummary, type SkillTactic, type SkillValidationError, type SmsConfig, SmsManager, type SmsMessage, SmsPoller, type SmsProvider, type SpamCategory, type SpamResult, type SpamRuleMatch, StalwartAdmin, type StalwartAdminOptions, type StalwartPrincipal, type StartPhoneCallOptions, type StartPhoneCallResult, type StartPhoneMissionInput, TELEGRAM_API_BASE, TELEGRAM_CHUNK_SIZE, TELEGRAM_MESSAGE_LIMIT, TELEGRAM_MIN_WEBHOOK_SECRET_LENGTH, TELEGRAM_OPERATOR_QUERY_TAG, TELEGRAM_STOP_WORDS, TELEGRAM_WEBHOOK_SECRET_RE, TELEPHONY_TRANSPORT_CAPABILITIES, TWILIO_MEDIA_SAMPLE_RATE, TWILIO_REALTIME_WS_PATH, TelegramApiError, type TelegramApiOptions, type TelegramBotInfo, type TelegramChatType, type TelegramConfig, TelegramManager, type TelegramMessage, type TelegramMode, type TelephonyTransportCapability, ThreadCache, type ThreadCacheEntry, type ThreadCacheOptions, type ThreadIdInput, type ToolExecutor, type TtsGenerateOptions, type TunnelConfig, TunnelManager, type TwilioConnectedMessage, type TwilioMarkMessage, type TwilioMediaMessage, type TwilioRealtimeInboundMessage, type TwilioRealtimeOutboundMessage, TwilioRealtimeTransport, type TwilioStartMessage, type TwilioStopMessage, type TwilioStreamTwiMLOptions, UnsafeApiUrlError, type UpdateMemoryInput, type ValidatedPhoneMissionStart, type VideoAction, type VideoEditOptions, type VideoTimelineEntry, type VideoUnderstandOptions, type VideoUnderstandResult, type VoiceCloneOptions, WARNING_THRESHOLD, WEB_SEARCH_TOOL, WEB_SEARCH_UNTRUSTED_PREFIX, type WatcherOptions, type WebSearchOptions, assertWithinBase, bridgeWakeErrorMessage, bridgeWakeLastSeenAgeMs, buildApiUrl, buildElksAudioMessage, buildElksByeMessage, buildElksHandshakeMessages, buildElksInterruptMessage, buildElksListeningMessage, buildElksSendingMessage, buildInboundSecurityAdvisory, buildOpenAIRealtimeUrl, buildPhoneTransportConfig, buildRealtimeInstructions, buildRealtimeSessionConfig, buildRealtimeToolGuidance, buildTwilioClearMessage, buildTwilioMarkMessage, buildTwilioMediaMessage, buildTwilioSayTwiML, buildTwilioSignature, buildTwilioStreamTwiML, callTelegramApi, classifyEmailRoute, classifyPhoneNumberRisk, classifyResumeError, clearMediaCapabilityCache, closeDatabase, composeBridgeWakePrompt, createRealtimeTransport, createTestDatabase, createToolExecutor, debug, debugWarn, deleteTelegramWebhook, detectBinary, ensureDataDir, escapeXml, extractEmailAddress, extractVerificationCode, flushTelemetry, forgetHostSession, formatOperatorQueryTelegramMessage, getDatabase, getDatetime, getMediaCapabilities, getOperatorEmail, getSmsProvider, getTelegramChat, getTelegramMe, getTelegramUpdates, getTelegramWebhookInfo, hostSessionStoragePath, inferPhoneRegion, invalidateSkillCache, isInternalEmail, isLoopbackMailHost, isOperatorReplySender, isPhoneRegionAllowed, isSessionFresh, isTelegramChatAllowed, isTelegramStopCommand, isValidPhoneNumber, listSkills, loadHostSession, loadSkill, mapProviderSmsStatus, nextTelegramOffset, normalizeAddress, normalizePhoneNumber, normalizeSubject, operatorPrefsStoragePath, operatorQuerySubject, parseElksRealtimeMessage, parseEmail, parseGoogleVoiceSms, parseOperatorQueryReply, parseTelegramOperatorReply, parseTelegramUpdate, parseTwilioRealtimeMessage, planBridgeWake, pollForOperatorAnswer, recallMemory, recordToolCall, redactBotToken, redactObject, redactPhoneTransportConfig, redactSecret, redactSmsConfig, redactTelegramConfig, renderSkillAsPrompt, requireBinary, requireWhisperModel, resolveCallbackPolicy, resolveConfig, resolveExtensionPolicy, resolveTlsRejectUnauthorized, safeJoin, sanitizeEmail, saveConfig, saveHostSession, saveUserSkill, scanOutboundEmail, scoreEmail, searchSkills, sendTelegramMessage, setOperatorEmail, setTelegramWebhook, setTelemetryVersion, shouldSkipBridgeWakeForLiveOperator, splitTelegramMessage, startRelayBridge, stem, stripTelegramMarkdown, threadIdFor, tokenize, tryJoin, userSkillsDir, validateApiUrl, validatePhoneMissionPolicy, validatePhoneMissionStart, validatePhoneTransportProfile, validateSkill, validateTwilioSignature, webSearch };
package/dist/index.js CHANGED
@@ -5884,6 +5884,7 @@ var DEFAULT_CALLBACK_POLICY = {
5884
5884
  allowAutoCallback: true,
5885
5885
  maxCallbackChain: 2
5886
5886
  };
5887
+ var PHONE_CALLBACK_MIN_DELAY_SECONDS = 30;
5887
5888
  var PHONE_CALLBACK_MAX_DELAY_SECONDS = 7 * 24 * 60 * 60;
5888
5889
  var EU_DIAL_PREFIXES = [
5889
5890
  "+30",
@@ -14471,6 +14472,8 @@ export {
14471
14472
  CloudflareClient,
14472
14473
  DEFAULT_AGENT_NAME,
14473
14474
  DEFAULT_AGENT_ROLE,
14475
+ DEFAULT_CALLBACK_POLICY,
14476
+ DEFAULT_EXTENSION_POLICY,
14474
14477
  DEFAULT_REALTIME_AUDIO_FORMAT,
14475
14478
  DEFAULT_REALTIME_MODEL,
14476
14479
  DEFAULT_REALTIME_VOICE,
@@ -14483,8 +14486,11 @@ export {
14483
14486
  DomainPurchaser,
14484
14487
  ELKS_REALTIME_AUDIO_FORMATS,
14485
14488
  ELKS_REALTIME_WS_PATH,
14489
+ END_CALL_TOOL,
14490
+ EXTEND_CALL_TIME_TOOL,
14486
14491
  ElksRealtimeTransport,
14487
14492
  EmailSearchIndex,
14493
+ GET_CALL_STATUS_TOOL,
14488
14494
  GET_DATETIME_TOOL,
14489
14495
  GatewayManager,
14490
14496
  InboxWatcher,
@@ -14499,6 +14505,8 @@ export {
14499
14505
  OPERATOR_QUERY_SUBJECT_TAG,
14500
14506
  OPERATOR_QUERY_TIMEOUT_MS,
14501
14507
  OPERATOR_QUERY_TIMEOUT_SENTINEL,
14508
+ PHONE_CALLBACK_MAX_DELAY_SECONDS,
14509
+ PHONE_CALLBACK_MIN_DELAY_SECONDS,
14502
14510
  PHONE_CALL_CONTROL_PROVIDERS,
14503
14511
  PHONE_MAX_CONCURRENT_MISSIONS,
14504
14512
  PHONE_MIN_WEBHOOK_SECRET_LENGTH,
@@ -14507,8 +14515,12 @@ export {
14507
14515
  PHONE_RATE_LIMIT_PER_MINUTE,
14508
14516
  PHONE_REGION_SCOPES,
14509
14517
  PHONE_SERVER_MAX_ATTEMPTS,
14518
+ PHONE_SERVER_MAX_CALLBACK_CHAIN,
14510
14519
  PHONE_SERVER_MAX_CALL_DURATION_SECONDS,
14511
14520
  PHONE_SERVER_MAX_COST_PER_MISSION,
14521
+ PHONE_SERVER_MAX_EXTENSION_REQUESTS_PER_CALL,
14522
+ PHONE_SERVER_MAX_EXTENSION_SECONDS_PER_REQUEST,
14523
+ PHONE_SERVER_MAX_TOTAL_EXTENSION_SECONDS,
14512
14524
  PHONE_TASK_MAX_LENGTH,
14513
14525
  PathTraversalError,
14514
14526
  PhoneManager,
@@ -14524,6 +14536,7 @@ export {
14524
14536
  RealtimeVoiceBridge,
14525
14537
  RelayBridge,
14526
14538
  RelayGateway,
14539
+ SCHEDULE_CALLBACK_TOOL,
14527
14540
  SEARCH_EMAIL_TOOL,
14528
14541
  SEARCH_SKILLS_TOOL,
14529
14542
  SPAM_THRESHOLD,
@@ -14644,7 +14657,9 @@ export {
14644
14657
  renderSkillAsPrompt,
14645
14658
  requireBinary,
14646
14659
  requireWhisperModel,
14660
+ resolveCallbackPolicy,
14647
14661
  resolveConfig,
14662
+ resolveExtensionPolicy,
14648
14663
  resolveTlsRejectUnauthorized,
14649
14664
  safeJoin,
14650
14665
  sanitizeEmail,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticmail/core",
3
- "version": "0.9.28",
3
+ "version": "0.9.29",
4
4
  "description": "Core SDK for AgenticMail — email, SMS, and phone call-control for AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",