@lumavox/server 0.6.0 → 0.8.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
@@ -1,7 +1,7 @@
1
1
  # @lumavox/server
2
2
 
3
3
  The Lumavox API from your server, with your organisation's API key: speech,
4
- images and video, voices, your asset library, agents, knowledge, end users
4
+ images and video, voices, your asset library, agents, knowledge, tools, end users
5
5
  and the ephemeral keys their devices talk to agents with — every operation
6
6
  a key may call, typed from the published OpenAPI document. **Zero
7
7
  dependencies**: `fetch` and the web platform only — Node 20.3 or later,
@@ -68,7 +68,8 @@ list's page.
68
68
  | `tts`, `stt` | `create` |
69
69
  | `voices` | `list`, `page`, `get`, `create`, `uploadUrl`, `upload`, `update`, `delete`, `resample`, `design`, `saveDesign`, `wait` |
70
70
  | `assets` | `list`, `page`, `get`, `uploadUrl`, `confirm`, `upload`, `update`, `delete`, `deleteMany`, `move`, `wait`; `assets.folders.*` |
71
- | `agents` | `list`, `page`, `get`, `create`, `update`, `delete`; `agents.settings.get/update`; `agents.knowledge.list/set` |
71
+ | `agents` | `list`, `page`, `get`, `create`, `update`, `delete`; `agents.settings.get/update`; `agents.knowledge.list/set`; `agents.tools.list/set` |
72
+ | `tools` | `list`, `page`, `get`, `create` (a webhook's signing secret, shown once), `update`, `delete`, `rotateSecret`, `test` |
72
73
  | `knowledge` | `list`, `page`, `get`, `create`, `bulk`, `fromUrl`, `uploadUrl`, `fromFile`, `upload`, `update`, `delete`, `reindex`, `refresh`, `setAgents`, `search`, `categories`, `insights`, `wait` |
73
74
  | `usage` | `get`, `plan` |
74
75
  | the client | `health()` |
package/dist/client.d.ts CHANGED
@@ -20,6 +20,7 @@ import { Generations, Jobs, Skybox } from "./resources/generations.js";
20
20
  import { Knowledge } from "./resources/knowledge.js";
21
21
  import { Stt, Tts } from "./resources/speech.js";
22
22
  import { Templates } from "./resources/templates.js";
23
+ import { Tools } from "./resources/tools.js";
23
24
  import { Usage } from "./resources/usage.js";
24
25
  import { Voices } from "./resources/voices.js";
25
26
  import { type Fetch, type RequestOptions } from "./transport.js";
@@ -53,6 +54,7 @@ export interface Client {
53
54
  readonly assets: Assets;
54
55
  readonly agents: Agents;
55
56
  readonly knowledge: Knowledge;
57
+ readonly tools: Tools;
56
58
  /** Whether the API is up, and its version. Sends no key. */
57
59
  health(options?: RequestOptions): Promise<HealthResponse>;
58
60
  }
package/dist/client.js CHANGED
@@ -6,6 +6,7 @@ import { Generations, Jobs, Skybox } from "./resources/generations.js";
6
6
  import { Knowledge } from "./resources/knowledge.js";
7
7
  import { Stt, Tts } from "./resources/speech.js";
8
8
  import { Templates } from "./resources/templates.js";
9
+ import { Tools } from "./resources/tools.js";
9
10
  import { Usage } from "./resources/usage.js";
10
11
  import { Voices } from "./resources/voices.js";
11
12
  import { REFUSAL, refusedHere } from "./runtime.js";
@@ -45,6 +46,7 @@ export function createClient(options) {
45
46
  assets: new Assets(transport, "/v1/assets"),
46
47
  agents: new Agents(transport, "/v1/agents"),
47
48
  knowledge: new Knowledge(transport, "/v1/knowledge"),
49
+ tools: new Tools(transport, "/v1/tools"),
48
50
  health: (request) => transport
49
51
  .request({ method: "GET", path: "/health", open: true }, request)
50
52
  .then((answer) => answer.data),
@@ -1 +1 @@
1
- export type { AgentCreateRequest, AgentInfo, AgentKnowledgeUpdate, AgentPage, AgentSettingsInfo, AgentSettingsUpdate, AgentStt, AgentSttInfo, AgentSummary, AgentUpdate, AgentVoice, AgentVoiceInfo, ApiKeySelf, AssetBulkRequest, AssetDetail, AssetMoveRequest, AssetPage, AssetsAffected, AssetSummary, AssetUpdate, AssignedAgent, AudioRequest, BulkEditKnowledgeData, BulkEditKnowledgeError, BulkEditKnowledgeErrors, BulkEditKnowledgeResponse, BulkEditKnowledgeResponses, ClientOptions, CompactionInfo, CompactRequest, CompactSessionData, CompactSessionError, CompactSessionErrors, CompactSessionResponse, CompactSessionResponses, ConfirmAssetUploadData, ConfirmAssetUploadError, ConfirmAssetUploadErrors, ConfirmAssetUploadResponse, ConfirmAssetUploadResponses, CreateAgentData, CreateAgentError, CreateAgentErrors, CreateAgentResponse, CreateAgentResponses, CreateAssetFolderData, CreateAssetFolderError, CreateAssetFolderErrors, CreateAssetFolderResponse, CreateAssetFolderResponses, CreateAssetUploadUrlData, CreateAssetUploadUrlError, CreateAssetUploadUrlErrors, CreateAssetUploadUrlResponse, CreateAssetUploadUrlResponses, CreateAudioData, CreateAudioError, CreateAudioErrors, CreateAudioResponse, CreateAudioResponses, CreateEndUserData, CreateEndUserError, CreateEndUserErrors, CreateEndUserResponse, CreateEndUserResponses, CreateEphemeralKeyData, CreateEphemeralKeyError, CreateEphemeralKeyErrors, CreateEphemeralKeyResponse, CreateEphemeralKeyResponses, 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, CreateSessionData, CreateSessionError, CreateSessionErrors, CreateSessionResponse, CreateSessionResponses, CreateSkyboxData, CreateSkyboxError, CreateSkyboxErrors, CreateSkyboxResponse, CreateSkyboxResponses, 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, DeleteAllFactsData, DeleteAllFactsError, DeleteAllFactsErrors, DeleteAllFactsResponse, DeleteAllFactsResponses, DeleteAssetData, DeleteAssetError, DeleteAssetErrors, DeleteAssetFolderData, DeleteAssetFolderError, DeleteAssetFolderErrors, DeleteAssetFolderResponse, DeleteAssetFolderResponses, DeleteAssetResponse, DeleteAssetResponses, DeleteAssetsData, DeleteAssetsError, DeleteAssetsErrors, DeleteAssetsResponse, DeleteAssetsResponses, DeleteEndUserData, DeleteEndUserError, DeleteEndUserErrors, DeleteEndUserResponse, DeleteEndUserResponses, DeleteFactData, DeleteFactError, DeleteFactErrors, DeleteFactResponse, DeleteFactResponses, DeleteKnowledgeData, DeleteKnowledgeError, DeleteKnowledgeErrors, DeleteKnowledgeResponse, DeleteKnowledgeResponses, DeleteSessionData, DeleteSessionError, DeleteSessionErrors, DeleteSessionResponse, DeleteSessionResponses, DeleteVoiceData, DeleteVoiceError, DeleteVoiceErrors, DeleteVoiceResponse, DeleteVoiceResponses, DesignVoiceData, DesignVoiceError, DesignVoiceErrors, DesignVoiceResponse, DesignVoiceResponses, EndUserCreateRequest, EndUserDeleted, EndUserInfo, EndUserPage, EndUserUpdateRequest, EphemeralKeyCreateRequest, EphemeralKeyCreateResponse, EphemeralKeyInfo, EphemeralKeyLimits, EphemeralKeyPage, EphemeralTokenSelf, ErrorCode, ErrorInfo, ErrorResponse, ExtractSessionFactsData, ExtractSessionFactsError, ExtractSessionFactsErrors, ExtractSessionFactsResponse, ExtractSessionFactsResponses, FactInfo, FactPage, FactsDeleted, FolderCreate, FolderDeleted, FolderDetail, FolderPage, FolderSummary, FolderUpdate, GenerateFromTemplateData, GenerateFromTemplateError, GenerateFromTemplateErrors, GenerateFromTemplateResponse, GenerateFromTemplateResponses, GenerationAudio, GenerationImage, GenerationInfo, GenerationPage, GenerationSkybox, GenerationTranscript, GenerationVideo, GetAgentData, GetAgentError, GetAgentErrors, GetAgentResponse, GetAgentResponses, GetAgentSettingsData, GetAgentSettingsError, GetAgentSettingsErrors, GetAgentSettingsResponse, GetAgentSettingsResponses, GetAssetData, GetAssetError, GetAssetErrors, GetAssetFolderData, GetAssetFolderError, GetAssetFolderErrors, GetAssetFolderResponse, GetAssetFolderResponses, GetAssetResponse, GetAssetResponses, GetAudioData, GetAudioError, GetAudioErrors, GetAudioResponse, GetAudioResponses, GetEndUserData, GetEndUserError, GetEndUserErrors, 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, GetPlanData, GetPlanError, GetPlanErrors, GetPlanResponse, GetPlanResponses, GetSessionData, GetSessionError, GetSessionErrors, GetSessionResponse, GetSessionResponses, GetSkyboxData, GetSkyboxError, GetSkyboxErrors, GetSkyboxResponse, GetSkyboxResponses, GetTemplateData, GetTemplateError, GetTemplateErrors, GetTemplateFileData, GetTemplateFileError, GetTemplateFileErrors, GetTemplateFileResponses, GetTemplateResponse, GetTemplateResponses, GetTokenData, GetTokenError, GetTokenErrors, GetTokenResponse, GetTokenResponses, 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, ListAgentKnowledgeData, ListAgentKnowledgeError, ListAgentKnowledgeErrors, ListAgentKnowledgeResponse, ListAgentKnowledgeResponses, ListAgentsData, ListAgentsError, ListAgentsErrors, ListAgentsResponse, ListAgentsResponses, ListAssetFoldersData, ListAssetFoldersError, ListAssetFoldersErrors, ListAssetFoldersResponse, ListAssetFoldersResponses, ListAssetsData, ListAssetsError, ListAssetsErrors, ListAssetsResponse, ListAssetsResponses, 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, ListRelationsData, ListRelationsError, ListRelationsErrors, ListRelationsResponse, ListRelationsResponses, ListSessionsData, ListSessionsError, ListSessionsErrors, ListSessionsResponse, ListSessionsResponses, ListSkyboxStylesData, ListSkyboxStylesError, ListSkyboxStylesErrors, ListSkyboxStylesResponse, ListSkyboxStylesResponses, ListTemplatesData, ListTemplatesError, ListTemplatesErrors, ListTemplatesResponse, ListTemplatesResponses, ListVoicesData, ListVoicesError, ListVoicesErrors, ListVoicesResponse, ListVoicesResponses, MessageInfo, MessageKnowledge, MessagePage, MoveAssetsData, MoveAssetsError, MoveAssetsErrors, MoveAssetsResponse, MoveAssetsResponses, OrgPlan, ProviderVoiceSettings, ProviderVoiceSettingsInfo, Reference, RefreshKnowledgeData, RefreshKnowledgeError, RefreshKnowledgeErrors, RefreshKnowledgeResponse, RefreshKnowledgeResponses, ReindexKnowledgeData, ReindexKnowledgeError, ReindexKnowledgeErrors, ReindexKnowledgeResponse, ReindexKnowledgeResponses, RelationInfo, RelationPage, ResampleVoiceData, ResampleVoiceError, ResampleVoiceErrors, ResampleVoiceResponse, ResampleVoiceResponses, RevokeEphemeralKeyData, RevokeEphemeralKeyError, RevokeEphemeralKeyErrors, RevokeEphemeralKeyResponse, RevokeEphemeralKeyResponses, SaveDesignedVoiceData, SaveDesignedVoiceError, SaveDesignedVoiceErrors, SaveDesignedVoiceResponse, SaveDesignedVoiceResponses, SearchKnowledgeData, SearchKnowledgeError, SearchKnowledgeErrors, SearchKnowledgeResponse, SearchKnowledgeResponses, SessionCreateRequest, SessionDetail, SessionInfo, SessionPage, SetAgentKnowledgeData, SetAgentKnowledgeError, SetAgentKnowledgeErrors, SetAgentKnowledgeResponse, SetAgentKnowledgeResponses, SetKnowledgeAgentsData, SetKnowledgeAgentsError, SetKnowledgeAgentsErrors, SetKnowledgeAgentsResponse, SetKnowledgeAgentsResponses, SkyboxFile, SkyboxRequest, SkyboxStyle, SkyboxStylePage, SpeechProvider, StreamDone, StreamError, StreamSegment, StreamTranscript, SynthesizeSpeechData, SynthesizeSpeechError, SynthesizeSpeechErrors, SynthesizeSpeechResponse, SynthesizeSpeechResponses, TemplateGenerateRequest, TemplateInfo, TemplateInput, TemplatePage, TokenSelf, TranscribeAssetRequest, TranscribeData, TranscribeError, TranscribeErrors, TranscribeResponse, TranscribeResponses, Transcription, TranscriptionStreamLine, TranscriptWord, TtsOptions, TtsRequest, UnansweredQuestion, UpdateAgentData, UpdateAgentError, UpdateAgentErrors, UpdateAgentResponse, UpdateAgentResponses, UpdateAgentSettingsData, UpdateAgentSettingsError, UpdateAgentSettingsErrors, UpdateAgentSettingsResponse, UpdateAgentSettingsResponses, UpdateAssetData, UpdateAssetError, UpdateAssetErrors, UpdateAssetFolderData, UpdateAssetFolderError, UpdateAssetFolderErrors, UpdateAssetFolderResponse, UpdateAssetFolderResponses, UpdateAssetResponse, UpdateAssetResponses, UpdateEndUserData, UpdateEndUserError, UpdateEndUserErrors, UpdateEndUserResponse, UpdateEndUserResponses, UpdateKnowledgeData, UpdateKnowledgeError, UpdateKnowledgeErrors, UpdateKnowledgeResponse, UpdateKnowledgeResponses, UpdateVoiceData, UpdateVoiceError, UpdateVoiceErrors, UpdateVoiceResponse, UpdateVoiceResponses, UploadConfirm, UploadTicket, UploadTicketRequest, UsageByKey, UsageDay, UsageResponse, UsageSummary, ValidationIssue, VariantInfo, VideoRequest, VoiceDesignPreview, VoiceDesignRequest, VoiceDesignResult, VoiceDesignSaveRequest, VoiceDetail, VoiceInfo, VoiceInfoPage, VoiceKind, VoiceSample, VoiceSource, VoiceStatus, VoiceUpdate, VoiceUpload, VoiceUploadRequest, VoiceUploadTicket } from './types.gen.js';
1
+ export type { AgentCreateRequest, AgentInfo, AgentKnowledgeUpdate, AgentPage, AgentSettingsInfo, AgentSettingsUpdate, AgentStt, AgentSttInfo, AgentSummary, AgentToolsUpdate, AgentUpdate, AgentVoice, AgentVoiceInfo, ApiKeySelf, AssetBulkRequest, AssetDetail, AssetMoveRequest, AssetPage, AssetsAffected, AssetSummary, AssetUpdate, AssignedAgent, AudioRequest, BulkEditKnowledgeData, BulkEditKnowledgeError, BulkEditKnowledgeErrors, BulkEditKnowledgeResponse, BulkEditKnowledgeResponses, ClientOptions, CompactionInfo, CompactRequest, CompactSessionData, CompactSessionError, CompactSessionErrors, CompactSessionResponse, CompactSessionResponses, ConfirmAssetUploadData, ConfirmAssetUploadError, ConfirmAssetUploadErrors, ConfirmAssetUploadResponse, ConfirmAssetUploadResponses, CreateAgentData, CreateAgentError, CreateAgentErrors, CreateAgentResponse, CreateAgentResponses, CreateAssetFolderData, CreateAssetFolderError, CreateAssetFolderErrors, CreateAssetFolderResponse, CreateAssetFolderResponses, CreateAssetUploadUrlData, CreateAssetUploadUrlError, CreateAssetUploadUrlErrors, CreateAssetUploadUrlResponse, CreateAssetUploadUrlResponses, CreateAudioData, CreateAudioError, CreateAudioErrors, CreateAudioResponse, CreateAudioResponses, CreateEndUserData, CreateEndUserError, CreateEndUserErrors, CreateEndUserResponse, CreateEndUserResponses, CreateEphemeralKeyData, CreateEphemeralKeyError, CreateEphemeralKeyErrors, CreateEphemeralKeyResponse, CreateEphemeralKeyResponses, 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, 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, DeleteAllFactsData, DeleteAllFactsError, DeleteAllFactsErrors, DeleteAllFactsResponse, DeleteAllFactsResponses, DeleteAssetData, DeleteAssetError, DeleteAssetErrors, DeleteAssetFolderData, DeleteAssetFolderError, DeleteAssetFolderErrors, DeleteAssetFolderResponse, DeleteAssetFolderResponses, DeleteAssetResponse, DeleteAssetResponses, DeleteAssetsData, DeleteAssetsError, DeleteAssetsErrors, DeleteAssetsResponse, DeleteAssetsResponses, DeleteEndUserData, DeleteEndUserError, DeleteEndUserErrors, DeleteEndUserResponse, DeleteEndUserResponses, DeleteFactData, DeleteFactError, DeleteFactErrors, DeleteFactResponse, DeleteFactResponses, DeleteKnowledgeData, DeleteKnowledgeError, DeleteKnowledgeErrors, DeleteKnowledgeResponse, DeleteKnowledgeResponses, DeleteSessionData, DeleteSessionError, DeleteSessionErrors, DeleteSessionResponse, DeleteSessionResponses, DeleteToolData, DeleteToolError, DeleteToolErrors, DeleteToolResponse, DeleteToolResponses, DeleteVoiceData, DeleteVoiceError, DeleteVoiceErrors, DeleteVoiceResponse, DeleteVoiceResponses, DesignVoiceData, DesignVoiceError, DesignVoiceErrors, DesignVoiceResponse, DesignVoiceResponses, EndUserCreateRequest, EndUserDeleted, EndUserInfo, EndUserPage, EndUserUpdateRequest, EphemeralKeyCreateRequest, EphemeralKeyCreateResponse, EphemeralKeyInfo, EphemeralKeyLimits, EphemeralKeyPage, EphemeralTokenSelf, ErrorCode, ErrorInfo, ErrorResponse, ExtractSessionFactsData, ExtractSessionFactsError, ExtractSessionFactsErrors, ExtractSessionFactsResponse, ExtractSessionFactsResponses, FactInfo, FactPage, FactsDeleted, FolderCreate, FolderDeleted, FolderDetail, FolderPage, FolderSummary, FolderUpdate, GenerateFromTemplateData, GenerateFromTemplateError, GenerateFromTemplateErrors, GenerateFromTemplateResponse, GenerateFromTemplateResponses, GenerationAudio, GenerationImage, GenerationInfo, GenerationPage, GenerationSkybox, GenerationTranscript, GenerationVideo, GetAgentData, GetAgentError, GetAgentErrors, GetAgentResponse, GetAgentResponses, GetAgentSettingsData, GetAgentSettingsError, GetAgentSettingsErrors, GetAgentSettingsResponse, GetAgentSettingsResponses, GetAssetData, GetAssetError, GetAssetErrors, GetAssetFolderData, GetAssetFolderError, GetAssetFolderErrors, GetAssetFolderResponse, GetAssetFolderResponses, GetAssetResponse, GetAssetResponses, GetAudioData, GetAudioError, GetAudioErrors, GetAudioResponse, GetAudioResponses, GetEndUserData, GetEndUserError, GetEndUserErrors, 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, GetPlanData, GetPlanError, GetPlanErrors, GetPlanResponse, GetPlanResponses, 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, ListAgentKnowledgeData, ListAgentKnowledgeError, ListAgentKnowledgeErrors, ListAgentKnowledgeResponse, ListAgentKnowledgeResponses, ListAgentsData, ListAgentsError, ListAgentsErrors, ListAgentsResponse, ListAgentsResponses, ListAgentToolsData, ListAgentToolsError, ListAgentToolsErrors, ListAgentToolsResponse, ListAgentToolsResponses, ListAssetFoldersData, ListAssetFoldersError, ListAssetFoldersErrors, ListAssetFoldersResponse, ListAssetFoldersResponses, ListAssetsData, ListAssetsError, ListAssetsErrors, ListAssetsResponse, ListAssetsResponses, 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, ListRelationsData, ListRelationsError, ListRelationsErrors, ListRelationsResponse, ListRelationsResponses, ListSessionsData, ListSessionsError, ListSessionsErrors, ListSessionsResponse, ListSessionsResponses, ListSkyboxStylesData, ListSkyboxStylesError, ListSkyboxStylesErrors, ListSkyboxStylesResponse, ListSkyboxStylesResponses, ListTemplatesData, ListTemplatesError, ListTemplatesErrors, ListTemplatesResponse, ListTemplatesResponses, ListToolsData, ListToolsError, ListToolsErrors, ListToolsResponse, ListToolsResponses, ListVoicesData, ListVoicesError, ListVoicesErrors, ListVoicesResponse, ListVoicesResponses, MessageInfo, MessageKnowledge, MessagePage, MessageToolCall, MoveAssetsData, MoveAssetsError, MoveAssetsErrors, MoveAssetsResponse, MoveAssetsResponses, OrgPlan, ProviderVoiceSettings, ProviderVoiceSettingsInfo, Reference, RefreshKnowledgeData, RefreshKnowledgeError, RefreshKnowledgeErrors, RefreshKnowledgeResponse, RefreshKnowledgeResponses, ReindexKnowledgeData, ReindexKnowledgeError, ReindexKnowledgeErrors, ReindexKnowledgeResponse, ReindexKnowledgeResponses, RelationInfo, RelationPage, ResampleVoiceData, ResampleVoiceError, ResampleVoiceErrors, ResampleVoiceResponse, ResampleVoiceResponses, RevokeEphemeralKeyData, RevokeEphemeralKeyError, RevokeEphemeralKeyErrors, RevokeEphemeralKeyResponse, RevokeEphemeralKeyResponses, RotateToolSecretData, RotateToolSecretError, RotateToolSecretErrors, RotateToolSecretResponse, RotateToolSecretResponses, SaveDesignedVoiceData, SaveDesignedVoiceError, SaveDesignedVoiceErrors, SaveDesignedVoiceResponse, SaveDesignedVoiceResponses, 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, TestToolData, TestToolError, TestToolErrors, TestToolResponse, TestToolResponses, TokenSelf, ToolCreate, ToolInfo, ToolPage, ToolsAssigned, ToolTestRequest, ToolTestResult, ToolUpdate, ToolWithSecret, TranscribeAssetRequest, TranscribeData, TranscribeError, TranscribeErrors, TranscribeResponse, TranscribeResponses, Transcription, TranscriptionStreamLine, TranscriptWord, TtsOptions, TtsRequest, UnansweredQuestion, UpdateAgentData, UpdateAgentError, UpdateAgentErrors, UpdateAgentResponse, UpdateAgentResponses, UpdateAgentSettingsData, UpdateAgentSettingsError, UpdateAgentSettingsErrors, UpdateAgentSettingsResponse, UpdateAgentSettingsResponses, UpdateAssetData, UpdateAssetError, UpdateAssetErrors, UpdateAssetFolderData, UpdateAssetFolderError, UpdateAssetFolderErrors, UpdateAssetFolderResponse, UpdateAssetFolderResponses, UpdateAssetResponse, UpdateAssetResponses, UpdateEndUserData, UpdateEndUserError, UpdateEndUserErrors, UpdateEndUserResponse, UpdateEndUserResponses, UpdateKnowledgeData, UpdateKnowledgeError, UpdateKnowledgeErrors, UpdateKnowledgeResponse, UpdateKnowledgeResponses, UpdateToolData, UpdateToolError, UpdateToolErrors, UpdateToolResponse, UpdateToolResponses, UpdateVoiceData, UpdateVoiceError, UpdateVoiceErrors, UpdateVoiceResponse, UpdateVoiceResponses, UploadConfirm, UploadTicket, UploadTicketRequest, UsageByKey, UsageDay, UsageResponse, UsageSummary, ValidationIssue, VariantInfo, VideoRequest, VoiceDesignPreview, VoiceDesignRequest, VoiceDesignResult, VoiceDesignSaveRequest, VoiceDetail, VoiceInfo, VoiceInfoPage, VoiceKind, VoiceSample, VoiceSource, VoiceStatus, VoiceUpdate, VoiceUpload, VoiceUploadRequest, VoiceUploadTicket } from './types.gen.js';
@@ -1124,6 +1124,10 @@ export type MessageInfo = {
1124
1124
  */
1125
1125
  mood_intensity: number | null;
1126
1126
  role: 'user' | 'assistant';
1127
+ /**
1128
+ * On a reply: the calls of your tools it made, in order, each with its arguments and what it answered. Empty when it called none, and on the person's messages.
1129
+ */
1130
+ tool_calls: Array<MessageToolCall>;
1127
1131
  };
1128
1132
  export type MessageKnowledge = {
1129
1133
  lookups: Array<KnowledgeLookupInfo>;
@@ -1149,6 +1153,40 @@ export type KnowledgeCitation = {
1149
1153
  score: number;
1150
1154
  title: string;
1151
1155
  };
1156
+ export type MessageToolCall = {
1157
+ /**
1158
+ * The call's id, `call_…`: what your server or app was sent.
1159
+ */
1160
+ call_id: string;
1161
+ name: string;
1162
+ kind: 'webhook' | 'app';
1163
+ /**
1164
+ * What the model called it with.
1165
+ */
1166
+ arguments: {
1167
+ [key: string]: unknown;
1168
+ };
1169
+ /**
1170
+ * What it answered, as the model read it — its JSON, or its text, cut at 16 KB. Null when it answered nothing.
1171
+ */
1172
+ result?: unknown;
1173
+ /**
1174
+ * It answered in time, with a 2xx or a result.
1175
+ */
1176
+ ok: boolean;
1177
+ /**
1178
+ * What failed, as the model was told — or, for a tool that asks first, that it waited for the person's yes. Null when nothing did.
1179
+ */
1180
+ error: string | null;
1181
+ /**
1182
+ * How long it took.
1183
+ */
1184
+ ms: number;
1185
+ /**
1186
+ * Which of the reply's rounds of calls, 1 to 3; 0 for a call the person confirmed with a tap.
1187
+ */
1188
+ round: number;
1189
+ };
1152
1190
  export type RelationInfo = {
1153
1191
  agent_id: string;
1154
1192
  /**
@@ -2574,6 +2612,218 @@ export type AgentKnowledgeUpdate = {
2574
2612
  */
2575
2613
  entry_ids: Array<string>;
2576
2614
  };
2615
+ export type ToolPage = {
2616
+ data: Array<ToolInfo>;
2617
+ /**
2618
+ * Pass as `cursor` for the next page; `null` when this is the last.
2619
+ */
2620
+ next_cursor: string | null;
2621
+ };
2622
+ export type ToolInfo = {
2623
+ /**
2624
+ * The tool's id, `tl_…`.
2625
+ */
2626
+ id: string;
2627
+ /**
2628
+ * What the model calls the tool by: 1 to 64 lower-case letters, digits and underscores, starting with a letter. Unique in your organisation; `search_knowledge` and `remember_relation` are the platform's own.
2629
+ */
2630
+ name: string;
2631
+ description: string;
2632
+ /**
2633
+ * `webhook`: your server, sent a signed `POST` with the call. `app`: the person's app, called over the agent's WebSocket. Fixed at creation.
2634
+ */
2635
+ kind: 'webhook' | 'app';
2636
+ /**
2637
+ * Its inputs, as a JSON Schema object: `{"type": "object", "properties": {…}, "required": […]}`, each property `string` (with an optional `enum`), `number`, `integer`, `boolean`, `array` (with `items`) or `object`, each with an optional `description`. Nothing else is taken: a key outside this set is refused rather than passed on unenforced.
2638
+ */
2639
+ parameters: {
2640
+ [key: string]: unknown;
2641
+ };
2642
+ /**
2643
+ * A webhook's address; `null` for an app's.
2644
+ */
2645
+ url: string | null;
2646
+ /**
2647
+ * How long a call may take, in milliseconds: 1000 to 30000, 10000 by default. Past it the call failed, and the model is told so.
2648
+ */
2649
+ timeout_ms: number;
2650
+ /**
2651
+ * Never run on the model's word alone: the agent asks the person first, and the tool runs only after they say yes.
2652
+ */
2653
+ ask_first: boolean;
2654
+ /**
2655
+ * An app's tool only: the app is told to act and the reply carries on at once, with no answer awaited.
2656
+ */
2657
+ action_only: boolean;
2658
+ /**
2659
+ * The line said before the call; `null` for none.
2660
+ */
2661
+ filler: string | null;
2662
+ /**
2663
+ * The names of the headers sent with each call; their values are never shown.
2664
+ */
2665
+ header_names: Array<string>;
2666
+ /**
2667
+ * The signing secret's last four characters; `null` for an app's tool.
2668
+ */
2669
+ secret_hint: string | null;
2670
+ /**
2671
+ * The agents it is turned on for.
2672
+ */
2673
+ agent_ids: Array<string>;
2674
+ /**
2675
+ * Moves by one on every save. Send it back as `expected_version` on an update to have the save refused (409) if somebody else changed the tool since you read it.
2676
+ */
2677
+ version: number;
2678
+ created_at: string;
2679
+ updated_at: string;
2680
+ };
2681
+ export type ToolWithSecret = ToolInfo & {
2682
+ /**
2683
+ * The signing secret, `whsec_…`, **shown this once**: every call is signed with it (`X-Tool-Signature`). Keep it on your server. `null` for an app's tool.
2684
+ */
2685
+ secret: string | null;
2686
+ };
2687
+ export type ToolCreate = {
2688
+ /**
2689
+ * What the model calls the tool by: 1 to 64 lower-case letters, digits and underscores, starting with a letter. Unique in your organisation; `search_knowledge` and `remember_relation` are the platform's own.
2690
+ */
2691
+ name: string;
2692
+ /**
2693
+ * What the tool does and when to call it, in the model's terms: it reads this to decide.
2694
+ */
2695
+ description: string;
2696
+ /**
2697
+ * `webhook`: your server, sent a signed `POST` with the call. `app`: the person's app, called over the agent's WebSocket. Fixed at creation.
2698
+ */
2699
+ kind: 'webhook' | 'app';
2700
+ /**
2701
+ * Its inputs (as above); omitted: it takes none.
2702
+ */
2703
+ parameters?: {
2704
+ [key: string]: unknown;
2705
+ };
2706
+ /**
2707
+ * A webhook's `https://` address, public, and not this platform's. An app's tool has none.
2708
+ */
2709
+ url?: string | null;
2710
+ /**
2711
+ * How long a call may take, in milliseconds: 1000 to 30000, 10000 by default. Past it the call failed, and the model is told so.
2712
+ */
2713
+ timeout_ms?: number;
2714
+ /**
2715
+ * Never run on the model's word alone: the agent asks the person first, and the tool runs only after they say yes.
2716
+ */
2717
+ ask_first?: boolean;
2718
+ /**
2719
+ * An app's tool only: the app is told to act and the reply carries on at once, with no answer awaited.
2720
+ */
2721
+ action_only?: boolean;
2722
+ /**
2723
+ * A line the agent says before the call, while it waits: `Let me check that for you.` `null`: none.
2724
+ */
2725
+ filler?: string | null;
2726
+ /**
2727
+ * A webhook's own headers, sent with every call (your API token): at most 10, stored encrypted and never shown again — a tool answers their names. `Content-Type`, `User-Agent`, `X-Tool-*` and HTTP's own are the platform's.
2728
+ */
2729
+ headers?: {
2730
+ [key: string]: string;
2731
+ } | null;
2732
+ };
2733
+ export type ToolUpdate = {
2734
+ /**
2735
+ * What the model calls the tool by: 1 to 64 lower-case letters, digits and underscores, starting with a letter. Unique in your organisation; `search_knowledge` and `remember_relation` are the platform's own.
2736
+ */
2737
+ name?: string;
2738
+ /**
2739
+ * What the tool does and when to call it, in the model's terms: it reads this to decide.
2740
+ */
2741
+ description?: string;
2742
+ /**
2743
+ * Its inputs, as a JSON Schema object: `{"type": "object", "properties": {…}, "required": […]}`, each property `string` (with an optional `enum`), `number`, `integer`, `boolean`, `array` (with `items`) or `object`, each with an optional `description`. Nothing else is taken: a key outside this set is refused rather than passed on unenforced.
2744
+ */
2745
+ parameters?: {
2746
+ [key: string]: unknown;
2747
+ };
2748
+ /**
2749
+ * A webhook's `https://` address, public, and not this platform's. An app's tool has none.
2750
+ */
2751
+ url?: string;
2752
+ /**
2753
+ * How long a call may take, in milliseconds: 1000 to 30000, 10000 by default. Past it the call failed, and the model is told so.
2754
+ */
2755
+ timeout_ms?: number;
2756
+ /**
2757
+ * Never run on the model's word alone: the agent asks the person first, and the tool runs only after they say yes.
2758
+ */
2759
+ ask_first?: boolean;
2760
+ /**
2761
+ * An app's tool only: the app is told to act and the reply carries on at once, with no answer awaited.
2762
+ */
2763
+ action_only?: boolean;
2764
+ /**
2765
+ * A line the agent says before the call, while it waits: `Let me check that for you.` `null`: none.
2766
+ */
2767
+ filler?: string | null;
2768
+ /**
2769
+ * Replaces every header; `null` or `{}` sends none.
2770
+ */
2771
+ headers?: {
2772
+ [key: string]: string;
2773
+ } | null;
2774
+ /**
2775
+ * The `version` you last read. When set and the tool has been changed since, the update is refused with 409 and nothing is written. Omit it to write unconditionally.
2776
+ */
2777
+ expected_version?: number | null;
2778
+ };
2779
+ export type ToolTestResult = {
2780
+ /**
2781
+ * Your server answered 2xx within the timeout.
2782
+ */
2783
+ ok: boolean;
2784
+ /**
2785
+ * Its HTTP status; `null` when none came (unreachable, or too slow).
2786
+ */
2787
+ status: number | null;
2788
+ /**
2789
+ * From sending to its answer's last byte.
2790
+ */
2791
+ duration_ms: number;
2792
+ /**
2793
+ * Its answer: the JSON it sent, else its text, cut at 16384 bytes; `null` for none.
2794
+ */
2795
+ result?: unknown;
2796
+ /**
2797
+ * The answer was longer than 16384 bytes and was cut.
2798
+ */
2799
+ truncated: boolean;
2800
+ /**
2801
+ * What failed, as the model would be told; `null` when it did not.
2802
+ */
2803
+ error: string | null;
2804
+ };
2805
+ export type ToolTestRequest = {
2806
+ /**
2807
+ * What the call carries as `arguments`; `{}` when omitted.
2808
+ */
2809
+ arguments?: {
2810
+ [key: string]: unknown;
2811
+ };
2812
+ };
2813
+ export type ToolsAssigned = {
2814
+ added: number;
2815
+ removed: number;
2816
+ /**
2817
+ * Ids sent that are not this organisation's, ignored.
2818
+ */
2819
+ skipped: Array<string>;
2820
+ };
2821
+ export type AgentToolsUpdate = {
2822
+ /**
2823
+ * The complete set, at most 20. An empty list turns every tool off.
2824
+ */
2825
+ tool_ids: Array<string>;
2826
+ };
2577
2827
  export type TtsRequest = {
2578
2828
  /**
2579
2829
  * An id from `GET /v1/voices` — the built-in voice, a platform voice, or one your organisation uploaded.
@@ -6111,6 +6361,380 @@ export type SetAgentKnowledgeResponses = {
6111
6361
  200: KnowledgeAssigned;
6112
6362
  };
6113
6363
  export type SetAgentKnowledgeResponse = SetAgentKnowledgeResponses[keyof SetAgentKnowledgeResponses];
6364
+ export type ListToolsData = {
6365
+ body?: never;
6366
+ path?: never;
6367
+ query?: never;
6368
+ url: '/v1/tools';
6369
+ };
6370
+ export type ListToolsErrors = {
6371
+ /**
6372
+ * Missing or invalid credentials
6373
+ */
6374
+ 401: ErrorResponse;
6375
+ /**
6376
+ * 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
6377
+ */
6378
+ 403: ErrorResponse;
6379
+ /**
6380
+ * The request failed validation
6381
+ */
6382
+ 422: ErrorResponse;
6383
+ /**
6384
+ * Rate limit exceeded
6385
+ */
6386
+ 429: ErrorResponse;
6387
+ };
6388
+ export type ListToolsError = ListToolsErrors[keyof ListToolsErrors];
6389
+ export type ListToolsResponses = {
6390
+ /**
6391
+ * Every tool
6392
+ */
6393
+ 200: ToolPage;
6394
+ };
6395
+ export type ListToolsResponse = ListToolsResponses[keyof ListToolsResponses];
6396
+ export type CreateToolData = {
6397
+ body: ToolCreate;
6398
+ path?: never;
6399
+ query?: never;
6400
+ url: '/v1/tools';
6401
+ };
6402
+ export type CreateToolErrors = {
6403
+ /**
6404
+ * The request could not be read: malformed JSON
6405
+ */
6406
+ 400: ErrorResponse;
6407
+ /**
6408
+ * Missing or invalid credentials
6409
+ */
6410
+ 401: ErrorResponse;
6411
+ /**
6412
+ * 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
6413
+ */
6414
+ 403: ErrorResponse;
6415
+ /**
6416
+ * A tool by that name exists already, or the library holds 200 tools.
6417
+ */
6418
+ 409: ErrorResponse;
6419
+ /**
6420
+ * The request failed validation
6421
+ */
6422
+ 422: ErrorResponse;
6423
+ /**
6424
+ * Rate limit exceeded
6425
+ */
6426
+ 429: ErrorResponse;
6427
+ /**
6428
+ * This deployment cannot seal a tool's secret (`TOOL_SECRET_KEY` unset): webhook tools cannot be saved or called.
6429
+ */
6430
+ 503: ErrorResponse;
6431
+ };
6432
+ export type CreateToolError = CreateToolErrors[keyof CreateToolErrors];
6433
+ export type CreateToolResponses = {
6434
+ /**
6435
+ * The tool, with its signing secret shown this once
6436
+ */
6437
+ 201: ToolWithSecret;
6438
+ };
6439
+ export type CreateToolResponse = CreateToolResponses[keyof CreateToolResponses];
6440
+ export type DeleteToolData = {
6441
+ body?: never;
6442
+ path: {
6443
+ tool_id: string;
6444
+ };
6445
+ query?: never;
6446
+ url: '/v1/tools/{tool_id}';
6447
+ };
6448
+ export type DeleteToolErrors = {
6449
+ /**
6450
+ * Missing or invalid credentials
6451
+ */
6452
+ 401: ErrorResponse;
6453
+ /**
6454
+ * 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
6455
+ */
6456
+ 403: ErrorResponse;
6457
+ /**
6458
+ * Unknown tool id
6459
+ */
6460
+ 404: ErrorResponse;
6461
+ /**
6462
+ * The request failed validation
6463
+ */
6464
+ 422: ErrorResponse;
6465
+ /**
6466
+ * Rate limit exceeded
6467
+ */
6468
+ 429: ErrorResponse;
6469
+ };
6470
+ export type DeleteToolError = DeleteToolErrors[keyof DeleteToolErrors];
6471
+ export type DeleteToolResponses = {
6472
+ /**
6473
+ * The tool is gone
6474
+ */
6475
+ 204: void;
6476
+ };
6477
+ export type DeleteToolResponse = DeleteToolResponses[keyof DeleteToolResponses];
6478
+ export type GetToolData = {
6479
+ body?: never;
6480
+ path: {
6481
+ tool_id: string;
6482
+ };
6483
+ query?: never;
6484
+ url: '/v1/tools/{tool_id}';
6485
+ };
6486
+ export type GetToolErrors = {
6487
+ /**
6488
+ * Missing or invalid credentials
6489
+ */
6490
+ 401: ErrorResponse;
6491
+ /**
6492
+ * 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
6493
+ */
6494
+ 403: ErrorResponse;
6495
+ /**
6496
+ * Unknown tool id
6497
+ */
6498
+ 404: ErrorResponse;
6499
+ /**
6500
+ * The request failed validation
6501
+ */
6502
+ 422: ErrorResponse;
6503
+ /**
6504
+ * Rate limit exceeded
6505
+ */
6506
+ 429: ErrorResponse;
6507
+ };
6508
+ export type GetToolError = GetToolErrors[keyof GetToolErrors];
6509
+ export type GetToolResponses = {
6510
+ /**
6511
+ * The tool
6512
+ */
6513
+ 200: ToolInfo;
6514
+ };
6515
+ export type GetToolResponse = GetToolResponses[keyof GetToolResponses];
6516
+ export type UpdateToolData = {
6517
+ body: ToolUpdate;
6518
+ path: {
6519
+ tool_id: string;
6520
+ };
6521
+ query?: never;
6522
+ url: '/v1/tools/{tool_id}';
6523
+ };
6524
+ export type UpdateToolErrors = {
6525
+ /**
6526
+ * The request could not be read: malformed JSON
6527
+ */
6528
+ 400: ErrorResponse;
6529
+ /**
6530
+ * Missing or invalid credentials
6531
+ */
6532
+ 401: ErrorResponse;
6533
+ /**
6534
+ * 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
6535
+ */
6536
+ 403: ErrorResponse;
6537
+ /**
6538
+ * Unknown tool id
6539
+ */
6540
+ 404: ErrorResponse;
6541
+ /**
6542
+ * `expected_version` was sent and the tool has been changed since, or the new name is taken. Nothing was written.
6543
+ */
6544
+ 409: ErrorResponse;
6545
+ /**
6546
+ * The request failed validation
6547
+ */
6548
+ 422: ErrorResponse;
6549
+ /**
6550
+ * Rate limit exceeded
6551
+ */
6552
+ 429: ErrorResponse;
6553
+ /**
6554
+ * This deployment cannot seal a tool's secret (`TOOL_SECRET_KEY` unset): webhook tools cannot be saved or called.
6555
+ */
6556
+ 503: ErrorResponse;
6557
+ };
6558
+ export type UpdateToolError = UpdateToolErrors[keyof UpdateToolErrors];
6559
+ export type UpdateToolResponses = {
6560
+ /**
6561
+ * The tool as it now stands
6562
+ */
6563
+ 200: ToolInfo;
6564
+ };
6565
+ export type UpdateToolResponse = UpdateToolResponses[keyof UpdateToolResponses];
6566
+ export type RotateToolSecretData = {
6567
+ body?: never;
6568
+ path: {
6569
+ tool_id: string;
6570
+ };
6571
+ query?: never;
6572
+ url: '/v1/tools/{tool_id}/secret';
6573
+ };
6574
+ export type RotateToolSecretErrors = {
6575
+ /**
6576
+ * Missing or invalid credentials
6577
+ */
6578
+ 401: ErrorResponse;
6579
+ /**
6580
+ * 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
6581
+ */
6582
+ 403: ErrorResponse;
6583
+ /**
6584
+ * Unknown tool id
6585
+ */
6586
+ 404: ErrorResponse;
6587
+ /**
6588
+ * The request failed validation
6589
+ */
6590
+ 422: ErrorResponse;
6591
+ /**
6592
+ * Rate limit exceeded
6593
+ */
6594
+ 429: ErrorResponse;
6595
+ /**
6596
+ * This deployment cannot seal a tool's secret (`TOOL_SECRET_KEY` unset): webhook tools cannot be saved or called.
6597
+ */
6598
+ 503: ErrorResponse;
6599
+ };
6600
+ export type RotateToolSecretError = RotateToolSecretErrors[keyof RotateToolSecretErrors];
6601
+ export type RotateToolSecretResponses = {
6602
+ /**
6603
+ * The tool, with its new signing secret
6604
+ */
6605
+ 200: ToolWithSecret;
6606
+ };
6607
+ export type RotateToolSecretResponse = RotateToolSecretResponses[keyof RotateToolSecretResponses];
6608
+ export type TestToolData = {
6609
+ body: ToolTestRequest;
6610
+ path: {
6611
+ tool_id: string;
6612
+ };
6613
+ query?: never;
6614
+ url: '/v1/tools/{tool_id}/test';
6615
+ };
6616
+ export type TestToolErrors = {
6617
+ /**
6618
+ * The request could not be read: malformed JSON
6619
+ */
6620
+ 400: ErrorResponse;
6621
+ /**
6622
+ * Missing or invalid credentials
6623
+ */
6624
+ 401: ErrorResponse;
6625
+ /**
6626
+ * 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
6627
+ */
6628
+ 403: ErrorResponse;
6629
+ /**
6630
+ * Unknown tool id
6631
+ */
6632
+ 404: ErrorResponse;
6633
+ /**
6634
+ * The tool's stored secret cannot be opened: `TOOL_SECRET_KEY` changed since it was saved. Rotate its secret, and save its headers again.
6635
+ */
6636
+ 409: ErrorResponse;
6637
+ /**
6638
+ * The request failed validation
6639
+ */
6640
+ 422: ErrorResponse;
6641
+ /**
6642
+ * Rate limit exceeded
6643
+ */
6644
+ 429: ErrorResponse;
6645
+ /**
6646
+ * This deployment cannot seal a tool's secret (`TOOL_SECRET_KEY` unset): webhook tools cannot be saved or called.
6647
+ */
6648
+ 503: ErrorResponse;
6649
+ };
6650
+ export type TestToolError = TestToolErrors[keyof TestToolErrors];
6651
+ export type TestToolResponses = {
6652
+ /**
6653
+ * What your server answered, or why it did not
6654
+ */
6655
+ 200: ToolTestResult;
6656
+ };
6657
+ export type TestToolResponse = TestToolResponses[keyof TestToolResponses];
6658
+ export type ListAgentToolsData = {
6659
+ body?: never;
6660
+ path: {
6661
+ agent_id: string;
6662
+ };
6663
+ query?: never;
6664
+ url: '/v1/agents/{agent_id}/tools';
6665
+ };
6666
+ export type ListAgentToolsErrors = {
6667
+ /**
6668
+ * Missing or invalid credentials
6669
+ */
6670
+ 401: ErrorResponse;
6671
+ /**
6672
+ * 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
6673
+ */
6674
+ 403: ErrorResponse;
6675
+ /**
6676
+ * Unknown agent id
6677
+ */
6678
+ 404: ErrorResponse;
6679
+ /**
6680
+ * The request failed validation
6681
+ */
6682
+ 422: ErrorResponse;
6683
+ /**
6684
+ * Rate limit exceeded
6685
+ */
6686
+ 429: ErrorResponse;
6687
+ };
6688
+ export type ListAgentToolsError = ListAgentToolsErrors[keyof ListAgentToolsErrors];
6689
+ export type ListAgentToolsResponses = {
6690
+ /**
6691
+ * The tools this agent can call
6692
+ */
6693
+ 200: ToolPage;
6694
+ };
6695
+ export type ListAgentToolsResponse = ListAgentToolsResponses[keyof ListAgentToolsResponses];
6696
+ export type SetAgentToolsData = {
6697
+ body: AgentToolsUpdate;
6698
+ path: {
6699
+ agent_id: string;
6700
+ };
6701
+ query?: never;
6702
+ url: '/v1/agents/{agent_id}/tools';
6703
+ };
6704
+ export type SetAgentToolsErrors = {
6705
+ /**
6706
+ * The request could not be read: malformed JSON
6707
+ */
6708
+ 400: ErrorResponse;
6709
+ /**
6710
+ * Missing or invalid credentials
6711
+ */
6712
+ 401: ErrorResponse;
6713
+ /**
6714
+ * 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
6715
+ */
6716
+ 403: ErrorResponse;
6717
+ /**
6718
+ * Unknown agent id
6719
+ */
6720
+ 404: ErrorResponse;
6721
+ /**
6722
+ * The request failed validation
6723
+ */
6724
+ 422: ErrorResponse;
6725
+ /**
6726
+ * Rate limit exceeded
6727
+ */
6728
+ 429: ErrorResponse;
6729
+ };
6730
+ export type SetAgentToolsError = SetAgentToolsErrors[keyof SetAgentToolsErrors];
6731
+ export type SetAgentToolsResponses = {
6732
+ /**
6733
+ * How many tools were turned on and off
6734
+ */
6735
+ 200: ToolsAssigned;
6736
+ };
6737
+ export type SetAgentToolsResponse = SetAgentToolsResponses[keyof SetAgentToolsResponses];
6114
6738
  export type SynthesizeSpeechData = {
6115
6739
  body: TtsRequest;
6116
6740
  path?: never;
package/dist/index.d.ts CHANGED
@@ -8,15 +8,16 @@ export { type Client, type ClientOptions, createClient, DEFAULT_BASE_URL, } from
8
8
  export { AuthenticationError, ConflictError, ConnectionError, InsufficientCreditsError, NotFoundError, PermissionError, PlatformError, type PlatformErrorCode, type PlatformErrorInit, RateLimitError, ServerError, TimeoutError, ValidationError, } from "./errors.js";
9
9
  export type * from "./gen/index.js";
10
10
  export type { Page } from "./paging.js";
11
- export type { AgentKnowledge, AgentSettings, Agents, } from "./resources/agents.js";
11
+ export type { AgentKnowledge, AgentSettings, Agents, AgentTools, } from "./resources/agents.js";
12
12
  export type { AssetListParams, Assets, AssetUploadFields, FolderListParams, Folders, } from "./resources/assets.js";
13
13
  export type { EndUserCreated, EndUserExport, EndUserListParams, EndUsers, } from "./resources/end-users.js";
14
14
  export type { EphemeralKeyCreateOptions, EphemeralKeyListParams, EphemeralKeyRevokeOptions, EphemeralKeys, } from "./resources/ephemeral-keys.js";
15
15
  export type { GenerationListParams, Generations, Jobs, Skybox, } from "./resources/generations.js";
16
16
  export type { Knowledge, KnowledgeInsightsParams, KnowledgeListParams, KnowledgeUploadFields, } from "./resources/knowledge.js";
17
- export type { Resource, Waitable } from "./resources/resource.js";
17
+ export type { Library, Listing, Resource, Waitable, WaitableLibrary, } from "./resources/resource.js";
18
18
  export type { Speech, Stt, SttEvent, SttParams, Transcript, Tts, } from "./resources/speech.js";
19
19
  export type { TemplateFile, Templates } from "./resources/templates.js";
20
+ export type { Tools } from "./resources/tools.js";
20
21
  export type { Usage, UsageParams } from "./resources/usage.js";
21
22
  export type { Voices, VoiceUploadFields } from "./resources/voices.js";
22
23
  export type { Fetch, RequestOptions } from "./transport.js";
@@ -6,15 +6,16 @@
6
6
  * - **A save reaches running sessions within a minute**, not at once: an
7
7
  * agent's version travels through the platform's `STANDING` copy.
8
8
  * - **`settings`** are the organisation's, for every agent;
9
- * **`knowledge.set`** replaces the entries one agent may look up.
9
+ * **`knowledge.set`** replaces the entries one agent may look up, and
10
+ * **`tools.set`** the tools it can call.
10
11
  * - **`create` is a 409 at the plan's maximum agents**; `delete` answers
11
12
  * `true`, and `false` for one already gone.
12
13
  * - **`list()` reads one page**: an organisation's agents are few, and the
13
14
  * route answers them all with `next_cursor` `null` (`paging.ts`).
14
15
  */
15
- import type { AgentCreateRequest, AgentInfo, AgentKnowledgeUpdate, AgentPage, AgentSettingsInfo, AgentSettingsUpdate, AgentSummary, AgentUpdate, KnowledgeAssigned, KnowledgeInfo } from "../gen/index.js";
16
+ import type { AgentCreateRequest, AgentInfo, AgentKnowledgeUpdate, AgentPage, AgentSettingsInfo, AgentSettingsUpdate, AgentSummary, AgentToolsUpdate, AgentUpdate, KnowledgeAssigned, KnowledgeInfo, ToolInfo, ToolsAssigned } from "../gen/index.js";
16
17
  import type { RequestOptions, Transport } from "../transport.js";
17
- import { Editable } from "./resource.js";
18
+ import { Library } from "./resource.js";
18
19
  /** `agents.settings`: the organisation's, for every agent. */
19
20
  export interface AgentSettings {
20
21
  get(options?: RequestOptions): Promise<AgentSettingsInfo>;
@@ -27,13 +28,18 @@ export interface AgentKnowledge {
27
28
  /** Replaces them all with these. */
28
29
  set(agentId: string, body: AgentKnowledgeUpdate, options?: RequestOptions): Promise<KnowledgeAssigned>;
29
30
  }
30
- export declare class Agents extends Editable<AgentInfo, AgentUpdate> {
31
+ /** `agents.tools`: the tools one agent can call. */
32
+ export interface AgentTools {
33
+ /** Every tool it can call. */
34
+ list(agentId: string, options?: RequestOptions): AsyncGenerator<ToolInfo, void, undefined>;
35
+ /** Replaces them all with these, 20 at most. */
36
+ set(agentId: string, body: AgentToolsUpdate, options?: RequestOptions): Promise<ToolsAssigned>;
37
+ }
38
+ export declare class Agents extends Library<AgentInfo, AgentUpdate, AgentSummary, AgentPage, AgentCreateRequest> {
31
39
  readonly settings: AgentSettings;
32
40
  readonly knowledge: AgentKnowledge;
41
+ readonly tools: AgentTools;
33
42
  constructor(api: Transport, base: string);
34
- /** The page of agents, as the route answers it. */
35
- page(options?: RequestOptions): Promise<AgentPage>;
36
- /** Every agent. */
37
- list(options?: RequestOptions): AsyncGenerator<AgentSummary, void, undefined>;
38
- create(body: AgentCreateRequest, options?: RequestOptions): Promise<AgentInfo>;
43
+ /** An agent's links to what the organisation has: its knowledge, its tools. */
44
+ protected links<T extends AgentKnowledge | AgentTools>(rest: string): T;
39
45
  }
@@ -6,34 +6,29 @@
6
6
  * - **A save reaches running sessions within a minute**, not at once: an
7
7
  * agent's version travels through the platform's `STANDING` copy.
8
8
  * - **`settings`** are the organisation's, for every agent;
9
- * **`knowledge.set`** replaces the entries one agent may look up.
9
+ * **`knowledge.set`** replaces the entries one agent may look up, and
10
+ * **`tools.set`** the tools it can call.
10
11
  * - **`create` is a 409 at the plan's maximum agents**; `delete` answers
11
12
  * `true`, and `false` for one already gone.
12
13
  * - **`list()` reads one page**: an organisation's agents are few, and the
13
14
  * route answers them all with `next_cursor` `null` (`paging.ts`).
14
15
  */
15
- import { Editable } from "./resource.js";
16
- export class Agents extends Editable {
16
+ import { Library } from "./resource.js";
17
+ export class Agents extends Library {
17
18
  constructor(api, base) {
18
19
  super(api, base);
19
20
  this.settings = {
20
21
  get: (options) => this.send("GET", "/settings", options),
21
22
  update: (body, options) => this.send("PUT", "/settings", options, body),
22
23
  };
23
- this.knowledge = {
24
- list: (id, options) => this.each(this.at(id, "/knowledge"), {}, options),
25
- set: (id, body, options) => this.send("PUT", this.at(id, "/knowledge"), options, body),
26
- };
27
- }
28
- /** The page of agents, as the route answers it. */
29
- page(options) {
30
- return this.send("GET", "", options);
24
+ this.knowledge = this.links("/knowledge");
25
+ this.tools = this.links("/tools");
31
26
  }
32
- /** Every agent. */
33
- list(options) {
34
- return this.each("", {}, options);
35
- }
36
- create(body, options) {
37
- return this.send("POST", "", options, body);
27
+ /** An agent's links to what the organisation has: its knowledge, its tools. */
28
+ links(rest) {
29
+ return {
30
+ list: (id, options) => this.each(this.at(id, rest), {}, options),
31
+ set: (id, body, options) => this.send("PUT", this.at(id, rest), options, body),
32
+ };
38
33
  }
39
34
  }
@@ -40,3 +40,17 @@ export declare class Waitable<Item extends Job & {
40
40
  /** `item` as made, or as it ended when `options.wait` says to wait. */
41
41
  protected settled(item: Item, options: UploadOptions): Promise<Item>;
42
42
  }
43
+ /** What a `Library` adds to its base. */
44
+ export interface Listing<Listed, ListPage, Create, Created> {
45
+ /** The page, as the route answers it: all of them, `next_cursor` `null`. */
46
+ page(options?: RequestOptions): Promise<ListPage>;
47
+ /** Every one of them. */
48
+ list(options?: RequestOptions): AsyncGenerator<Listed, void, undefined>;
49
+ create(body: Create, options?: RequestOptions): Promise<Created>;
50
+ }
51
+ /** An editable listed whole and made by a `POST`: the agents, the tools. */
52
+ export declare const Library: new <Item, Update, Listed, ListPage, Create, Created = Item>(api: Transport, base: string) => Editable<Item, Update> & Listing<Listed, ListPage, Create, Created>;
53
+ /** A waitable listed whole and made by a `POST`: the voices. */
54
+ export declare const WaitableLibrary: new <Item extends Job & {
55
+ id: string;
56
+ }, Update, Listed, ListPage, Create>(api: Transport, base: string) => Waitable<Item, Update> & Listing<Listed, ListPage, Create, Item>;
@@ -13,6 +13,9 @@
13
13
  * `false` when there is nothing by that id — already done. One that
14
14
  * reports what went with it (an end user's, a folder's) answers those
15
15
  * counts, and `null` for nothing by that id: the same rule, with a body.
16
+ * - **`Library`** and **`WaitableLibrary`**: one of the two, listed whole
17
+ * in one page and made by a `POST` to the list — `page()`, `list()`,
18
+ * `create(body)`, written once (`listed`).
16
19
  * - **`Waitable`**: an editable whose items are jobs — a voice, an asset,
17
20
  * a knowledge entry — with `wait(id)` and `settled`, which an upload
18
21
  * answers through.
@@ -83,3 +86,23 @@ export class Waitable extends Editable {
83
86
  : item;
84
87
  }
85
88
  }
89
+ /**
90
+ * `Listing`'s three methods on `Base`, written once for every resource
91
+ * listed whole in one page and made by a `POST` to the list: a mixin, as
92
+ * the agents and the tools are editables and the voices waitables.
93
+ */
94
+ const listed = (Base) => class extends Base {
95
+ page(options) {
96
+ return this.send("GET", "", options);
97
+ }
98
+ list(options) {
99
+ return this.each("", {}, options);
100
+ }
101
+ create(body, options) {
102
+ return this.send("POST", "", options, body);
103
+ }
104
+ };
105
+ /** An editable listed whole and made by a `POST`: the agents, the tools. */
106
+ export const Library = listed(Editable);
107
+ /** A waitable listed whole and made by a `POST`: the voices. */
108
+ export const WaitableLibrary = listed(Waitable);
@@ -0,0 +1,24 @@
1
+ /**
2
+ * `client.tools`: what an organisation's agents can call while they reply
3
+ * — `/v1/tools*`. A tool is your server (`webhook`), sent a signed `POST`
4
+ * with the call, or the person's app (`app`), called over the agent's
5
+ * socket; each is turned on per agent (`agents.tools.set`), 20 at most.
6
+ *
7
+ * - **`create(body)`** answers a webhook's signing secret once, as does
8
+ * `rotateSecret` (`secret`); every call carries `X-Tool-Signature`.
9
+ * - **`test(id, { arguments })`** sends your server one call, signed as a
10
+ * real one, and answers what came back.
11
+ * - **`list()` reads one page**: a library holds 200 tools at most.
12
+ * - **`update` with `expected_version`** refuses an edit made over
13
+ * somebody else's (409); `delete` answers `true`, and `false` for one
14
+ * already gone.
15
+ */
16
+ import type { ToolCreate, ToolInfo, ToolPage, ToolTestRequest, ToolTestResult, ToolUpdate, ToolWithSecret } from "../gen/index.js";
17
+ import type { RequestOptions } from "../transport.js";
18
+ import { Library } from "./resource.js";
19
+ export declare class Tools extends Library<ToolInfo, ToolUpdate, ToolInfo, ToolPage, ToolCreate, ToolWithSecret> {
20
+ /** A new signing secret, shown this once. */
21
+ rotateSecret(id: string, options?: RequestOptions): Promise<ToolWithSecret>;
22
+ /** One call to your server, as a conversation would send it: `{ arguments }`. */
23
+ test(id: string, body?: ToolTestRequest, options?: RequestOptions): Promise<ToolTestResult>;
24
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * `client.tools`: what an organisation's agents can call while they reply
3
+ * — `/v1/tools*`. A tool is your server (`webhook`), sent a signed `POST`
4
+ * with the call, or the person's app (`app`), called over the agent's
5
+ * socket; each is turned on per agent (`agents.tools.set`), 20 at most.
6
+ *
7
+ * - **`create(body)`** answers a webhook's signing secret once, as does
8
+ * `rotateSecret` (`secret`); every call carries `X-Tool-Signature`.
9
+ * - **`test(id, { arguments })`** sends your server one call, signed as a
10
+ * real one, and answers what came back.
11
+ * - **`list()` reads one page**: a library holds 200 tools at most.
12
+ * - **`update` with `expected_version`** refuses an edit made over
13
+ * somebody else's (409); `delete` answers `true`, and `false` for one
14
+ * already gone.
15
+ */
16
+ import { Library } from "./resource.js";
17
+ export class Tools extends Library {
18
+ /** A new signing secret, shown this once. */
19
+ rotateSecret(id, options) {
20
+ return this.send("POST", this.at(id, "/secret"), options);
21
+ }
22
+ /** One call to your server, as a conversation would send it: `{ arguments }`. */
23
+ test(id, body = {}, options) {
24
+ return this.send("POST", this.at(id, "/test"), options, body);
25
+ }
26
+ }
@@ -16,20 +16,18 @@
16
16
  import type { VoiceDesignRequest, VoiceDesignResult, VoiceDesignSaveRequest, VoiceDetail, VoiceInfo, VoiceInfoPage, VoiceUpdate, VoiceUpload, VoiceUploadRequest, VoiceUploadTicket } from "../gen/index.js";
17
17
  import type { RequestOptions } from "../transport.js";
18
18
  import { type UploadData, type UploadOptions } from "../upload.js";
19
- import { Waitable } from "./resource.js";
19
+ import { WaitableLibrary } from "./resource.js";
20
20
  /** A recording's voice: the create's fields, and the recording's type. */
21
21
  export type VoiceUploadFields = Omit<VoiceUpload, "upload_id"> & {
22
22
  /** A Blob's own type by default: `audio/wav`, `audio/mpeg`, … */
23
23
  content_type?: string;
24
24
  };
25
- /** `update` renames a voice, or changes its description or defaults. */
26
- export declare class Voices extends Waitable<VoiceDetail, VoiceUpdate> {
27
- /** The page of voices, as the route answers it: all of them, `next_cursor` `null`. */
28
- page(options?: RequestOptions): Promise<VoiceInfoPage>;
29
- /** Every voice this organisation may speak with. */
30
- list(options?: RequestOptions): AsyncGenerator<VoiceInfo, void, undefined>;
31
- /** Clones a recording already `PUT` to its ticket: `pending` at once. */
32
- create(body: VoiceUpload, options?: RequestOptions): Promise<VoiceDetail>;
25
+ /**
26
+ * `update` renames a voice, or changes its description or defaults;
27
+ * `list()` is every voice this organisation may speak with; `create(body)`
28
+ * clones a recording already `PUT` to its ticket, `pending` at once.
29
+ */
30
+ export declare class Voices extends WaitableLibrary<VoiceDetail, VoiceUpdate, VoiceInfo, VoiceInfoPage, VoiceUpload> {
33
31
  /** A signed URL to `PUT` a recording to, with exactly this type. */
34
32
  uploadUrl(body: VoiceUploadRequest, options?: RequestOptions): Promise<VoiceUploadTicket>;
35
33
  /** Uploads a recording and clones it: `uploadUrl`, the `PUT`, `create`. */
@@ -14,21 +14,13 @@
14
14
  * - **`list()` reads one page**: the route answers every voice in it.
15
15
  */
16
16
  import { needType, put, } from "../upload.js";
17
- import { Waitable } from "./resource.js";
18
- /** `update` renames a voice, or changes its description or defaults. */
19
- export class Voices extends Waitable {
20
- /** The page of voices, as the route answers it: all of them, `next_cursor` `null`. */
21
- page(options) {
22
- return this.send("GET", "", options);
23
- }
24
- /** Every voice this organisation may speak with. */
25
- list(options) {
26
- return this.each("", {}, options);
27
- }
28
- /** Clones a recording already `PUT` to its ticket: `pending` at once. */
29
- create(body, options) {
30
- return this.send("POST", "", options, body);
31
- }
17
+ import { WaitableLibrary } from "./resource.js";
18
+ /**
19
+ * `update` renames a voice, or changes its description or defaults;
20
+ * `list()` is every voice this organisation may speak with; `create(body)`
21
+ * clones a recording already `PUT` to its ticket, `pending` at once.
22
+ */
23
+ export class Voices extends WaitableLibrary {
32
24
  /** A signed URL to `PUT` a recording to, with exactly this type. */
33
25
  uploadUrl(body, options) {
34
26
  return this.send("POST", "/upload-url", options, body);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumavox/server",
3
- "version": "0.6.0",
3
+ "version": "0.8.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",