@letta-ai/letta-react 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks/agentsHooks/index.d.ts +22 -22
- package/dist/hooks/agentsHooks/useAgents/index.d.ts +4 -4
- package/dist/hooks/blocksHooks/index.d.ts +6 -6
- package/dist/hooks/groupsHooks/index.d.ts +8 -8
- package/dist/hooks/healthHooks/index.d.ts +2 -2
- package/dist/hooks/identitiesHooks/index.d.ts +6 -6
- package/dist/hooks/index.d.ts +84 -84
- package/dist/hooks/jobsHooks/index.d.ts +6 -6
- package/dist/hooks/modelsHooks/index.d.ts +3 -3
- package/dist/hooks/providersHooks/index.d.ts +3 -3
- package/dist/hooks/runsHooks/index.d.ts +10 -10
- package/dist/hooks/sourcesHooks/index.d.ts +10 -10
- package/dist/hooks/stepsHooks/index.d.ts +4 -4
- package/dist/hooks/tagHooks/index.d.ts +2 -2
- package/dist/hooks/toolsHooks/index.d.ts +16 -16
- package/dist/hooks/voiceHooks/index.d.ts +1 -1
- package/dist/index.d.ts +137 -137
- package/dist/index.js +1242 -1618
- package/dist/index.js.map +4 -4
- package/dist/types/agents/index.d.ts +1 -1
- package/dist/types/clientSideAccessTokens/index.d.ts +1 -1
- package/dist/types/index.d.ts +67 -67
- package/hooks/agentsHooks/index.d.ts +22 -22
- package/hooks/agentsHooks/useAgents/index.d.ts +4 -4
- package/hooks/blocksHooks/index.d.ts +6 -6
- package/hooks/groupsHooks/index.d.ts +8 -8
- package/hooks/healthHooks/index.d.ts +2 -2
- package/hooks/identitiesHooks/index.d.ts +6 -6
- package/hooks/index.d.ts +84 -84
- package/hooks/jobsHooks/index.d.ts +6 -6
- package/hooks/modelsHooks/index.d.ts +3 -3
- package/hooks/providersHooks/index.d.ts +3 -3
- package/hooks/runsHooks/index.d.ts +10 -10
- package/hooks/sourcesHooks/index.d.ts +10 -10
- package/hooks/stepsHooks/index.d.ts +4 -4
- package/hooks/tagHooks/index.d.ts +2 -2
- package/hooks/toolsHooks/index.d.ts +16 -16
- package/hooks/voiceHooks/index.d.ts +1 -1
- package/index.d.ts +137 -137
- package/index.js +1242 -1618
- package/index.js.map +4 -4
- package/package.json +9 -7
- package/src/hooks/agentsHooks/index.ts +171 -72
- package/src/hooks/agentsHooks/useAgents/createTemplateFromAgent.ts +48 -22
- package/src/hooks/agentsHooks/useAgents/getAgentVariables.ts +69 -31
- package/src/hooks/agentsHooks/useAgents/getAgentVariablesSuspense.ts +68 -31
- package/src/hooks/agentsHooks/useAgents/index.ts +28 -12
- package/src/hooks/agentsHooks/useAgents/migrateAgent.ts +57 -25
- package/src/hooks/agentsHooks/useAgents/searchDeployedAgents.ts +43 -21
- package/src/hooks/agentsHooks/useAgents/versionAgentTemplate.ts +56 -29
- package/src/hooks/agentsHooks/useCreateAgent.ts +41 -21
- package/src/hooks/agentsHooks/useCreateAgentMessageAsync.ts +48 -23
- package/src/hooks/agentsHooks/useCreateAgentMessageStream.ts +48 -22
- package/src/hooks/agentsHooks/useCreatePassage.ts +53 -23
- package/src/hooks/agentsHooks/useDeleteAgent.ts +40 -21
- package/src/hooks/agentsHooks/useDeletePassage.ts +48 -23
- package/src/hooks/agentsHooks/useExportAgentSerialized.ts +74 -31
- package/src/hooks/agentsHooks/useExportAgentSerializedSuspense.ts +75 -31
- package/src/hooks/agentsHooks/useImportAgentSerialized.ts +60 -29
- package/src/hooks/agentsHooks/useListAgentSources.ts +71 -31
- package/src/hooks/agentsHooks/useListAgentSourcesSuspense.ts +72 -32
- package/src/hooks/agentsHooks/useListAgentTools.ts +75 -32
- package/src/hooks/agentsHooks/useListAgentToolsSuspense.ts +74 -32
- package/src/hooks/agentsHooks/useListAgents.ts +77 -32
- package/src/hooks/agentsHooks/useListAgentsSuspense.ts +78 -32
- package/src/hooks/agentsHooks/useListCoreMemoryBlocks.ts +72 -31
- package/src/hooks/agentsHooks/useListCoreMemoryBlocksSuspense.ts +72 -31
- package/src/hooks/agentsHooks/useListMessages.ts +74 -32
- package/src/hooks/agentsHooks/useListMessagesSuspense.ts +75 -32
- package/src/hooks/agentsHooks/useListPassages.ts +77 -32
- package/src/hooks/agentsHooks/useListPassagesSuspense.ts +78 -32
- package/src/hooks/agentsHooks/useRetrieveAgent.ts +72 -32
- package/src/hooks/agentsHooks/useRetrieveAgentContextWindow.ts +59 -30
- package/src/hooks/agentsHooks/useRetrieveAgentContextWindowSuspense.ts +66 -31
- package/src/hooks/agentsHooks/useRetrieveAgentMemory.ts +69 -31
- package/src/hooks/agentsHooks/useRetrieveAgentMemorySuspense.ts +69 -31
- package/src/hooks/agentsHooks/useRetrieveAgentSuspense.ts +71 -32
- package/src/hooks/agentsHooks/useRetrieveCoreMemoryBlock.ts +70 -31
- package/src/hooks/agentsHooks/useRetrieveCoreMemoryBlockSuspense.ts +72 -31
- package/src/hooks/agentsHooks/useSendMessage.ts +50 -23
- package/src/hooks/blocksHooks/index.ts +44 -16
- package/src/hooks/blocksHooks/useCreateBlock.ts +46 -22
- package/src/hooks/blocksHooks/useDeleteBlock.ts +40 -21
- package/src/hooks/blocksHooks/useListAgentsForBlock.ts +72 -31
- package/src/hooks/blocksHooks/useListAgentsForBlockSuspense.ts +72 -32
- package/src/hooks/blocksHooks/useListBlocks.ts +77 -32
- package/src/hooks/blocksHooks/useListBlocksSuspense.ts +78 -32
- package/src/hooks/blocksHooks/useRetrieveBlock.ts +72 -32
- package/src/hooks/blocksHooks/useRetrieveBlockSuspense.ts +71 -32
- package/src/hooks/clientSideAccessTokensHooks/index.ts +4 -4
- package/src/hooks/clientSideAccessTokensHooks/useClientSideAccessTokens/createClientSideAccessToken.ts +45 -21
- package/src/hooks/clientSideAccessTokensHooks/useClientSideAccessTokens/deleteClientSideAccessToken.ts +54 -22
- package/src/hooks/clientSideAccessTokensHooks/useClientSideAccessTokens/index.ts +4 -4
- package/src/hooks/groupsHooks/index.ts +56 -20
- package/src/hooks/groupsHooks/useCreateGroup.ts +41 -21
- package/src/hooks/groupsHooks/useDeleteGroup.ts +40 -21
- package/src/hooks/groupsHooks/useListGroupMessages.ts +68 -31
- package/src/hooks/groupsHooks/useListGroupMessagesSuspense.ts +72 -32
- package/src/hooks/groupsHooks/useListGroups.ts +77 -32
- package/src/hooks/groupsHooks/useListGroupsSuspense.ts +78 -32
- package/src/hooks/groupsHooks/useRetrieveGroup.ts +72 -32
- package/src/hooks/groupsHooks/useRetrieveGroupSuspense.ts +71 -32
- package/src/hooks/groupsHooks/useSendGroupMessage.ts +48 -23
- package/src/hooks/groupsHooks/useSendGroupMessageStreaming.ts +48 -22
- package/src/hooks/healthHooks/index.ts +14 -4
- package/src/hooks/healthHooks/useHealthCheck.ts +65 -30
- package/src/hooks/healthHooks/useHealthCheckSuspense.ts +68 -29
- package/src/hooks/identitiesHooks/index.ts +42 -16
- package/src/hooks/identitiesHooks/useCreateIdentity.ts +48 -23
- package/src/hooks/identitiesHooks/useDeleteIdentity.ts +43 -21
- package/src/hooks/identitiesHooks/useListIdentities.ts +71 -31
- package/src/hooks/identitiesHooks/useListIdentitiesSuspense.ts +74 -31
- package/src/hooks/identitiesHooks/useRetrieveIdentity.ts +72 -31
- package/src/hooks/identitiesHooks/useRetrieveIdentitySuspense.ts +75 -32
- package/src/hooks/identitiesHooks/useUpsertIdentity.ts +48 -23
- package/src/hooks/identitiesHooks/useUpsertIdentityProperties.ts +48 -22
- package/src/hooks/index.ts +657 -274
- package/src/hooks/jobsHooks/index.ts +43 -14
- package/src/hooks/jobsHooks/useDeleteJob.ts +46 -22
- package/src/hooks/jobsHooks/useListActiveJobs.ts +67 -31
- package/src/hooks/jobsHooks/useListActiveJobsSuspense.ts +68 -31
- package/src/hooks/jobsHooks/useListJobs.ts +76 -31
- package/src/hooks/jobsHooks/useListJobsSuspense.ts +77 -31
- package/src/hooks/jobsHooks/useRetrieveJob.ts +80 -37
- package/src/hooks/jobsHooks/useRetrieveJobSuspense.ts +83 -37
- package/src/hooks/modelsHooks/index.ts +23 -8
- package/src/hooks/modelsHooks/useListEmbeddingModels.ts +66 -31
- package/src/hooks/modelsHooks/useListEmbeddingModelsSuspense.ts +66 -31
- package/src/hooks/modelsHooks/useListModels.ts +65 -30
- package/src/hooks/modelsHooks/useListModelsSuspense.ts +68 -29
- package/src/hooks/providersHooks/index.ts +21 -8
- package/src/hooks/providersHooks/useCreateProvider.ts +50 -22
- package/src/hooks/providersHooks/useDeleteProvider.ts +49 -22
- package/src/hooks/providersHooks/useListProviders.ts +71 -31
- package/src/hooks/providersHooks/useListProvidersSuspense.ts +74 -31
- package/src/hooks/runsHooks/index.ts +75 -26
- package/src/hooks/runsHooks/useDeleteRun.ts +46 -22
- package/src/hooks/runsHooks/useListActiveRuns.ts +71 -31
- package/src/hooks/runsHooks/useListActiveRunsSuspense.ts +74 -31
- package/src/hooks/runsHooks/useListRunMessages.ts +73 -31
- package/src/hooks/runsHooks/useListRunMessagesSuspense.ts +76 -32
- package/src/hooks/runsHooks/useListRunSteps.ts +74 -32
- package/src/hooks/runsHooks/useListRunStepsSuspense.ts +75 -32
- package/src/hooks/runsHooks/useListRuns.ts +76 -31
- package/src/hooks/runsHooks/useListRunsSuspense.ts +77 -31
- package/src/hooks/runsHooks/useRetrieveRun.ts +80 -37
- package/src/hooks/runsHooks/useRetrieveRunSuspense.ts +83 -37
- package/src/hooks/runsHooks/useRetrieveRunUsage.ts +71 -31
- package/src/hooks/runsHooks/useRetrieveRunUsageSuspense.ts +72 -32
- package/src/hooks/sourcesHooks/index.ts +74 -28
- package/src/hooks/sourcesHooks/useCreateSource.ts +48 -22
- package/src/hooks/sourcesHooks/useDeleteFileFromSource.ts +48 -23
- package/src/hooks/sourcesHooks/useDeleteSource.ts +42 -21
- package/src/hooks/sourcesHooks/useGetSourceIdByName.ts +72 -31
- package/src/hooks/sourcesHooks/useGetSourceIdByNameSuspense.ts +75 -32
- package/src/hooks/sourcesHooks/useListSourceFiles.ts +73 -31
- package/src/hooks/sourcesHooks/useListSourceFilesSuspense.ts +77 -32
- package/src/hooks/sourcesHooks/useListSourcePassages.ts +72 -31
- package/src/hooks/sourcesHooks/useListSourcePassagesSuspense.ts +75 -32
- package/src/hooks/sourcesHooks/useListSources.ts +70 -34
- package/src/hooks/sourcesHooks/useListSourcesSuspense.ts +75 -35
- package/src/hooks/sourcesHooks/useRetrieveSource.ts +75 -32
- package/src/hooks/sourcesHooks/useRetrieveSourceSuspense.ts +71 -32
- package/src/hooks/sourcesHooks/useUploadFileToSource.ts +60 -29
- package/src/hooks/stepsHooks/index.ts +28 -8
- package/src/hooks/stepsHooks/useListSteps.ts +76 -31
- package/src/hooks/stepsHooks/useListStepsSuspense.ts +77 -31
- package/src/hooks/stepsHooks/useRetrieveStep.ts +72 -31
- package/src/hooks/stepsHooks/useRetrieveStepSuspense.ts +74 -32
- package/src/hooks/tagHooks/index.ts +14 -4
- package/src/hooks/tagHooks/useListTags.ts +76 -31
- package/src/hooks/tagHooks/useListTagsSuspense.ts +77 -31
- package/src/hooks/templatesHooks/index.ts +2 -2
- package/src/hooks/templatesHooks/useTemplates/createAgentsFromTemplate.ts +52 -27
- package/src/hooks/templatesHooks/useTemplates/index.ts +2 -2
- package/src/hooks/toolsHooks/index.ts +113 -42
- package/src/hooks/toolsHooks/useAddBaseTools.ts +51 -22
- package/src/hooks/toolsHooks/useAddComposioTool.ts +43 -22
- package/src/hooks/toolsHooks/useAddMcpServer.ts +49 -22
- package/src/hooks/toolsHooks/useAddMcpTool.ts +45 -23
- package/src/hooks/toolsHooks/useCreateTool.ts +49 -22
- package/src/hooks/toolsHooks/useDeleteMcpServer.ts +40 -21
- package/src/hooks/toolsHooks/useDeleteTool.ts +46 -22
- package/src/hooks/toolsHooks/useListComposioActionsByApp.ts +63 -30
- package/src/hooks/toolsHooks/useListComposioActionsByAppSuspense.ts +69 -31
- package/src/hooks/toolsHooks/useListComposioApps.ts +70 -30
- package/src/hooks/toolsHooks/useListComposioAppsSuspense.ts +73 -31
- package/src/hooks/toolsHooks/useListMcpServers.ts +71 -31
- package/src/hooks/toolsHooks/useListMcpServersSuspense.ts +72 -31
- package/src/hooks/toolsHooks/useListMcpToolsByServer.ts +72 -31
- package/src/hooks/toolsHooks/useListMcpToolsByServerSuspense.ts +73 -31
- package/src/hooks/toolsHooks/useListTools.ts +76 -31
- package/src/hooks/toolsHooks/useListToolsSuspense.ts +77 -31
- package/src/hooks/toolsHooks/useRetrieveTool.ts +72 -31
- package/src/hooks/toolsHooks/useRetrieveToolSuspense.ts +74 -32
- package/src/hooks/toolsHooks/useRunToolFromSource.ts +44 -21
- package/src/hooks/toolsHooks/useUpsertTool.ts +49 -22
- package/src/hooks/voiceHooks/index.ts +6 -2
- package/src/hooks/voiceHooks/useCreateVoiceChatCompletions.ts +47 -26
- package/src/index.ts +1232 -602
- package/src/schemas/HTTPValidationError.json +26 -1
- package/src/schemas/JSONSchema.json +19 -1
- package/src/schemas/LLMConfig.json +93 -1
- package/src/schemas/MCPServerType.json +6 -1
- package/src/schemas/MCPTool.json +20 -1
- package/src/schemas/SSEServerConfig.json +25 -1
- package/src/schemas/actionModel.json +93 -1
- package/src/schemas/actionParametersModel.json +27 -1
- package/src/schemas/actionResponseModel.json +27 -1
- package/src/schemas/agentEnvironmentVariable.json +62 -1
- package/src/schemas/agentSchema.json +562 -1
- package/src/schemas/agentState.json +995 -1
- package/src/schemas/agentType.json +7 -1
- package/src/schemas/appAuthScheme.json +95 -1
- package/src/schemas/appModel.json +159 -1
- package/src/schemas/assistantMessage.json +67 -1
- package/src/schemas/audio.json +7 -1
- package/src/schemas/authRequest.json +12 -1
- package/src/schemas/authResponse.json +19 -1
- package/src/schemas/authSchemeField.json +30 -1
- package/src/schemas/baseToolRuleSchema.json +10 -1
- package/src/schemas/block.json +67 -1
- package/src/schemas/blockUpdate.json +48 -1
- package/src/schemas/bodyImportAgentSerialized.json +9 -1
- package/src/schemas/bodyUploadFileToSource.json +9 -1
- package/src/schemas/chatCompletionAssistantMessageParam.json +103 -1
- package/src/schemas/chatCompletionAudioParam.json +35 -1
- package/src/schemas/chatCompletionContentPartImageParam.json +23 -1
- package/src/schemas/chatCompletionContentPartInputAudioParam.json +23 -1
- package/src/schemas/chatCompletionContentPartRefusalParam.json +10 -1
- package/src/schemas/chatCompletionContentPartTextParam.json +10 -1
- package/src/schemas/chatCompletionDeveloperMessageParam.json +29 -1
- package/src/schemas/chatCompletionFunctionCallOptionParam.json +7 -1
- package/src/schemas/chatCompletionFunctionMessageParam.json +14 -1
- package/src/schemas/chatCompletionMessageToolCall.json +22 -1
- package/src/schemas/chatCompletionMessageToolCallParam.json +20 -1
- package/src/schemas/chatCompletionNamedToolChoiceParam.json +16 -1
- package/src/schemas/chatCompletionPredictionContentParam.json +28 -1
- package/src/schemas/chatCompletionStreamOptionsParam.json +8 -1
- package/src/schemas/chatCompletionSystemMessageParam.json +29 -1
- package/src/schemas/chatCompletionToolMessageParam.json +29 -1
- package/src/schemas/chatCompletionToolParam.json +28 -1
- package/src/schemas/chatCompletionUserMessageParam.json +106 -1
- package/src/schemas/childToolRule.json +27 -1
- package/src/schemas/childToolRuleSchema.json +15 -1
- package/src/schemas/completionCreateParamsNonStreaming.json +797 -1
- package/src/schemas/completionCreateParamsStreaming.json +794 -1
- package/src/schemas/conditionalToolRule.json +38 -1
- package/src/schemas/conditionalToolRuleSchema.json +29 -1
- package/src/schemas/contextWindowOverview.json +491 -1
- package/src/schemas/continueToolRule.json +21 -1
- package/src/schemas/coreMemoryBlockSchema.json +38 -1
- package/src/schemas/createAgentRequest.json +883 -1
- package/src/schemas/createArchivalMemory.json +13 -1
- package/src/schemas/createBlock.json +49 -1
- package/src/schemas/dynamicManager.json +31 -1
- package/src/schemas/dynamicManagerUpdate.json +29 -1
- package/src/schemas/e2BSandboxConfig.json +26 -1
- package/src/schemas/embeddingConfig.json +76 -1
- package/src/schemas/file.json +19 -1
- package/src/schemas/fileFile.json +10 -1
- package/src/schemas/fileMetadata.json +74 -1
- package/src/schemas/functionCall.json +10 -1
- package/src/schemas/functionDefinitionInput.json +19 -1
- package/src/schemas/functionDefinitionOutput.json +25 -1
- package/src/schemas/functionOutput.json +11 -1
- package/src/schemas/functionTool.json +35 -1
- package/src/schemas/group.json +69 -1
- package/src/schemas/groupCreate.json +137 -1
- package/src/schemas/groupUpdate.json +140 -1
- package/src/schemas/health.json +11 -1
- package/src/schemas/hiddenReasoningMessage.json +35 -1
- package/src/schemas/identity.json +94 -1
- package/src/schemas/identityCreate.json +90 -1
- package/src/schemas/identityProperty.json +33 -1
- package/src/schemas/identityPropertyType.json +7 -1
- package/src/schemas/identityType.json +7 -1
- package/src/schemas/identityUpdate.json +90 -1
- package/src/schemas/identityUpsert.json +90 -1
- package/src/schemas/imageURL.json +14 -1
- package/src/schemas/initToolRule.json +21 -1
- package/src/schemas/inputAudio.json +10 -1
- package/src/schemas/job.json +82 -1
- package/src/schemas/jobStatus.json +15 -1
- package/src/schemas/jobType.json +6 -1
- package/src/schemas/lettaAssistantMessageContentUnion.json +31 -1
- package/src/schemas/lettaMessageContentUnion.json +184 -1
- package/src/schemas/lettaMessageUnion.json +382 -1
- package/src/schemas/lettaRequest.json +250 -1
- package/src/schemas/lettaRequestConfig.json +25 -1
- package/src/schemas/lettaResponse.json +860 -1
- package/src/schemas/lettaStreamingRequest.json +256 -1
- package/src/schemas/lettaUsageStatistics.json +411 -1
- package/src/schemas/lettaUserMessageContentUnion.json +31 -1
- package/src/schemas/localSandboxConfig.json +48 -1
- package/src/schemas/managerType.json +6 -1
- package/src/schemas/maxCountPerStepToolRule.json +26 -1
- package/src/schemas/maxCountPerStepToolRuleSchema.json +11 -1
- package/src/schemas/memory.json +87 -1
- package/src/schemas/message.json +336 -1
- package/src/schemas/messageCreate.json +219 -1
- package/src/schemas/messageRole.json +6 -1
- package/src/schemas/messageSchema.json +65 -1
- package/src/schemas/omittedReasoningContent.json +21 -1
- package/src/schemas/openaiTypesChatChatCompletionMessageToolCallParamFunction.json +10 -1
- package/src/schemas/openaiTypesChatChatCompletionNamedToolChoiceParamFunction.json +7 -1
- package/src/schemas/openaiTypesChatCompletionCreateParamsFunction.json +15 -1
- package/src/schemas/organization.json +35 -1
- package/src/schemas/organizationCreate.json +19 -1
- package/src/schemas/organizationUpdate.json +19 -1
- package/src/schemas/parameterProperties.json +13 -1
- package/src/schemas/parametersSchema.json +35 -1
- package/src/schemas/parentToolRule.json +27 -1
- package/src/schemas/passage.json +170 -1
- package/src/schemas/passageUpdate.json +169 -1
- package/src/schemas/pipRequirement.json +19 -1
- package/src/schemas/provider.json +32 -1
- package/src/schemas/providerCreate.json +19 -1
- package/src/schemas/providerUpdate.json +19 -1
- package/src/schemas/reasoningContent.json +31 -1
- package/src/schemas/reasoningMessage.json +37 -1
- package/src/schemas/redactedReasoningContent.json +21 -1
- package/src/schemas/responseFormatJSONObject.json +9 -1
- package/src/schemas/responseFormatJSONSchema.json +28 -1
- package/src/schemas/responseFormatText.json +9 -1
- package/src/schemas/roundRobinManager.json +19 -1
- package/src/schemas/roundRobinManagerUpdate.json +19 -1
- package/src/schemas/run.json +112 -1
- package/src/schemas/sandboxConfig.json +54 -1
- package/src/schemas/sandboxConfigCreate.json +89 -1
- package/src/schemas/sandboxConfigUpdate.json +89 -1
- package/src/schemas/sandboxEnvironmentVariable.json +62 -1
- package/src/schemas/sandboxEnvironmentVariableCreate.json +24 -1
- package/src/schemas/sandboxEnvironmentVariableUpdate.json +23 -1
- package/src/schemas/sandboxType.json +6 -1
- package/src/schemas/sleeptimeManager.json +25 -1
- package/src/schemas/sleeptimeManagerUpdate.json +24 -1
- package/src/schemas/source.json +141 -1
- package/src/schemas/sourceCreate.json +124 -1
- package/src/schemas/sourceUpdate.json +113 -1
- package/src/schemas/stdioServerConfig.json +39 -1
- package/src/schemas/step.json +440 -1
- package/src/schemas/supervisorManager.json +20 -1
- package/src/schemas/supervisorManagerUpdate.json +20 -1
- package/src/schemas/systemMessage.json +31 -1
- package/src/schemas/tagSchema.json +7 -1
- package/src/schemas/terminalToolRule.json +21 -1
- package/src/schemas/textContent.json +21 -1
- package/src/schemas/tool.json +100 -1
- package/src/schemas/toolCall.json +11 -1
- package/src/schemas/toolCallContent.json +32 -1
- package/src/schemas/toolCallDelta.json +19 -1
- package/src/schemas/toolCallMessage.json +61 -1
- package/src/schemas/toolCreate.json +54 -1
- package/src/schemas/toolEnvVarSchema.json +16 -1
- package/src/schemas/toolJSONSchema.json +56 -1
- package/src/schemas/toolReturn.json +30 -1
- package/src/schemas/toolReturnContent.json +30 -1
- package/src/schemas/toolReturnMessage.json +54 -1
- package/src/schemas/toolRunFromSource.json +52 -1
- package/src/schemas/toolSchema.json +99 -1
- package/src/schemas/toolType.json +15 -1
- package/src/schemas/toolUpdate.json +51 -1
- package/src/schemas/updateAgent.json +513 -1
- package/src/schemas/updateAssistantMessage.json +55 -1
- package/src/schemas/updateReasoningMessage.json +15 -1
- package/src/schemas/updateSystemMessage.json +19 -1
- package/src/schemas/updateUserMessage.json +55 -1
- package/src/schemas/usageStatistics.json +18 -1
- package/src/schemas/user.json +44 -1
- package/src/schemas/userCreate.json +14 -1
- package/src/schemas/userMessage.json +67 -1
- package/src/schemas/userUpdate.json +19 -1
- package/src/schemas/validationError.json +15 -1
- package/src/schemas/webSearchOptions.json +41 -1
- package/src/schemas/webSearchOptionsUserLocation.json +20 -1
- package/src/schemas/webSearchOptionsUserLocationApproximate.json +11 -1
- package/src/types/ActionModel.ts +15 -15
- package/src/types/ActionParametersModel.ts +7 -7
- package/src/types/ActionResponseModel.ts +7 -7
- package/src/types/AddBaseTools.ts +8 -8
- package/src/types/AddComposioTool.ts +11 -11
- package/src/types/AddMcpServer.ts +11 -11
- package/src/types/AddMcpTool.ts +12 -12
- package/src/types/AgentEnvironmentVariable.ts +10 -10
- package/src/types/AgentSchema.ts +37 -32
- package/src/types/AgentState.ts +53 -43
- package/src/types/AgentType.ts +3 -3
- package/src/types/AppAuthScheme.ts +16 -15
- package/src/types/AppModel.ts +20 -20
- package/src/types/AssistantMessage.ts +11 -10
- package/src/types/AttachCoreMemoryBlock.ts +12 -12
- package/src/types/AttachSourceToAgent.ts +12 -12
- package/src/types/AttachTool.ts +12 -12
- package/src/types/Audio.ts +2 -2
- package/src/types/AuthRequest.ts +2 -2
- package/src/types/AuthResponse.ts +3 -3
- package/src/types/AuthSchemeField.ts +9 -9
- package/src/types/BaseToolRuleSchema.ts +3 -3
- package/src/types/Block.ts +12 -12
- package/src/types/BlockUpdate.ts +9 -9
- package/src/types/BodyImportAgentSerialized.ts +2 -2
- package/src/types/BodyUploadFileToSource.ts +2 -2
- package/src/types/ChatCompletionAssistantMessageParam.ts +19 -13
- package/src/types/ChatCompletionAudioParam.ts +9 -7
- package/src/types/ChatCompletionContentPartImageParam.ts +4 -4
- package/src/types/ChatCompletionContentPartInputAudioParam.ts +4 -4
- package/src/types/ChatCompletionContentPartRefusalParam.ts +3 -3
- package/src/types/ChatCompletionContentPartTextParam.ts +3 -3
- package/src/types/ChatCompletionDeveloperMessageParam.ts +5 -5
- package/src/types/ChatCompletionFunctionCallOptionParam.ts +2 -2
- package/src/types/ChatCompletionFunctionMessageParam.ts +4 -4
- package/src/types/ChatCompletionMessageToolCall.ts +6 -6
- package/src/types/ChatCompletionMessageToolCallParam.ts +5 -5
- package/src/types/ChatCompletionNamedToolChoiceParam.ts +4 -4
- package/src/types/ChatCompletionPredictionContentParam.ts +4 -4
- package/src/types/ChatCompletionStreamOptionsParam.ts +2 -2
- package/src/types/ChatCompletionSystemMessageParam.ts +5 -5
- package/src/types/ChatCompletionToolMessageParam.ts +5 -5
- package/src/types/ChatCompletionToolParam.ts +4 -4
- package/src/types/ChatCompletionUserMessageParam.ts +15 -8
- package/src/types/ChildToolRule.ts +4 -4
- package/src/types/ChildToolRuleSchema.ts +4 -4
- package/src/types/CompletionCreateParamsNonStreaming.ts +74 -65
- package/src/types/CompletionCreateParamsStreaming.ts +75 -65
- package/src/types/ConditionalToolRule.ts +7 -7
- package/src/types/ConditionalToolRuleSchema.ts +7 -7
- package/src/types/ContextWindowOverview.ts +20 -20
- package/src/types/ContinueToolRule.ts +3 -3
- package/src/types/CoreMemoryBlockSchema.ts +11 -11
- package/src/types/CreateAgent.ts +14 -14
- package/src/types/CreateAgentMessageAsync.ts +15 -14
- package/src/types/CreateAgentMessageStream.ts +14 -13
- package/src/types/CreateAgentRequest.ts +62 -52
- package/src/types/CreateArchivalMemory.ts +2 -2
- package/src/types/CreateBlock.ts +19 -19
- package/src/types/CreateGroup.ts +14 -14
- package/src/types/CreateIdentity.ts +14 -14
- package/src/types/CreatePassage.ts +14 -14
- package/src/types/CreateProvider.ts +11 -11
- package/src/types/CreateSource.ts +11 -11
- package/src/types/CreateTool.ts +11 -11
- package/src/types/CreateVoiceChatCompletions.ts +20 -17
- package/src/types/DeleteAgent.ts +10 -10
- package/src/types/DeleteBlock.ts +11 -11
- package/src/types/DeleteFileFromSource.ts +11 -11
- package/src/types/DeleteGroup.ts +10 -10
- package/src/types/DeleteIdentity.ts +10 -10
- package/src/types/DeleteJob.ts +11 -11
- package/src/types/DeleteMcpServer.ts +12 -12
- package/src/types/DeletePassage.ts +11 -11
- package/src/types/DeleteProvider.ts +10 -10
- package/src/types/DeleteRun.ts +11 -11
- package/src/types/DeleteSource.ts +10 -10
- package/src/types/DeleteTool.ts +10 -10
- package/src/types/DetachCoreMemoryBlock.ts +12 -12
- package/src/types/DetachSourceFromAgent.ts +12 -12
- package/src/types/DetachTool.ts +12 -12
- package/src/types/DynamicManager.ts +5 -5
- package/src/types/DynamicManagerUpdate.ts +5 -5
- package/src/types/E2BSandboxConfig.ts +4 -4
- package/src/types/EmbeddingConfig.ts +13 -12
- package/src/types/ExportAgentSerialized.ts +13 -13
- package/src/types/File.ts +4 -4
- package/src/types/FileFile.ts +4 -4
- package/src/types/FileMetadata.ts +12 -12
- package/src/types/FunctionCall.ts +3 -3
- package/src/types/FunctionDefinitionInput.ts +6 -6
- package/src/types/FunctionDefinitionOutput.ts +7 -7
- package/src/types/FunctionOutput.ts +4 -4
- package/src/types/FunctionTool.ts +5 -5
- package/src/types/GetSourceIdByName.ts +10 -10
- package/src/types/Group.ts +13 -13
- package/src/types/GroupCreate.ts +13 -9
- package/src/types/GroupUpdate.ts +16 -9
- package/src/types/HTTPValidationError.ts +3 -3
- package/src/types/Health.ts +3 -3
- package/src/types/HealthCheck.ts +6 -6
- package/src/types/HiddenReasoningMessage.ts +14 -12
- package/src/types/Identity.ts +11 -11
- package/src/types/IdentityCreate.ts +10 -10
- package/src/types/IdentityProperty.ts +6 -6
- package/src/types/IdentityPropertyType.ts +4 -3
- package/src/types/IdentityType.ts +4 -3
- package/src/types/IdentityUpdate.ts +9 -9
- package/src/types/IdentityUpsert.ts +10 -10
- package/src/types/ImageURL.ts +6 -5
- package/src/types/ImportAgentSerialized.ts +17 -17
- package/src/types/InitToolRule.ts +3 -3
- package/src/types/InputAudio.ts +6 -5
- package/src/types/JSONSchema.ts +6 -6
- package/src/types/Job.ts +13 -13
- package/src/types/JobStatus.ts +3 -3
- package/src/types/JobType.ts +3 -3
- package/src/types/LLMConfig.ts +15 -14
- package/src/types/LettaAssistantMessageContentUnion.ts +5 -5
- package/src/types/LettaMessageContentUnion.ts +16 -15
- package/src/types/LettaMessageUnion.ts +18 -17
- package/src/types/LettaRequest.ts +6 -6
- package/src/types/LettaRequestConfig.ts +4 -4
- package/src/types/LettaResponse.ts +5 -5
- package/src/types/LettaStreamingRequest.ts +7 -7
- package/src/types/LettaUsageStatistics.ts +9 -9
- package/src/types/LettaUserMessageContentUnion.ts +6 -5
- package/src/types/ListActiveJobs.ts +8 -8
- package/src/types/ListActiveRuns.ts +11 -11
- package/src/types/ListAgentSources.ts +11 -11
- package/src/types/ListAgentTools.ts +11 -11
- package/src/types/ListAgents.ts +24 -24
- package/src/types/ListAgentsForBlock.ts +11 -11
- package/src/types/ListBlocks.ts +15 -15
- package/src/types/ListComposioActionsByApp.ts +11 -11
- package/src/types/ListComposioApps.ts +11 -11
- package/src/types/ListCoreMemoryBlocks.ts +11 -11
- package/src/types/ListEmbeddingModels.ts +6 -6
- package/src/types/ListGroupMessages.ts +19 -19
- package/src/types/ListGroups.ts +16 -16
- package/src/types/ListIdentities.ts +18 -18
- package/src/types/ListJobs.ts +11 -11
- package/src/types/ListMcpServers.ts +13 -13
- package/src/types/ListMcpToolsByServer.ts +11 -11
- package/src/types/ListMessages.ts +20 -20
- package/src/types/ListModels.ts +6 -6
- package/src/types/ListPassages.ts +18 -18
- package/src/types/ListProviders.ts +12 -12
- package/src/types/ListRunMessages.ts +19 -19
- package/src/types/ListRunSteps.ts +17 -17
- package/src/types/ListRuns.ts +11 -11
- package/src/types/ListSourceFiles.ts +15 -15
- package/src/types/ListSourcePassages.ts +11 -11
- package/src/types/ListSources.ts +8 -8
- package/src/types/ListSteps.ts +18 -18
- package/src/types/ListTags.ts +12 -12
- package/src/types/ListTools.ts +13 -13
- package/src/types/LocalSandboxConfig.ts +6 -6
- package/src/types/MCPServerType.ts +4 -3
- package/src/types/MCPTool.ts +6 -6
- package/src/types/ManagerType.ts +4 -3
- package/src/types/MaxCountPerStepToolRule.ts +4 -4
- package/src/types/MaxCountPerStepToolRuleSchema.ts +4 -4
- package/src/types/Memory.ts +4 -4
- package/src/types/Message.ts +35 -26
- package/src/types/MessageCreate.ts +9 -8
- package/src/types/MessageRole.ts +4 -3
- package/src/types/MessageSchema.ts +12 -12
- package/src/types/ModifyAgent.ts +14 -14
- package/src/types/ModifyBlock.ts +14 -14
- package/src/types/ModifyCoreMemoryBlock.ts +15 -15
- package/src/types/ModifyGroup.ts +17 -17
- package/src/types/ModifyGroupMessage.ts +28 -24
- package/src/types/ModifyMessage.ts +35 -24
- package/src/types/ModifyPassage.ts +15 -15
- package/src/types/ModifyProvider.ts +11 -11
- package/src/types/ModifySource.ts +14 -14
- package/src/types/ModifyTool.ts +14 -14
- package/src/types/OmittedReasoningContent.ts +6 -5
- package/src/types/OpenaiTypesChatChatCompletionMessageToolCallParamFunction.ts +3 -3
- package/src/types/OpenaiTypesChatChatCompletionNamedToolChoiceParamFunction.ts +2 -2
- package/src/types/OpenaiTypesChatCompletionCreateParamsFunction.ts +5 -5
- package/src/types/Organization.ts +5 -5
- package/src/types/OrganizationCreate.ts +3 -3
- package/src/types/OrganizationUpdate.ts +3 -3
- package/src/types/ParameterProperties.ts +3 -3
- package/src/types/ParametersSchema.ts +6 -6
- package/src/types/ParentToolRule.ts +4 -4
- package/src/types/Passage.ts +16 -16
- package/src/types/PassageUpdate.ts +16 -16
- package/src/types/PipRequirement.ts +3 -3
- package/src/types/Provider.ts +5 -5
- package/src/types/ProviderCreate.ts +3 -3
- package/src/types/ProviderUpdate.ts +3 -3
- package/src/types/ReasoningContent.ts +8 -7
- package/src/types/ReasoningMessage.ts +15 -13
- package/src/types/RedactedReasoningContent.ts +6 -5
- package/src/types/ResetGroupMessages.ts +10 -10
- package/src/types/ResetMessages.ts +14 -14
- package/src/types/ResponseFormatJSONObject.ts +2 -2
- package/src/types/ResponseFormatJSONSchema.ts +4 -4
- package/src/types/ResponseFormatText.ts +2 -2
- package/src/types/RetrieveAgent.ts +11 -11
- package/src/types/RetrieveAgentContextWindow.ts +12 -11
- package/src/types/RetrieveAgentMemory.ts +11 -11
- package/src/types/RetrieveBlock.ts +11 -11
- package/src/types/RetrieveCoreMemoryBlock.ts +12 -12
- package/src/types/RetrieveGroup.ts +11 -11
- package/src/types/RetrieveIdentity.ts +11 -11
- package/src/types/RetrieveJob.ts +11 -11
- package/src/types/RetrieveRun.ts +11 -11
- package/src/types/RetrieveRunUsage.ts +11 -11
- package/src/types/RetrieveSource.ts +11 -11
- package/src/types/RetrieveStep.ts +11 -11
- package/src/types/RetrieveTool.ts +11 -11
- package/src/types/RoundRobinManager.ts +3 -3
- package/src/types/RoundRobinManagerUpdate.ts +3 -3
- package/src/types/Run.ts +15 -15
- package/src/types/RunToolFromSource.ts +11 -11
- package/src/types/SSEServerConfig.ts +5 -5
- package/src/types/SandboxConfig.ts +10 -10
- package/src/types/SandboxConfigCreate.ts +4 -4
- package/src/types/SandboxConfigUpdate.ts +4 -4
- package/src/types/SandboxEnvironmentVariable.ts +10 -10
- package/src/types/SandboxEnvironmentVariableCreate.ts +4 -4
- package/src/types/SandboxEnvironmentVariableUpdate.ts +4 -4
- package/src/types/SandboxType.ts +4 -3
- package/src/types/SendGroupMessage.ts +14 -14
- package/src/types/SendGroupMessageStreaming.ts +14 -13
- package/src/types/SendMessage.ts +14 -14
- package/src/types/SleeptimeManager.ts +4 -4
- package/src/types/SleeptimeManagerUpdate.ts +4 -4
- package/src/types/Source.ts +12 -12
- package/src/types/SourceCreate.ts +9 -9
- package/src/types/SourceUpdate.ts +7 -7
- package/src/types/StdioServerConfig.ts +8 -8
- package/src/types/Step.ts +20 -20
- package/src/types/SupervisorManager.ts +3 -3
- package/src/types/SupervisorManagerUpdate.ts +3 -3
- package/src/types/SystemMessage.ts +10 -9
- package/src/types/TagSchema.ts +2 -2
- package/src/types/TerminalToolRule.ts +3 -3
- package/src/types/TextContent.ts +6 -5
- package/src/types/Tool.ts +18 -18
- package/src/types/ToolCall.ts +4 -4
- package/src/types/ToolCallContent.ts +9 -8
- package/src/types/ToolCallDelta.ts +4 -4
- package/src/types/ToolCallMessage.ts +12 -11
- package/src/types/ToolCreate.ts +10 -10
- package/src/types/ToolEnvVarSchema.ts +6 -6
- package/src/types/ToolJSONSchema.ts +7 -7
- package/src/types/ToolReturn.ts +7 -6
- package/src/types/ToolReturnContent.ts +5 -5
- package/src/types/ToolReturnMessage.ts +17 -15
- package/src/types/ToolRunFromSource.ts +12 -12
- package/src/types/ToolSchema.ts +15 -15
- package/src/types/ToolType.ts +3 -3
- package/src/types/ToolUpdate.ts +10 -10
- package/src/types/UpdateAgent.ts +43 -33
- package/src/types/UpdateAssistantMessage.ts +4 -4
- package/src/types/UpdateIdentity.ts +14 -14
- package/src/types/UpdateReasoningMessage.ts +3 -3
- package/src/types/UpdateSystemMessage.ts +3 -3
- package/src/types/UpdateUserMessage.ts +4 -4
- package/src/types/UploadFileToSource.ts +14 -14
- package/src/types/UpsertIdentity.ts +14 -14
- package/src/types/UpsertIdentityProperties.ts +14 -13
- package/src/types/UpsertTool.ts +11 -11
- package/src/types/UsageStatistics.ts +4 -4
- package/src/types/User.ts +6 -6
- package/src/types/UserCreate.ts +2 -2
- package/src/types/UserMessage.ts +11 -10
- package/src/types/UserUpdate.ts +3 -3
- package/src/types/ValidationError.ts +4 -4
- package/src/types/WebSearchOptions.ts +7 -6
- package/src/types/WebSearchOptionsUserLocation.ts +4 -4
- package/src/types/WebSearchOptionsUserLocationApproximate.ts +5 -5
- package/src/types/agents/CreateTemplateFromAgent.ts +18 -17
- package/src/types/agents/GetAgentVariables.ts +15 -14
- package/src/types/agents/MigrateAgent.ts +35 -30
- package/src/types/agents/SearchDeployedAgents.ts +50 -42
- package/src/types/agents/VersionAgentTemplate.ts +26 -23
- package/src/types/agents/index.ts +13 -10
- package/src/types/clientSideAccessTokens/CreateClientSideAccessToken.ts +39 -34
- package/src/types/clientSideAccessTokens/DeleteClientSideAccessToken.ts +14 -12
- package/src/types/clientSideAccessTokens/index.ts +9 -3
- package/src/types/index.ts +653 -328
- package/src/types/templates/CreateAgentsFromTemplate.ts +21 -20
- package/src/types/templates/index.ts +1 -1
- package/types/agents/index.d.ts +1 -1
- package/types/clientSideAccessTokens/index.d.ts +1 -1
- package/types/index.d.ts +67 -67
@@ -3,20 +3,38 @@
|
|
3
3
|
* Do not edit manually.
|
4
4
|
*/
|
5
5
|
|
6
|
-
import client from '@kubb/plugin-client/clients/axios'
|
6
|
+
import client from '@kubb/plugin-client/clients/axios';
|
7
7
|
import type {
|
8
8
|
AgentsGetAgentVariablesQueryResponse,
|
9
9
|
AgentsGetAgentVariablesPathParams,
|
10
10
|
AgentsGetAgentVariables404,
|
11
|
-
} from '../../../types/agents/GetAgentVariables.ts'
|
12
|
-
import type {
|
13
|
-
|
14
|
-
|
11
|
+
} from '../../../types/agents/GetAgentVariables.ts';
|
12
|
+
import type {
|
13
|
+
RequestConfig,
|
14
|
+
ResponseErrorConfig,
|
15
|
+
ResponseConfig,
|
16
|
+
} from '@kubb/plugin-client/clients/axios';
|
17
|
+
import type {
|
18
|
+
QueryKey,
|
19
|
+
QueryClient,
|
20
|
+
UseSuspenseQueryOptions,
|
21
|
+
UseSuspenseQueryResult,
|
22
|
+
} from '@tanstack/react-query';
|
23
|
+
import { queryOptions, useSuspenseQuery } from '@tanstack/react-query';
|
15
24
|
|
16
|
-
export const agentsGetAgentVariablesSuspenseQueryKey = (
|
17
|
-
|
25
|
+
export const agentsGetAgentVariablesSuspenseQueryKey = (
|
26
|
+
agent_id: AgentsGetAgentVariablesPathParams['agent_id']
|
27
|
+
) =>
|
28
|
+
[
|
29
|
+
{
|
30
|
+
url: '/v1/agents/:agent_id/core-memory/variables',
|
31
|
+
params: { agent_id: agent_id },
|
32
|
+
},
|
33
|
+
] as const;
|
18
34
|
|
19
|
-
export type AgentsGetAgentVariablesSuspenseQueryKey = ReturnType<
|
35
|
+
export type AgentsGetAgentVariablesSuspenseQueryKey = ReturnType<
|
36
|
+
typeof agentsGetAgentVariablesSuspenseQueryKey
|
37
|
+
>;
|
20
38
|
|
21
39
|
/**
|
22
40
|
* @description Get the variables associated with an agent
|
@@ -25,23 +43,27 @@ export type AgentsGetAgentVariablesSuspenseQueryKey = ReturnType<typeof agentsGe
|
|
25
43
|
*/
|
26
44
|
export async function agentsGetAgentVariablesSuspense(
|
27
45
|
agent_id: AgentsGetAgentVariablesPathParams['agent_id'],
|
28
|
-
config: Partial<RequestConfig> & { client?: typeof client } = {}
|
46
|
+
config: Partial<RequestConfig> & { client?: typeof client } = {}
|
29
47
|
) {
|
30
|
-
const { client: request = client, ...requestConfig } = config
|
48
|
+
const { client: request = client, ...requestConfig } = config;
|
31
49
|
|
32
|
-
const res = await request<
|
50
|
+
const res = await request<
|
51
|
+
AgentsGetAgentVariablesQueryResponse,
|
52
|
+
ResponseErrorConfig<AgentsGetAgentVariables404>,
|
53
|
+
unknown
|
54
|
+
>({
|
33
55
|
method: 'GET',
|
34
56
|
url: `/v1/agents/${agent_id}/core-memory/variables`,
|
35
57
|
...requestConfig,
|
36
|
-
})
|
37
|
-
return res
|
58
|
+
});
|
59
|
+
return res;
|
38
60
|
}
|
39
61
|
|
40
62
|
export function agentsGetAgentVariablesSuspenseQueryOptions(
|
41
63
|
agent_id: AgentsGetAgentVariablesPathParams['agent_id'],
|
42
|
-
config: Partial<RequestConfig> & { client?: typeof client } = {}
|
64
|
+
config: Partial<RequestConfig> & { client?: typeof client } = {}
|
43
65
|
) {
|
44
|
-
const queryKey = agentsGetAgentVariablesSuspenseQueryKey(agent_id)
|
66
|
+
const queryKey = agentsGetAgentVariablesSuspenseQueryKey(agent_id);
|
45
67
|
return queryOptions<
|
46
68
|
ResponseConfig<AgentsGetAgentVariablesQueryResponse>,
|
47
69
|
ResponseErrorConfig<AgentsGetAgentVariables404>,
|
@@ -51,10 +73,10 @@ export function agentsGetAgentVariablesSuspenseQueryOptions(
|
|
51
73
|
enabled: !!agent_id,
|
52
74
|
queryKey,
|
53
75
|
queryFn: async ({ signal }) => {
|
54
|
-
config.signal = signal
|
55
|
-
return agentsGetAgentVariablesSuspense(agent_id, config)
|
76
|
+
config.signal = signal;
|
77
|
+
return agentsGetAgentVariablesSuspense(agent_id, config);
|
56
78
|
},
|
57
|
-
})
|
79
|
+
});
|
58
80
|
}
|
59
81
|
|
60
82
|
/**
|
@@ -65,29 +87,44 @@ export function agentsGetAgentVariablesSuspenseQueryOptions(
|
|
65
87
|
export function useAgentsGetAgentVariablesSuspense<
|
66
88
|
TData = ResponseConfig<AgentsGetAgentVariablesQueryResponse>,
|
67
89
|
TQueryData = ResponseConfig<AgentsGetAgentVariablesQueryResponse>,
|
68
|
-
TQueryKey extends QueryKey = AgentsGetAgentVariablesSuspenseQueryKey
|
90
|
+
TQueryKey extends QueryKey = AgentsGetAgentVariablesSuspenseQueryKey
|
69
91
|
>(
|
70
92
|
agent_id: AgentsGetAgentVariablesPathParams['agent_id'],
|
71
93
|
options: {
|
72
94
|
query?: Partial<
|
73
|
-
UseSuspenseQueryOptions<
|
74
|
-
|
75
|
-
|
76
|
-
|
95
|
+
UseSuspenseQueryOptions<
|
96
|
+
ResponseConfig<AgentsGetAgentVariablesQueryResponse>,
|
97
|
+
ResponseErrorConfig<AgentsGetAgentVariables404>,
|
98
|
+
TData,
|
99
|
+
TQueryKey
|
100
|
+
>
|
101
|
+
> & { client?: QueryClient };
|
102
|
+
client?: Partial<RequestConfig> & { client?: typeof client };
|
103
|
+
} = {}
|
77
104
|
) {
|
78
|
-
const {
|
79
|
-
|
105
|
+
const {
|
106
|
+
query: { client: queryClient, ...queryOptions } = {},
|
107
|
+
client: config = {},
|
108
|
+
} = options ?? {};
|
109
|
+
const queryKey =
|
110
|
+
queryOptions?.queryKey ?? agentsGetAgentVariablesSuspenseQueryKey(agent_id);
|
80
111
|
|
81
112
|
const query = useSuspenseQuery(
|
82
113
|
{
|
83
|
-
...(agentsGetAgentVariablesSuspenseQueryOptions(
|
114
|
+
...(agentsGetAgentVariablesSuspenseQueryOptions(
|
115
|
+
agent_id,
|
116
|
+
config
|
117
|
+
) as unknown as UseSuspenseQueryOptions),
|
84
118
|
queryKey,
|
85
119
|
...(queryOptions as unknown as Omit<UseSuspenseQueryOptions, 'queryKey'>),
|
86
120
|
},
|
87
|
-
queryClient
|
88
|
-
) as UseSuspenseQueryResult<
|
121
|
+
queryClient
|
122
|
+
) as UseSuspenseQueryResult<
|
123
|
+
TData,
|
124
|
+
ResponseErrorConfig<AgentsGetAgentVariables404>
|
125
|
+
> & { queryKey: TQueryKey };
|
89
126
|
|
90
|
-
query.queryKey = queryKey as TQueryKey
|
127
|
+
query.queryKey = queryKey as TQueryKey;
|
91
128
|
|
92
|
-
return query
|
93
|
-
}
|
129
|
+
return query;
|
130
|
+
}
|
@@ -1,22 +1,38 @@
|
|
1
|
-
export type { AgentsCreateTemplateFromAgentMutationKey } from './createTemplateFromAgent.ts'
|
2
|
-
export type { AgentsGetAgentVariablesQueryKey } from './getAgentVariables.ts'
|
3
|
-
export type { AgentsGetAgentVariablesSuspenseQueryKey } from './getAgentVariablesSuspense.ts'
|
4
|
-
export type { AgentsMigrateAgentMutationKey } from './migrateAgent.ts'
|
5
|
-
export type { AgentsSearchDeployedAgentsMutationKey } from './searchDeployedAgents.ts'
|
6
|
-
export type { AgentsVersionAgentTemplateMutationKey } from './versionAgentTemplate.ts'
|
7
|
-
export {
|
1
|
+
export type { AgentsCreateTemplateFromAgentMutationKey } from './createTemplateFromAgent.ts';
|
2
|
+
export type { AgentsGetAgentVariablesQueryKey } from './getAgentVariables.ts';
|
3
|
+
export type { AgentsGetAgentVariablesSuspenseQueryKey } from './getAgentVariablesSuspense.ts';
|
4
|
+
export type { AgentsMigrateAgentMutationKey } from './migrateAgent.ts';
|
5
|
+
export type { AgentsSearchDeployedAgentsMutationKey } from './searchDeployedAgents.ts';
|
6
|
+
export type { AgentsVersionAgentTemplateMutationKey } from './versionAgentTemplate.ts';
|
7
|
+
export {
|
8
|
+
agentsCreateTemplateFromAgentMutationKey,
|
9
|
+
agentsCreateTemplateFromAgent,
|
10
|
+
useAgentsCreateTemplateFromAgent,
|
11
|
+
} from './createTemplateFromAgent.ts';
|
8
12
|
export {
|
9
13
|
agentsGetAgentVariablesQueryKey,
|
10
14
|
agentsGetAgentVariables,
|
11
15
|
agentsGetAgentVariablesQueryOptions,
|
12
16
|
useAgentsGetAgentVariables,
|
13
|
-
} from './getAgentVariables.ts'
|
17
|
+
} from './getAgentVariables.ts';
|
14
18
|
export {
|
15
19
|
agentsGetAgentVariablesSuspenseQueryKey,
|
16
20
|
agentsGetAgentVariablesSuspense,
|
17
21
|
agentsGetAgentVariablesSuspenseQueryOptions,
|
18
22
|
useAgentsGetAgentVariablesSuspense,
|
19
|
-
} from './getAgentVariablesSuspense.ts'
|
20
|
-
export {
|
21
|
-
|
22
|
-
|
23
|
+
} from './getAgentVariablesSuspense.ts';
|
24
|
+
export {
|
25
|
+
agentsMigrateAgentMutationKey,
|
26
|
+
agentsMigrateAgent,
|
27
|
+
useAgentsMigrateAgent,
|
28
|
+
} from './migrateAgent.ts';
|
29
|
+
export {
|
30
|
+
agentsSearchDeployedAgentsMutationKey,
|
31
|
+
agentsSearchDeployedAgents,
|
32
|
+
useAgentsSearchDeployedAgents,
|
33
|
+
} from './searchDeployedAgents.ts';
|
34
|
+
export {
|
35
|
+
agentsVersionAgentTemplateMutationKey,
|
36
|
+
agentsVersionAgentTemplate,
|
37
|
+
useAgentsVersionAgentTemplate,
|
38
|
+
} from './versionAgentTemplate.ts';
|
@@ -3,7 +3,7 @@
|
|
3
3
|
* Do not edit manually.
|
4
4
|
*/
|
5
5
|
|
6
|
-
import client from '@kubb/plugin-client/clients/axios'
|
6
|
+
import client from '@kubb/plugin-client/clients/axios';
|
7
7
|
import type {
|
8
8
|
AgentsMigrateAgentMutationRequest,
|
9
9
|
AgentsMigrateAgentMutationResponse,
|
@@ -11,14 +11,21 @@ import type {
|
|
11
11
|
AgentsMigrateAgent404,
|
12
12
|
AgentsMigrateAgent409,
|
13
13
|
AgentsMigrateAgent500,
|
14
|
-
} from '../../../types/agents/MigrateAgent.ts'
|
15
|
-
import type {
|
16
|
-
|
17
|
-
|
14
|
+
} from '../../../types/agents/MigrateAgent.ts';
|
15
|
+
import type {
|
16
|
+
RequestConfig,
|
17
|
+
ResponseConfig,
|
18
|
+
ResponseErrorConfig,
|
19
|
+
} from '@kubb/plugin-client/clients/axios';
|
20
|
+
import type { UseMutationOptions, QueryClient } from '@tanstack/react-query';
|
21
|
+
import { useMutation } from '@tanstack/react-query';
|
18
22
|
|
19
|
-
export const agentsMigrateAgentMutationKey = () =>
|
23
|
+
export const agentsMigrateAgentMutationKey = () =>
|
24
|
+
[{ url: '/v1/agents/{agent_id}/migrate' }] as const;
|
20
25
|
|
21
|
-
export type AgentsMigrateAgentMutationKey = ReturnType<
|
26
|
+
export type AgentsMigrateAgentMutationKey = ReturnType<
|
27
|
+
typeof agentsMigrateAgentMutationKey
|
28
|
+
>;
|
22
29
|
|
23
30
|
/**
|
24
31
|
* @description Migrate an agent to a new versioned agent template
|
@@ -28,16 +35,25 @@ export type AgentsMigrateAgentMutationKey = ReturnType<typeof agentsMigrateAgent
|
|
28
35
|
export async function agentsMigrateAgent(
|
29
36
|
agent_id: AgentsMigrateAgentPathParams['agent_id'],
|
30
37
|
data: AgentsMigrateAgentMutationRequest,
|
31
|
-
config: Partial<RequestConfig<AgentsMigrateAgentMutationRequest>> & {
|
38
|
+
config: Partial<RequestConfig<AgentsMigrateAgentMutationRequest>> & {
|
39
|
+
client?: typeof client;
|
40
|
+
} = {}
|
32
41
|
) {
|
33
|
-
const { client: request = client, ...requestConfig } = config
|
42
|
+
const { client: request = client, ...requestConfig } = config;
|
34
43
|
|
35
44
|
const res = await request<
|
36
45
|
AgentsMigrateAgentMutationResponse,
|
37
|
-
ResponseErrorConfig<
|
46
|
+
ResponseErrorConfig<
|
47
|
+
AgentsMigrateAgent404 | AgentsMigrateAgent409 | AgentsMigrateAgent500
|
48
|
+
>,
|
38
49
|
AgentsMigrateAgentMutationRequest
|
39
|
-
>({
|
40
|
-
|
50
|
+
>({
|
51
|
+
method: 'POST',
|
52
|
+
url: `/v1/agents/${agent_id}/migrate`,
|
53
|
+
data,
|
54
|
+
...requestConfig,
|
55
|
+
});
|
56
|
+
return res;
|
41
57
|
}
|
42
58
|
|
43
59
|
/**
|
@@ -49,29 +65,45 @@ export function useAgentsMigrateAgent<TContext>(
|
|
49
65
|
options: {
|
50
66
|
mutation?: UseMutationOptions<
|
51
67
|
ResponseConfig<AgentsMigrateAgentMutationResponse>,
|
52
|
-
ResponseErrorConfig<
|
53
|
-
|
68
|
+
ResponseErrorConfig<
|
69
|
+
AgentsMigrateAgent404 | AgentsMigrateAgent409 | AgentsMigrateAgent500
|
70
|
+
>,
|
71
|
+
{
|
72
|
+
agent_id: AgentsMigrateAgentPathParams['agent_id'];
|
73
|
+
data: AgentsMigrateAgentMutationRequest;
|
74
|
+
},
|
54
75
|
TContext
|
55
|
-
> & { client?: QueryClient }
|
56
|
-
client?: Partial<RequestConfig<AgentsMigrateAgentMutationRequest>> & {
|
57
|
-
|
76
|
+
> & { client?: QueryClient };
|
77
|
+
client?: Partial<RequestConfig<AgentsMigrateAgentMutationRequest>> & {
|
78
|
+
client?: typeof client;
|
79
|
+
};
|
80
|
+
} = {}
|
58
81
|
) {
|
59
|
-
const {
|
60
|
-
|
82
|
+
const {
|
83
|
+
mutation: { client: queryClient, ...mutationOptions } = {},
|
84
|
+
client: config = {},
|
85
|
+
} = options ?? {};
|
86
|
+
const mutationKey =
|
87
|
+
mutationOptions?.mutationKey ?? agentsMigrateAgentMutationKey();
|
61
88
|
|
62
89
|
return useMutation<
|
63
90
|
ResponseConfig<AgentsMigrateAgentMutationResponse>,
|
64
|
-
ResponseErrorConfig<
|
65
|
-
|
91
|
+
ResponseErrorConfig<
|
92
|
+
AgentsMigrateAgent404 | AgentsMigrateAgent409 | AgentsMigrateAgent500
|
93
|
+
>,
|
94
|
+
{
|
95
|
+
agent_id: AgentsMigrateAgentPathParams['agent_id'];
|
96
|
+
data: AgentsMigrateAgentMutationRequest;
|
97
|
+
},
|
66
98
|
TContext
|
67
99
|
>(
|
68
100
|
{
|
69
101
|
mutationFn: async ({ agent_id, data }) => {
|
70
|
-
return agentsMigrateAgent(agent_id, data, config)
|
102
|
+
return agentsMigrateAgent(agent_id, data, config);
|
71
103
|
},
|
72
104
|
mutationKey,
|
73
105
|
...mutationOptions,
|
74
106
|
},
|
75
|
-
queryClient
|
76
|
-
)
|
77
|
-
}
|
107
|
+
queryClient
|
108
|
+
);
|
109
|
+
}
|
@@ -3,15 +3,25 @@
|
|
3
3
|
* Do not edit manually.
|
4
4
|
*/
|
5
5
|
|
6
|
-
import client from '@kubb/plugin-client/clients/axios'
|
7
|
-
import type {
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
import client from '@kubb/plugin-client/clients/axios';
|
7
|
+
import type {
|
8
|
+
AgentsSearchDeployedAgentsMutationRequest,
|
9
|
+
AgentsSearchDeployedAgentsMutationResponse,
|
10
|
+
} from '../../../types/agents/SearchDeployedAgents.ts';
|
11
|
+
import type {
|
12
|
+
RequestConfig,
|
13
|
+
ResponseConfig,
|
14
|
+
ResponseErrorConfig,
|
15
|
+
} from '@kubb/plugin-client/clients/axios';
|
16
|
+
import type { UseMutationOptions, QueryClient } from '@tanstack/react-query';
|
17
|
+
import { useMutation } from '@tanstack/react-query';
|
11
18
|
|
12
|
-
export const agentsSearchDeployedAgentsMutationKey = () =>
|
19
|
+
export const agentsSearchDeployedAgentsMutationKey = () =>
|
20
|
+
[{ url: '/v1/agents/search' }] as const;
|
13
21
|
|
14
|
-
export type AgentsSearchDeployedAgentsMutationKey = ReturnType<
|
22
|
+
export type AgentsSearchDeployedAgentsMutationKey = ReturnType<
|
23
|
+
typeof agentsSearchDeployedAgentsMutationKey
|
24
|
+
>;
|
15
25
|
|
16
26
|
/**
|
17
27
|
* @description Search deployed agents
|
@@ -20,17 +30,23 @@ export type AgentsSearchDeployedAgentsMutationKey = ReturnType<typeof agentsSear
|
|
20
30
|
*/
|
21
31
|
export async function agentsSearchDeployedAgents(
|
22
32
|
data?: AgentsSearchDeployedAgentsMutationRequest,
|
23
|
-
config: Partial<RequestConfig<AgentsSearchDeployedAgentsMutationRequest>> & {
|
33
|
+
config: Partial<RequestConfig<AgentsSearchDeployedAgentsMutationRequest>> & {
|
34
|
+
client?: typeof client;
|
35
|
+
} = {}
|
24
36
|
) {
|
25
|
-
const { client: request = client, ...requestConfig } = config
|
37
|
+
const { client: request = client, ...requestConfig } = config;
|
26
38
|
|
27
|
-
const res = await request<
|
39
|
+
const res = await request<
|
40
|
+
AgentsSearchDeployedAgentsMutationResponse,
|
41
|
+
ResponseErrorConfig<Error>,
|
42
|
+
AgentsSearchDeployedAgentsMutationRequest
|
43
|
+
>({
|
28
44
|
method: 'POST',
|
29
45
|
url: `/v1/agents/search`,
|
30
46
|
data,
|
31
47
|
...requestConfig,
|
32
|
-
})
|
33
|
-
return res
|
48
|
+
});
|
49
|
+
return res;
|
34
50
|
}
|
35
51
|
|
36
52
|
/**
|
@@ -45,12 +61,18 @@ export function useAgentsSearchDeployedAgents<TContext>(
|
|
45
61
|
ResponseErrorConfig<Error>,
|
46
62
|
{ data?: AgentsSearchDeployedAgentsMutationRequest },
|
47
63
|
TContext
|
48
|
-
> & { client?: QueryClient }
|
49
|
-
client?: Partial<
|
50
|
-
|
64
|
+
> & { client?: QueryClient };
|
65
|
+
client?: Partial<
|
66
|
+
RequestConfig<AgentsSearchDeployedAgentsMutationRequest>
|
67
|
+
> & { client?: typeof client };
|
68
|
+
} = {}
|
51
69
|
) {
|
52
|
-
const {
|
53
|
-
|
70
|
+
const {
|
71
|
+
mutation: { client: queryClient, ...mutationOptions } = {},
|
72
|
+
client: config = {},
|
73
|
+
} = options ?? {};
|
74
|
+
const mutationKey =
|
75
|
+
mutationOptions?.mutationKey ?? agentsSearchDeployedAgentsMutationKey();
|
54
76
|
|
55
77
|
return useMutation<
|
56
78
|
ResponseConfig<AgentsSearchDeployedAgentsMutationResponse>,
|
@@ -60,11 +82,11 @@ export function useAgentsSearchDeployedAgents<TContext>(
|
|
60
82
|
>(
|
61
83
|
{
|
62
84
|
mutationFn: async ({ data }) => {
|
63
|
-
return agentsSearchDeployedAgents(data, config)
|
85
|
+
return agentsSearchDeployedAgents(data, config);
|
64
86
|
},
|
65
87
|
mutationKey,
|
66
88
|
...mutationOptions,
|
67
89
|
},
|
68
|
-
queryClient
|
69
|
-
)
|
70
|
-
}
|
90
|
+
queryClient
|
91
|
+
);
|
92
|
+
}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
* Do not edit manually.
|
4
4
|
*/
|
5
5
|
|
6
|
-
import client from '@kubb/plugin-client/clients/axios'
|
6
|
+
import client from '@kubb/plugin-client/clients/axios';
|
7
7
|
import type {
|
8
8
|
AgentsVersionAgentTemplateMutationRequest,
|
9
9
|
AgentsVersionAgentTemplateMutationResponse,
|
@@ -11,14 +11,21 @@ import type {
|
|
11
11
|
AgentsVersionAgentTemplateQueryParams,
|
12
12
|
AgentsVersionAgentTemplate404,
|
13
13
|
AgentsVersionAgentTemplate500,
|
14
|
-
} from '../../../types/agents/VersionAgentTemplate.ts'
|
15
|
-
import type {
|
16
|
-
|
17
|
-
|
14
|
+
} from '../../../types/agents/VersionAgentTemplate.ts';
|
15
|
+
import type {
|
16
|
+
RequestConfig,
|
17
|
+
ResponseConfig,
|
18
|
+
ResponseErrorConfig,
|
19
|
+
} from '@kubb/plugin-client/clients/axios';
|
20
|
+
import type { UseMutationOptions, QueryClient } from '@tanstack/react-query';
|
21
|
+
import { useMutation } from '@tanstack/react-query';
|
18
22
|
|
19
|
-
export const agentsVersionAgentTemplateMutationKey = () =>
|
23
|
+
export const agentsVersionAgentTemplateMutationKey = () =>
|
24
|
+
[{ url: '/v1/agents/{agent_id}/version-template' }] as const;
|
20
25
|
|
21
|
-
export type AgentsVersionAgentTemplateMutationKey = ReturnType<
|
26
|
+
export type AgentsVersionAgentTemplateMutationKey = ReturnType<
|
27
|
+
typeof agentsVersionAgentTemplateMutationKey
|
28
|
+
>;
|
22
29
|
|
23
30
|
/**
|
24
31
|
* @description Creates a versioned version of an agent
|
@@ -29,16 +36,26 @@ export async function agentsVersionAgentTemplate(
|
|
29
36
|
agent_id: AgentsVersionAgentTemplatePathParams['agent_id'],
|
30
37
|
data?: AgentsVersionAgentTemplateMutationRequest,
|
31
38
|
params?: AgentsVersionAgentTemplateQueryParams,
|
32
|
-
config: Partial<RequestConfig<AgentsVersionAgentTemplateMutationRequest>> & {
|
39
|
+
config: Partial<RequestConfig<AgentsVersionAgentTemplateMutationRequest>> & {
|
40
|
+
client?: typeof client;
|
41
|
+
} = {}
|
33
42
|
) {
|
34
|
-
const { client: request = client, ...requestConfig } = config
|
43
|
+
const { client: request = client, ...requestConfig } = config;
|
35
44
|
|
36
45
|
const res = await request<
|
37
46
|
AgentsVersionAgentTemplateMutationResponse,
|
38
|
-
ResponseErrorConfig<
|
47
|
+
ResponseErrorConfig<
|
48
|
+
AgentsVersionAgentTemplate404 | AgentsVersionAgentTemplate500
|
49
|
+
>,
|
39
50
|
AgentsVersionAgentTemplateMutationRequest
|
40
|
-
>({
|
41
|
-
|
51
|
+
>({
|
52
|
+
method: 'POST',
|
53
|
+
url: `/v1/agents/${agent_id}/version-template`,
|
54
|
+
params,
|
55
|
+
data,
|
56
|
+
...requestConfig,
|
57
|
+
});
|
58
|
+
return res;
|
42
59
|
}
|
43
60
|
|
44
61
|
/**
|
@@ -50,37 +67,47 @@ export function useAgentsVersionAgentTemplate<TContext>(
|
|
50
67
|
options: {
|
51
68
|
mutation?: UseMutationOptions<
|
52
69
|
ResponseConfig<AgentsVersionAgentTemplateMutationResponse>,
|
53
|
-
ResponseErrorConfig<
|
70
|
+
ResponseErrorConfig<
|
71
|
+
AgentsVersionAgentTemplate404 | AgentsVersionAgentTemplate500
|
72
|
+
>,
|
54
73
|
{
|
55
|
-
agent_id: AgentsVersionAgentTemplatePathParams['agent_id']
|
56
|
-
data?: AgentsVersionAgentTemplateMutationRequest
|
57
|
-
params?: AgentsVersionAgentTemplateQueryParams
|
74
|
+
agent_id: AgentsVersionAgentTemplatePathParams['agent_id'];
|
75
|
+
data?: AgentsVersionAgentTemplateMutationRequest;
|
76
|
+
params?: AgentsVersionAgentTemplateQueryParams;
|
58
77
|
},
|
59
78
|
TContext
|
60
|
-
> & { client?: QueryClient }
|
61
|
-
client?: Partial<
|
62
|
-
|
79
|
+
> & { client?: QueryClient };
|
80
|
+
client?: Partial<
|
81
|
+
RequestConfig<AgentsVersionAgentTemplateMutationRequest>
|
82
|
+
> & { client?: typeof client };
|
83
|
+
} = {}
|
63
84
|
) {
|
64
|
-
const {
|
65
|
-
|
85
|
+
const {
|
86
|
+
mutation: { client: queryClient, ...mutationOptions } = {},
|
87
|
+
client: config = {},
|
88
|
+
} = options ?? {};
|
89
|
+
const mutationKey =
|
90
|
+
mutationOptions?.mutationKey ?? agentsVersionAgentTemplateMutationKey();
|
66
91
|
|
67
92
|
return useMutation<
|
68
93
|
ResponseConfig<AgentsVersionAgentTemplateMutationResponse>,
|
69
|
-
ResponseErrorConfig<
|
94
|
+
ResponseErrorConfig<
|
95
|
+
AgentsVersionAgentTemplate404 | AgentsVersionAgentTemplate500
|
96
|
+
>,
|
70
97
|
{
|
71
|
-
agent_id: AgentsVersionAgentTemplatePathParams['agent_id']
|
72
|
-
data?: AgentsVersionAgentTemplateMutationRequest
|
73
|
-
params?: AgentsVersionAgentTemplateQueryParams
|
98
|
+
agent_id: AgentsVersionAgentTemplatePathParams['agent_id'];
|
99
|
+
data?: AgentsVersionAgentTemplateMutationRequest;
|
100
|
+
params?: AgentsVersionAgentTemplateQueryParams;
|
74
101
|
},
|
75
102
|
TContext
|
76
103
|
>(
|
77
104
|
{
|
78
105
|
mutationFn: async ({ agent_id, data, params }) => {
|
79
|
-
return agentsVersionAgentTemplate(agent_id, data, params, config)
|
106
|
+
return agentsVersionAgentTemplate(agent_id, data, params, config);
|
80
107
|
},
|
81
108
|
mutationKey,
|
82
109
|
...mutationOptions,
|
83
110
|
},
|
84
|
-
queryClient
|
85
|
-
)
|
86
|
-
}
|
111
|
+
queryClient
|
112
|
+
);
|
113
|
+
}
|
@@ -3,15 +3,24 @@
|
|
3
3
|
* Do not edit manually.
|
4
4
|
*/
|
5
5
|
|
6
|
-
import client from '@kubb/plugin-client/clients/axios'
|
7
|
-
import type {
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
import client from '@kubb/plugin-client/clients/axios';
|
7
|
+
import type {
|
8
|
+
CreateAgentMutationRequest,
|
9
|
+
CreateAgentMutationResponse,
|
10
|
+
CreateAgentHeaderParams,
|
11
|
+
CreateAgent422,
|
12
|
+
} from '../../types/CreateAgent.ts';
|
13
|
+
import type {
|
14
|
+
RequestConfig,
|
15
|
+
ResponseConfig,
|
16
|
+
ResponseErrorConfig,
|
17
|
+
} from '@kubb/plugin-client/clients/axios';
|
18
|
+
import type { UseMutationOptions, QueryClient } from '@tanstack/react-query';
|
19
|
+
import { useMutation } from '@tanstack/react-query';
|
11
20
|
|
12
|
-
export const createAgentMutationKey = () => [{ url: '/v1/agents/' }] as const
|
21
|
+
export const createAgentMutationKey = () => [{ url: '/v1/agents/' }] as const;
|
13
22
|
|
14
|
-
export type CreateAgentMutationKey = ReturnType<typeof createAgentMutationKey
|
23
|
+
export type CreateAgentMutationKey = ReturnType<typeof createAgentMutationKey>;
|
15
24
|
|
16
25
|
/**
|
17
26
|
* @description Create a new agent with the specified configuration.
|
@@ -21,18 +30,24 @@ export type CreateAgentMutationKey = ReturnType<typeof createAgentMutationKey>
|
|
21
30
|
export async function createAgent(
|
22
31
|
data?: CreateAgentMutationRequest,
|
23
32
|
headers?: CreateAgentHeaderParams,
|
24
|
-
config: Partial<RequestConfig<CreateAgentMutationRequest>> & {
|
33
|
+
config: Partial<RequestConfig<CreateAgentMutationRequest>> & {
|
34
|
+
client?: typeof client;
|
35
|
+
} = {}
|
25
36
|
) {
|
26
|
-
const { client: request = client, ...requestConfig } = config
|
37
|
+
const { client: request = client, ...requestConfig } = config;
|
27
38
|
|
28
|
-
const res = await request<
|
39
|
+
const res = await request<
|
40
|
+
CreateAgentMutationResponse,
|
41
|
+
ResponseErrorConfig<CreateAgent422>,
|
42
|
+
CreateAgentMutationRequest
|
43
|
+
>({
|
29
44
|
method: 'POST',
|
30
45
|
url: `/v1/agents/`,
|
31
46
|
data,
|
32
47
|
...requestConfig,
|
33
48
|
headers: { ...headers, ...requestConfig.headers },
|
34
|
-
})
|
35
|
-
return res
|
49
|
+
});
|
50
|
+
return res;
|
36
51
|
}
|
37
52
|
|
38
53
|
/**
|
@@ -47,12 +62,17 @@ export function useCreateAgent<TContext>(
|
|
47
62
|
ResponseErrorConfig<CreateAgent422>,
|
48
63
|
{ data?: CreateAgentMutationRequest; headers?: CreateAgentHeaderParams },
|
49
64
|
TContext
|
50
|
-
> & { client?: QueryClient }
|
51
|
-
client?: Partial<RequestConfig<CreateAgentMutationRequest>> & {
|
52
|
-
|
65
|
+
> & { client?: QueryClient };
|
66
|
+
client?: Partial<RequestConfig<CreateAgentMutationRequest>> & {
|
67
|
+
client?: typeof client;
|
68
|
+
};
|
69
|
+
} = {}
|
53
70
|
) {
|
54
|
-
const {
|
55
|
-
|
71
|
+
const {
|
72
|
+
mutation: { client: queryClient, ...mutationOptions } = {},
|
73
|
+
client: config = {},
|
74
|
+
} = options ?? {};
|
75
|
+
const mutationKey = mutationOptions?.mutationKey ?? createAgentMutationKey();
|
56
76
|
|
57
77
|
return useMutation<
|
58
78
|
ResponseConfig<CreateAgentMutationResponse>,
|
@@ -62,11 +82,11 @@ export function useCreateAgent<TContext>(
|
|
62
82
|
>(
|
63
83
|
{
|
64
84
|
mutationFn: async ({ data, headers }) => {
|
65
|
-
return createAgent(data, headers, config)
|
85
|
+
return createAgent(data, headers, config);
|
66
86
|
},
|
67
87
|
mutationKey,
|
68
88
|
...mutationOptions,
|
69
89
|
},
|
70
|
-
queryClient
|
71
|
-
)
|
72
|
-
}
|
90
|
+
queryClient
|
91
|
+
);
|
92
|
+
}
|