@lumavox/server 0.53.0 → 0.58.0

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/README.md CHANGED
@@ -64,7 +64,7 @@ list's page.
64
64
 
65
65
  | Resource | Methods |
66
66
  |---|---|
67
- | `endUsers` | `create`, `get`, `update`, `delete`, `list`, `page`, `export`, `toolResult`; `facts.list`, `facts.add`, `facts.update`, `facts.delete`; `memories.list`, `memories.page`, `memories.get`, `memories.delete`, `memories.deleteAll`; `personalization.get`, `personalization.update`, `note`; `scheduledMessages.create`, `scheduledMessages.list`, `scheduledMessages.get`, `scheduledMessages.cancel`; `reports.list`, `reports.page`, `reports.get` |
67
+ | `endUsers` | `create`, `get`, `update`, `delete`, `list`, `page`, `export`, `toolResult`; `facts.list`, `facts.add`, `facts.update`, `facts.delete`; `memories.list`, `memories.page`, `memories.get`, `memories.create`, `memories.update`, `memories.delete`, `memories.deleteAll`; `personalization.get`, `personalization.update`, `states.list`, `states.get`, `states.set`, `states.delete` — where a person stands with one agent, which that agent reads on every reply; `note`; `scheduledMessages.create`, `scheduledMessages.list`, `scheduledMessages.get`, `scheduledMessages.cancel`; `reports.list`, `reports.page`, `reports.get` |
68
68
  | `ephemeralKeys` | `limits`, `create`, `get`, `revoke`, `inspect`, `list`, `page` |
69
69
  | `images`, `videos`, `audio`, `skybox`, `transcriptions` | `create`, `get`, `wait`, `generate`; `images.draftLayout`, `images.findElements`; `skybox.styles` |
70
70
  | `generations` | `get`, `wait`, `list`, `page` |
@@ -77,6 +77,7 @@ list's page.
77
77
  | `knowledge` | `list`, `page`, `get`, `create`, `bulk`, `fromUrl`, `uploadUrl`, `fromFile`, `upload`, `update`, `delete`, `reindex`, `refresh`, `setAgents`, `search`, `categories`, `insights`, `wait` |
78
78
  | `usage` | `get`, `plan` |
79
79
  | the client | `health()`, `limits()` (the platform's limits, each by its key) |
80
+ | no client | `verifyWebhook`, `verifyToolCall`: a post from the platform, checked and typed, or a `SignatureError` |
80
81
 
81
82
  - **`list()` is an async iterator over every item**, page after page by
82
83
  each page's `next_cursor`; `page()` is one page, `{ data, next_cursor }`.
@@ -114,6 +115,7 @@ the API did not answer: `connection_error`, `timeout`, …), `message`,
114
115
  | `ServerError` | 5xx |
115
116
  | `ConnectionError` | no response; `cause` is what `fetch` threw |
116
117
  | `TimeoutError` | no response within `timeoutMs`, on the last attempt |
118
+ | `SignatureError` | a post `verifyWebhook` or `verifyToolCall` could not take as the platform's; its `status` is 401 |
117
119
 
118
120
  Quote `requestId` when you report a problem: every attempt of a call carries
119
121
  the same one. Your own `signal` aborting throws its reason, not an error of
@@ -1 +1 @@
1
- export type { AgentCreateRequest, AgentDefaults, AgentDefaultsUpdate, AgentDraft, AgentDraftPublish, AgentDraftUpdate, AgentHandoff, AgentHandoffInfo, AgentInfo, AgentKnowledgeUpdate, AgentPage, AgentPrompt, AgentPromptPart, AgentPromptVoice, AgentQuietHours, AgentReportField, AgentReportFieldInfo, AgentRestored, AgentSettingInForce, AgentSettingsInfo, AgentSettingsUpdate, AgentsFollowing, AgentStt, AgentSttInfo, AgentSummary, AgentToolsUpdate, AgentUpdate, AgentVersion, AgentVersionPage, AgentVersionRestore, AgentVersionSummary, AgentVoice, AgentVoiceInfo, ApiKeySelf, AssetBulkRequest, AssetDetail, AssetMoveRequest, AssetPage, AssetsAffected, AssetSummary, AssetUpdate, AssignedAgent, AudioRequest, BulkEditKnowledgeData, BulkEditKnowledgeError, BulkEditKnowledgeErrors, BulkEditKnowledgeResponse, BulkEditKnowledgeResponses, CancelScheduledMessageData, CancelScheduledMessageError, CancelScheduledMessageErrors, CancelScheduledMessageResponse, CancelScheduledMessageResponses, ClientOptions, CompactionInfo, CompactRequest, CompactSessionData, CompactSessionError, CompactSessionErrors, CompactSessionResponse, CompactSessionResponses, ConfirmAssetUploadData, ConfirmAssetUploadError, ConfirmAssetUploadErrors, ConfirmAssetUploadResponse, ConfirmAssetUploadResponses, ConversationReport, ConversationReportPage, CreateAgentData, CreateAgentError, CreateAgentErrors, CreateAgentResponse, CreateAgentResponses, CreateAssetFolderData, CreateAssetFolderError, CreateAssetFolderErrors, CreateAssetFolderResponse, CreateAssetFolderResponses, CreateAssetUploadUrlData, CreateAssetUploadUrlError, CreateAssetUploadUrlErrors, CreateAssetUploadUrlResponse, CreateAssetUploadUrlResponses, CreateAudioData, CreateAudioError, CreateAudioErrors, CreateAudioResponse, CreateAudioResponses, CreateEndUserData, CreateEndUserError, CreateEndUserErrors, CreateEndUserFactData, CreateEndUserFactError, CreateEndUserFactErrors, CreateEndUserFactResponse, CreateEndUserFactResponses, CreateEndUserNoteData, CreateEndUserNoteError, CreateEndUserNoteErrors, CreateEndUserNoteResponse, CreateEndUserNoteResponses, CreateEndUserResponse, CreateEndUserResponses, CreateEphemeralKeyData, CreateEphemeralKeyError, CreateEphemeralKeyErrors, CreateEphemeralKeyResponse, CreateEphemeralKeyResponses, CreateFactData, CreateFactError, CreateFactErrors, CreateFactResponse, CreateFactResponses, CreateImageData, CreateImageError, CreateImageErrors, CreateImageResponse, CreateImageResponses, CreateKnowledgeData, CreateKnowledgeError, CreateKnowledgeErrors, CreateKnowledgeFromFileData, CreateKnowledgeFromFileError, CreateKnowledgeFromFileErrors, CreateKnowledgeFromFileResponse, CreateKnowledgeFromFileResponses, CreateKnowledgeFromUrlData, CreateKnowledgeFromUrlError, CreateKnowledgeFromUrlErrors, CreateKnowledgeFromUrlResponse, CreateKnowledgeFromUrlResponses, CreateKnowledgeResponse, CreateKnowledgeResponses, CreateKnowledgeUploadUrlData, CreateKnowledgeUploadUrlError, CreateKnowledgeUploadUrlErrors, CreateKnowledgeUploadUrlResponse, CreateKnowledgeUploadUrlResponses, CreateScheduledMessageData, CreateScheduledMessageError, CreateScheduledMessageErrors, CreateScheduledMessageResponse, CreateScheduledMessageResponses, CreateSessionData, CreateSessionError, CreateSessionErrors, CreateSessionResponse, CreateSessionResponses, CreateSkyboxData, CreateSkyboxError, CreateSkyboxErrors, CreateSkyboxResponse, CreateSkyboxResponses, CreateToolData, CreateToolError, CreateToolErrors, CreateToolResponse, CreateToolResponses, CreateTranscriptionData, CreateTranscriptionError, CreateTranscriptionErrors, CreateTranscriptionResponse, CreateTranscriptionResponses, CreateVideoData, CreateVideoError, CreateVideoErrors, CreateVideoResponse, CreateVideoResponses, CreateVoiceData, CreateVoiceError, CreateVoiceErrors, CreateVoiceResponse, CreateVoiceResponses, CreateVoiceUploadUrlData, CreateVoiceUploadUrlError, CreateVoiceUploadUrlErrors, CreateVoiceUploadUrlResponse, CreateVoiceUploadUrlResponses, DeleteAgentData, DeleteAgentError, DeleteAgentErrors, DeleteAgentResponse, DeleteAgentResponses, DeleteAllEndUserMemoriesData, DeleteAllEndUserMemoriesError, DeleteAllEndUserMemoriesErrors, DeleteAllEndUserMemoriesResponse, DeleteAllEndUserMemoriesResponses, DeleteAllFactsData, DeleteAllFactsError, DeleteAllFactsErrors, DeleteAllFactsResponse, DeleteAllFactsResponses, DeleteAllMemoriesData, DeleteAllMemoriesError, DeleteAllMemoriesErrors, DeleteAllMemoriesResponse, DeleteAllMemoriesResponses, DeleteAssetData, DeleteAssetError, DeleteAssetErrors, DeleteAssetFolderData, DeleteAssetFolderError, DeleteAssetFolderErrors, DeleteAssetFolderResponse, DeleteAssetFolderResponses, DeleteAssetResponse, DeleteAssetResponses, DeleteAssetsData, DeleteAssetsError, DeleteAssetsErrors, DeleteAssetsResponse, DeleteAssetsResponses, DeleteEndUserData, DeleteEndUserError, DeleteEndUserErrors, DeleteEndUserFactData, DeleteEndUserFactError, DeleteEndUserFactErrors, DeleteEndUserFactResponse, DeleteEndUserFactResponses, DeleteEndUserMemoryData, DeleteEndUserMemoryError, DeleteEndUserMemoryErrors, DeleteEndUserMemoryResponse, DeleteEndUserMemoryResponses, DeleteEndUserResponse, DeleteEndUserResponses, DeleteFactData, DeleteFactError, DeleteFactErrors, DeleteFactResponse, DeleteFactResponses, DeleteKnowledgeData, DeleteKnowledgeError, DeleteKnowledgeErrors, DeleteKnowledgeResponse, DeleteKnowledgeResponses, DeleteMemoryData, DeleteMemoryError, DeleteMemoryErrors, DeleteMemoryResponse, DeleteMemoryResponses, DeleteSessionData, DeleteSessionError, DeleteSessionErrors, DeleteSessionResponse, DeleteSessionResponses, DeleteToolData, DeleteToolError, DeleteToolErrors, DeleteToolResponse, DeleteToolResponses, DeleteVoiceData, DeleteVoiceError, DeleteVoiceErrors, DeleteVoiceResponse, DeleteVoiceResponses, DesignVoiceData, DesignVoiceError, DesignVoiceErrors, DesignVoiceResponse, DesignVoiceResponses, DiscardAgentDraftData, DiscardAgentDraftError, DiscardAgentDraftErrors, DiscardAgentDraftResponse, DiscardAgentDraftResponses, DraftLayoutData, DraftLayoutError, DraftLayoutErrors, DraftLayoutResponse, DraftLayoutResponses, EndUserCreateRequest, EndUserDeleted, EndUserInfo, EndUserPage, EndUserPersonalization, EndUserPersonalizationUpdate, EndUserUpdateRequest, EphemeralKeyCreateRequest, EphemeralKeyCreateResponse, EphemeralKeyInfo, EphemeralKeyLimits, EphemeralKeyOverrides, EphemeralKeyPage, EphemeralTokenSelf, ErrorCode, ErrorInfo, ErrorResponse, ExtractSessionFactsData, ExtractSessionFactsError, ExtractSessionFactsErrors, ExtractSessionFactsResponse, ExtractSessionFactsResponses, FactCreateRequest, FactInfo, FactPage, FactsDeleted, FactsReadInfo, FactUpdateRequest, FindLayoutElementsData, FindLayoutElementsError, FindLayoutElementsErrors, FindLayoutElementsResponse, FindLayoutElementsResponses, FolderCreate, FolderDeleted, FolderDetail, FolderPage, FolderSummary, FolderUpdate, GenerateFromTemplateData, GenerateFromTemplateError, GenerateFromTemplateErrors, GenerateFromTemplateResponse, GenerateFromTemplateResponses, GenerationAudio, GenerationImage, GenerationInfo, GenerationPage, GenerationSkybox, GenerationTranscript, GenerationVideo, GetAgentData, GetAgentDraftData, GetAgentDraftError, GetAgentDraftErrors, GetAgentDraftResponse, GetAgentDraftResponses, GetAgentError, GetAgentErrors, GetAgentPromptData, GetAgentPromptError, GetAgentPromptErrors, GetAgentPromptResponse, GetAgentPromptResponses, GetAgentResponse, GetAgentResponses, GetAgentSettingsData, GetAgentSettingsError, GetAgentSettingsErrors, GetAgentSettingsResponse, GetAgentSettingsResponses, GetAgentVersionData, GetAgentVersionError, GetAgentVersionErrors, GetAgentVersionResponse, GetAgentVersionResponses, GetAssetData, GetAssetError, GetAssetErrors, GetAssetFolderData, GetAssetFolderError, GetAssetFolderErrors, GetAssetFolderResponse, GetAssetFolderResponses, GetAssetResponse, GetAssetResponses, GetAudioData, GetAudioError, GetAudioErrors, GetAudioResponse, GetAudioResponses, GetEndUserData, GetEndUserError, GetEndUserErrors, GetEndUserMemoryData, GetEndUserMemoryError, GetEndUserMemoryErrors, GetEndUserMemoryResponse, GetEndUserMemoryResponses, GetEndUserPersonalizationData, GetEndUserPersonalizationError, GetEndUserPersonalizationErrors, GetEndUserPersonalizationResponse, GetEndUserPersonalizationResponses, GetEndUserReportData, GetEndUserReportError, GetEndUserReportErrors, GetEndUserReportResponse, GetEndUserReportResponses, GetEndUserResponse, GetEndUserResponses, GetEphemeralKeyData, GetEphemeralKeyError, GetEphemeralKeyErrors, GetEphemeralKeyLimitsData, GetEphemeralKeyLimitsError, GetEphemeralKeyLimitsErrors, GetEphemeralKeyLimitsResponse, GetEphemeralKeyLimitsResponses, GetEphemeralKeyResponse, GetEphemeralKeyResponses, GetGenerationData, GetGenerationError, GetGenerationErrors, GetGenerationResponse, GetGenerationResponses, GetHealthData, GetHealthResponse, GetHealthResponses, GetImageData, GetImageError, GetImageErrors, GetImageResponse, GetImageResponses, GetKnowledgeData, GetKnowledgeError, GetKnowledgeErrors, GetKnowledgeInsightsData, GetKnowledgeInsightsError, GetKnowledgeInsightsErrors, GetKnowledgeInsightsResponse, GetKnowledgeInsightsResponses, GetKnowledgeResponse, GetKnowledgeResponses, GetMemoryData, GetMemoryError, GetMemoryErrors, GetMemoryResponse, GetMemoryResponses, GetPlanData, GetPlanError, GetPlanErrors, GetPlanResponse, GetPlanResponses, GetPlatformLimitsData, GetPlatformLimitsResponse, GetPlatformLimitsResponses, GetScheduledMessageData, GetScheduledMessageError, GetScheduledMessageErrors, GetScheduledMessageResponse, GetScheduledMessageResponses, GetSessionData, GetSessionError, GetSessionErrors, GetSessionResponse, GetSessionResponses, GetSkyboxData, GetSkyboxError, GetSkyboxErrors, GetSkyboxResponse, GetSkyboxResponses, GetTemplateData, GetTemplateError, GetTemplateErrors, GetTemplateFileData, GetTemplateFileError, GetTemplateFileErrors, GetTemplateFileResponses, GetTemplateResponse, GetTemplateResponses, GetTokenData, GetTokenError, GetTokenErrors, GetTokenResponse, GetTokenResponses, GetToolData, GetToolError, GetToolErrors, GetToolResponse, GetToolResponses, GetTranscriptionData, GetTranscriptionError, GetTranscriptionErrors, GetTranscriptionResponse, GetTranscriptionResponses, GetUsageData, GetUsageError, GetUsageErrors, GetUsageResponse, GetUsageResponses, GetVideoData, GetVideoError, GetVideoErrors, GetVideoResponse, GetVideoResponses, GetVoiceData, GetVoiceError, GetVoiceErrors, GetVoiceResponse, GetVoiceResponses, HealthResponse, ImageRequest, KnowledgeAgentsUpdate, KnowledgeAssigned, KnowledgeBulk, KnowledgeBulkResult, KnowledgeCategoryPage, KnowledgeCitation, KnowledgeCreate, KnowledgeEntryUsage, KnowledgeFileCreate, KnowledgeInfo, KnowledgeInsights, KnowledgeLookupInfo, KnowledgePage, KnowledgeSearchHit, KnowledgeSearchRequest, KnowledgeSearchResult, KnowledgeUpdate, KnowledgeUploadRequest, KnowledgeUploadTicket, KnowledgeUrlCreate, LayoutDraft, LayoutDraftRequest, LayoutElement, LayoutElementInfo, LayoutFindRequest, LayoutFound, LayoutSourceInfo, ListAgentKnowledgeData, ListAgentKnowledgeError, ListAgentKnowledgeErrors, ListAgentKnowledgeResponse, ListAgentKnowledgeResponses, ListAgentsData, ListAgentsError, ListAgentsErrors, ListAgentsResponse, ListAgentsResponses, ListAgentToolsData, ListAgentToolsError, ListAgentToolsErrors, ListAgentToolsResponse, ListAgentToolsResponses, ListAgentVersionsData, ListAgentVersionsError, ListAgentVersionsErrors, ListAgentVersionsResponse, ListAgentVersionsResponses, ListAssetFoldersData, ListAssetFoldersError, ListAssetFoldersErrors, ListAssetFoldersResponse, ListAssetFoldersResponses, ListAssetsData, ListAssetsError, ListAssetsErrors, ListAssetsResponse, ListAssetsResponses, ListEndUserFactsData, ListEndUserFactsError, ListEndUserFactsErrors, ListEndUserFactsResponse, ListEndUserFactsResponses, ListEndUserMemoriesData, ListEndUserMemoriesError, ListEndUserMemoriesErrors, ListEndUserMemoriesResponse, ListEndUserMemoriesResponses, ListEndUserReportsData, ListEndUserReportsError, ListEndUserReportsErrors, ListEndUserReportsResponse, ListEndUserReportsResponses, ListEndUsersData, ListEndUsersError, ListEndUsersErrors, ListEndUsersResponse, ListEndUsersResponses, ListEphemeralKeysData, ListEphemeralKeysError, ListEphemeralKeysErrors, ListEphemeralKeysResponse, ListEphemeralKeysResponses, ListFactsData, ListFactsError, ListFactsErrors, ListFactsResponse, ListFactsResponses, ListGenerationsData, ListGenerationsError, ListGenerationsErrors, ListGenerationsResponse, ListGenerationsResponses, ListKnowledgeCategoriesData, ListKnowledgeCategoriesError, ListKnowledgeCategoriesErrors, ListKnowledgeCategoriesResponse, ListKnowledgeCategoriesResponses, ListKnowledgeData, ListKnowledgeError, ListKnowledgeErrors, ListKnowledgeResponse, ListKnowledgeResponses, ListMemoriesData, ListMemoriesError, ListMemoriesErrors, ListMemoriesResponse, ListMemoriesResponses, ListRelationsData, ListRelationsError, ListRelationsErrors, ListRelationsResponse, ListRelationsResponses, ListScheduledMessagesData, ListScheduledMessagesError, ListScheduledMessagesErrors, ListScheduledMessagesResponse, ListScheduledMessagesResponses, ListSessionsData, ListSessionsError, ListSessionsErrors, ListSessionsResponse, ListSessionsResponses, ListSkyboxStylesData, ListSkyboxStylesError, ListSkyboxStylesErrors, ListSkyboxStylesResponse, ListSkyboxStylesResponses, ListTemplatesData, ListTemplatesError, ListTemplatesErrors, ListTemplatesResponse, ListTemplatesResponses, ListToolCallsData, ListToolCallsError, ListToolCallsErrors, ListToolCallsResponse, ListToolCallsResponses, ListToolsData, ListToolsError, ListToolsErrors, ListToolsResponse, ListToolsResponses, ListVoicesData, ListVoicesError, ListVoicesErrors, ListVoicesResponse, ListVoicesResponses, MemoriesDeleted, MemoriesWrittenInfo, MemoryCitation, MemoryInfo, MemoryPage, MessageContext, MessageInfo, MessageKnowledge, MessageMemories, MessageNote, MessagePage, MessageSource, MessageToolCall, MoveAssetsData, MoveAssetsError, MoveAssetsErrors, MoveAssetsResponse, MoveAssetsResponses, NoteCreateRequest, NoteTaken, OrgPlan, PlatformLimit, PlatformLimitPage, PostSessionToolResultData, PostSessionToolResultError, PostSessionToolResultErrors, PostSessionToolResultResponse, PostSessionToolResultResponses, PostToolResultData, PostToolResultError, PostToolResultErrors, PostToolResultResponse, PostToolResultResponses, ProviderVoiceSettings, ProviderVoiceSettingsInfo, PublishAgentDraftData, PublishAgentDraftError, PublishAgentDraftErrors, PublishAgentDraftResponse, PublishAgentDraftResponses, Reference, ReferenceInfo, RefreshKnowledgeData, RefreshKnowledgeError, RefreshKnowledgeErrors, RefreshKnowledgeResponse, RefreshKnowledgeResponses, ReindexKnowledgeData, ReindexKnowledgeError, ReindexKnowledgeErrors, ReindexKnowledgeResponse, ReindexKnowledgeResponses, RelationInfo, RelationPage, ReportAgentVersion, ReportDelivery, ReportLine, ResampleVoiceData, ResampleVoiceError, ResampleVoiceErrors, ResampleVoiceResponse, ResampleVoiceResponses, RestoreAgentVersionData, RestoreAgentVersionError, RestoreAgentVersionErrors, RestoreAgentVersionResponse, RestoreAgentVersionResponses, RevokeEphemeralKeyData, RevokeEphemeralKeyError, RevokeEphemeralKeyErrors, RevokeEphemeralKeyResponse, RevokeEphemeralKeyResponses, RotateToolSecretData, RotateToolSecretError, RotateToolSecretErrors, RotateToolSecretResponse, RotateToolSecretResponses, RotateWebhookSecretData, RotateWebhookSecretError, RotateWebhookSecretErrors, RotateWebhookSecretResponse, RotateWebhookSecretResponses, SafetyInfo, SaveDesignedVoiceData, SaveDesignedVoiceError, SaveDesignedVoiceErrors, SaveDesignedVoiceResponse, SaveDesignedVoiceResponses, ScheduledMessage, ScheduledMessageCreateRequest, ScheduledMessageDelivery, ScheduledMessagePage, SearchKnowledgeData, SearchKnowledgeError, SearchKnowledgeErrors, SearchKnowledgeResponse, SearchKnowledgeResponses, SessionCreateRequest, SessionDetail, SessionInfo, SessionPage, SetAgentKnowledgeData, SetAgentKnowledgeError, SetAgentKnowledgeErrors, SetAgentKnowledgeResponse, SetAgentKnowledgeResponses, SetAgentToolsData, SetAgentToolsError, SetAgentToolsErrors, SetAgentToolsResponse, SetAgentToolsResponses, SetKnowledgeAgentsData, SetKnowledgeAgentsError, SetKnowledgeAgentsErrors, SetKnowledgeAgentsResponse, SetKnowledgeAgentsResponses, SkyboxFile, SkyboxRequest, SkyboxStyle, SkyboxStylePage, SpeechProvider, StreamDone, StreamError, StreamSegment, StreamTranscript, SynthesizeSpeechData, SynthesizeSpeechError, SynthesizeSpeechErrors, SynthesizeSpeechResponse, SynthesizeSpeechResponses, TemplateGenerateRequest, TemplateInfo, TemplateInput, TemplatePage, TestAgentWebhookData, TestAgentWebhookError, TestAgentWebhookErrors, TestAgentWebhookResponse, TestAgentWebhookResponses, TestToolData, TestToolError, TestToolErrors, TestToolResponse, TestToolResponses, TokenSelf, ToolCall, ToolCallPage, ToolCreate, ToolInfo, ToolPage, ToolResultRequest, ToolResultTaken, ToolsAssigned, ToolTestRequest, ToolTestResult, ToolUpdate, ToolWithSecret, TranscribeAssetRequest, TranscribeData, TranscribeError, TranscribeErrors, TranscribeResponse, TranscribeResponses, Transcription, TranscriptionStreamLine, TranscriptWord, TtsOptions, TtsRequest, UnansweredQuestion, UpdateAgentData, UpdateAgentDraftData, UpdateAgentDraftError, UpdateAgentDraftErrors, UpdateAgentDraftResponse, UpdateAgentDraftResponses, UpdateAgentError, UpdateAgentErrors, UpdateAgentResponse, UpdateAgentResponses, UpdateAgentSettingsData, UpdateAgentSettingsError, UpdateAgentSettingsErrors, UpdateAgentSettingsResponse, UpdateAgentSettingsResponses, UpdateAssetData, UpdateAssetError, UpdateAssetErrors, UpdateAssetFolderData, UpdateAssetFolderError, UpdateAssetFolderErrors, UpdateAssetFolderResponse, UpdateAssetFolderResponses, UpdateAssetResponse, UpdateAssetResponses, UpdateEndUserData, UpdateEndUserError, UpdateEndUserErrors, UpdateEndUserFactData, UpdateEndUserFactError, UpdateEndUserFactErrors, UpdateEndUserFactResponse, UpdateEndUserFactResponses, UpdateEndUserPersonalizationData, UpdateEndUserPersonalizationError, UpdateEndUserPersonalizationErrors, UpdateEndUserPersonalizationResponse, UpdateEndUserPersonalizationResponses, UpdateEndUserResponse, UpdateEndUserResponses, UpdateFactData, UpdateFactError, UpdateFactErrors, UpdateFactResponse, UpdateFactResponses, UpdateKnowledgeData, UpdateKnowledgeError, UpdateKnowledgeErrors, UpdateKnowledgeResponse, UpdateKnowledgeResponses, UpdateToolData, UpdateToolError, UpdateToolErrors, UpdateToolResponse, UpdateToolResponses, UpdateVoiceData, UpdateVoiceError, UpdateVoiceErrors, UpdateVoiceResponse, UpdateVoiceResponses, UploadConfirm, UploadTicket, UploadTicketRequest, UsageByKey, UsageDay, UsageResponse, UsageSummary, ValidationIssue, Variables, VariantInfo, VideoRequest, VoiceDesignPreview, VoiceDesignRequest, VoiceDesignResult, VoiceDesignSaveRequest, VoiceDetail, VoiceInfo, VoiceInfoPage, VoiceKind, VoiceSample, VoiceSource, VoiceStatus, VoiceUpdate, VoiceUpload, VoiceUploadRequest, VoiceUploadTicket, WebhookSecret, WebhookTestResult, WriteSessionMemoriesData, WriteSessionMemoriesError, WriteSessionMemoriesErrors, WriteSessionMemoriesResponse, WriteSessionMemoriesResponses } from './types.gen.js';
1
+ export type { AgentCreateRequest, AgentDefaults, AgentDefaultsUpdate, AgentDraft, AgentDraftPublish, AgentDraftUpdate, AgentHandoff, AgentHandoffInfo, AgentInfo, AgentKnowledgeUpdate, AgentPage, AgentPrompt, AgentPromptPart, AgentPromptVoice, AgentQuietHours, AgentReportField, AgentReportFieldInfo, AgentRestored, AgentSettingInForce, AgentSettingsInfo, AgentSettingsUpdate, AgentsFollowing, AgentStt, AgentSttInfo, AgentSummary, AgentToolsUpdate, AgentUpdate, AgentVersion, AgentVersionPage, AgentVersionRestore, AgentVersionSummary, AgentVoice, AgentVoiceInfo, ApiKeySelf, AssetBulkRequest, AssetDetail, AssetMoveRequest, AssetPage, AssetsAffected, AssetSummary, AssetUpdate, AssignedAgent, AudioRequest, BulkEditKnowledgeData, BulkEditKnowledgeError, BulkEditKnowledgeErrors, BulkEditKnowledgeResponse, BulkEditKnowledgeResponses, CancelScheduledMessageData, CancelScheduledMessageError, CancelScheduledMessageErrors, CancelScheduledMessageResponse, CancelScheduledMessageResponses, ClientOptions, CompactionInfo, CompactRequest, CompactSessionData, CompactSessionError, CompactSessionErrors, CompactSessionResponse, CompactSessionResponses, ConfirmAssetUploadData, ConfirmAssetUploadError, ConfirmAssetUploadErrors, ConfirmAssetUploadResponse, ConfirmAssetUploadResponses, ConversationReport, ConversationReportPage, CreateAgentData, CreateAgentError, CreateAgentErrors, CreateAgentResponse, CreateAgentResponses, CreateAssetFolderData, CreateAssetFolderError, CreateAssetFolderErrors, CreateAssetFolderResponse, CreateAssetFolderResponses, CreateAssetUploadUrlData, CreateAssetUploadUrlError, CreateAssetUploadUrlErrors, CreateAssetUploadUrlResponse, CreateAssetUploadUrlResponses, CreateAudioData, CreateAudioError, CreateAudioErrors, CreateAudioResponse, CreateAudioResponses, CreateEndUserData, CreateEndUserError, CreateEndUserErrors, CreateEndUserFactData, CreateEndUserFactError, CreateEndUserFactErrors, CreateEndUserFactResponse, CreateEndUserFactResponses, CreateEndUserMemoryData, CreateEndUserMemoryError, CreateEndUserMemoryErrors, CreateEndUserMemoryResponse, CreateEndUserMemoryResponses, CreateEndUserNoteData, CreateEndUserNoteError, CreateEndUserNoteErrors, CreateEndUserNoteResponse, CreateEndUserNoteResponses, CreateEndUserResponse, CreateEndUserResponses, CreateEphemeralKeyData, CreateEphemeralKeyError, CreateEphemeralKeyErrors, CreateEphemeralKeyResponse, CreateEphemeralKeyResponses, CreateFactData, CreateFactError, CreateFactErrors, CreateFactResponse, CreateFactResponses, CreateImageData, CreateImageError, CreateImageErrors, CreateImageResponse, CreateImageResponses, CreateKnowledgeData, CreateKnowledgeError, CreateKnowledgeErrors, CreateKnowledgeFromFileData, CreateKnowledgeFromFileError, CreateKnowledgeFromFileErrors, CreateKnowledgeFromFileResponse, CreateKnowledgeFromFileResponses, CreateKnowledgeFromUrlData, CreateKnowledgeFromUrlError, CreateKnowledgeFromUrlErrors, CreateKnowledgeFromUrlResponse, CreateKnowledgeFromUrlResponses, CreateKnowledgeResponse, CreateKnowledgeResponses, CreateKnowledgeUploadUrlData, CreateKnowledgeUploadUrlError, CreateKnowledgeUploadUrlErrors, CreateKnowledgeUploadUrlResponse, CreateKnowledgeUploadUrlResponses, CreateScheduledMessageData, CreateScheduledMessageError, CreateScheduledMessageErrors, CreateScheduledMessageResponse, CreateScheduledMessageResponses, CreateSessionData, CreateSessionError, CreateSessionErrors, CreateSessionResponse, CreateSessionResponses, CreateSkyboxData, CreateSkyboxError, CreateSkyboxErrors, CreateSkyboxResponse, CreateSkyboxResponses, CreateToolData, CreateToolError, CreateToolErrors, CreateToolResponse, CreateToolResponses, CreateTranscriptionData, CreateTranscriptionError, CreateTranscriptionErrors, CreateTranscriptionResponse, CreateTranscriptionResponses, CreateVideoData, CreateVideoError, CreateVideoErrors, CreateVideoResponse, CreateVideoResponses, CreateVoiceData, CreateVoiceError, CreateVoiceErrors, CreateVoiceResponse, CreateVoiceResponses, CreateVoiceUploadUrlData, CreateVoiceUploadUrlError, CreateVoiceUploadUrlErrors, CreateVoiceUploadUrlResponse, CreateVoiceUploadUrlResponses, DeleteAgentData, DeleteAgentError, DeleteAgentErrors, DeleteAgentResponse, DeleteAgentResponses, DeleteAllEndUserMemoriesData, DeleteAllEndUserMemoriesError, DeleteAllEndUserMemoriesErrors, DeleteAllEndUserMemoriesResponse, DeleteAllEndUserMemoriesResponses, DeleteAllFactsData, DeleteAllFactsError, DeleteAllFactsErrors, DeleteAllFactsResponse, DeleteAllFactsResponses, DeleteAllMemoriesData, DeleteAllMemoriesError, DeleteAllMemoriesErrors, DeleteAllMemoriesResponse, DeleteAllMemoriesResponses, DeleteAssetData, DeleteAssetError, DeleteAssetErrors, DeleteAssetFolderData, DeleteAssetFolderError, DeleteAssetFolderErrors, DeleteAssetFolderResponse, DeleteAssetFolderResponses, DeleteAssetResponse, DeleteAssetResponses, DeleteAssetsData, DeleteAssetsError, DeleteAssetsErrors, DeleteAssetsResponse, DeleteAssetsResponses, DeleteEndUserData, DeleteEndUserError, DeleteEndUserErrors, DeleteEndUserFactData, DeleteEndUserFactError, DeleteEndUserFactErrors, DeleteEndUserFactResponse, DeleteEndUserFactResponses, DeleteEndUserMemoryData, DeleteEndUserMemoryError, DeleteEndUserMemoryErrors, DeleteEndUserMemoryResponse, DeleteEndUserMemoryResponses, DeleteEndUserResponse, DeleteEndUserResponses, DeleteEndUserStateData, DeleteEndUserStateError, DeleteEndUserStateErrors, DeleteEndUserStateResponse, DeleteEndUserStateResponses, DeleteFactData, DeleteFactError, DeleteFactErrors, DeleteFactResponse, DeleteFactResponses, DeleteKnowledgeData, DeleteKnowledgeError, DeleteKnowledgeErrors, DeleteKnowledgeResponse, DeleteKnowledgeResponses, DeleteMemoryData, DeleteMemoryError, DeleteMemoryErrors, DeleteMemoryResponse, DeleteMemoryResponses, DeleteSessionData, DeleteSessionError, DeleteSessionErrors, DeleteSessionResponse, DeleteSessionResponses, DeleteToolData, DeleteToolError, DeleteToolErrors, DeleteToolResponse, DeleteToolResponses, DeleteVoiceData, DeleteVoiceError, DeleteVoiceErrors, DeleteVoiceResponse, DeleteVoiceResponses, DesignVoiceData, DesignVoiceError, DesignVoiceErrors, DesignVoiceResponse, DesignVoiceResponses, DiscardAgentDraftData, DiscardAgentDraftError, DiscardAgentDraftErrors, DiscardAgentDraftResponse, DiscardAgentDraftResponses, DraftLayoutData, DraftLayoutError, DraftLayoutErrors, DraftLayoutResponse, DraftLayoutResponses, EndUserCreateRequest, EndUserDeleted, EndUserInfo, EndUserPage, EndUserPersonalization, EndUserPersonalizationUpdate, EndUserState, EndUserStatePage, EndUserStateUpdate, EndUserUpdateRequest, EphemeralKeyCreateRequest, EphemeralKeyCreateResponse, EphemeralKeyInfo, EphemeralKeyLimits, EphemeralKeyOverrides, EphemeralKeyPage, EphemeralTokenSelf, ErrorCode, ErrorInfo, ErrorResponse, ExtractSessionFactsData, ExtractSessionFactsError, ExtractSessionFactsErrors, ExtractSessionFactsResponse, ExtractSessionFactsResponses, FactCreateRequest, FactInfo, FactPage, FactsDeleted, FactsReadInfo, FactUpdateRequest, FindLayoutElementsData, FindLayoutElementsError, FindLayoutElementsErrors, FindLayoutElementsResponse, FindLayoutElementsResponses, FolderCreate, FolderDeleted, FolderDetail, FolderPage, FolderSummary, FolderUpdate, GenerateFromTemplateData, GenerateFromTemplateError, GenerateFromTemplateErrors, GenerateFromTemplateResponse, GenerateFromTemplateResponses, GenerationAudio, GenerationImage, GenerationInfo, GenerationPage, GenerationSkybox, GenerationTranscript, GenerationVideo, GetAgentData, GetAgentDraftData, GetAgentDraftError, GetAgentDraftErrors, GetAgentDraftResponse, GetAgentDraftResponses, GetAgentError, GetAgentErrors, GetAgentPromptData, GetAgentPromptError, GetAgentPromptErrors, GetAgentPromptResponse, GetAgentPromptResponses, GetAgentResponse, GetAgentResponses, GetAgentSettingsData, GetAgentSettingsError, GetAgentSettingsErrors, GetAgentSettingsResponse, GetAgentSettingsResponses, GetAgentVersionData, GetAgentVersionError, GetAgentVersionErrors, GetAgentVersionResponse, GetAgentVersionResponses, GetAssetData, GetAssetError, GetAssetErrors, GetAssetFolderData, GetAssetFolderError, GetAssetFolderErrors, GetAssetFolderResponse, GetAssetFolderResponses, GetAssetResponse, GetAssetResponses, GetAudioData, GetAudioError, GetAudioErrors, GetAudioResponse, GetAudioResponses, GetEndUserData, GetEndUserError, GetEndUserErrors, GetEndUserMemoryData, GetEndUserMemoryError, GetEndUserMemoryErrors, GetEndUserMemoryResponse, GetEndUserMemoryResponses, GetEndUserPersonalizationData, GetEndUserPersonalizationError, GetEndUserPersonalizationErrors, GetEndUserPersonalizationResponse, GetEndUserPersonalizationResponses, GetEndUserReportData, GetEndUserReportError, GetEndUserReportErrors, GetEndUserReportResponse, GetEndUserReportResponses, GetEndUserResponse, GetEndUserResponses, GetEndUserStateData, GetEndUserStateError, GetEndUserStateErrors, GetEndUserStateResponse, GetEndUserStateResponses, GetEphemeralKeyData, GetEphemeralKeyError, GetEphemeralKeyErrors, GetEphemeralKeyLimitsData, GetEphemeralKeyLimitsError, GetEphemeralKeyLimitsErrors, GetEphemeralKeyLimitsResponse, GetEphemeralKeyLimitsResponses, GetEphemeralKeyResponse, GetEphemeralKeyResponses, GetGenerationData, GetGenerationError, GetGenerationErrors, GetGenerationResponse, GetGenerationResponses, GetHealthData, GetHealthResponse, GetHealthResponses, GetImageData, GetImageError, GetImageErrors, GetImageResponse, GetImageResponses, GetKnowledgeData, GetKnowledgeError, GetKnowledgeErrors, GetKnowledgeInsightsData, GetKnowledgeInsightsError, GetKnowledgeInsightsErrors, GetKnowledgeInsightsResponse, GetKnowledgeInsightsResponses, GetKnowledgeResponse, GetKnowledgeResponses, GetMemoryData, GetMemoryError, GetMemoryErrors, GetMemoryResponse, GetMemoryResponses, GetPlanData, GetPlanError, GetPlanErrors, GetPlanResponse, GetPlanResponses, GetPlatformLimitsData, GetPlatformLimitsResponse, GetPlatformLimitsResponses, GetScheduledMessageData, GetScheduledMessageError, GetScheduledMessageErrors, GetScheduledMessageResponse, GetScheduledMessageResponses, GetSessionData, GetSessionError, GetSessionErrors, GetSessionResponse, GetSessionResponses, GetSkyboxData, GetSkyboxError, GetSkyboxErrors, GetSkyboxResponse, GetSkyboxResponses, GetTemplateData, GetTemplateError, GetTemplateErrors, GetTemplateFileData, GetTemplateFileError, GetTemplateFileErrors, GetTemplateFileResponses, GetTemplateResponse, GetTemplateResponses, GetTokenData, GetTokenError, GetTokenErrors, GetTokenResponse, GetTokenResponses, GetToolData, GetToolError, GetToolErrors, GetToolResponse, GetToolResponses, GetTranscriptionData, GetTranscriptionError, GetTranscriptionErrors, GetTranscriptionResponse, GetTranscriptionResponses, GetUsageData, GetUsageError, GetUsageErrors, GetUsageResponse, GetUsageResponses, GetVideoData, GetVideoError, GetVideoErrors, GetVideoResponse, GetVideoResponses, GetVoiceData, GetVoiceError, GetVoiceErrors, GetVoiceResponse, GetVoiceResponses, HealthResponse, ImageRequest, KnowledgeAgentsUpdate, KnowledgeAssigned, KnowledgeBulk, KnowledgeBulkResult, KnowledgeCategoryPage, KnowledgeCitation, KnowledgeCreate, KnowledgeEntryUsage, KnowledgeFileCreate, KnowledgeInfo, KnowledgeInsights, KnowledgeLookupInfo, KnowledgePage, KnowledgeSearchHit, KnowledgeSearchRequest, KnowledgeSearchResult, KnowledgeUpdate, KnowledgeUploadRequest, KnowledgeUploadTicket, KnowledgeUrlCreate, LayoutDraft, LayoutDraftRequest, LayoutElement, LayoutElementInfo, LayoutFindRequest, LayoutFound, LayoutSourceInfo, ListAgentKnowledgeData, ListAgentKnowledgeError, ListAgentKnowledgeErrors, ListAgentKnowledgeResponse, ListAgentKnowledgeResponses, ListAgentsData, ListAgentsError, ListAgentsErrors, ListAgentsResponse, ListAgentsResponses, ListAgentToolsData, ListAgentToolsError, ListAgentToolsErrors, ListAgentToolsResponse, ListAgentToolsResponses, ListAgentVersionsData, ListAgentVersionsError, ListAgentVersionsErrors, ListAgentVersionsResponse, ListAgentVersionsResponses, ListAssetFoldersData, ListAssetFoldersError, ListAssetFoldersErrors, ListAssetFoldersResponse, ListAssetFoldersResponses, ListAssetsData, ListAssetsError, ListAssetsErrors, ListAssetsResponse, ListAssetsResponses, ListEndUserFactsData, ListEndUserFactsError, ListEndUserFactsErrors, ListEndUserFactsResponse, ListEndUserFactsResponses, ListEndUserMemoriesData, ListEndUserMemoriesError, ListEndUserMemoriesErrors, ListEndUserMemoriesResponse, ListEndUserMemoriesResponses, ListEndUserReportsData, ListEndUserReportsError, ListEndUserReportsErrors, ListEndUserReportsResponse, ListEndUserReportsResponses, ListEndUsersData, ListEndUsersError, ListEndUsersErrors, ListEndUsersResponse, ListEndUsersResponses, ListEndUserStatesData, ListEndUserStatesError, ListEndUserStatesErrors, ListEndUserStatesResponse, ListEndUserStatesResponses, ListEphemeralKeysData, ListEphemeralKeysError, ListEphemeralKeysErrors, ListEphemeralKeysResponse, ListEphemeralKeysResponses, ListFactsData, ListFactsError, ListFactsErrors, ListFactsResponse, ListFactsResponses, ListGenerationsData, ListGenerationsError, ListGenerationsErrors, ListGenerationsResponse, ListGenerationsResponses, ListKnowledgeCategoriesData, ListKnowledgeCategoriesError, ListKnowledgeCategoriesErrors, ListKnowledgeCategoriesResponse, ListKnowledgeCategoriesResponses, ListKnowledgeData, ListKnowledgeError, ListKnowledgeErrors, ListKnowledgeResponse, ListKnowledgeResponses, ListMemoriesData, ListMemoriesError, ListMemoriesErrors, ListMemoriesResponse, ListMemoriesResponses, ListRelationsData, ListRelationsError, ListRelationsErrors, ListRelationsResponse, ListRelationsResponses, ListScheduledMessagesData, ListScheduledMessagesError, ListScheduledMessagesErrors, ListScheduledMessagesResponse, ListScheduledMessagesResponses, ListSessionsData, ListSessionsError, ListSessionsErrors, ListSessionsResponse, ListSessionsResponses, ListSkyboxStylesData, ListSkyboxStylesError, ListSkyboxStylesErrors, ListSkyboxStylesResponse, ListSkyboxStylesResponses, ListTemplatesData, ListTemplatesError, ListTemplatesErrors, ListTemplatesResponse, ListTemplatesResponses, ListToolCallsData, ListToolCallsError, ListToolCallsErrors, ListToolCallsResponse, ListToolCallsResponses, ListToolsData, ListToolsError, ListToolsErrors, ListToolsResponse, ListToolsResponses, ListVoicesData, ListVoicesError, ListVoicesErrors, ListVoicesResponse, ListVoicesResponses, MemoriesDeleted, MemoriesWrittenInfo, MemoryCitation, MemoryCreateRequest, MemoryInfo, MemoryPage, MemoryUpdateRequest, MessageContext, MessageInfo, MessageKnowledge, MessageMemories, MessageNote, MessagePage, MessageSource, MessageToolCall, MoveAssetsData, MoveAssetsError, MoveAssetsErrors, MoveAssetsResponse, MoveAssetsResponses, NoteCreateRequest, NoteTaken, OrgPlan, PlatformLimit, PlatformLimitPage, PostSessionToolResultData, PostSessionToolResultError, PostSessionToolResultErrors, PostSessionToolResultResponse, PostSessionToolResultResponses, PostToolResultData, PostToolResultError, PostToolResultErrors, PostToolResultResponse, PostToolResultResponses, ProviderVoiceSettings, ProviderVoiceSettingsInfo, PublishAgentDraftData, PublishAgentDraftError, PublishAgentDraftErrors, PublishAgentDraftResponse, PublishAgentDraftResponses, Reference, ReferenceInfo, RefreshKnowledgeData, RefreshKnowledgeError, RefreshKnowledgeErrors, RefreshKnowledgeResponse, RefreshKnowledgeResponses, ReindexKnowledgeData, ReindexKnowledgeError, ReindexKnowledgeErrors, ReindexKnowledgeResponse, ReindexKnowledgeResponses, RelationInfo, RelationPage, ReportAgentVersion, ReportDelivery, ReportLine, ResampleVoiceData, ResampleVoiceError, ResampleVoiceErrors, ResampleVoiceResponse, ResampleVoiceResponses, RestoreAgentVersionData, RestoreAgentVersionError, RestoreAgentVersionErrors, RestoreAgentVersionResponse, RestoreAgentVersionResponses, RevokeEphemeralKeyData, RevokeEphemeralKeyError, RevokeEphemeralKeyErrors, RevokeEphemeralKeyResponse, RevokeEphemeralKeyResponses, RotateToolSecretData, RotateToolSecretError, RotateToolSecretErrors, RotateToolSecretResponse, RotateToolSecretResponses, RotateWebhookSecretData, RotateWebhookSecretError, RotateWebhookSecretErrors, RotateWebhookSecretResponse, RotateWebhookSecretResponses, SafetyInfo, SaveDesignedVoiceData, SaveDesignedVoiceError, SaveDesignedVoiceErrors, SaveDesignedVoiceResponse, SaveDesignedVoiceResponses, ScheduledMessage, ScheduledMessageCreateRequest, ScheduledMessageDelivery, ScheduledMessagePage, SearchKnowledgeData, SearchKnowledgeError, SearchKnowledgeErrors, SearchKnowledgeResponse, SearchKnowledgeResponses, SessionCreateRequest, SessionDetail, SessionInfo, SessionPage, SetAgentKnowledgeData, SetAgentKnowledgeError, SetAgentKnowledgeErrors, SetAgentKnowledgeResponse, SetAgentKnowledgeResponses, SetAgentToolsData, SetAgentToolsError, SetAgentToolsErrors, SetAgentToolsResponse, SetAgentToolsResponses, SetEndUserStateData, SetEndUserStateError, SetEndUserStateErrors, SetEndUserStateResponse, SetEndUserStateResponses, SetKnowledgeAgentsData, SetKnowledgeAgentsError, SetKnowledgeAgentsErrors, SetKnowledgeAgentsResponse, SetKnowledgeAgentsResponses, SkyboxFile, SkyboxRequest, SkyboxStyle, SkyboxStylePage, SpeechProvider, StreamDone, StreamError, StreamSegment, StreamTranscript, SynthesizeSpeechData, SynthesizeSpeechError, SynthesizeSpeechErrors, SynthesizeSpeechResponse, SynthesizeSpeechResponses, TemplateGenerateRequest, TemplateInfo, TemplateInput, TemplatePage, TestAgentWebhookData, TestAgentWebhookError, TestAgentWebhookErrors, TestAgentWebhookResponse, TestAgentWebhookResponses, TestToolData, TestToolError, TestToolErrors, TestToolResponse, TestToolResponses, TokenSelf, ToolCall, ToolCallPage, ToolCreate, ToolInfo, ToolPage, ToolResultRequest, ToolResultTaken, ToolsAssigned, ToolTestRequest, ToolTestResult, ToolUpdate, ToolWithSecret, TranscribeAssetRequest, TranscribeData, TranscribeError, TranscribeErrors, TranscribeResponse, TranscribeResponses, Transcription, TranscriptionStreamLine, TranscriptWord, TtsOptions, TtsRequest, UnansweredQuestion, UpdateAgentData, UpdateAgentDraftData, UpdateAgentDraftError, UpdateAgentDraftErrors, UpdateAgentDraftResponse, UpdateAgentDraftResponses, UpdateAgentError, UpdateAgentErrors, UpdateAgentResponse, UpdateAgentResponses, UpdateAgentSettingsData, UpdateAgentSettingsError, UpdateAgentSettingsErrors, UpdateAgentSettingsResponse, UpdateAgentSettingsResponses, UpdateAssetData, UpdateAssetError, UpdateAssetErrors, UpdateAssetFolderData, UpdateAssetFolderError, UpdateAssetFolderErrors, UpdateAssetFolderResponse, UpdateAssetFolderResponses, UpdateAssetResponse, UpdateAssetResponses, UpdateEndUserData, UpdateEndUserError, UpdateEndUserErrors, UpdateEndUserFactData, UpdateEndUserFactError, UpdateEndUserFactErrors, UpdateEndUserFactResponse, UpdateEndUserFactResponses, UpdateEndUserMemoryData, UpdateEndUserMemoryError, UpdateEndUserMemoryErrors, UpdateEndUserMemoryResponse, UpdateEndUserMemoryResponses, UpdateEndUserPersonalizationData, UpdateEndUserPersonalizationError, UpdateEndUserPersonalizationErrors, UpdateEndUserPersonalizationResponse, UpdateEndUserPersonalizationResponses, UpdateEndUserResponse, UpdateEndUserResponses, UpdateFactData, UpdateFactError, UpdateFactErrors, UpdateFactResponse, UpdateFactResponses, UpdateKnowledgeData, UpdateKnowledgeError, UpdateKnowledgeErrors, UpdateKnowledgeResponse, UpdateKnowledgeResponses, UpdateToolData, UpdateToolError, UpdateToolErrors, UpdateToolResponse, UpdateToolResponses, UpdateVoiceData, UpdateVoiceError, UpdateVoiceErrors, UpdateVoiceResponse, UpdateVoiceResponses, UploadConfirm, UploadTicket, UploadTicketRequest, UsageByKey, UsageDay, UsageResponse, UsageSummary, ValidationIssue, Variables, VariantInfo, VideoRequest, VoiceDesignPreview, VoiceDesignRequest, VoiceDesignResult, VoiceDesignSaveRequest, VoiceDetail, VoiceInfo, VoiceInfoPage, VoiceKind, VoiceSample, VoiceSource, VoiceStatus, VoiceUpdate, VoiceUpload, VoiceUploadRequest, VoiceUploadTicket, WebhookSecret, WebhookTestResult, WriteSessionMemoriesData, WriteSessionMemoriesError, WriteSessionMemoriesErrors, WriteSessionMemoriesResponse, WriteSessionMemoriesResponses } from './types.gen.js';
@@ -338,6 +338,14 @@ export type OrgPlan = {
338
338
  */
339
339
  credit_balance_micros: number;
340
340
  period_end: string;
341
+ /**
342
+ * The most agents the plan allows; `null` for no limit. Creating one past it is a 409.
343
+ */
344
+ max_agents: number | null;
345
+ /**
346
+ * How many agents the organisation has now — read it against `max_agents` before a create, rather than learning from the 409.
347
+ */
348
+ agent_count: number;
341
349
  };
342
350
  export type UsageSummary = {
343
351
  capability: string;
@@ -1761,6 +1769,10 @@ export type FactInfo = {
1761
1769
  confirmed_at: string | null;
1762
1770
  created_at: string;
1763
1771
  id: string;
1772
+ /**
1773
+ * You pinned it: every agent that sees it recalls it first on every turn, outside what recall's budget holds (at most the platform's `agents.memory.pinned_max` a person, `GET /v1/platform/limits`).
1774
+ */
1775
+ pinned: boolean;
1764
1776
  /**
1765
1777
  * When a later conversation replaced or removed it; `null` while it stands. Listed only with `include_replaced=true`.
1766
1778
  */
@@ -1792,12 +1804,23 @@ export type FactCreateRequest = {
1792
1804
  * Keep it to one agent: only that agent recalls it. Unset or `null`: every agent of yours that shares its facts — and the ones that keep their own, too.
1793
1805
  */
1794
1806
  agent_id?: string | null;
1807
+ /**
1808
+ * `true` pins it: every agent that sees it recalls it first on every turn, however many newer facts there are. At most the platform's `agents.memory.pinned_max` pinned facts a person (`GET /v1/platform/limits`); one more is a 409.
1809
+ */
1810
+ pinned?: boolean;
1795
1811
  };
1812
+ /**
1813
+ * `text`, `pinned` or both; at least one.
1814
+ */
1796
1815
  export type FactUpdateRequest = {
1797
1816
  /**
1798
1817
  * What to remember about the person, as one plain statement: "Prefers to be called Sam." At most 500 characters. Never a secret — a password, a code, a card, account or identity number, or a key is refused, since facts are sent to the model on every turn.
1799
1818
  */
1800
- text: string;
1819
+ text?: string;
1820
+ /**
1821
+ * `true` pins it, `false` unpins it. At most the platform's `agents.memory.pinned_max` pinned facts a person (`GET /v1/platform/limits`); one more is a 409.
1822
+ */
1823
+ pinned?: boolean;
1801
1824
  };
1802
1825
  export type FactsDeleted = {
1803
1826
  /**
@@ -1817,15 +1840,15 @@ export type MemoryPage = {
1817
1840
  */
1818
1841
  export type MemoryInfo = {
1819
1842
  /**
1820
- * The agent whose conversation first wrote it.
1843
+ * The agent whose conversation first wrote it, or the agent you wrote it for; `null` for one you wrote for every agent.
1821
1844
  */
1822
- agent_id: string;
1845
+ agent_id: string | null;
1823
1846
  /**
1824
- * One of the writing agent's `memory_categories`, or the platform's.
1847
+ * One of the writing agent's `memory_categories`, or the platform's — or the one you gave it.
1825
1848
  */
1826
1849
  category: string;
1827
1850
  /**
1828
- * The topic's story so far, dated, ending with where it stands — rewritten whole by each conversation that comes back to it.
1851
+ * The topic's story so far, dated, ending with where it stands — rewritten whole by each conversation that comes back to it. One you wrote, a conversation only adds to.
1829
1852
  */
1830
1853
  content: string;
1831
1854
  /**
@@ -1839,13 +1862,21 @@ export type MemoryInfo = {
1839
1862
  first_talked_at: string;
1840
1863
  id: string;
1841
1864
  /**
1842
- * The latest message it was written from.
1865
+ * The latest message it was written from; for one you wrote, when you wrote it until a conversation adds to it.
1843
1866
  */
1844
1867
  last_talked_at: string;
1845
1868
  /**
1846
- * `person`: every agent of yours that shares memories sees it. `agent`: only the agent that wrote it (`memories_scope`).
1869
+ * You pinned it: its title and summary head the topics every agent that sees it is shown at a conversation's open, however old.
1870
+ */
1871
+ pinned: boolean;
1872
+ /**
1873
+ * `person`: every agent of yours that shares memories sees it — and the ones that keep their own, too, when you wrote it. `agent`: only `agent_id` sees it (`memories_scope`, or written for that agent).
1847
1874
  */
1848
1875
  scope: 'person' | 'agent';
1876
+ /**
1877
+ * `conversation`: a reading wrote it. `customer`: you wrote or changed it — a later conversation may add to it, never take it over.
1878
+ */
1879
+ source: 'conversation' | 'customer';
1849
1880
  /**
1850
1881
  * One line: where it stands now.
1851
1882
  */
@@ -1856,7 +1887,7 @@ export type MemoryInfo = {
1856
1887
  title: string;
1857
1888
  updated_at: string;
1858
1889
  /**
1859
- * Moves by one each time a conversation rewrites it.
1890
+ * Moves by one each time its words are rewritten, by a conversation or by you.
1860
1891
  */
1861
1892
  version: number;
1862
1893
  };
@@ -1973,6 +2004,14 @@ export type AgentSummary = {
1973
2004
  * The language the agent replies in, as a tag — `es`, `pt-BR` — whatever language the person writes in: told to the model, spoken by the voice where `voice_config` names no `language` of its own, and the hint its hearing transcribes with (the language alone, `pt` of `pt-BR`) where `stt_config` names none. **A conversation whose key names a `language` uses that instead.** Unset, the agent answers in the language it is spoken to in.
1974
2005
  */
1975
2006
  language: string | null;
2007
+ /**
2008
+ * Whether the model is told the person's local date and time with every reply — "Friday, 20 November 2026, 12:40" — so the agent can say good evening, notice it is nearly lunch, or know that today is not over. **Off by default**, and off changes nothing.
2009
+ *
2010
+ * On, it is told in front of each message the agent answers, in an opening line it writes and in a message it writes to the person first — never in its instructions, so the part of the prompt the model's provider caches stays whole. It is read in the person's own time zone: the one your server set (`time_zone` on `/v1/end-users/{end_user_id}/personalization`), else the one their app reported when it connected, which the client SDK sends by itself. **With no time zone of theirs, nothing is told**: a guessed hour is worse than none.
2011
+ *
2012
+ * About 20 input tokens on each reply, and no extra model call.
2013
+ */
2014
+ local_time: boolean;
1976
2015
  /**
1977
2016
  * Lines in the agent's voice, to show the model how it talks — its manner, not lines to repeat: at most 20, of 500 characters each, each read as one line. Part of its instructions on every turn, so they are prompt tokens on every reply. Always answered: `[]` for none.
1978
2017
  */
@@ -2268,7 +2307,7 @@ export type AgentSummary = {
2268
2307
  *
2269
2308
  * Answered field by field, a set's every field, each answered as the agent runs it. Always answered: `[]` for none.
2270
2309
  */
2271
- org_defaults: Array<'model' | 'thinking_level' | 'thinking_summaries' | 'max_output_tokens' | 'temperature' | 'top_p' | 'top_k' | 'seed' | 'stop_sequences' | 'language' | 'voice_enabled' | 'voice_config' | 'stream_chunk_schedule' | 'stt_config' | 'emotion_enabled' | 'emotion_instruction' | 'relation_enabled' | 'relation_instruction' | 'knowledge_enabled' | 'knowledge_mode' | 'knowledge_lookup_first' | 'knowledge_max_results' | 'url_context' | 'code_execution' | 'tools_off' | 'compact_threshold_tokens' | 'compact_instruction' | 'compact_model' | 'compact_thinking_level' | 'compact_max_output_tokens' | 'fact_instruction' | 'fact_model' | 'fact_thinking_level' | 'fact_max_output_tokens' | 'max_facts' | 'facts_enabled' | 'facts_scope' | 'memories_enabled' | 'memories_scope' | 'memory_model' | 'memory_thinking_level' | 'memory_max_output_tokens' | 'memory_instruction' | 'memory_categories' | 'report_enabled' | 'report_fields' | 'report_success' | 'report_instruction' | 'report_model' | 'report_thinking_level' | 'report_max_output_tokens' | 'report_transcript' | 'outreach_enabled' | 'outreach_quiet_hours' | 'outreach_time_zone' | 'outreach_tool' | 'guardrails' | 'age_level' | 'blocked_topics' | 'fallback_message'>;
2310
+ org_defaults: Array<'model' | 'thinking_level' | 'thinking_summaries' | 'max_output_tokens' | 'temperature' | 'top_p' | 'top_k' | 'seed' | 'stop_sequences' | 'language' | 'local_time' | 'voice_enabled' | 'voice_config' | 'stream_chunk_schedule' | 'stt_config' | 'emotion_enabled' | 'emotion_instruction' | 'relation_enabled' | 'relation_instruction' | 'knowledge_enabled' | 'knowledge_mode' | 'knowledge_lookup_first' | 'knowledge_max_results' | 'url_context' | 'code_execution' | 'tools_off' | 'compact_threshold_tokens' | 'compact_instruction' | 'compact_model' | 'compact_thinking_level' | 'compact_max_output_tokens' | 'fact_instruction' | 'fact_model' | 'fact_thinking_level' | 'fact_max_output_tokens' | 'max_facts' | 'facts_enabled' | 'facts_scope' | 'memories_enabled' | 'memories_scope' | 'memory_model' | 'memory_thinking_level' | 'memory_max_output_tokens' | 'memory_instruction' | 'memory_categories' | 'report_enabled' | 'report_fields' | 'report_success' | 'report_instruction' | 'report_model' | 'report_thinking_level' | 'report_max_output_tokens' | 'report_transcript' | 'outreach_enabled' | 'outreach_quiet_hours' | 'outreach_time_zone' | 'outreach_tool' | 'guardrails' | 'age_level' | 'blocked_topics' | 'fallback_message'>;
2272
2311
  id: string;
2273
2312
  created_at: string;
2274
2313
  updated_at: string;
@@ -2440,6 +2479,14 @@ export type AgentInfo = {
2440
2479
  * The language the agent replies in, as a tag — `es`, `pt-BR` — whatever language the person writes in: told to the model, spoken by the voice where `voice_config` names no `language` of its own, and the hint its hearing transcribes with (the language alone, `pt` of `pt-BR`) where `stt_config` names none. **A conversation whose key names a `language` uses that instead.** Unset, the agent answers in the language it is spoken to in.
2441
2480
  */
2442
2481
  language: string | null;
2482
+ /**
2483
+ * Whether the model is told the person's local date and time with every reply — "Friday, 20 November 2026, 12:40" — so the agent can say good evening, notice it is nearly lunch, or know that today is not over. **Off by default**, and off changes nothing.
2484
+ *
2485
+ * On, it is told in front of each message the agent answers, in an opening line it writes and in a message it writes to the person first — never in its instructions, so the part of the prompt the model's provider caches stays whole. It is read in the person's own time zone: the one your server set (`time_zone` on `/v1/end-users/{end_user_id}/personalization`), else the one their app reported when it connected, which the client SDK sends by itself. **With no time zone of theirs, nothing is told**: a guessed hour is worse than none.
2486
+ *
2487
+ * About 20 input tokens on each reply, and no extra model call.
2488
+ */
2489
+ local_time: boolean;
2443
2490
  /**
2444
2491
  * Lines in the agent's voice, to show the model how it talks — its manner, not lines to repeat: at most 20, of 500 characters each, each read as one line. Part of its instructions on every turn, so they are prompt tokens on every reply. Always answered: `[]` for none.
2445
2492
  */
@@ -2735,7 +2782,7 @@ export type AgentInfo = {
2735
2782
  *
2736
2783
  * Answered field by field, a set's every field, each answered as the agent runs it. Always answered: `[]` for none.
2737
2784
  */
2738
- org_defaults: Array<'model' | 'thinking_level' | 'thinking_summaries' | 'max_output_tokens' | 'temperature' | 'top_p' | 'top_k' | 'seed' | 'stop_sequences' | 'language' | 'voice_enabled' | 'voice_config' | 'stream_chunk_schedule' | 'stt_config' | 'emotion_enabled' | 'emotion_instruction' | 'relation_enabled' | 'relation_instruction' | 'knowledge_enabled' | 'knowledge_mode' | 'knowledge_lookup_first' | 'knowledge_max_results' | 'url_context' | 'code_execution' | 'tools_off' | 'compact_threshold_tokens' | 'compact_instruction' | 'compact_model' | 'compact_thinking_level' | 'compact_max_output_tokens' | 'fact_instruction' | 'fact_model' | 'fact_thinking_level' | 'fact_max_output_tokens' | 'max_facts' | 'facts_enabled' | 'facts_scope' | 'memories_enabled' | 'memories_scope' | 'memory_model' | 'memory_thinking_level' | 'memory_max_output_tokens' | 'memory_instruction' | 'memory_categories' | 'report_enabled' | 'report_fields' | 'report_success' | 'report_instruction' | 'report_model' | 'report_thinking_level' | 'report_max_output_tokens' | 'report_transcript' | 'outreach_enabled' | 'outreach_quiet_hours' | 'outreach_time_zone' | 'outreach_tool' | 'guardrails' | 'age_level' | 'blocked_topics' | 'fallback_message'>;
2785
+ org_defaults: Array<'model' | 'thinking_level' | 'thinking_summaries' | 'max_output_tokens' | 'temperature' | 'top_p' | 'top_k' | 'seed' | 'stop_sequences' | 'language' | 'local_time' | 'voice_enabled' | 'voice_config' | 'stream_chunk_schedule' | 'stt_config' | 'emotion_enabled' | 'emotion_instruction' | 'relation_enabled' | 'relation_instruction' | 'knowledge_enabled' | 'knowledge_mode' | 'knowledge_lookup_first' | 'knowledge_max_results' | 'url_context' | 'code_execution' | 'tools_off' | 'compact_threshold_tokens' | 'compact_instruction' | 'compact_model' | 'compact_thinking_level' | 'compact_max_output_tokens' | 'fact_instruction' | 'fact_model' | 'fact_thinking_level' | 'fact_max_output_tokens' | 'max_facts' | 'facts_enabled' | 'facts_scope' | 'memories_enabled' | 'memories_scope' | 'memory_model' | 'memory_thinking_level' | 'memory_max_output_tokens' | 'memory_instruction' | 'memory_categories' | 'report_enabled' | 'report_fields' | 'report_success' | 'report_instruction' | 'report_model' | 'report_thinking_level' | 'report_max_output_tokens' | 'report_transcript' | 'outreach_enabled' | 'outreach_quiet_hours' | 'outreach_time_zone' | 'outreach_tool' | 'guardrails' | 'age_level' | 'blocked_topics' | 'fallback_message'>;
2739
2786
  id: string;
2740
2787
  created_at: string;
2741
2788
  updated_at: string;
@@ -2805,6 +2852,14 @@ export type AgentCreateRequest = {
2805
2852
  * The language the agent replies in, as a tag — `es`, `pt-BR` — whatever language the person writes in: told to the model, spoken by the voice where `voice_config` names no `language` of its own, and the hint its hearing transcribes with (the language alone, `pt` of `pt-BR`) where `stt_config` names none. **A conversation whose key names a `language` uses that instead.** Unset, the agent answers in the language it is spoken to in.
2806
2853
  */
2807
2854
  language?: string | null;
2855
+ /**
2856
+ * Whether the model is told the person's local date and time with every reply — "Friday, 20 November 2026, 12:40" — so the agent can say good evening, notice it is nearly lunch, or know that today is not over. **Off by default**, and off changes nothing.
2857
+ *
2858
+ * On, it is told in front of each message the agent answers, in an opening line it writes and in a message it writes to the person first — never in its instructions, so the part of the prompt the model's provider caches stays whole. It is read in the person's own time zone: the one your server set (`time_zone` on `/v1/end-users/{end_user_id}/personalization`), else the one their app reported when it connected, which the client SDK sends by itself. **With no time zone of theirs, nothing is told**: a guessed hour is worse than none.
2859
+ *
2860
+ * About 20 input tokens on each reply, and no extra model call.
2861
+ */
2862
+ local_time?: boolean | null;
2808
2863
  /**
2809
2864
  * Lines in the agent's voice, to show the model how it talks — its manner, not lines to repeat: at most 20, of 500 characters each, each read as one line. Part of its instructions on every turn, so they are prompt tokens on every reply. The complete list: `null` or `[]` clears it.
2810
2865
  */
@@ -3100,7 +3155,7 @@ export type AgentCreateRequest = {
3100
3155
  *
3101
3156
  * Naming one field of a set names all of it. A section's name — `voice`, `safety` and the rest of the console's tabs — stands for every field of it.
3102
3157
  */
3103
- org_defaults?: Array<'model' | 'thinking_level' | 'thinking_summaries' | 'max_output_tokens' | 'temperature' | 'top_p' | 'top_k' | 'seed' | 'stop_sequences' | 'language' | 'voice_enabled' | 'voice_config' | 'stream_chunk_schedule' | 'stt_config' | 'emotion_enabled' | 'emotion_instruction' | 'relation_enabled' | 'relation_instruction' | 'knowledge_enabled' | 'knowledge_mode' | 'knowledge_lookup_first' | 'knowledge_max_results' | 'url_context' | 'code_execution' | 'tools_off' | 'compact_threshold_tokens' | 'compact_instruction' | 'compact_model' | 'compact_thinking_level' | 'compact_max_output_tokens' | 'fact_instruction' | 'fact_model' | 'fact_thinking_level' | 'fact_max_output_tokens' | 'max_facts' | 'facts_enabled' | 'facts_scope' | 'memories_enabled' | 'memories_scope' | 'memory_model' | 'memory_thinking_level' | 'memory_max_output_tokens' | 'memory_instruction' | 'memory_categories' | 'report_enabled' | 'report_fields' | 'report_success' | 'report_instruction' | 'report_model' | 'report_thinking_level' | 'report_max_output_tokens' | 'report_transcript' | 'outreach_enabled' | 'outreach_quiet_hours' | 'outreach_time_zone' | 'outreach_tool' | 'guardrails' | 'age_level' | 'blocked_topics' | 'fallback_message' | 'voice' | 'hearing' | 'emotion' | 'relationship' | 'knowledge' | 'builtin_tools' | 'compaction' | 'facts' | 'memories' | 'reports' | 'outreach' | 'safety'> | null;
3158
+ org_defaults?: Array<'model' | 'thinking_level' | 'thinking_summaries' | 'max_output_tokens' | 'temperature' | 'top_p' | 'top_k' | 'seed' | 'stop_sequences' | 'language' | 'local_time' | 'voice_enabled' | 'voice_config' | 'stream_chunk_schedule' | 'stt_config' | 'emotion_enabled' | 'emotion_instruction' | 'relation_enabled' | 'relation_instruction' | 'knowledge_enabled' | 'knowledge_mode' | 'knowledge_lookup_first' | 'knowledge_max_results' | 'url_context' | 'code_execution' | 'tools_off' | 'compact_threshold_tokens' | 'compact_instruction' | 'compact_model' | 'compact_thinking_level' | 'compact_max_output_tokens' | 'fact_instruction' | 'fact_model' | 'fact_thinking_level' | 'fact_max_output_tokens' | 'max_facts' | 'facts_enabled' | 'facts_scope' | 'memories_enabled' | 'memories_scope' | 'memory_model' | 'memory_thinking_level' | 'memory_max_output_tokens' | 'memory_instruction' | 'memory_categories' | 'report_enabled' | 'report_fields' | 'report_success' | 'report_instruction' | 'report_model' | 'report_thinking_level' | 'report_max_output_tokens' | 'report_transcript' | 'outreach_enabled' | 'outreach_quiet_hours' | 'outreach_time_zone' | 'outreach_tool' | 'guardrails' | 'age_level' | 'blocked_topics' | 'fallback_message' | 'time' | 'voice' | 'hearing' | 'emotion' | 'relationship' | 'knowledge' | 'builtin_tools' | 'compaction' | 'facts' | 'memories' | 'reports' | 'outreach' | 'safety'> | null;
3104
3159
  };
3105
3160
  export type AgentReportField = {
3106
3161
  /**
@@ -3300,6 +3355,14 @@ export type AgentDefaults = {
3300
3355
  * The language the agent replies in, as a tag — `es`, `pt-BR` — whatever language the person writes in: told to the model, spoken by the voice where `voice_config` names no `language` of its own, and the hint its hearing transcribes with (the language alone, `pt` of `pt-BR`) where `stt_config` names none. **A conversation whose key names a `language` uses that instead.** Unset, the agent answers in the language it is spoken to in.
3301
3356
  */
3302
3357
  language: string | null;
3358
+ /**
3359
+ * Whether the model is told the person's local date and time with every reply — "Friday, 20 November 2026, 12:40" — so the agent can say good evening, notice it is nearly lunch, or know that today is not over. **Off by default**, and off changes nothing.
3360
+ *
3361
+ * On, it is told in front of each message the agent answers, in an opening line it writes and in a message it writes to the person first — never in its instructions, so the part of the prompt the model's provider caches stays whole. It is read in the person's own time zone: the one your server set (`time_zone` on `/v1/end-users/{end_user_id}/personalization`), else the one their app reported when it connected, which the client SDK sends by itself. **With no time zone of theirs, nothing is told**: a guessed hour is worse than none.
3362
+ *
3363
+ * About 20 input tokens on each reply, and no extra model call.
3364
+ */
3365
+ local_time: boolean | null;
3303
3366
  /**
3304
3367
  * Whether replies come back as audio as well as text.
3305
3368
  *
@@ -3532,6 +3595,7 @@ export type AgentsFollowing = {
3532
3595
  seed: number;
3533
3596
  stop_sequences: number;
3534
3597
  language: number;
3598
+ local_time: number;
3535
3599
  voice_enabled: number;
3536
3600
  voice_config: number;
3537
3601
  stream_chunk_schedule: number;
@@ -3675,6 +3739,14 @@ export type AgentDefaultsUpdate = {
3675
3739
  * The language the agent replies in, as a tag — `es`, `pt-BR` — whatever language the person writes in: told to the model, spoken by the voice where `voice_config` names no `language` of its own, and the hint its hearing transcribes with (the language alone, `pt` of `pt-BR`) where `stt_config` names none. **A conversation whose key names a `language` uses that instead.** Unset, the agent answers in the language it is spoken to in.
3676
3740
  */
3677
3741
  language?: string | null;
3742
+ /**
3743
+ * Whether the model is told the person's local date and time with every reply — "Friday, 20 November 2026, 12:40" — so the agent can say good evening, notice it is nearly lunch, or know that today is not over. **Off by default**, and off changes nothing.
3744
+ *
3745
+ * On, it is told in front of each message the agent answers, in an opening line it writes and in a message it writes to the person first — never in its instructions, so the part of the prompt the model's provider caches stays whole. It is read in the person's own time zone: the one your server set (`time_zone` on `/v1/end-users/{end_user_id}/personalization`), else the one their app reported when it connected, which the client SDK sends by itself. **With no time zone of theirs, nothing is told**: a guessed hour is worse than none.
3746
+ *
3747
+ * About 20 input tokens on each reply, and no extra model call.
3748
+ */
3749
+ local_time?: boolean | null;
3678
3750
  /**
3679
3751
  * Whether replies come back as audio as well as text.
3680
3752
  *
@@ -3959,6 +4031,14 @@ export type AgentUpdate = {
3959
4031
  * The language the agent replies in, as a tag — `es`, `pt-BR` — whatever language the person writes in: told to the model, spoken by the voice where `voice_config` names no `language` of its own, and the hint its hearing transcribes with (the language alone, `pt` of `pt-BR`) where `stt_config` names none. **A conversation whose key names a `language` uses that instead.** Unset, the agent answers in the language it is spoken to in.
3960
4032
  */
3961
4033
  language?: string | null;
4034
+ /**
4035
+ * Whether the model is told the person's local date and time with every reply — "Friday, 20 November 2026, 12:40" — so the agent can say good evening, notice it is nearly lunch, or know that today is not over. **Off by default**, and off changes nothing.
4036
+ *
4037
+ * On, it is told in front of each message the agent answers, in an opening line it writes and in a message it writes to the person first — never in its instructions, so the part of the prompt the model's provider caches stays whole. It is read in the person's own time zone: the one your server set (`time_zone` on `/v1/end-users/{end_user_id}/personalization`), else the one their app reported when it connected, which the client SDK sends by itself. **With no time zone of theirs, nothing is told**: a guessed hour is worse than none.
4038
+ *
4039
+ * About 20 input tokens on each reply, and no extra model call.
4040
+ */
4041
+ local_time?: boolean | null;
3962
4042
  /**
3963
4043
  * Lines in the agent's voice, to show the model how it talks — its manner, not lines to repeat: at most 20, of 500 characters each, each read as one line. Part of its instructions on every turn, so they are prompt tokens on every reply. The complete list: `null` or `[]` clears it.
3964
4044
  */
@@ -4254,7 +4334,7 @@ export type AgentUpdate = {
4254
4334
  *
4255
4335
  * Naming one field of a set names all of it. A section's name — `voice`, `safety` and the rest of the console's tabs — stands for every field of it.
4256
4336
  */
4257
- org_defaults?: Array<'model' | 'thinking_level' | 'thinking_summaries' | 'max_output_tokens' | 'temperature' | 'top_p' | 'top_k' | 'seed' | 'stop_sequences' | 'language' | 'voice_enabled' | 'voice_config' | 'stream_chunk_schedule' | 'stt_config' | 'emotion_enabled' | 'emotion_instruction' | 'relation_enabled' | 'relation_instruction' | 'knowledge_enabled' | 'knowledge_mode' | 'knowledge_lookup_first' | 'knowledge_max_results' | 'url_context' | 'code_execution' | 'tools_off' | 'compact_threshold_tokens' | 'compact_instruction' | 'compact_model' | 'compact_thinking_level' | 'compact_max_output_tokens' | 'fact_instruction' | 'fact_model' | 'fact_thinking_level' | 'fact_max_output_tokens' | 'max_facts' | 'facts_enabled' | 'facts_scope' | 'memories_enabled' | 'memories_scope' | 'memory_model' | 'memory_thinking_level' | 'memory_max_output_tokens' | 'memory_instruction' | 'memory_categories' | 'report_enabled' | 'report_fields' | 'report_success' | 'report_instruction' | 'report_model' | 'report_thinking_level' | 'report_max_output_tokens' | 'report_transcript' | 'outreach_enabled' | 'outreach_quiet_hours' | 'outreach_time_zone' | 'outreach_tool' | 'guardrails' | 'age_level' | 'blocked_topics' | 'fallback_message' | 'voice' | 'hearing' | 'emotion' | 'relationship' | 'knowledge' | 'builtin_tools' | 'compaction' | 'facts' | 'memories' | 'reports' | 'outreach' | 'safety'> | null;
4337
+ org_defaults?: Array<'model' | 'thinking_level' | 'thinking_summaries' | 'max_output_tokens' | 'temperature' | 'top_p' | 'top_k' | 'seed' | 'stop_sequences' | 'language' | 'local_time' | 'voice_enabled' | 'voice_config' | 'stream_chunk_schedule' | 'stt_config' | 'emotion_enabled' | 'emotion_instruction' | 'relation_enabled' | 'relation_instruction' | 'knowledge_enabled' | 'knowledge_mode' | 'knowledge_lookup_first' | 'knowledge_max_results' | 'url_context' | 'code_execution' | 'tools_off' | 'compact_threshold_tokens' | 'compact_instruction' | 'compact_model' | 'compact_thinking_level' | 'compact_max_output_tokens' | 'fact_instruction' | 'fact_model' | 'fact_thinking_level' | 'fact_max_output_tokens' | 'max_facts' | 'facts_enabled' | 'facts_scope' | 'memories_enabled' | 'memories_scope' | 'memory_model' | 'memory_thinking_level' | 'memory_max_output_tokens' | 'memory_instruction' | 'memory_categories' | 'report_enabled' | 'report_fields' | 'report_success' | 'report_instruction' | 'report_model' | 'report_thinking_level' | 'report_max_output_tokens' | 'report_transcript' | 'outreach_enabled' | 'outreach_quiet_hours' | 'outreach_time_zone' | 'outreach_tool' | 'guardrails' | 'age_level' | 'blocked_topics' | 'fallback_message' | 'time' | 'voice' | 'hearing' | 'emotion' | 'relationship' | 'knowledge' | 'builtin_tools' | 'compaction' | 'facts' | 'memories' | 'reports' | 'outreach' | 'safety'> | null;
4258
4338
  /**
4259
4339
  * The `version` you last read for this agent. When set and the agent has been changed since, the update is refused with 409 and nothing is written - re-read it and decide again. Omit it to write unconditionally.
4260
4340
  */
@@ -4620,6 +4700,14 @@ export type AgentDraftUpdate = {
4620
4700
  * The language the agent replies in, as a tag — `es`, `pt-BR` — whatever language the person writes in: told to the model, spoken by the voice where `voice_config` names no `language` of its own, and the hint its hearing transcribes with (the language alone, `pt` of `pt-BR`) where `stt_config` names none. **A conversation whose key names a `language` uses that instead.** Unset, the agent answers in the language it is spoken to in.
4621
4701
  */
4622
4702
  language?: string | null;
4703
+ /**
4704
+ * Whether the model is told the person's local date and time with every reply — "Friday, 20 November 2026, 12:40" — so the agent can say good evening, notice it is nearly lunch, or know that today is not over. **Off by default**, and off changes nothing.
4705
+ *
4706
+ * On, it is told in front of each message the agent answers, in an opening line it writes and in a message it writes to the person first — never in its instructions, so the part of the prompt the model's provider caches stays whole. It is read in the person's own time zone: the one your server set (`time_zone` on `/v1/end-users/{end_user_id}/personalization`), else the one their app reported when it connected, which the client SDK sends by itself. **With no time zone of theirs, nothing is told**: a guessed hour is worse than none.
4707
+ *
4708
+ * About 20 input tokens on each reply, and no extra model call.
4709
+ */
4710
+ local_time?: boolean | null;
4623
4711
  /**
4624
4712
  * Lines in the agent's voice, to show the model how it talks — its manner, not lines to repeat: at most 20, of 500 characters each, each read as one line. Part of its instructions on every turn, so they are prompt tokens on every reply. The complete list: `null` or `[]` clears it.
4625
4713
  */
@@ -4915,7 +5003,7 @@ export type AgentDraftUpdate = {
4915
5003
  *
4916
5004
  * Naming one field of a set names all of it. A section's name — `voice`, `safety` and the rest of the console's tabs — stands for every field of it.
4917
5005
  */
4918
- org_defaults?: Array<'model' | 'thinking_level' | 'thinking_summaries' | 'max_output_tokens' | 'temperature' | 'top_p' | 'top_k' | 'seed' | 'stop_sequences' | 'language' | 'voice_enabled' | 'voice_config' | 'stream_chunk_schedule' | 'stt_config' | 'emotion_enabled' | 'emotion_instruction' | 'relation_enabled' | 'relation_instruction' | 'knowledge_enabled' | 'knowledge_mode' | 'knowledge_lookup_first' | 'knowledge_max_results' | 'url_context' | 'code_execution' | 'tools_off' | 'compact_threshold_tokens' | 'compact_instruction' | 'compact_model' | 'compact_thinking_level' | 'compact_max_output_tokens' | 'fact_instruction' | 'fact_model' | 'fact_thinking_level' | 'fact_max_output_tokens' | 'max_facts' | 'facts_enabled' | 'facts_scope' | 'memories_enabled' | 'memories_scope' | 'memory_model' | 'memory_thinking_level' | 'memory_max_output_tokens' | 'memory_instruction' | 'memory_categories' | 'report_enabled' | 'report_fields' | 'report_success' | 'report_instruction' | 'report_model' | 'report_thinking_level' | 'report_max_output_tokens' | 'report_transcript' | 'outreach_enabled' | 'outreach_quiet_hours' | 'outreach_time_zone' | 'outreach_tool' | 'guardrails' | 'age_level' | 'blocked_topics' | 'fallback_message' | 'voice' | 'hearing' | 'emotion' | 'relationship' | 'knowledge' | 'builtin_tools' | 'compaction' | 'facts' | 'memories' | 'reports' | 'outreach' | 'safety'> | null;
5006
+ org_defaults?: Array<'model' | 'thinking_level' | 'thinking_summaries' | 'max_output_tokens' | 'temperature' | 'top_p' | 'top_k' | 'seed' | 'stop_sequences' | 'language' | 'local_time' | 'voice_enabled' | 'voice_config' | 'stream_chunk_schedule' | 'stt_config' | 'emotion_enabled' | 'emotion_instruction' | 'relation_enabled' | 'relation_instruction' | 'knowledge_enabled' | 'knowledge_mode' | 'knowledge_lookup_first' | 'knowledge_max_results' | 'url_context' | 'code_execution' | 'tools_off' | 'compact_threshold_tokens' | 'compact_instruction' | 'compact_model' | 'compact_thinking_level' | 'compact_max_output_tokens' | 'fact_instruction' | 'fact_model' | 'fact_thinking_level' | 'fact_max_output_tokens' | 'max_facts' | 'facts_enabled' | 'facts_scope' | 'memories_enabled' | 'memories_scope' | 'memory_model' | 'memory_thinking_level' | 'memory_max_output_tokens' | 'memory_instruction' | 'memory_categories' | 'report_enabled' | 'report_fields' | 'report_success' | 'report_instruction' | 'report_model' | 'report_thinking_level' | 'report_max_output_tokens' | 'report_transcript' | 'outreach_enabled' | 'outreach_quiet_hours' | 'outreach_time_zone' | 'outreach_tool' | 'guardrails' | 'age_level' | 'blocked_topics' | 'fallback_message' | 'time' | 'voice' | 'hearing' | 'emotion' | 'relationship' | 'knowledge' | 'builtin_tools' | 'compaction' | 'facts' | 'memories' | 'reports' | 'outreach' | 'safety'> | null;
4919
5007
  /**
4920
5008
  * The whole set of tools the agent would have, by `tl_…`; omitted, the draft's as they are. Ids not yours are left out.
4921
5009
  */
@@ -5041,6 +5129,57 @@ export type EndUserDeleted = {
5041
5129
  */
5042
5130
  sessions_deleted: number;
5043
5131
  };
5132
+ export type MemoryCreateRequest = {
5133
+ /**
5134
+ * The topic, short: one line of at most 80 characters.
5135
+ */
5136
+ title: string;
5137
+ /**
5138
+ * One line, at most 100 characters: where it stands now. Shown with the title at every conversation's open.
5139
+ */
5140
+ summary?: string;
5141
+ /**
5142
+ * Its story: what happened, dated. At most the platform's `agents.memory.memories.content_max_chars` (`GET /v1/platform/limits`). Never a secret — a password, a code, a card, account or identity number, or a key is refused.
5143
+ */
5144
+ content: string;
5145
+ /**
5146
+ * A category, one line of at most 40 characters — best one of the agent's `memory_categories`, or the platform's. Unset: the platform list's catch-all.
5147
+ */
5148
+ category?: string;
5149
+ /**
5150
+ * Keep it to one agent: only that agent sees it. Unset or `null`: every agent of yours that shares memories — and the ones that keep their own, too.
5151
+ */
5152
+ agent_id?: string | null;
5153
+ /**
5154
+ * `true` pins it: its title and summary head the topics every agent that sees it is shown at a conversation's open, however old. At most the platform's `agents.memory.pinned_max` pinned memories a person (`GET /v1/platform/limits`); one more is a 409.
5155
+ */
5156
+ pinned?: boolean;
5157
+ };
5158
+ /**
5159
+ * Any of its words, its category or its pin; at least one.
5160
+ */
5161
+ export type MemoryUpdateRequest = {
5162
+ /**
5163
+ * The topic, short: one line of at most 80 characters.
5164
+ */
5165
+ title?: string;
5166
+ /**
5167
+ * One line, at most 100 characters: where it stands now. Shown with the title at every conversation's open.
5168
+ */
5169
+ summary?: string;
5170
+ /**
5171
+ * Its story: what happened, dated. At most the platform's `agents.memory.memories.content_max_chars` (`GET /v1/platform/limits`). Never a secret — a password, a code, a card, account or identity number, or a key is refused.
5172
+ */
5173
+ content?: string;
5174
+ /**
5175
+ * A category, one line of at most 40 characters — best one of the agent's `memory_categories`, or the platform's. Unset: the platform list's catch-all.
5176
+ */
5177
+ category?: string;
5178
+ /**
5179
+ * `true` pins it: its title and summary head the topics every agent that sees it is shown at a conversation's open, however old; `false` unpins it. At most the platform's `agents.memory.pinned_max` pinned memories a person; one more is a 409.
5180
+ */
5181
+ pinned?: boolean;
5182
+ };
5044
5183
  export type NoteTaken = {
5045
5184
  id: string;
5046
5185
  /**
@@ -5269,6 +5408,49 @@ export type ReportLine = {
5269
5408
  agent_version: number | null;
5270
5409
  created_at: string;
5271
5410
  };
5411
+ export type EndUserStatePage = {
5412
+ data: Array<EndUserState>;
5413
+ /**
5414
+ * Pass as `cursor` for the next page; `null` when this is the last.
5415
+ */
5416
+ next_cursor: string | null;
5417
+ };
5418
+ export type EndUserState = {
5419
+ /**
5420
+ * The end user's `eu_...` id.
5421
+ */
5422
+ end_user_id: string;
5423
+ /**
5424
+ * The agent it is for.
5425
+ */
5426
+ agent_id: string;
5427
+ /**
5428
+ * Your own record of where this person stands with this agent, in plain words: "Cooking: cooked 1 of 3 this week. Persian history: off." Up to 2,000 characters.
5429
+ *
5430
+ * **Only this agent reads it, with this person, and always**: on every reply, in an opening line it writes, and in a message it writes to them first. A change reaches a conversation already open on its next reply.
5431
+ *
5432
+ * **Yours alone to write**: only an API key sets or reads it — never the person's app, a conversation or the model. Each write replaces the whole text, and nothing of the old one is kept, so it suits what changes often: a count, a streak, a step in a course. It sits in the agent's instructions after yours for the person and before what the agent remembers of them: about 250 input tokens on every reply at 1,000 characters.
5433
+ *
5434
+ * Null for none.
5435
+ */
5436
+ text: string | null;
5437
+ /**
5438
+ * When it was last set. Null with none.
5439
+ */
5440
+ updated_at: string | null;
5441
+ };
5442
+ export type EndUserStateUpdate = {
5443
+ /**
5444
+ * Your own record of where this person stands with this agent, in plain words: "Cooking: cooked 1 of 3 this week. Persian history: off." Up to 2,000 characters.
5445
+ *
5446
+ * **Only this agent reads it, with this person, and always**: on every reply, in an opening line it writes, and in a message it writes to them first. A change reaches a conversation already open on its next reply.
5447
+ *
5448
+ * **Yours alone to write**: only an API key sets or reads it — never the person's app, a conversation or the model. Each write replaces the whole text, and nothing of the old one is kept, so it suits what changes often: a count, a streak, a step in a course. It sits in the agent's instructions after yours for the person and before what the agent remembers of them: about 250 input tokens on every reply at 1,000 characters.
5449
+ *
5450
+ * The whole text, each time: to clear it, `DELETE` it.
5451
+ */
5452
+ text: string;
5453
+ };
5272
5454
  export type ScheduledMessage = {
5273
5455
  /**
5274
5456
  * The message's id, `om_…`.
@@ -8409,6 +8591,10 @@ export type CreateFactErrors = {
8409
8591
  * The key's scopes do not cover this, or it is pinned to agents and `agent_id` names another
8410
8592
  */
8411
8593
  403: ErrorResponse;
8594
+ /**
8595
+ * the person already has the most pinned the platform allows (`agents.memory.pinned_max`)
8596
+ */
8597
+ 409: ErrorResponse;
8412
8598
  /**
8413
8599
  * No text, or text that looks like a secret — a password, a code, a card, account or identity number, or a key — which no fact may hold
8414
8600
  */
@@ -8494,7 +8680,7 @@ export type UpdateFactErrors = {
8494
8680
  */
8495
8681
  404: ErrorResponse;
8496
8682
  /**
8497
- * Replaced by a later conversation, or another fact already says that
8683
+ * Replaced by a later conversation, another fact already says that, or the person already has the most pinned the platform allows (`agents.memory.pinned_max`)
8498
8684
  */
8499
8685
  409: ErrorResponse;
8500
8686
  /**
@@ -9754,6 +9940,10 @@ export type CreateEndUserFactErrors = {
9754
9940
  * Unknown end user id
9755
9941
  */
9756
9942
  404: ErrorResponse;
9943
+ /**
9944
+ * the person already has the most pinned the platform allows (`agents.memory.pinned_max`)
9945
+ */
9946
+ 409: ErrorResponse;
9757
9947
  /**
9758
9948
  * No text, or text that looks like a secret — a password, a code, a card, account or identity number, or a key — which no fact may hold
9759
9949
  */
@@ -9841,7 +10031,7 @@ export type UpdateEndUserFactErrors = {
9841
10031
  */
9842
10032
  404: ErrorResponse;
9843
10033
  /**
9844
- * Replaced by a later conversation, or another fact already says that
10034
+ * Replaced by a later conversation, another fact already says that, or the person already has the most pinned the platform allows (`agents.memory.pinned_max`)
9845
10035
  */
9846
10036
  409: ErrorResponse;
9847
10037
  /**
@@ -9954,6 +10144,60 @@ export type ListEndUserMemoriesResponses = {
9954
10144
  200: MemoryPage;
9955
10145
  };
9956
10146
  export type ListEndUserMemoriesResponse = ListEndUserMemoriesResponses[keyof ListEndUserMemoriesResponses];
10147
+ export type CreateEndUserMemoryData = {
10148
+ body: MemoryCreateRequest;
10149
+ path: {
10150
+ end_user_id: string;
10151
+ };
10152
+ query?: never;
10153
+ url: '/v1/end-users/{end_user_id}/memories';
10154
+ };
10155
+ export type CreateEndUserMemoryErrors = {
10156
+ /**
10157
+ * The request could not be read: malformed JSON
10158
+ */
10159
+ 400: ErrorResponse;
10160
+ /**
10161
+ * Missing or invalid credentials
10162
+ */
10163
+ 401: ErrorResponse;
10164
+ /**
10165
+ * The key is valid but its scopes do not cover this capability — a key limited to `tts` gets this from `/v1/images` rather than a 401
10166
+ */
10167
+ 403: ErrorResponse;
10168
+ /**
10169
+ * Unknown end user id
10170
+ */
10171
+ 404: ErrorResponse;
10172
+ /**
10173
+ * The person already holds the most memories a search reads, or the person already has the most pinned the platform allows (`agents.memory.pinned_max`)
10174
+ */
10175
+ 409: ErrorResponse;
10176
+ /**
10177
+ * No title or story, a story past the platform's length, or words that look like a secret — a password, a code, a card, account or identity number, or a key
10178
+ */
10179
+ 422: ErrorResponse;
10180
+ /**
10181
+ * Rate limit exceeded
10182
+ */
10183
+ 429: ErrorResponse;
10184
+ /**
10185
+ * Gemini's embedding failed: nothing was written
10186
+ */
10187
+ 502: ErrorResponse;
10188
+ /**
10189
+ * Embeddings are not configured
10190
+ */
10191
+ 503: ErrorResponse;
10192
+ };
10193
+ export type CreateEndUserMemoryError = CreateEndUserMemoryErrors[keyof CreateEndUserMemoryErrors];
10194
+ export type CreateEndUserMemoryResponses = {
10195
+ /**
10196
+ * The memory, written
10197
+ */
10198
+ 201: MemoryInfo;
10199
+ };
10200
+ export type CreateEndUserMemoryResponse = CreateEndUserMemoryResponses[keyof CreateEndUserMemoryResponses];
9957
10201
  export type DeleteEndUserMemoryData = {
9958
10202
  body?: never;
9959
10203
  path: {
@@ -10024,6 +10268,61 @@ export type GetEndUserMemoryResponses = {
10024
10268
  200: MemoryInfo;
10025
10269
  };
10026
10270
  export type GetEndUserMemoryResponse = GetEndUserMemoryResponses[keyof GetEndUserMemoryResponses];
10271
+ export type UpdateEndUserMemoryData = {
10272
+ body: MemoryUpdateRequest;
10273
+ path: {
10274
+ end_user_id: string;
10275
+ memory_id: string;
10276
+ };
10277
+ query?: never;
10278
+ url: '/v1/end-users/{end_user_id}/memories/{memory_id}';
10279
+ };
10280
+ export type UpdateEndUserMemoryErrors = {
10281
+ /**
10282
+ * The request could not be read: malformed JSON
10283
+ */
10284
+ 400: ErrorResponse;
10285
+ /**
10286
+ * Missing or invalid credentials
10287
+ */
10288
+ 401: ErrorResponse;
10289
+ /**
10290
+ * The key is valid but its scopes do not cover this capability — a key limited to `tts` gets this from `/v1/images` rather than a 401
10291
+ */
10292
+ 403: ErrorResponse;
10293
+ /**
10294
+ * Unknown end user id, or Unknown memory id
10295
+ */
10296
+ 404: ErrorResponse;
10297
+ /**
10298
+ * A conversation rewrote it meanwhile, or the person already has the most pinned the platform allows (`agents.memory.pinned_max`)
10299
+ */
10300
+ 409: ErrorResponse;
10301
+ /**
10302
+ * No title or story, a story past the platform's length, or words that look like a secret — a password, a code, a card, account or identity number, or a key
10303
+ */
10304
+ 422: ErrorResponse;
10305
+ /**
10306
+ * Rate limit exceeded
10307
+ */
10308
+ 429: ErrorResponse;
10309
+ /**
10310
+ * Gemini's embedding failed: nothing was written
10311
+ */
10312
+ 502: ErrorResponse;
10313
+ /**
10314
+ * Embeddings are not configured
10315
+ */
10316
+ 503: ErrorResponse;
10317
+ };
10318
+ export type UpdateEndUserMemoryError = UpdateEndUserMemoryErrors[keyof UpdateEndUserMemoryErrors];
10319
+ export type UpdateEndUserMemoryResponses = {
10320
+ /**
10321
+ * The memory, changed
10322
+ */
10323
+ 200: MemoryInfo;
10324
+ };
10325
+ export type UpdateEndUserMemoryResponse = UpdateEndUserMemoryResponses[keyof UpdateEndUserMemoryResponses];
10027
10326
  export type CreateEndUserNoteData = {
10028
10327
  body: NoteCreateRequest;
10029
10328
  path: {
@@ -10291,6 +10590,165 @@ export type PostToolResultResponses = {
10291
10590
  200: ToolResultTaken;
10292
10591
  };
10293
10592
  export type PostToolResultResponse = PostToolResultResponses[keyof PostToolResultResponses];
10593
+ export type ListEndUserStatesData = {
10594
+ body?: never;
10595
+ path: {
10596
+ end_user_id: string;
10597
+ };
10598
+ query?: never;
10599
+ url: '/v1/end-users/{end_user_id}/states';
10600
+ };
10601
+ export type ListEndUserStatesErrors = {
10602
+ /**
10603
+ * Missing or invalid credentials
10604
+ */
10605
+ 401: ErrorResponse;
10606
+ /**
10607
+ * The key is valid but its scopes do not cover this capability — a key limited to `tts` gets this from `/v1/images` rather than a 401
10608
+ */
10609
+ 403: ErrorResponse;
10610
+ /**
10611
+ * Unknown end user id
10612
+ */
10613
+ 404: ErrorResponse;
10614
+ /**
10615
+ * The request failed validation
10616
+ */
10617
+ 422: ErrorResponse;
10618
+ /**
10619
+ * Rate limit exceeded
10620
+ */
10621
+ 429: ErrorResponse;
10622
+ };
10623
+ export type ListEndUserStatesError = ListEndUserStatesErrors[keyof ListEndUserStatesErrors];
10624
+ export type ListEndUserStatesResponses = {
10625
+ /**
10626
+ * Their state with each agent that has one
10627
+ */
10628
+ 200: EndUserStatePage;
10629
+ };
10630
+ export type ListEndUserStatesResponse = ListEndUserStatesResponses[keyof ListEndUserStatesResponses];
10631
+ export type DeleteEndUserStateData = {
10632
+ body?: never;
10633
+ path: {
10634
+ end_user_id: string;
10635
+ agent_id: string;
10636
+ };
10637
+ query?: never;
10638
+ url: '/v1/end-users/{end_user_id}/states/{agent_id}';
10639
+ };
10640
+ export type DeleteEndUserStateErrors = {
10641
+ /**
10642
+ * Missing or invalid credentials
10643
+ */
10644
+ 401: ErrorResponse;
10645
+ /**
10646
+ * The key is valid but its scopes do not cover this capability — a key limited to `tts` gets this from `/v1/images` rather than a 401
10647
+ */
10648
+ 403: ErrorResponse;
10649
+ /**
10650
+ * Unknown end user id, or Unknown agent id
10651
+ */
10652
+ 404: ErrorResponse;
10653
+ /**
10654
+ * The request failed validation
10655
+ */
10656
+ 422: ErrorResponse;
10657
+ /**
10658
+ * Rate limit exceeded
10659
+ */
10660
+ 429: ErrorResponse;
10661
+ };
10662
+ export type DeleteEndUserStateError = DeleteEndUserStateErrors[keyof DeleteEndUserStateErrors];
10663
+ export type DeleteEndUserStateResponses = {
10664
+ /**
10665
+ * Cleared, or there was none
10666
+ */
10667
+ 204: void;
10668
+ };
10669
+ export type DeleteEndUserStateResponse = DeleteEndUserStateResponses[keyof DeleteEndUserStateResponses];
10670
+ export type GetEndUserStateData = {
10671
+ body?: never;
10672
+ path: {
10673
+ end_user_id: string;
10674
+ agent_id: string;
10675
+ };
10676
+ query?: never;
10677
+ url: '/v1/end-users/{end_user_id}/states/{agent_id}';
10678
+ };
10679
+ export type GetEndUserStateErrors = {
10680
+ /**
10681
+ * Missing or invalid credentials
10682
+ */
10683
+ 401: ErrorResponse;
10684
+ /**
10685
+ * The key is valid but its scopes do not cover this capability — a key limited to `tts` gets this from `/v1/images` rather than a 401
10686
+ */
10687
+ 403: ErrorResponse;
10688
+ /**
10689
+ * Unknown end user id, or Unknown agent id
10690
+ */
10691
+ 404: ErrorResponse;
10692
+ /**
10693
+ * The request failed validation
10694
+ */
10695
+ 422: ErrorResponse;
10696
+ /**
10697
+ * Rate limit exceeded
10698
+ */
10699
+ 429: ErrorResponse;
10700
+ };
10701
+ export type GetEndUserStateError = GetEndUserStateErrors[keyof GetEndUserStateErrors];
10702
+ export type GetEndUserStateResponses = {
10703
+ /**
10704
+ * The state, or none
10705
+ */
10706
+ 200: EndUserState;
10707
+ };
10708
+ export type GetEndUserStateResponse = GetEndUserStateResponses[keyof GetEndUserStateResponses];
10709
+ export type SetEndUserStateData = {
10710
+ body: EndUserStateUpdate;
10711
+ path: {
10712
+ end_user_id: string;
10713
+ agent_id: string;
10714
+ };
10715
+ query?: never;
10716
+ url: '/v1/end-users/{end_user_id}/states/{agent_id}';
10717
+ };
10718
+ export type SetEndUserStateErrors = {
10719
+ /**
10720
+ * The request could not be read: malformed JSON
10721
+ */
10722
+ 400: ErrorResponse;
10723
+ /**
10724
+ * Missing or invalid credentials
10725
+ */
10726
+ 401: ErrorResponse;
10727
+ /**
10728
+ * The key is valid but its scopes do not cover this capability — a key limited to `tts` gets this from `/v1/images` rather than a 401
10729
+ */
10730
+ 403: ErrorResponse;
10731
+ /**
10732
+ * Unknown end user id, or Unknown agent id
10733
+ */
10734
+ 404: ErrorResponse;
10735
+ /**
10736
+ * The request failed validation
10737
+ */
10738
+ 422: ErrorResponse;
10739
+ /**
10740
+ * Rate limit exceeded
10741
+ */
10742
+ 429: ErrorResponse;
10743
+ };
10744
+ export type SetEndUserStateError = SetEndUserStateErrors[keyof SetEndUserStateErrors];
10745
+ export type SetEndUserStateResponses = {
10746
+ /**
10747
+ * The state, as it is now
10748
+ */
10749
+ 200: EndUserState;
10750
+ };
10751
+ export type SetEndUserStateResponse = SetEndUserStateResponses[keyof SetEndUserStateResponses];
10294
10752
  export type ListScheduledMessagesData = {
10295
10753
  body?: never;
10296
10754
  path: {
package/dist/index.d.ts CHANGED
@@ -10,7 +10,7 @@ export type * from "./gen/index.js";
10
10
  export type { Page } from "./paging.js";
11
11
  export type { AgentDrafts, AgentKnowledge, AgentSettings, Agents, AgentTools, AgentVersions, } from "./resources/agents.js";
12
12
  export type { AssetListParams, Assets, AssetUploadFields, FolderListParams, Folders, } from "./resources/assets.js";
13
- export type { EndUserCreated, EndUserExport, EndUserFacts, EndUserListParams, EndUserMemories, EndUserMemoryListParams, EndUserPersonalizations, EndUserReportListParams, EndUserReports, EndUserScheduledMessages, EndUsers, FactAdded, } from "./resources/end-users.js";
13
+ export type { EndUserCreated, EndUserExport, EndUserFacts, EndUserListParams, EndUserMemories, EndUserMemoryListParams, EndUserPersonalizations, EndUserReportListParams, EndUserReports, EndUserScheduledMessages, EndUserStates, EndUsers, FactAdded, } from "./resources/end-users.js";
14
14
  export type { EphemeralKeyCreateOptions, EphemeralKeyListParams, EphemeralKeyRevokeOptions, EphemeralKeys, } from "./resources/ephemeral-keys.js";
15
15
  export type { GenerationListParams, Generations, Images, Jobs, Skybox, } from "./resources/generations.js";
16
16
  export type { Knowledge, KnowledgeInsightsParams, KnowledgeListParams, KnowledgeUploadFields, } from "./resources/knowledge.js";
@@ -23,3 +23,4 @@ export type { Voices, VoiceUploadFields } from "./resources/voices.js";
23
23
  export type { Fetch, RequestOptions } from "./transport.js";
24
24
  export type { UploadData, UploadOptions } from "./upload.js";
25
25
  export { type Job, type Made, madeBy } from "./wait.js";
26
+ export { type ConversationReportEvent, type HeadersLike, type OutreachMessageEvent, SignatureError, type ToolWebhookCall, type VerifyOptions, verifyToolCall, verifyWebhook, type WebhookEvent, } from "./webhooks.js";
package/dist/index.js CHANGED
@@ -7,3 +7,4 @@
7
7
  export { createClient, DEFAULT_BASE_URL, } from "./client.js";
8
8
  export { AuthenticationError, ConflictError, ConnectionError, InsufficientCreditsError, NotFoundError, PermissionError, PlatformError, RateLimitError, ServerError, TimeoutError, ValidationError, } from "./errors.js";
9
9
  export { madeBy } from "./wait.js";
10
+ export { SignatureError, verifyToolCall, verifyWebhook, } from "./webhooks.js";
@@ -34,7 +34,7 @@
34
34
  * read fails with a 401; its one micro-credit is set aside like any key's,
35
35
  * so an organisation with no balance cannot export (402).
36
36
  */
37
- import type { ConversationReport, ConversationReportPage, EndUserCreateRequest, EndUserDeleted, EndUserInfo, EndUserPage, EndUserPersonalization, EndUserPersonalizationUpdate, EndUserUpdateRequest, FactCreateRequest, FactInfo, FactUpdateRequest, ListEndUserMemoriesData, ListEndUserReportsData, ListEndUsersData, MemoriesDeleted, MemoryInfo, MemoryPage, NoteCreateRequest, NoteTaken, RelationInfo, ScheduledMessage, ScheduledMessageCreateRequest, SessionDetail, ToolResultRequest, ToolResultTaken } from "../gen/index.js";
37
+ import type { ConversationReport, ConversationReportPage, EndUserCreateRequest, EndUserDeleted, EndUserInfo, EndUserPage, EndUserPersonalization, EndUserPersonalizationUpdate, EndUserState, EndUserStateUpdate, EndUserUpdateRequest, FactCreateRequest, FactInfo, FactUpdateRequest, ListEndUserMemoriesData, ListEndUserReportsData, ListEndUsersData, MemoriesDeleted, MemoryCreateRequest, MemoryInfo, MemoryPage, MemoryUpdateRequest, NoteCreateRequest, NoteTaken, RelationInfo, ScheduledMessage, ScheduledMessageCreateRequest, SessionDetail, ToolResultRequest, ToolResultTaken } from "../gen/index.js";
38
38
  import { type RequestOptions, type Transport } from "../transport.js";
39
39
  import type { EphemeralKeys } from "./ephemeral-keys.js";
40
40
  import { Editable } from "./resource.js";
@@ -77,6 +77,8 @@ export interface EndUserExport {
77
77
  reports: ConversationReport[];
78
78
  /** What your server set for them: the instructions every agent follows, an opening line's blanks. */
79
79
  personalization: EndUserPersonalization;
80
+ /** Where your server says they stand with each agent that has a state, by agent id. */
81
+ states: EndUserState[];
80
82
  /** The messages an agent was to write to them first, sent or still waiting, newest `send_at` first. */
81
83
  scheduled_messages: ScheduledMessage[];
82
84
  }
@@ -94,9 +96,9 @@ export interface EndUserFacts {
94
96
  list(id: string, params?: {
95
97
  include_replaced?: boolean;
96
98
  }, options?: RequestOptions): AsyncGenerator<FactInfo, void, undefined>;
97
- /** Tells the agents something: yours, never replaced by a conversation. */
99
+ /** Tells the agents something: yours, never replaced by a conversation; `pinned` recalls it first on every turn. */
98
100
  add(id: string, body: FactCreateRequest, options?: RequestOptions): Promise<FactAdded>;
99
- /** Corrects one fact's words; the old ones are kept as forgotten. */
101
+ /** Corrects one fact's words (the old ones kept as forgotten), pins or unpins it. */
100
102
  update(id: string, factId: string, body: FactUpdateRequest, options?: RequestOptions): Promise<FactInfo>;
101
103
  /** Forgets one: `true`, or `false` when there is none by that id. */
102
104
  delete(id: string, factId: string, options?: RequestOptions): Promise<boolean>;
@@ -104,8 +106,8 @@ export interface EndUserFacts {
104
106
  /**
105
107
  * `endUsers.memories`: what the agents remember of one person's life, one
106
108
  * memory per topic, from your server with no key minted for them —
107
- * `/v1/end-users/{id}/memories`. Read and forgotten, never written: only
108
- * a conversation writes one.
109
+ * `/v1/end-users/{id}/memories`. Written by their conversations, and by
110
+ * you: `create` from your records, `update` to change or pin one.
109
111
  */
110
112
  export interface EndUserMemories {
111
113
  /** Every memory, the topic last talked about first, page after page (100 a page by default). */
@@ -114,6 +116,18 @@ export interface EndUserMemories {
114
116
  page(id: string, params?: EndUserMemoryListParams, options?: RequestOptions): Promise<MemoryPage>;
115
117
  /** One memory. A `NotFoundError` when there is none, or no such person. */
116
118
  get(id: string, memoryId: string, options?: RequestOptions): Promise<MemoryInfo>;
119
+ /**
120
+ * Writes a memory from your records — yours: a later conversation adds
121
+ * to it, never takes it over. For every agent, or `agent_id`'s alone;
122
+ * `pinned` heads the topics every conversation opens with.
123
+ */
124
+ create(id: string, body: MemoryCreateRequest, options?: RequestOptions): Promise<MemoryInfo>;
125
+ /**
126
+ * Changes any of its words or its category, pins or unpins it. A
127
+ * `ConflictError` when a conversation rewrote it meanwhile: read it
128
+ * again, then send your change.
129
+ */
130
+ update(id: string, memoryId: string, body: MemoryUpdateRequest, options?: RequestOptions): Promise<MemoryInfo>;
117
131
  /**
118
132
  * Forgets one: `true`, or `false` when there is none by that id. A later
119
133
  * conversation about the topic starts a new one.
@@ -138,6 +152,29 @@ export interface EndUserPersonalizations {
138
152
  */
139
153
  update(id: string, body: EndUserPersonalizationUpdate, options?: RequestOptions): Promise<EndUserPersonalization>;
140
154
  }
155
+ /**
156
+ * `endUsers.states`: your own record of where one person stands with one
157
+ * agent — "Cooking: cooked 1 of 3 this week." — which that agent alone
158
+ * reads, with them, on every reply, in an opening line it writes and in a
159
+ * message it writes first: `/v1/end-users/{id}/states`. One an agent,
160
+ * replaced whole each time; only an API key reads or sets it.
161
+ */
162
+ export interface EndUserStates {
163
+ /** Every agent's state with them, by agent id: one page, an agent with none left out. */
164
+ list(id: string, options?: RequestOptions): AsyncGenerator<EndUserState, void, undefined>;
165
+ /** Their state with `agentId`; `text` `null` for none. */
166
+ get(id: string, agentId: string, options?: RequestOptions): Promise<EndUserState>;
167
+ /**
168
+ * Sets it — the whole text, over whatever was there. The agent reads it
169
+ * on its next reply with them, in a conversation already open too.
170
+ */
171
+ set(id: string, agentId: string, body: EndUserStateUpdate, options?: RequestOptions): Promise<EndUserState>;
172
+ /**
173
+ * Clears it: `true`, with one or none; `false` when there is no such
174
+ * person or agent.
175
+ */
176
+ delete(id: string, agentId: string, options?: RequestOptions): Promise<boolean>;
177
+ }
141
178
  /**
142
179
  * `endUsers.reports`: what an agent with `report_enabled` wrote after each
143
180
  * of one person's conversations — a summary, your fields, success by your
@@ -179,6 +216,8 @@ export declare class EndUsers extends Editable<EndUserInfo, EndUserUpdateRequest
179
216
  readonly facts: EndUserFacts;
180
217
  readonly memories: EndUserMemories;
181
218
  readonly personalization: EndUserPersonalizations;
219
+ /** Where your server says a person stands with one agent: `endUsers.states`. */
220
+ readonly states: EndUserStates;
182
221
  /** Messages an agent writes to the person first: `endUsers.scheduledMessages`. */
183
222
  readonly scheduledMessages: EndUserScheduledMessages;
184
223
  readonly reports: EndUserReports;
@@ -87,6 +87,8 @@ export class EndUsers extends Editable {
87
87
  list: (id, params = {}, options) => this.each(memories(id), params, options, MEMORY_PAGE),
88
88
  page: (id, params = {}, options) => this.send("GET", memories(id), options, params),
89
89
  get: (id, memoryId, options) => this.send("GET", memories(id, `/${segment(memoryId)}`), options),
90
+ create: (id, body, options) => this.send("POST", memories(id), options, body),
91
+ update: (id, memoryId, body, options) => this.send("PATCH", memories(id, `/${segment(memoryId)}`), options, body),
90
92
  delete: (id, memoryId, options) => drop(memories(id, `/${segment(memoryId)}`), options),
91
93
  deleteAll: (id, options) => this.send("DELETE", memories(id), options),
92
94
  };
@@ -94,6 +96,14 @@ export class EndUsers extends Editable {
94
96
  get: (id, options) => this.send("GET", this.at(id, "/personalization"), options),
95
97
  update: (id, body, options) => this.send("PATCH", this.at(id, "/personalization"), options, body),
96
98
  };
99
+ const state = (id, agentId) => this.at(id, `/states/${segment(agentId)}`);
100
+ this.states = {
101
+ // One page by nature, an agent's row each: no `limit` to send.
102
+ list: (id, options) => this.each(this.at(id, "/states"), {}, options),
103
+ get: (id, agentId, options) => this.send("GET", state(id, agentId), options),
104
+ set: (id, agentId, body, options) => this.send("PUT", state(id, agentId), options, body),
105
+ delete: (id, agentId, options) => drop(state(id, agentId), options),
106
+ };
97
107
  const reports = (id, rest = "") => this.at(id, `/reports${rest}`);
98
108
  this.reports = {
99
109
  list: (id, params = {}, options) => this.each(reports(id), params, options, MEMORY_PAGE),
@@ -210,9 +220,10 @@ export class EndUsers extends Editable {
210
220
  // Their own record, and what your server set, scheduled and was
211
221
  // sent about them: the API key's to read, by the id the key named.
212
222
  const person = key.end_user_id ?? id;
213
- const [end_user, personalization, reports, scheduled_messages] = await Promise.all([
223
+ const [end_user, personalization, states, reports, scheduled_messages] = await Promise.all([
214
224
  this.get(person, options),
215
225
  this.personalization.get(person, options),
226
+ all(this.states.list(person, options)),
216
227
  all(this.reports.list(person, {}, options)),
217
228
  all(this.scheduledMessages.list(person, {}, options)),
218
229
  ]);
@@ -225,6 +236,7 @@ export class EndUsers extends Editable {
225
236
  relations,
226
237
  reports,
227
238
  personalization,
239
+ states,
228
240
  scheduled_messages,
229
241
  };
230
242
  }
@@ -0,0 +1,110 @@
1
+ /**
2
+ * What the platform posts to your server, checked before it is believed:
3
+ * an event on your organisation's webhook (`verifyWebhook`) and a webhook
4
+ * tool's call (`verifyToolCall`).
5
+ *
6
+ * - **Both are signed one way** (`packages/core/src/tools/webhook.ts`'s
7
+ * `signature`): `t=<unix seconds>,v1=<hex>`, the HMAC-SHA256 of
8
+ * `<t>.<the raw body>` under the secret's UTF-8 bytes — an event's in
9
+ * `X-Webhook-Signature` under the organisation's one webhook secret, a
10
+ * tool call's in `X-Tool-Signature` under that tool's own.
11
+ * - **The body is the bytes that arrived**: one parsed and written again
12
+ * is other bytes, and fails. So the check comes first and the parse
13
+ * after, here.
14
+ * - **A `t` more than five minutes from now is refused**, which stops a
15
+ * post being replayed.
16
+ * - **Web Crypto only** — `crypto.subtle`, on Workers, Node, Deno and Bun
17
+ * alike — and its `verify` compares in constant time.
18
+ * - **Held to the platform's own signer**: `apps/api/test/sdk.test.ts`
19
+ * checks what `signedEvent` and `webhookRequest` sign, and each body's
20
+ * fields against the types here.
21
+ */
22
+ import { PlatformError } from "./errors.js";
23
+ import type { ConversationReport, ScheduledMessage } from "./gen/index.js";
24
+ /** One event as it is posted: `data` is the thing itself, as the API answers it. */
25
+ interface Envelope<Type extends string, Data> {
26
+ /** Unique per event, the same on every retry: your key to take it once. */
27
+ id: string;
28
+ type: Type;
29
+ /** When it was made: ISO 8601 UTC. */
30
+ created_at: string;
31
+ /** Sent by a test button, or from a test chat on an agent's draft: not a player's. */
32
+ test: boolean;
33
+ data: Data;
34
+ }
35
+ /** A conversation's report, written after it ended. */
36
+ export type ConversationReportEvent = Envelope<"conversation.report", ConversationReport>;
37
+ /** A message an agent wrote to a person first, at a set time. */
38
+ export type OutreachMessageEvent = Envelope<"outreach.message", ScheduledMessage>;
39
+ /**
40
+ * Every event your webhook is posted; `type` says which, and narrows
41
+ * `data`. A later platform may post a type this version does not name:
42
+ * give your `switch` a `default` that answers 2xx and does nothing.
43
+ */
44
+ export type WebhookEvent = ConversationReportEvent | OutreachMessageEvent;
45
+ /** One call to a webhook tool, as your server is posted it. */
46
+ export interface ToolWebhookCall {
47
+ /** The tool's name. */
48
+ tool: string;
49
+ /** The call's id: a background tool's result is posted under it. */
50
+ call_id: string;
51
+ /** What the model called it with, as the tool's `parameters` describe. */
52
+ arguments: Record<string, unknown>;
53
+ /** `null` on a call from the test button, as the three below. */
54
+ agent_id: string | null;
55
+ session_id: string | null;
56
+ turn_id: string | null;
57
+ /** The person: their `eu_…` id, and your own id for them. */
58
+ end_user: {
59
+ id: string;
60
+ external_id: string | null;
61
+ } | null;
62
+ /** A call from the test button, not a conversation. */
63
+ test: boolean;
64
+ /** When it was sent: ISO 8601 UTC. */
65
+ sent_at: string;
66
+ /** A background tool's: where its result goes; else `null`. */
67
+ callback_url: string | null;
68
+ /** A background tool's: its deadline, ISO 8601 UTC; else `null`. */
69
+ expires_at: string | null;
70
+ }
71
+ /** A request's headers: a `Headers`, or a plain object such as Node's `req.headers`. */
72
+ export type HeadersLike = {
73
+ get(name: string): string | null;
74
+ } | Readonly<Record<string, string | readonly string[] | undefined>>;
75
+ export interface VerifyOptions {
76
+ /**
77
+ * The post's body exactly as it arrived, text or bytes: `await
78
+ * request.text()`, or the raw `Buffer` — never an object parsed and
79
+ * written again.
80
+ */
81
+ body: string | ArrayBuffer | ArrayBufferView;
82
+ headers: HeadersLike;
83
+ /** Your organisation's webhook secret; for a tool's call, that tool's. */
84
+ secret: string;
85
+ /** How far from now a signature's time may be, in seconds: 300. */
86
+ toleranceSeconds?: number;
87
+ }
88
+ /**
89
+ * A post that was not the platform's, or not this one: no signature, one
90
+ * made too long ago, or one that does not match the body and the secret.
91
+ * A `PlatformError` like every failure here; its `status`, 401, is what to
92
+ * answer the post with.
93
+ */
94
+ export declare class SignatureError extends PlatformError {
95
+ name: string;
96
+ constructor(message: string);
97
+ }
98
+ /**
99
+ * An event posted to your organisation's webhook, checked against its
100
+ * `X-Webhook-Signature` and your webhook secret: the event, typed by its
101
+ * `type`, or a `SignatureError`.
102
+ */
103
+ export declare const verifyWebhook: (options: VerifyOptions) => Promise<WebhookEvent>;
104
+ /**
105
+ * A call posted to a webhook tool of yours, checked against its
106
+ * `X-Tool-Signature` and that tool's secret: the call, or a
107
+ * `SignatureError`.
108
+ */
109
+ export declare const verifyToolCall: (options: VerifyOptions) => Promise<ToolWebhookCall>;
110
+ export {};
@@ -0,0 +1,121 @@
1
+ /**
2
+ * What the platform posts to your server, checked before it is believed:
3
+ * an event on your organisation's webhook (`verifyWebhook`) and a webhook
4
+ * tool's call (`verifyToolCall`).
5
+ *
6
+ * - **Both are signed one way** (`packages/core/src/tools/webhook.ts`'s
7
+ * `signature`): `t=<unix seconds>,v1=<hex>`, the HMAC-SHA256 of
8
+ * `<t>.<the raw body>` under the secret's UTF-8 bytes — an event's in
9
+ * `X-Webhook-Signature` under the organisation's one webhook secret, a
10
+ * tool call's in `X-Tool-Signature` under that tool's own.
11
+ * - **The body is the bytes that arrived**: one parsed and written again
12
+ * is other bytes, and fails. So the check comes first and the parse
13
+ * after, here.
14
+ * - **A `t` more than five minutes from now is refused**, which stops a
15
+ * post being replayed.
16
+ * - **Web Crypto only** — `crypto.subtle`, on Workers, Node, Deno and Bun
17
+ * alike — and its `verify` compares in constant time.
18
+ * - **Held to the platform's own signer**: `apps/api/test/sdk.test.ts`
19
+ * checks what `signedEvent` and `webhookRequest` sign, and each body's
20
+ * fields against the types here.
21
+ */
22
+ import { PlatformError } from "./errors.js";
23
+ /**
24
+ * A post that was not the platform's, or not this one: no signature, one
25
+ * made too long ago, or one that does not match the body and the secret.
26
+ * A `PlatformError` like every failure here; its `status`, 401, is what to
27
+ * answer the post with.
28
+ */
29
+ export class SignatureError extends PlatformError {
30
+ name = "SignatureError";
31
+ constructor(message) {
32
+ super({ status: 401, code: "unauthenticated", message, requestId: null });
33
+ }
34
+ }
35
+ /** How old a signed `t` is taken: the platform's own five minutes. */
36
+ const TOLERANCE_SECONDS = 300;
37
+ const header = (headers, name) => {
38
+ if (typeof headers.get === "function") {
39
+ return headers.get(name);
40
+ }
41
+ // A plain object's names are as its server wrote them: Node's lowercase.
42
+ const wanted = name.toLowerCase();
43
+ const all = headers;
44
+ for (const key in all) {
45
+ if (key.toLowerCase() !== wanted)
46
+ continue;
47
+ const value = all[key];
48
+ return (typeof value === "string" ? value : value?.[0]) ?? null;
49
+ }
50
+ return null;
51
+ };
52
+ const bytesOf = (body) => typeof body === "string"
53
+ ? new TextEncoder().encode(body)
54
+ : body instanceof ArrayBuffer
55
+ ? new Uint8Array(body)
56
+ : new Uint8Array(body.buffer, body.byteOffset, body.byteLength);
57
+ /** A signature's bytes — SHA-256's 32, as 64 hex digits; `null` for anything else. */
58
+ const unhex = (text) => {
59
+ if (!/^[0-9a-f]{64}$/i.test(text))
60
+ return null;
61
+ const out = new Uint8Array(32);
62
+ for (let i = 0; i < out.length; i++) {
63
+ out[i] = Number.parseInt(text.slice(i * 2, i * 2 + 2), 16);
64
+ }
65
+ return out;
66
+ };
67
+ /** The body, parsed, once `name`'s signature is the platform's; else a `SignatureError`. */
68
+ async function verified(name, options) {
69
+ const given = header(options.headers, name);
70
+ if (!given)
71
+ throw new SignatureError(`This post has no ${name} header.`);
72
+ let t = Number.NaN;
73
+ const signatures = [];
74
+ for (const part of given.split(",")) {
75
+ const cut = part.indexOf("=");
76
+ if (cut < 0)
77
+ continue;
78
+ const key = part.slice(0, cut).trim();
79
+ const value = part.slice(cut + 1).trim();
80
+ if (key === "t" && Number.isNaN(t))
81
+ t = Number(value || Number.NaN);
82
+ const signature = key === "v1" ? unhex(value) : null;
83
+ if (signature)
84
+ signatures.push(signature);
85
+ }
86
+ const tolerance = options.toleranceSeconds ?? TOLERANCE_SECONDS;
87
+ if (!Number.isSafeInteger(t) || !signatures.length) {
88
+ throw new SignatureError(`This post's ${name} is not a signature.`);
89
+ }
90
+ if (Math.abs(Date.now() / 1000 - t) > tolerance) {
91
+ throw new SignatureError(`This post was signed more than ${tolerance} seconds from now: a replay, or a clock that is wrong.`);
92
+ }
93
+ const body = bytesOf(options.body);
94
+ const lead = new TextEncoder().encode(`${t}.`);
95
+ const signed = new Uint8Array(lead.length + body.length);
96
+ signed.set(lead);
97
+ signed.set(body, lead.length);
98
+ const key = await crypto.subtle.importKey("raw", new TextEncoder().encode(options.secret), { name: "HMAC", hash: "SHA-256" }, false, ["verify"]);
99
+ let ours = false;
100
+ for (const signature of signatures) {
101
+ ours ||= await crypto.subtle.verify("HMAC", key, signature, signed);
102
+ }
103
+ if (!ours) {
104
+ throw new SignatureError(`This post's ${name} does not match its body under this secret. Check the raw body, before anything parses it, and that the secret is the one in use.`);
105
+ }
106
+ return JSON.parse(typeof options.body === "string"
107
+ ? options.body
108
+ : new TextDecoder().decode(body));
109
+ }
110
+ /**
111
+ * An event posted to your organisation's webhook, checked against its
112
+ * `X-Webhook-Signature` and your webhook secret: the event, typed by its
113
+ * `type`, or a `SignatureError`.
114
+ */
115
+ export const verifyWebhook = (options) => verified("X-Webhook-Signature", options);
116
+ /**
117
+ * A call posted to a webhook tool of yours, checked against its
118
+ * `X-Tool-Signature` and that tool's secret: the call, or a
119
+ * `SignatureError`.
120
+ */
121
+ export const verifyToolCall = (options) => verified("X-Tool-Signature", options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumavox/server",
3
- "version": "0.53.0",
3
+ "version": "0.58.0",
4
4
  "description": "The Lumavox API from your server: end users, ephemeral keys and the rest, typed from the published OpenAPI document. Zero dependencies.",
5
5
  "license": "MIT",
6
6
  "type": "module",