@harborclient/core 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/CHANGELOG.md +13 -0
- package/LICENSE +21 -0
- package/README.md +36 -0
- package/dist/ai/chatComposer.d.ts +12 -0
- package/dist/ai/chatComposer.d.ts.map +1 -0
- package/dist/ai/chatComposer.js +20 -0
- package/dist/ai/chatComposer.js.map +1 -0
- package/dist/ai/chatContext.d.ts +181 -0
- package/dist/ai/chatContext.d.ts.map +1 -0
- package/dist/ai/chatContext.js +168 -0
- package/dist/ai/chatContext.js.map +1 -0
- package/dist/ai/chatStepMode.d.ts +43 -0
- package/dist/ai/chatStepMode.d.ts.map +1 -0
- package/dist/ai/chatStepMode.js +64 -0
- package/dist/ai/chatStepMode.js.map +1 -0
- package/dist/ai/chatTitle.d.ts +35 -0
- package/dist/ai/chatTitle.d.ts.map +1 -0
- package/dist/ai/chatTitle.js +109 -0
- package/dist/ai/chatTitle.js.map +1 -0
- package/dist/ai/gitCommitMessage.d.ts +47 -0
- package/dist/ai/gitCommitMessage.d.ts.map +1 -0
- package/dist/ai/gitCommitMessage.js +139 -0
- package/dist/ai/gitCommitMessage.js.map +1 -0
- package/dist/ai/models.d.ts +115 -0
- package/dist/ai/models.d.ts.map +1 -0
- package/dist/ai/models.js +209 -0
- package/dist/ai/models.js.map +1 -0
- package/dist/ai/requestUpdate.d.ts +273 -0
- package/dist/ai/requestUpdate.d.ts.map +1 -0
- package/dist/ai/requestUpdate.js +274 -0
- package/dist/ai/requestUpdate.js.map +1 -0
- package/dist/ai/scriptAsk.d.ts +115 -0
- package/dist/ai/scriptAsk.d.ts.map +1 -0
- package/dist/ai/scriptAsk.js +243 -0
- package/dist/ai/scriptAsk.js.map +1 -0
- package/dist/ai/scriptReferences.d.ts +377 -0
- package/dist/ai/scriptReferences.d.ts.map +1 -0
- package/dist/ai/scriptReferences.js +787 -0
- package/dist/ai/scriptReferences.js.map +1 -0
- package/dist/ai/settings.d.ts +8 -0
- package/dist/ai/settings.d.ts.map +1 -0
- package/dist/ai/settings.js +11 -0
- package/dist/ai/settings.js.map +1 -0
- package/dist/ai/tools/ITool.d.ts +26 -0
- package/dist/ai/tools/ITool.d.ts.map +1 -0
- package/dist/ai/tools/ITool.js +2 -0
- package/dist/ai/tools/ITool.js.map +1 -0
- package/dist/ai/tools/createCollection.d.ts +164 -0
- package/dist/ai/tools/createCollection.d.ts.map +1 -0
- package/dist/ai/tools/createCollection.js +36 -0
- package/dist/ai/tools/createCollection.js.map +1 -0
- package/dist/ai/tools/createFolder.d.ts +50 -0
- package/dist/ai/tools/createFolder.d.ts.map +1 -0
- package/dist/ai/tools/createFolder.js +34 -0
- package/dist/ai/tools/createFolder.js.map +1 -0
- package/dist/ai/tools/createRequest.d.ts +210 -0
- package/dist/ai/tools/createRequest.d.ts.map +1 -0
- package/dist/ai/tools/createRequest.js +88 -0
- package/dist/ai/tools/createRequest.js.map +1 -0
- package/dist/ai/tools/getActiveRequest.d.ts +20 -0
- package/dist/ai/tools/getActiveRequest.d.ts.map +1 -0
- package/dist/ai/tools/getActiveRequest.js +16 -0
- package/dist/ai/tools/getActiveRequest.js.map +1 -0
- package/dist/ai/tools/getActiveRequestDetails.d.ts +20 -0
- package/dist/ai/tools/getActiveRequestDetails.d.ts.map +1 -0
- package/dist/ai/tools/getActiveRequestDetails.js +16 -0
- package/dist/ai/tools/getActiveRequestDetails.js.map +1 -0
- package/dist/ai/tools/getActiveResponse.d.ts +39 -0
- package/dist/ai/tools/getActiveResponse.d.ts.map +1 -0
- package/dist/ai/tools/getActiveResponse.js +30 -0
- package/dist/ai/tools/getActiveResponse.js.map +1 -0
- package/dist/ai/tools/getActiveResponseSummary.d.ts +20 -0
- package/dist/ai/tools/getActiveResponseSummary.d.ts.map +1 -0
- package/dist/ai/tools/getActiveResponseSummary.js +16 -0
- package/dist/ai/tools/getActiveResponseSummary.js.map +1 -0
- package/dist/ai/tools/getActiveTerminal.d.ts +20 -0
- package/dist/ai/tools/getActiveTerminal.d.ts.map +1 -0
- package/dist/ai/tools/getActiveTerminal.js +16 -0
- package/dist/ai/tools/getActiveTerminal.js.map +1 -0
- package/dist/ai/tools/getActiveTerminalLines.d.ts +50 -0
- package/dist/ai/tools/getActiveTerminalLines.d.ts.map +1 -0
- package/dist/ai/tools/getActiveTerminalLines.js +37 -0
- package/dist/ai/tools/getActiveTerminalLines.js.map +1 -0
- package/dist/ai/tools/getCollection.d.ts +31 -0
- package/dist/ai/tools/getCollection.d.ts.map +1 -0
- package/dist/ai/tools/getCollection.js +28 -0
- package/dist/ai/tools/getCollection.js.map +1 -0
- package/dist/ai/tools/getFolder.d.ts +31 -0
- package/dist/ai/tools/getFolder.d.ts.map +1 -0
- package/dist/ai/tools/getFolder.js +28 -0
- package/dist/ai/tools/getFolder.js.map +1 -0
- package/dist/ai/tools/getMarkdownDocument.d.ts +40 -0
- package/dist/ai/tools/getMarkdownDocument.d.ts.map +1 -0
- package/dist/ai/tools/getMarkdownDocument.js +31 -0
- package/dist/ai/tools/getMarkdownDocument.js.map +1 -0
- package/dist/ai/tools/getRequest.d.ts +31 -0
- package/dist/ai/tools/getRequest.d.ts.map +1 -0
- package/dist/ai/tools/getRequest.js +28 -0
- package/dist/ai/tools/getRequest.js.map +1 -0
- package/dist/ai/tools/getSelectedCollection.d.ts +20 -0
- package/dist/ai/tools/getSelectedCollection.d.ts.map +1 -0
- package/dist/ai/tools/getSelectedCollection.js +16 -0
- package/dist/ai/tools/getSelectedCollection.js.map +1 -0
- package/dist/ai/tools/getSidebarRequest.d.ts +20 -0
- package/dist/ai/tools/getSidebarRequest.d.ts.map +1 -0
- package/dist/ai/tools/getSidebarRequest.js +16 -0
- package/dist/ai/tools/getSidebarRequest.js.map +1 -0
- package/dist/ai/tools/gitCommits.d.ts +50 -0
- package/dist/ai/tools/gitCommits.d.ts.map +1 -0
- package/dist/ai/tools/gitCommits.js +37 -0
- package/dist/ai/tools/gitCommits.js.map +1 -0
- package/dist/ai/tools/gitDiff.d.ts +70 -0
- package/dist/ai/tools/gitDiff.d.ts.map +1 -0
- package/dist/ai/tools/gitDiff.js +49 -0
- package/dist/ai/tools/gitDiff.js.map +1 -0
- package/dist/ai/tools/gitFileDiff.d.ts +80 -0
- package/dist/ai/tools/gitFileDiff.d.ts.map +1 -0
- package/dist/ai/tools/gitFileDiff.js +55 -0
- package/dist/ai/tools/gitFileDiff.js.map +1 -0
- package/dist/ai/tools/gitFileInfo.d.ts +60 -0
- package/dist/ai/tools/gitFileInfo.d.ts.map +1 -0
- package/dist/ai/tools/gitFileInfo.js +43 -0
- package/dist/ai/tools/gitFileInfo.js.map +1 -0
- package/dist/ai/tools/gitRepoInfo.d.ts +40 -0
- package/dist/ai/tools/gitRepoInfo.d.ts.map +1 -0
- package/dist/ai/tools/gitRepoInfo.js +31 -0
- package/dist/ai/tools/gitRepoInfo.js.map +1 -0
- package/dist/ai/tools/index.d.ts +1260 -0
- package/dist/ai/tools/index.d.ts.map +1 -0
- package/dist/ai/tools/index.js +100 -0
- package/dist/ai/tools/index.js.map +1 -0
- package/dist/ai/tools/listCollections.d.ts +20 -0
- package/dist/ai/tools/listCollections.d.ts.map +1 -0
- package/dist/ai/tools/listCollections.js +16 -0
- package/dist/ai/tools/listCollections.js.map +1 -0
- package/dist/ai/tools/listEnvironments.d.ts +20 -0
- package/dist/ai/tools/listEnvironments.d.ts.map +1 -0
- package/dist/ai/tools/listEnvironments.js +16 -0
- package/dist/ai/tools/listEnvironments.js.map +1 -0
- package/dist/ai/tools/listRequests.d.ts +40 -0
- package/dist/ai/tools/listRequests.d.ts.map +1 -0
- package/dist/ai/tools/listRequests.js +28 -0
- package/dist/ai/tools/listRequests.js.map +1 -0
- package/dist/ai/tools/queryResponseBody.d.ts +50 -0
- package/dist/ai/tools/queryResponseBody.d.ts.map +1 -0
- package/dist/ai/tools/queryResponseBody.js +37 -0
- package/dist/ai/tools/queryResponseBody.js.map +1 -0
- package/dist/ai/tools/schemas.d.ts +152 -0
- package/dist/ai/tools/schemas.d.ts.map +1 -0
- package/dist/ai/tools/schemas.js +81 -0
- package/dist/ai/tools/schemas.js.map +1 -0
- package/dist/ai/tools/searchDocs.d.ts +64 -0
- package/dist/ai/tools/searchDocs.d.ts.map +1 -0
- package/dist/ai/tools/searchDocs.js +44 -0
- package/dist/ai/tools/searchDocs.js.map +1 -0
- package/dist/ai/tools/sendActiveRequest.d.ts +39 -0
- package/dist/ai/tools/sendActiveRequest.d.ts.map +1 -0
- package/dist/ai/tools/sendActiveRequest.js +30 -0
- package/dist/ai/tools/sendActiveRequest.js.map +1 -0
- package/dist/ai/tools/setActiveEnvironment.d.ts +49 -0
- package/dist/ai/tools/setActiveEnvironment.d.ts.map +1 -0
- package/dist/ai/tools/setActiveEnvironment.js +36 -0
- package/dist/ai/tools/setActiveEnvironment.js.map +1 -0
- package/dist/ai/tools/systemPrompt.d.ts +5 -0
- package/dist/ai/tools/systemPrompt.d.ts.map +1 -0
- package/dist/ai/tools/systemPrompt.js +34 -0
- package/dist/ai/tools/systemPrompt.js.map +1 -0
- package/dist/ai/tools/terminalExec.d.ts +40 -0
- package/dist/ai/tools/terminalExec.d.ts.map +1 -0
- package/dist/ai/tools/terminalExec.js +31 -0
- package/dist/ai/tools/terminalExec.js.map +1 -0
- package/dist/ai/tools/types.d.ts +68 -0
- package/dist/ai/tools/types.d.ts.map +1 -0
- package/dist/ai/tools/types.js +2 -0
- package/dist/ai/tools/types.js.map +1 -0
- package/dist/ai/tools/updateActiveRequest.d.ts +279 -0
- package/dist/ai/tools/updateActiveRequest.d.ts.map +1 -0
- package/dist/ai/tools/updateActiveRequest.js +175 -0
- package/dist/ai/tools/updateActiveRequest.js.map +1 -0
- package/dist/ai/tools/updateRequestScript.d.ts +93 -0
- package/dist/ai/tools/updateRequestScript.d.ts.map +1 -0
- package/dist/ai/tools/updateRequestScript.js +57 -0
- package/dist/ai/tools/updateRequestScript.js.map +1 -0
- package/dist/auth.d.ts +192 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +294 -0
- package/dist/auth.js.map +1 -0
- package/dist/bodyRawSend.d.ts +25 -0
- package/dist/bodyRawSend.d.ts.map +1 -0
- package/dist/bodyRawSend.js +61 -0
- package/dist/bodyRawSend.js.map +1 -0
- package/dist/builtinThemes.d.ts +33 -0
- package/dist/builtinThemes.d.ts.map +1 -0
- package/dist/builtinThemes.js +40 -0
- package/dist/builtinThemes.js.map +1 -0
- package/dist/codeEditorSettings.d.ts +2 -0
- package/dist/codeEditorSettings.d.ts.map +1 -0
- package/dist/codeEditorSettings.js +2 -0
- package/dist/codeEditorSettings.js.map +1 -0
- package/dist/collectionContainerOrder.d.ts +42 -0
- package/dist/collectionContainerOrder.d.ts.map +1 -0
- package/dist/collectionContainerOrder.js +62 -0
- package/dist/collectionContainerOrder.js.map +1 -0
- package/dist/collectionRunner.d.ts +510 -0
- package/dist/collectionRunner.d.ts.map +1 -0
- package/dist/collectionRunner.js +296 -0
- package/dist/collectionRunner.js.map +1 -0
- package/dist/contrast.d.ts +16 -0
- package/dist/contrast.d.ts.map +1 -0
- package/dist/contrast.js +51 -0
- package/dist/contrast.js.map +1 -0
- package/dist/cookies/CookieJar.d.ts +151 -0
- package/dist/cookies/CookieJar.d.ts.map +1 -0
- package/dist/cookies/CookieJar.js +318 -0
- package/dist/cookies/CookieJar.js.map +1 -0
- package/dist/deepLink.d.ts +98 -0
- package/dist/deepLink.d.ts.map +1 -0
- package/dist/deepLink.js +211 -0
- package/dist/deepLink.js.map +1 -0
- package/dist/environmentVariables.d.ts +34 -0
- package/dist/environmentVariables.d.ts.map +1 -0
- package/dist/environmentVariables.js +56 -0
- package/dist/environmentVariables.js.map +1 -0
- package/dist/filestore/index.d.ts +16 -0
- package/dist/filestore/index.d.ts.map +1 -0
- package/dist/filestore/index.js +16 -0
- package/dist/filestore/index.js.map +1 -0
- package/dist/filestore/parse.d.ts +44 -0
- package/dist/filestore/parse.d.ts.map +1 -0
- package/dist/filestore/parse.js +80 -0
- package/dist/filestore/parse.js.map +1 -0
- package/dist/filestore/schemas.d.ts +1612 -0
- package/dist/filestore/schemas.d.ts.map +1 -0
- package/dist/filestore/schemas.js +586 -0
- package/dist/filestore/schemas.js.map +1 -0
- package/dist/filestore/snippet.d.ts +10 -0
- package/dist/filestore/snippet.d.ts.map +1 -0
- package/dist/filestore/snippet.js +43 -0
- package/dist/filestore/snippet.js.map +1 -0
- package/dist/filestore/storageSchemas.d.ts +123 -0
- package/dist/filestore/storageSchemas.d.ts.map +1 -0
- package/dist/filestore/storageSchemas.js +94 -0
- package/dist/filestore/storageSchemas.js.map +1 -0
- package/dist/filestore/stringify.d.ts +59 -0
- package/dist/filestore/stringify.d.ts.map +1 -0
- package/dist/filestore/stringify.js +103 -0
- package/dist/filestore/stringify.js.map +1 -0
- package/dist/filestore/validate.d.ts +60 -0
- package/dist/filestore/validate.d.ts.map +1 -0
- package/dist/filestore/validate.js +118 -0
- package/dist/filestore/validate.js.map +1 -0
- package/dist/filestore/variables.d.ts +9 -0
- package/dist/filestore/variables.d.ts.map +1 -0
- package/dist/filestore/variables.js +15 -0
- package/dist/filestore/variables.js.map +1 -0
- package/dist/formData.d.ts +2 -0
- package/dist/formData.d.ts.map +1 -0
- package/dist/formData.js +2 -0
- package/dist/formData.js.map +1 -0
- package/dist/generalSettings.d.ts +22 -0
- package/dist/generalSettings.d.ts.map +1 -0
- package/dist/generalSettings.js +188 -0
- package/dist/generalSettings.js.map +1 -0
- package/dist/gitHttpErrors.d.ts +125 -0
- package/dist/gitHttpErrors.d.ts.map +1 -0
- package/dist/gitHttpErrors.js +271 -0
- package/dist/gitHttpErrors.js.map +1 -0
- package/dist/gitSidebarExpansion.d.ts +22 -0
- package/dist/gitSidebarExpansion.d.ts.map +1 -0
- package/dist/gitSidebarExpansion.js +16 -0
- package/dist/gitSidebarExpansion.js.map +1 -0
- package/dist/gitUrl.d.ts +39 -0
- package/dist/gitUrl.d.ts.map +1 -0
- package/dist/gitUrl.js +105 -0
- package/dist/gitUrl.js.map +1 -0
- package/dist/harborclientExport.d.ts +23 -0
- package/dist/harborclientExport.d.ts.map +1 -0
- package/dist/harborclientExport.js +39 -0
- package/dist/harborclientExport.js.map +1 -0
- package/dist/highContrastPalette.d.ts +91 -0
- package/dist/highContrastPalette.d.ts.map +1 -0
- package/dist/highContrastPalette.js +118 -0
- package/dist/highContrastPalette.js.map +1 -0
- package/dist/httpHeaders.d.ts +2 -0
- package/dist/httpHeaders.d.ts.map +1 -0
- package/dist/httpHeaders.js +2 -0
- package/dist/httpHeaders.js.map +1 -0
- package/dist/httpMethod.d.ts +9 -0
- package/dist/httpMethod.d.ts.map +1 -0
- package/dist/httpMethod.js +23 -0
- package/dist/httpMethod.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/ICookieJar.d.ts +41 -0
- package/dist/interfaces/ICookieJar.d.ts.map +1 -0
- package/dist/interfaces/ICookieJar.js +2 -0
- package/dist/interfaces/ICookieJar.js.map +1 -0
- package/dist/interfaces/IScriptRunner.d.ts +20 -0
- package/dist/interfaces/IScriptRunner.d.ts.map +1 -0
- package/dist/interfaces/IScriptRunner.js +2 -0
- package/dist/interfaces/IScriptRunner.js.map +1 -0
- package/dist/interfaces/PluginHooks.d.ts +24 -0
- package/dist/interfaces/PluginHooks.d.ts.map +1 -0
- package/dist/interfaces/PluginHooks.js +2 -0
- package/dist/interfaces/PluginHooks.js.map +1 -0
- package/dist/interfaces/SettingsProvider.d.ts +20 -0
- package/dist/interfaces/SettingsProvider.d.ts.map +1 -0
- package/dist/interfaces/SettingsProvider.js +2 -0
- package/dist/interfaces/SettingsProvider.js.map +1 -0
- package/dist/interfaces/index.d.ts +5 -0
- package/dist/interfaces/index.d.ts.map +1 -0
- package/dist/interfaces/index.js +2 -0
- package/dist/interfaces/index.js.map +1 -0
- package/dist/mcpToolNames.d.ts +27 -0
- package/dist/mcpToolNames.d.ts.map +1 -0
- package/dist/mcpToolNames.js +41 -0
- package/dist/mcpToolNames.js.map +1 -0
- package/dist/multipartRaw.d.ts +85 -0
- package/dist/multipartRaw.d.ts.map +1 -0
- package/dist/multipartRaw.js +244 -0
- package/dist/multipartRaw.js.map +1 -0
- package/dist/network/executeHttpSend.d.ts +39 -0
- package/dist/network/executeHttpSend.d.ts.map +1 -0
- package/dist/network/executeHttpSend.js +60 -0
- package/dist/network/executeHttpSend.js.map +1 -0
- package/dist/pageSidebarSection.d.ts +35 -0
- package/dist/pageSidebarSection.d.ts.map +1 -0
- package/dist/pageSidebarSection.js +76 -0
- package/dist/pageSidebarSection.js.map +1 -0
- package/dist/parseJson.d.ts +8 -0
- package/dist/parseJson.d.ts.map +1 -0
- package/dist/parseJson.js +17 -0
- package/dist/parseJson.js.map +1 -0
- package/dist/plugin/catalog.d.ts +229 -0
- package/dist/plugin/catalog.d.ts.map +1 -0
- package/dist/plugin/catalog.js +248 -0
- package/dist/plugin/catalog.js.map +1 -0
- package/dist/plugin/catalogCategories.d.ts +30 -0
- package/dist/plugin/catalogCategories.d.ts.map +1 -0
- package/dist/plugin/catalogCategories.js +88 -0
- package/dist/plugin/catalogCategories.js.map +1 -0
- package/dist/plugin/customThemeExport.d.ts +95 -0
- package/dist/plugin/customThemeExport.d.ts.map +1 -0
- package/dist/plugin/customThemeExport.js +264 -0
- package/dist/plugin/customThemeExport.js.map +1 -0
- package/dist/plugin/databaseTypes.d.ts +90 -0
- package/dist/plugin/databaseTypes.d.ts.map +1 -0
- package/dist/plugin/databaseTypes.js +2 -0
- package/dist/plugin/databaseTypes.js.map +1 -0
- package/dist/plugin/githubRaw.d.ts +54 -0
- package/dist/plugin/githubRaw.d.ts.map +1 -0
- package/dist/plugin/githubRaw.js +138 -0
- package/dist/plugin/githubRaw.js.map +1 -0
- package/dist/plugin/httpRequest.d.ts +17 -0
- package/dist/plugin/httpRequest.d.ts.map +1 -0
- package/dist/plugin/httpRequest.js +45 -0
- package/dist/plugin/httpRequest.js.map +1 -0
- package/dist/plugin/importHandlers.d.ts +65 -0
- package/dist/plugin/importHandlers.d.ts.map +1 -0
- package/dist/plugin/importHandlers.js +2 -0
- package/dist/plugin/importHandlers.js.map +1 -0
- package/dist/plugin/pluginDatabaseApi.d.ts +39 -0
- package/dist/plugin/pluginDatabaseApi.d.ts.map +1 -0
- package/dist/plugin/pluginDatabaseApi.js +45 -0
- package/dist/plugin/pluginDatabaseApi.js.map +1 -0
- package/dist/plugin/pluginSurface.d.ts +20 -0
- package/dist/plugin/pluginSurface.d.ts.map +1 -0
- package/dist/plugin/pluginSurface.js +31 -0
- package/dist/plugin/pluginSurface.js.map +1 -0
- package/dist/plugin/stripPluginScreenshotImagesFromMarkdown.d.ts +9 -0
- package/dist/plugin/stripPluginScreenshotImagesFromMarkdown.d.ts.map +1 -0
- package/dist/plugin/stripPluginScreenshotImagesFromMarkdown.js +132 -0
- package/dist/plugin/stripPluginScreenshotImagesFromMarkdown.js.map +1 -0
- package/dist/plugin/themeCategory.d.ts +62 -0
- package/dist/plugin/themeCategory.d.ts.map +1 -0
- package/dist/plugin/themeCategory.js +84 -0
- package/dist/plugin/themeCategory.js.map +1 -0
- package/dist/plugin/types.d.ts +415 -0
- package/dist/plugin/types.d.ts.map +1 -0
- package/dist/plugin/types.js +81 -0
- package/dist/plugin/types.js.map +1 -0
- package/dist/queryParams.d.ts +63 -0
- package/dist/queryParams.d.ts.map +1 -0
- package/dist/queryParams.js +170 -0
- package/dist/queryParams.js.map +1 -0
- package/dist/requestEditorTab.d.ts +24 -0
- package/dist/requestEditorTab.d.ts.map +1 -0
- package/dist/requestEditorTab.js +44 -0
- package/dist/requestEditorTab.js.map +1 -0
- package/dist/requestRunner/RequestRunner.d.ts +39 -0
- package/dist/requestRunner/RequestRunner.d.ts.map +1 -0
- package/dist/requestRunner/RequestRunner.js +298 -0
- package/dist/requestRunner/RequestRunner.js.map +1 -0
- package/dist/requestRunner/helpers.d.ts +52 -0
- package/dist/requestRunner/helpers.d.ts.map +1 -0
- package/dist/requestRunner/helpers.js +195 -0
- package/dist/requestRunner/helpers.js.map +1 -0
- package/dist/requestRunner/index.d.ts +7 -0
- package/dist/requestRunner/index.d.ts.map +1 -0
- package/dist/requestRunner/index.js +6 -0
- package/dist/requestRunner/index.js.map +1 -0
- package/dist/requestRunner/types.d.ts +148 -0
- package/dist/requestRunner/types.d.ts.map +1 -0
- package/dist/requestRunner/types.js +2 -0
- package/dist/requestRunner/types.js.map +1 -0
- package/dist/requestTags.d.ts +22 -0
- package/dist/requestTags.d.ts.map +1 -0
- package/dist/requestTags.js +34 -0
- package/dist/requestTags.js.map +1 -0
- package/dist/scriptRefs.d.ts +190 -0
- package/dist/scriptRefs.d.ts.map +1 -0
- package/dist/scriptRefs.js +387 -0
- package/dist/scriptRefs.js.map +1 -0
- package/dist/scriptStage.d.ts +118 -0
- package/dist/scriptStage.d.ts.map +1 -0
- package/dist/scriptStage.js +204 -0
- package/dist/scriptStage.js.map +1 -0
- package/dist/scripting/scriptApi.d.ts +59 -0
- package/dist/scripting/scriptApi.d.ts.map +1 -0
- package/dist/scripting/scriptApi.js +692 -0
- package/dist/scripting/scriptApi.js.map +1 -0
- package/dist/scripting/scriptAssertionCompat.d.ts +21 -0
- package/dist/scripting/scriptAssertionCompat.d.ts.map +1 -0
- package/dist/scripting/scriptAssertionCompat.js +58 -0
- package/dist/scripting/scriptAssertionCompat.js.map +1 -0
- package/dist/scripting/scriptEvaluator.d.ts +42 -0
- package/dist/scripting/scriptEvaluator.d.ts.map +1 -0
- package/dist/scripting/scriptEvaluator.js +179 -0
- package/dist/scripting/scriptEvaluator.js.map +1 -0
- package/dist/scripting/scriptExpect.d.ts +3 -0
- package/dist/scripting/scriptExpect.d.ts.map +1 -0
- package/dist/scripting/scriptExpect.js +14 -0
- package/dist/scripting/scriptExpect.js.map +1 -0
- package/dist/scripting/scriptFileOperations.d.ts +172 -0
- package/dist/scripting/scriptFileOperations.d.ts.map +1 -0
- package/dist/scripting/scriptFileOperations.js +271 -0
- package/dist/scripting/scriptFileOperations.js.map +1 -0
- package/dist/scripting/scriptResponseAssertions.d.ts +40 -0
- package/dist/scripting/scriptResponseAssertions.d.ts.map +1 -0
- package/dist/scripting/scriptResponseAssertions.js +249 -0
- package/dist/scripting/scriptResponseAssertions.js.map +1 -0
- package/dist/scripting/scriptResponseDocument.d.ts +47 -0
- package/dist/scripting/scriptResponseDocument.d.ts.map +1 -0
- package/dist/scripting/scriptResponseDocument.js +49 -0
- package/dist/scripting/scriptResponseDocument.js.map +1 -0
- package/dist/scripting/scriptRunner.d.ts +2 -0
- package/dist/scripting/scriptRunner.d.ts.map +1 -0
- package/dist/scripting/scriptRunner.js +132 -0
- package/dist/scripting/scriptRunner.js.map +1 -0
- package/dist/scripting/scriptSnippetBundler.d.ts +46 -0
- package/dist/scripting/scriptSnippetBundler.d.ts.map +1 -0
- package/dist/scripting/scriptSnippetBundler.js +136 -0
- package/dist/scripting/scriptSnippetBundler.js.map +1 -0
- package/dist/search/actions.d.ts +44 -0
- package/dist/search/actions.d.ts.map +1 -0
- package/dist/search/actions.js +120 -0
- package/dist/search/actions.js.map +1 -0
- package/dist/search/index.d.ts +13 -0
- package/dist/search/index.d.ts.map +1 -0
- package/dist/search/index.js +13 -0
- package/dist/search/index.js.map +1 -0
- package/dist/search/installedPlugins.d.ts +31 -0
- package/dist/search/installedPlugins.d.ts.map +1 -0
- package/dist/search/installedPlugins.js +73 -0
- package/dist/search/installedPlugins.js.map +1 -0
- package/dist/search/oramaIndex.d.ts +47 -0
- package/dist/search/oramaIndex.d.ts.map +1 -0
- package/dist/search/oramaIndex.js +56 -0
- package/dist/search/oramaIndex.js.map +1 -0
- package/dist/search/pagesCatalog.d.ts +34 -0
- package/dist/search/pagesCatalog.d.ts.map +1 -0
- package/dist/search/pagesCatalog.js +37 -0
- package/dist/search/pagesCatalog.js.map +1 -0
- package/dist/search/plugins.d.ts +40 -0
- package/dist/search/plugins.d.ts.map +1 -0
- package/dist/search/plugins.js +79 -0
- package/dist/search/plugins.js.map +1 -0
- package/dist/search/settings.d.ts +29 -0
- package/dist/search/settings.d.ts.map +1 -0
- package/dist/search/settings.js +63 -0
- package/dist/search/settings.js.map +1 -0
- package/dist/search/settingsCatalog.d.ts +112 -0
- package/dist/search/settingsCatalog.d.ts.map +1 -0
- package/dist/search/settingsCatalog.js +426 -0
- package/dist/search/settingsCatalog.js.map +1 -0
- package/dist/search/sidebar.d.ts +139 -0
- package/dist/search/sidebar.d.ts.map +1 -0
- package/dist/search/sidebar.js +342 -0
- package/dist/search/sidebar.js.map +1 -0
- package/dist/search/slashCommands.d.ts +45 -0
- package/dist/search/slashCommands.d.ts.map +1 -0
- package/dist/search/slashCommands.js +71 -0
- package/dist/search/slashCommands.js.map +1 -0
- package/dist/search/snippets.d.ts +48 -0
- package/dist/search/snippets.d.ts.map +1 -0
- package/dist/search/snippets.js +114 -0
- package/dist/search/snippets.js.map +1 -0
- package/dist/search/types.d.ts +60 -0
- package/dist/search/types.d.ts.map +1 -0
- package/dist/search/types.js +49 -0
- package/dist/search/types.js.map +1 -0
- package/dist/search/unified.d.ts +57 -0
- package/dist/search/unified.d.ts.map +1 -0
- package/dist/search/unified.js +153 -0
- package/dist/search/unified.js.map +1 -0
- package/dist/shortcuts.d.ts +174 -0
- package/dist/shortcuts.d.ts.map +1 -0
- package/dist/shortcuts.js +1040 -0
- package/dist/shortcuts.js.map +1 -0
- package/dist/sidebarColor.d.ts +16 -0
- package/dist/sidebarColor.d.ts.map +1 -0
- package/dist/sidebarColor.js +21 -0
- package/dist/sidebarColor.js.map +1 -0
- package/dist/sidebarExpansion.d.ts +12 -0
- package/dist/sidebarExpansion.d.ts.map +1 -0
- package/dist/sidebarExpansion.js +116 -0
- package/dist/sidebarExpansion.js.map +1 -0
- package/dist/snippet/catalog.d.ts +120 -0
- package/dist/snippet/catalog.d.ts.map +1 -0
- package/dist/snippet/catalog.js +105 -0
- package/dist/snippet/catalog.js.map +1 -0
- package/dist/snippet/types.d.ts +90 -0
- package/dist/snippet/types.d.ts.map +1 -0
- package/dist/snippet/types.js +2 -0
- package/dist/snippet/types.js.map +1 -0
- package/dist/snippetBundle.d.ts +21 -0
- package/dist/snippetBundle.d.ts.map +1 -0
- package/dist/snippetBundle.js +107 -0
- package/dist/snippetBundle.js.map +1 -0
- package/dist/snippetImport.d.ts +19 -0
- package/dist/snippetImport.d.ts.map +1 -0
- package/dist/snippetImport.js +34 -0
- package/dist/snippetImport.js.map +1 -0
- package/dist/snippetScope.d.ts +42 -0
- package/dist/snippetScope.d.ts.map +1 -0
- package/dist/snippetScope.js +50 -0
- package/dist/snippetScope.js.map +1 -0
- package/dist/storage/IStorage.d.ts +375 -0
- package/dist/storage/IStorage.d.ts.map +1 -0
- package/dist/storage/IStorage.js +2 -0
- package/dist/storage/IStorage.js.map +1 -0
- package/dist/themes.d.ts +24 -0
- package/dist/themes.d.ts.map +1 -0
- package/dist/themes.js +10 -0
- package/dist/themes.js.map +1 -0
- package/dist/types/ai.d.ts +304 -0
- package/dist/types/ai.d.ts.map +1 -0
- package/dist/types/ai.js +2 -0
- package/dist/types/ai.js.map +1 -0
- package/dist/types/api/backup.d.ts +27 -0
- package/dist/types/api/backup.d.ts.map +1 -0
- package/dist/types/api/backup.js +2 -0
- package/dist/types/api/backup.js.map +1 -0
- package/dist/types/api/chats.d.ts +88 -0
- package/dist/types/api/chats.d.ts.map +1 -0
- package/dist/types/api/chats.js +2 -0
- package/dist/types/api/chats.js.map +1 -0
- package/dist/types/api/collections.d.ts +251 -0
- package/dist/types/api/collections.d.ts.map +1 -0
- package/dist/types/api/collections.js +2 -0
- package/dist/types/api/collections.js.map +1 -0
- package/dist/types/api/customThemes.d.ts +68 -0
- package/dist/types/api/customThemes.d.ts.map +1 -0
- package/dist/types/api/customThemes.js +2 -0
- package/dist/types/api/customThemes.js.map +1 -0
- package/dist/types/api/docs.d.ts +14 -0
- package/dist/types/api/docs.d.ts.map +1 -0
- package/dist/types/api/docs.js +2 -0
- package/dist/types/api/docs.js.map +1 -0
- package/dist/types/api/documents.d.ts +51 -0
- package/dist/types/api/documents.d.ts.map +1 -0
- package/dist/types/api/documents.js +2 -0
- package/dist/types/api/documents.js.map +1 -0
- package/dist/types/api/environments.d.ts +57 -0
- package/dist/types/api/environments.d.ts.map +1 -0
- package/dist/types/api/environments.js +2 -0
- package/dist/types/api/environments.js.map +1 -0
- package/dist/types/api/git.d.ts +392 -0
- package/dist/types/api/git.d.ts.map +1 -0
- package/dist/types/api/git.js +2 -0
- package/dist/types/api/git.js.map +1 -0
- package/dist/types/api/http.d.ts +47 -0
- package/dist/types/api/http.d.ts.map +1 -0
- package/dist/types/api/http.js +2 -0
- package/dist/types/api/http.js.map +1 -0
- package/dist/types/api/index.d.ts +28 -0
- package/dist/types/api/index.d.ts.map +1 -0
- package/dist/types/api/index.js +2 -0
- package/dist/types/api/index.js.map +1 -0
- package/dist/types/api/mcp.d.ts +77 -0
- package/dist/types/api/mcp.d.ts.map +1 -0
- package/dist/types/api/mcp.js +2 -0
- package/dist/types/api/mcp.js.map +1 -0
- package/dist/types/api/plugins.d.ts +338 -0
- package/dist/types/api/plugins.d.ts.map +1 -0
- package/dist/types/api/plugins.js +2 -0
- package/dist/types/api/plugins.js.map +1 -0
- package/dist/types/api/requestHistory.d.ts +27 -0
- package/dist/types/api/requestHistory.d.ts.map +1 -0
- package/dist/types/api/requestHistory.js +2 -0
- package/dist/types/api/requestHistory.js.map +1 -0
- package/dist/types/api/requests.d.ts +35 -0
- package/dist/types/api/requests.d.ts.map +1 -0
- package/dist/types/api/requests.js +2 -0
- package/dist/types/api/requests.js.map +1 -0
- package/dist/types/api/settings.d.ts +163 -0
- package/dist/types/api/settings.d.ts.map +1 -0
- package/dist/types/api/settings.js +2 -0
- package/dist/types/api/settings.js.map +1 -0
- package/dist/types/api/sharing.d.ts +68 -0
- package/dist/types/api/sharing.d.ts.map +1 -0
- package/dist/types/api/sharing.js +2 -0
- package/dist/types/api/sharing.js.map +1 -0
- package/dist/types/api/snippets.d.ts +159 -0
- package/dist/types/api/snippets.d.ts.map +1 -0
- package/dist/types/api/snippets.js +2 -0
- package/dist/types/api/snippets.js.map +1 -0
- package/dist/types/api/storage.d.ts +57 -0
- package/dist/types/api/storage.d.ts.map +1 -0
- package/dist/types/api/storage.js +2 -0
- package/dist/types/api/storage.js.map +1 -0
- package/dist/types/api/tabGroup.d.ts +43 -0
- package/dist/types/api/tabGroup.d.ts.map +1 -0
- package/dist/types/api/tabGroup.js +2 -0
- package/dist/types/api/tabGroup.js.map +1 -0
- package/dist/types/api/teamHub.d.ts +225 -0
- package/dist/types/api/teamHub.d.ts.map +1 -0
- package/dist/types/api/teamHub.js +2 -0
- package/dist/types/api/teamHub.js.map +1 -0
- package/dist/types/api/terminal.d.ts +101 -0
- package/dist/types/api/terminal.d.ts.map +1 -0
- package/dist/types/api/terminal.js +2 -0
- package/dist/types/api/terminal.js.map +1 -0
- package/dist/types/api/trash.d.ts +27 -0
- package/dist/types/api/trash.d.ts.map +1 -0
- package/dist/types/api/trash.js +2 -0
- package/dist/types/api/trash.js.map +1 -0
- package/dist/types/api/window.d.ts +251 -0
- package/dist/types/api/window.d.ts.map +1 -0
- package/dist/types/api/window.js +2 -0
- package/dist/types/api/window.js.map +1 -0
- package/dist/types/app.d.ts +83 -0
- package/dist/types/app.d.ts.map +1 -0
- package/dist/types/app.js +2 -0
- package/dist/types/app.js.map +1 -0
- package/dist/types/collection.d.ts +559 -0
- package/dist/types/collection.d.ts.map +1 -0
- package/dist/types/collection.js +2 -0
- package/dist/types/collection.js.map +1 -0
- package/dist/types/common.d.ts +23 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/common.js +2 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/customTheme.d.ts +163 -0
- package/dist/types/customTheme.d.ts.map +1 -0
- package/dist/types/customTheme.js +311 -0
- package/dist/types/customTheme.js.map +1 -0
- package/dist/types/environment.d.ts +64 -0
- package/dist/types/environment.d.ts.map +1 -0
- package/dist/types/environment.js +2 -0
- package/dist/types/environment.js.map +1 -0
- package/dist/types/index.d.ts +21 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +20 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/mcp.d.ts +153 -0
- package/dist/types/mcp.d.ts.map +1 -0
- package/dist/types/mcp.js +2 -0
- package/dist/types/mcp.js.map +1 -0
- package/dist/types/request.d.ts +294 -0
- package/dist/types/request.d.ts.map +1 -0
- package/dist/types/request.js +2 -0
- package/dist/types/request.js.map +1 -0
- package/dist/types/requestHistory.d.ts +88 -0
- package/dist/types/requestHistory.d.ts.map +1 -0
- package/dist/types/requestHistory.js +5 -0
- package/dist/types/requestHistory.js.map +1 -0
- package/dist/types/script.d.ts +366 -0
- package/dist/types/script.d.ts.map +1 -0
- package/dist/types/script.js +34 -0
- package/dist/types/script.js.map +1 -0
- package/dist/types/settings.d.ts +340 -0
- package/dist/types/settings.d.ts.map +1 -0
- package/dist/types/settings.js +3 -0
- package/dist/types/settings.js.map +1 -0
- package/dist/types/sharing.d.ts +87 -0
- package/dist/types/sharing.d.ts.map +1 -0
- package/dist/types/sharing.js +2 -0
- package/dist/types/sharing.js.map +1 -0
- package/dist/types/snippet.d.ts +150 -0
- package/dist/types/snippet.d.ts.map +1 -0
- package/dist/types/snippet.js +2 -0
- package/dist/types/snippet.js.map +1 -0
- package/dist/types/storage.d.ts +846 -0
- package/dist/types/storage.d.ts.map +1 -0
- package/dist/types/storage.js +2 -0
- package/dist/types/storage.js.map +1 -0
- package/dist/types/tabGroup.d.ts +108 -0
- package/dist/types/tabGroup.d.ts.map +1 -0
- package/dist/types/tabGroup.js +26 -0
- package/dist/types/tabGroup.js.map +1 -0
- package/dist/types/teamHub.d.ts +690 -0
- package/dist/types/teamHub.d.ts.map +1 -0
- package/dist/types/teamHub.js +2 -0
- package/dist/types/teamHub.js.map +1 -0
- package/dist/types/trash.d.ts +63 -0
- package/dist/types/trash.d.ts.map +1 -0
- package/dist/types/trash.js +2 -0
- package/dist/types/trash.js.map +1 -0
- package/dist/types/window.d.ts +14 -0
- package/dist/types/window.d.ts.map +1 -0
- package/dist/types/window.js +2 -0
- package/dist/types/window.js.map +1 -0
- package/dist/types.d.ts +7 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/urlencoded.d.ts +2 -0
- package/dist/urlencoded.d.ts.map +1 -0
- package/dist/urlencoded.js +2 -0
- package/dist/urlencoded.js.map +1 -0
- package/dist/urlencodedRaw.d.ts +23 -0
- package/dist/urlencodedRaw.d.ts.map +1 -0
- package/dist/urlencodedRaw.js +60 -0
- package/dist/urlencodedRaw.js.map +1 -0
- package/dist/userAgent.d.ts +132 -0
- package/dist/userAgent.d.ts.map +1 -0
- package/dist/userAgent.js +178 -0
- package/dist/userAgent.js.map +1 -0
- package/dist/zoomPresets.d.ts +38 -0
- package/dist/zoomPresets.d.ts.map +1 -0
- package/dist/zoomPresets.js +67 -0
- package/dist/zoomPresets.js.map +1 -0
- package/package.json +92 -0
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { type AuthConfig } from '../auth';
|
|
2
|
+
import type { BodyType, HttpMethod, KeyValue } from '../types/common';
|
|
3
|
+
import type { ScriptRef } from '../types/script';
|
|
4
|
+
/**
|
|
5
|
+
* Merge mode for key-value lists such as headers, params, and cookies.
|
|
6
|
+
*/
|
|
7
|
+
export type KeyValueListMode = 'merge' | 'replace';
|
|
8
|
+
/**
|
|
9
|
+
* Replace or append mode for pre/post request script fields.
|
|
10
|
+
*/
|
|
11
|
+
export type ScriptUpdateMode = 'replace' | 'append';
|
|
12
|
+
/**
|
|
13
|
+
* Request draft fields the AI update tool can modify.
|
|
14
|
+
*/
|
|
15
|
+
export interface AiRequestDraft {
|
|
16
|
+
/**
|
|
17
|
+
* Display name for the request tab.
|
|
18
|
+
*/
|
|
19
|
+
name: string;
|
|
20
|
+
/**
|
|
21
|
+
* HTTP method for the request.
|
|
22
|
+
*/
|
|
23
|
+
method: HttpMethod;
|
|
24
|
+
/**
|
|
25
|
+
* Request URL including optional query string and hash.
|
|
26
|
+
*/
|
|
27
|
+
url: string;
|
|
28
|
+
/**
|
|
29
|
+
* Request headers table rows.
|
|
30
|
+
*/
|
|
31
|
+
headers: KeyValue[];
|
|
32
|
+
/**
|
|
33
|
+
* Query params table rows.
|
|
34
|
+
*/
|
|
35
|
+
params: KeyValue[];
|
|
36
|
+
/**
|
|
37
|
+
* Request-level authorization settings.
|
|
38
|
+
*/
|
|
39
|
+
auth: AuthConfig;
|
|
40
|
+
/**
|
|
41
|
+
* Request-level User-Agent override; empty inherits folder → collection → global.
|
|
42
|
+
*/
|
|
43
|
+
userAgent: string;
|
|
44
|
+
/**
|
|
45
|
+
* Raw request body content.
|
|
46
|
+
*/
|
|
47
|
+
body: string;
|
|
48
|
+
/**
|
|
49
|
+
* Content type of the request body.
|
|
50
|
+
*/
|
|
51
|
+
body_type: BodyType;
|
|
52
|
+
/**
|
|
53
|
+
* Verbatim Raw body override; null when the structured editor is authoritative.
|
|
54
|
+
*/
|
|
55
|
+
body_raw: string | null;
|
|
56
|
+
/**
|
|
57
|
+
* When true, the Raw body drawer is open in the request editor.
|
|
58
|
+
*/
|
|
59
|
+
body_raw_open: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* JavaScript run before the request is sent.
|
|
62
|
+
*/
|
|
63
|
+
pre_request_script: string;
|
|
64
|
+
/**
|
|
65
|
+
* JavaScript run after the response is received.
|
|
66
|
+
*/
|
|
67
|
+
post_request_script: string;
|
|
68
|
+
/**
|
|
69
|
+
* Ordered pre-request scripts for the editor.
|
|
70
|
+
*/
|
|
71
|
+
pre_request_scripts: ScriptRef[];
|
|
72
|
+
/**
|
|
73
|
+
* Ordered post-request scripts for the editor.
|
|
74
|
+
*/
|
|
75
|
+
post_request_scripts: ScriptRef[];
|
|
76
|
+
/**
|
|
77
|
+
* Free-form notes for the request.
|
|
78
|
+
*/
|
|
79
|
+
comment: string;
|
|
80
|
+
/**
|
|
81
|
+
* Comma-separated tags for organizing requests.
|
|
82
|
+
*/
|
|
83
|
+
tags: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Partial auth patch accepted by the update tool.
|
|
87
|
+
*/
|
|
88
|
+
export interface AiAuthPatch {
|
|
89
|
+
/**
|
|
90
|
+
* Selected auth mode.
|
|
91
|
+
*/
|
|
92
|
+
type?: AuthConfig['type'];
|
|
93
|
+
/**
|
|
94
|
+
* Basic auth credentials.
|
|
95
|
+
*/
|
|
96
|
+
basic?: Partial<AuthConfig['basic']>;
|
|
97
|
+
/**
|
|
98
|
+
* Bearer token credentials.
|
|
99
|
+
*/
|
|
100
|
+
bearer?: Partial<AuthConfig['bearer']>;
|
|
101
|
+
/**
|
|
102
|
+
* OAuth 2.0 Client Credentials settings.
|
|
103
|
+
*/
|
|
104
|
+
oauth2?: Partial<AuthConfig['oauth2']>;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Key-value row input from the model; enabled defaults to true.
|
|
108
|
+
*/
|
|
109
|
+
export interface AiKeyValueInput {
|
|
110
|
+
/**
|
|
111
|
+
* Header, param, or cookie name.
|
|
112
|
+
*/
|
|
113
|
+
key: string;
|
|
114
|
+
/**
|
|
115
|
+
* Header, param, or cookie value.
|
|
116
|
+
*/
|
|
117
|
+
value: string;
|
|
118
|
+
/**
|
|
119
|
+
* Whether the row is active; defaults to true when omitted.
|
|
120
|
+
*/
|
|
121
|
+
enabled?: boolean;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Arguments for the update_active_request tool.
|
|
125
|
+
*/
|
|
126
|
+
export interface UpdateActiveRequestToolArgs {
|
|
127
|
+
/**
|
|
128
|
+
* New display name for the request.
|
|
129
|
+
*/
|
|
130
|
+
name?: string;
|
|
131
|
+
/**
|
|
132
|
+
* HTTP method for the request.
|
|
133
|
+
*/
|
|
134
|
+
method?: HttpMethod;
|
|
135
|
+
/**
|
|
136
|
+
* Request URL; when changed without params, the params table syncs from the query string.
|
|
137
|
+
*/
|
|
138
|
+
url?: string;
|
|
139
|
+
/**
|
|
140
|
+
* Request body content.
|
|
141
|
+
*/
|
|
142
|
+
body?: string;
|
|
143
|
+
/**
|
|
144
|
+
* Content type of the request body.
|
|
145
|
+
*/
|
|
146
|
+
body_type?: BodyType;
|
|
147
|
+
/**
|
|
148
|
+
* Verbatim Raw body override for multipart/urlencoded. Pass a string to set the
|
|
149
|
+
* override (authoritative at send time) and best-effort sync structured rows; pass
|
|
150
|
+
* null to clear the override and restore structured-row projection.
|
|
151
|
+
*/
|
|
152
|
+
body_raw?: string | null;
|
|
153
|
+
/**
|
|
154
|
+
* Pre-request script content.
|
|
155
|
+
*/
|
|
156
|
+
pre_request_script?: string;
|
|
157
|
+
/**
|
|
158
|
+
* How to apply pre_request_script; defaults to replace.
|
|
159
|
+
*/
|
|
160
|
+
pre_request_script_mode?: ScriptUpdateMode;
|
|
161
|
+
/**
|
|
162
|
+
* Post-request script content.
|
|
163
|
+
*/
|
|
164
|
+
post_request_script?: string;
|
|
165
|
+
/**
|
|
166
|
+
* How to apply post_request_script; defaults to replace.
|
|
167
|
+
*/
|
|
168
|
+
post_request_script_mode?: ScriptUpdateMode;
|
|
169
|
+
/**
|
|
170
|
+
* Free-form notes for the request.
|
|
171
|
+
*/
|
|
172
|
+
comment?: string;
|
|
173
|
+
/**
|
|
174
|
+
* Request headers to merge or replace.
|
|
175
|
+
*/
|
|
176
|
+
headers?: AiKeyValueInput[];
|
|
177
|
+
/**
|
|
178
|
+
* How to apply headers; defaults to merge.
|
|
179
|
+
*/
|
|
180
|
+
headers_mode?: KeyValueListMode;
|
|
181
|
+
/**
|
|
182
|
+
* Query params to merge or replace.
|
|
183
|
+
*/
|
|
184
|
+
params?: AiKeyValueInput[];
|
|
185
|
+
/**
|
|
186
|
+
* How to apply params; defaults to merge.
|
|
187
|
+
*/
|
|
188
|
+
params_mode?: KeyValueListMode;
|
|
189
|
+
/**
|
|
190
|
+
* Partial auth settings patch.
|
|
191
|
+
*/
|
|
192
|
+
auth?: AiAuthPatch;
|
|
193
|
+
/**
|
|
194
|
+
* Cookies for the request host; applied via the cookie jar, not stored on the draft.
|
|
195
|
+
*/
|
|
196
|
+
cookies?: AiKeyValueInput[];
|
|
197
|
+
/**
|
|
198
|
+
* How to apply cookies; defaults to merge.
|
|
199
|
+
*/
|
|
200
|
+
cookies_mode?: KeyValueListMode;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Result of applying an update patch to a request draft.
|
|
204
|
+
*/
|
|
205
|
+
export interface ApplyRequestDraftUpdateResult {
|
|
206
|
+
/**
|
|
207
|
+
* Updated draft after applying the patch.
|
|
208
|
+
*/
|
|
209
|
+
draft: AiRequestDraft;
|
|
210
|
+
/**
|
|
211
|
+
* Names of fields that were changed on the draft.
|
|
212
|
+
*/
|
|
213
|
+
changedFields: string[];
|
|
214
|
+
/**
|
|
215
|
+
* Whether cookies were included in the patch (handled separately by the executor).
|
|
216
|
+
*/
|
|
217
|
+
hasCookieUpdate: boolean;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Resolves the effective raw body wire text for AI reads.
|
|
221
|
+
*
|
|
222
|
+
* When `body_raw` is set it is returned as-is. Otherwise multipart/urlencoded drafts
|
|
223
|
+
* project structured rows into wire text; other body types return null.
|
|
224
|
+
*
|
|
225
|
+
* @param draft - Request draft fields needed for projection.
|
|
226
|
+
* @returns Effective raw body text, or null when not applicable.
|
|
227
|
+
*/
|
|
228
|
+
export declare function resolveEffectiveBodyRaw(draft: {
|
|
229
|
+
body: string;
|
|
230
|
+
body_type: BodyType;
|
|
231
|
+
body_raw: string | null;
|
|
232
|
+
}): string | null;
|
|
233
|
+
/**
|
|
234
|
+
* Merges or replaces key-value rows by trimmed key (case-sensitive).
|
|
235
|
+
*
|
|
236
|
+
* @param current - Existing table rows.
|
|
237
|
+
* @param patch - Incoming rows from the tool.
|
|
238
|
+
* @param mode - Merge upserts by key; replace uses patch as the new table.
|
|
239
|
+
* @returns Updated key-value table with a trailing blank row.
|
|
240
|
+
*/
|
|
241
|
+
export declare function mergeKeyValues(current: KeyValue[], patch: AiKeyValueInput[], mode?: KeyValueListMode): KeyValue[];
|
|
242
|
+
/**
|
|
243
|
+
* Applies replace or append semantics to a script field.
|
|
244
|
+
*
|
|
245
|
+
* @param current - Existing script text.
|
|
246
|
+
* @param next - New script text from the tool.
|
|
247
|
+
* @param mode - Replace overwrites; append adds after existing content with a newline.
|
|
248
|
+
* @returns Updated script string.
|
|
249
|
+
*/
|
|
250
|
+
export declare function applyScriptUpdate(current: string, next: string, mode?: ScriptUpdateMode): string;
|
|
251
|
+
/**
|
|
252
|
+
* Shallow-merges a partial auth patch into the current auth config.
|
|
253
|
+
*
|
|
254
|
+
* @param current - Existing auth configuration.
|
|
255
|
+
* @param patch - Partial auth update from the tool.
|
|
256
|
+
* @returns Merged auth configuration.
|
|
257
|
+
*/
|
|
258
|
+
export declare function applyAuthPatch(current: AuthConfig, patch: AiAuthPatch): AuthConfig;
|
|
259
|
+
/**
|
|
260
|
+
* Returns whether the update args include at least one supported field.
|
|
261
|
+
*
|
|
262
|
+
* @param args - Parsed tool arguments.
|
|
263
|
+
*/
|
|
264
|
+
export declare function hasRequestUpdateFields(args: UpdateActiveRequestToolArgs): boolean;
|
|
265
|
+
/**
|
|
266
|
+
* Applies a partial update patch to a request draft, syncing URL and params like the editor.
|
|
267
|
+
*
|
|
268
|
+
* @param draft - Current request draft from the active tab.
|
|
269
|
+
* @param args - Parsed update_active_request tool arguments.
|
|
270
|
+
* @returns Updated draft, changed field names, and optional cookie rows for IPC.
|
|
271
|
+
*/
|
|
272
|
+
export declare function applyRequestDraftUpdate(draft: AiRequestDraft, args: UpdateActiveRequestToolArgs): ApplyRequestDraftUpdateResult;
|
|
273
|
+
//# sourceMappingURL=requestUpdate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestUpdate.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A6B,CAgH/B"}
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { normalizeAuth } from '../auth';
|
|
2
|
+
import { applyParamsToUrl, mergeParamsFromUrl } from '../queryParams';
|
|
3
|
+
import { scriptRefsFromLegacyString } from '../scriptRefs';
|
|
4
|
+
import { parseFormParts, serializeFormParts } from '../formData';
|
|
5
|
+
import { generateMultipartBoundary, parseMultipartRaw, renderMultipartRaw } from '../multipartRaw';
|
|
6
|
+
import { parseUrlEncodedParts, serializeUrlEncodedParts } from '../urlencoded';
|
|
7
|
+
import { rawUrlEncodedToRows, rowsToRawUrlEncoded } from '../urlencodedRaw';
|
|
8
|
+
/**
|
|
9
|
+
* Returns an empty enabled key-value row for editor-style trailing rows.
|
|
10
|
+
*/
|
|
11
|
+
function emptyKeyValueRow() {
|
|
12
|
+
return { key: '', value: '', enabled: true };
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Resolves the effective raw body wire text for AI reads.
|
|
16
|
+
*
|
|
17
|
+
* When `body_raw` is set it is returned as-is. Otherwise multipart/urlencoded drafts
|
|
18
|
+
* project structured rows into wire text; other body types return null.
|
|
19
|
+
*
|
|
20
|
+
* @param draft - Request draft fields needed for projection.
|
|
21
|
+
* @returns Effective raw body text, or null when not applicable.
|
|
22
|
+
*/
|
|
23
|
+
export function resolveEffectiveBodyRaw(draft) {
|
|
24
|
+
if (draft.body_raw != null) {
|
|
25
|
+
return draft.body_raw;
|
|
26
|
+
}
|
|
27
|
+
if (draft.body_type === 'urlencoded') {
|
|
28
|
+
return rowsToRawUrlEncoded(parseUrlEncodedParts(draft.body));
|
|
29
|
+
}
|
|
30
|
+
if (draft.body_type === 'multipart') {
|
|
31
|
+
return renderMultipartRaw(parseFormParts(draft.body), generateMultipartBoundary());
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Best-effort syncs structured `body` from a verbatim raw override.
|
|
37
|
+
*
|
|
38
|
+
* @param bodyType - Active body type after the patch.
|
|
39
|
+
* @param bodyRaw - Verbatim raw body text.
|
|
40
|
+
* @returns Serialized structured body, or null when the body type does not use rows.
|
|
41
|
+
*/
|
|
42
|
+
function syncStructuredBodyFromRaw(bodyType, bodyRaw) {
|
|
43
|
+
if (bodyType === 'urlencoded') {
|
|
44
|
+
const rows = rawUrlEncodedToRows(bodyRaw);
|
|
45
|
+
return serializeUrlEncodedParts(rows.length ? rows : [emptyKeyValueRow()]);
|
|
46
|
+
}
|
|
47
|
+
if (bodyType === 'multipart') {
|
|
48
|
+
return serializeFormParts(parseMultipartRaw(bodyRaw).parts);
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Normalizes key-value input rows from the model into KeyValue entries.
|
|
54
|
+
*
|
|
55
|
+
* @param rows - Raw rows from tool arguments.
|
|
56
|
+
* @returns Normalized KeyValue rows.
|
|
57
|
+
*/
|
|
58
|
+
function normalizeKeyValueInput(rows) {
|
|
59
|
+
return rows.map((row) => ({
|
|
60
|
+
key: row.key,
|
|
61
|
+
value: row.value,
|
|
62
|
+
enabled: row.enabled ?? true
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Ensures a key-value table ends with one blank trailing row like the request editor.
|
|
67
|
+
*
|
|
68
|
+
* @param rows - Key-value table rows.
|
|
69
|
+
* @returns Rows with a trailing blank row when needed.
|
|
70
|
+
*/
|
|
71
|
+
function ensureTrailingBlankRow(rows) {
|
|
72
|
+
if (rows.length === 0) {
|
|
73
|
+
return [emptyKeyValueRow()];
|
|
74
|
+
}
|
|
75
|
+
const last = rows[rows.length - 1];
|
|
76
|
+
if (last.key.trim() !== '' || last.value.trim() !== '') {
|
|
77
|
+
return [...rows, emptyKeyValueRow()];
|
|
78
|
+
}
|
|
79
|
+
return rows;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Merges or replaces key-value rows by trimmed key (case-sensitive).
|
|
83
|
+
*
|
|
84
|
+
* @param current - Existing table rows.
|
|
85
|
+
* @param patch - Incoming rows from the tool.
|
|
86
|
+
* @param mode - Merge upserts by key; replace uses patch as the new table.
|
|
87
|
+
* @returns Updated key-value table with a trailing blank row.
|
|
88
|
+
*/
|
|
89
|
+
export function mergeKeyValues(current, patch, mode = 'merge') {
|
|
90
|
+
const normalizedPatch = normalizeKeyValueInput(patch);
|
|
91
|
+
if (mode === 'replace') {
|
|
92
|
+
return ensureTrailingBlankRow(normalizedPatch);
|
|
93
|
+
}
|
|
94
|
+
const next = current.filter((row) => row.key.trim() !== '' || row.value.trim() !== '');
|
|
95
|
+
for (const incoming of normalizedPatch) {
|
|
96
|
+
const key = incoming.key.trim();
|
|
97
|
+
if (!key) {
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
const index = next.findIndex((row) => row.key.trim() === key);
|
|
101
|
+
if (index === -1) {
|
|
102
|
+
next.push(incoming);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
next[index] = incoming;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return ensureTrailingBlankRow(next);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Applies replace or append semantics to a script field.
|
|
112
|
+
*
|
|
113
|
+
* @param current - Existing script text.
|
|
114
|
+
* @param next - New script text from the tool.
|
|
115
|
+
* @param mode - Replace overwrites; append adds after existing content with a newline.
|
|
116
|
+
* @returns Updated script string.
|
|
117
|
+
*/
|
|
118
|
+
export function applyScriptUpdate(current, next, mode = 'replace') {
|
|
119
|
+
if (mode === 'append') {
|
|
120
|
+
const trimmedCurrent = current.trimEnd();
|
|
121
|
+
if (!trimmedCurrent) {
|
|
122
|
+
return next;
|
|
123
|
+
}
|
|
124
|
+
if (!next.trim()) {
|
|
125
|
+
return current;
|
|
126
|
+
}
|
|
127
|
+
return `${trimmedCurrent}\n${next}`;
|
|
128
|
+
}
|
|
129
|
+
return next;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Shallow-merges a partial auth patch into the current auth config.
|
|
133
|
+
*
|
|
134
|
+
* @param current - Existing auth configuration.
|
|
135
|
+
* @param patch - Partial auth update from the tool.
|
|
136
|
+
* @returns Merged auth configuration.
|
|
137
|
+
*/
|
|
138
|
+
export function applyAuthPatch(current, patch) {
|
|
139
|
+
return normalizeAuth({
|
|
140
|
+
type: patch.type ?? current.type,
|
|
141
|
+
basic: {
|
|
142
|
+
...current.basic,
|
|
143
|
+
...patch.basic
|
|
144
|
+
},
|
|
145
|
+
bearer: {
|
|
146
|
+
...current.bearer,
|
|
147
|
+
...patch.bearer
|
|
148
|
+
},
|
|
149
|
+
oauth2: {
|
|
150
|
+
...current.oauth2,
|
|
151
|
+
...patch.oauth2
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Returns whether the update args include at least one supported field.
|
|
157
|
+
*
|
|
158
|
+
* @param args - Parsed tool arguments.
|
|
159
|
+
*/
|
|
160
|
+
export function hasRequestUpdateFields(args) {
|
|
161
|
+
return (args.name !== undefined ||
|
|
162
|
+
args.method !== undefined ||
|
|
163
|
+
args.url !== undefined ||
|
|
164
|
+
args.body !== undefined ||
|
|
165
|
+
args.body_type !== undefined ||
|
|
166
|
+
args.body_raw !== undefined ||
|
|
167
|
+
args.pre_request_script !== undefined ||
|
|
168
|
+
args.post_request_script !== undefined ||
|
|
169
|
+
args.comment !== undefined ||
|
|
170
|
+
args.headers !== undefined ||
|
|
171
|
+
args.params !== undefined ||
|
|
172
|
+
args.auth !== undefined ||
|
|
173
|
+
args.cookies !== undefined);
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Applies a partial update patch to a request draft, syncing URL and params like the editor.
|
|
177
|
+
*
|
|
178
|
+
* @param draft - Current request draft from the active tab.
|
|
179
|
+
* @param args - Parsed update_active_request tool arguments.
|
|
180
|
+
* @returns Updated draft, changed field names, and optional cookie rows for IPC.
|
|
181
|
+
*/
|
|
182
|
+
export function applyRequestDraftUpdate(draft, args) {
|
|
183
|
+
const changedFields = [];
|
|
184
|
+
const next = { ...draft };
|
|
185
|
+
if (args.name !== undefined) {
|
|
186
|
+
next.name = args.name;
|
|
187
|
+
changedFields.push('name');
|
|
188
|
+
}
|
|
189
|
+
if (args.method !== undefined) {
|
|
190
|
+
next.method = args.method;
|
|
191
|
+
changedFields.push('method');
|
|
192
|
+
}
|
|
193
|
+
if (args.body !== undefined) {
|
|
194
|
+
next.body = args.body;
|
|
195
|
+
changedFields.push('body');
|
|
196
|
+
}
|
|
197
|
+
if (args.body_type !== undefined) {
|
|
198
|
+
next.body_type = args.body_type;
|
|
199
|
+
changedFields.push('body_type');
|
|
200
|
+
// Match the request editor: switching body type clears a stale raw override unless
|
|
201
|
+
// the same patch also sets body_raw.
|
|
202
|
+
if (args.body_raw === undefined && next.body_raw != null) {
|
|
203
|
+
next.body_raw = null;
|
|
204
|
+
changedFields.push('body_raw');
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
if (args.body_raw !== undefined) {
|
|
208
|
+
next.body_raw = args.body_raw;
|
|
209
|
+
changedFields.push('body_raw');
|
|
210
|
+
if (args.body_raw != null) {
|
|
211
|
+
if (!next.body_raw_open) {
|
|
212
|
+
next.body_raw_open = true;
|
|
213
|
+
changedFields.push('body_raw_open');
|
|
214
|
+
}
|
|
215
|
+
// When the model only patches body_raw, refresh structured rows like the Raw drawer.
|
|
216
|
+
if (args.body === undefined) {
|
|
217
|
+
const synced = syncStructuredBodyFromRaw(next.body_type, args.body_raw);
|
|
218
|
+
if (synced != null) {
|
|
219
|
+
next.body = synced;
|
|
220
|
+
changedFields.push('body');
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
if (args.comment !== undefined) {
|
|
226
|
+
next.comment = args.comment;
|
|
227
|
+
changedFields.push('comment');
|
|
228
|
+
}
|
|
229
|
+
if (args.pre_request_script !== undefined) {
|
|
230
|
+
next.pre_request_script = applyScriptUpdate(next.pre_request_script, args.pre_request_script, args.pre_request_script_mode ?? 'replace');
|
|
231
|
+
next.pre_request_scripts = scriptRefsFromLegacyString(next.pre_request_script);
|
|
232
|
+
changedFields.push('pre_request_script');
|
|
233
|
+
}
|
|
234
|
+
if (args.post_request_script !== undefined) {
|
|
235
|
+
next.post_request_script = applyScriptUpdate(next.post_request_script, args.post_request_script, args.post_request_script_mode ?? 'replace');
|
|
236
|
+
next.post_request_scripts = scriptRefsFromLegacyString(next.post_request_script);
|
|
237
|
+
changedFields.push('post_request_script');
|
|
238
|
+
}
|
|
239
|
+
if (args.auth !== undefined) {
|
|
240
|
+
next.auth = applyAuthPatch(next.auth, args.auth);
|
|
241
|
+
changedFields.push('auth');
|
|
242
|
+
}
|
|
243
|
+
if (args.url !== undefined) {
|
|
244
|
+
next.url = args.url;
|
|
245
|
+
changedFields.push('url');
|
|
246
|
+
}
|
|
247
|
+
if (args.params !== undefined) {
|
|
248
|
+
next.params = mergeKeyValues(next.params, args.params, args.params_mode ?? 'merge');
|
|
249
|
+
next.url = applyParamsToUrl(next.url, next.params);
|
|
250
|
+
changedFields.push('params');
|
|
251
|
+
if (!changedFields.includes('url')) {
|
|
252
|
+
changedFields.push('url');
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
else if (args.url !== undefined) {
|
|
256
|
+
next.params = mergeParamsFromUrl(next.url, next.params);
|
|
257
|
+
changedFields.push('params');
|
|
258
|
+
}
|
|
259
|
+
if (args.headers !== undefined) {
|
|
260
|
+
next.headers = mergeKeyValues(next.headers, args.headers, args.headers_mode ?? 'merge');
|
|
261
|
+
changedFields.push('headers');
|
|
262
|
+
}
|
|
263
|
+
let hasCookieUpdate = false;
|
|
264
|
+
if (args.cookies !== undefined) {
|
|
265
|
+
hasCookieUpdate = true;
|
|
266
|
+
changedFields.push('cookies');
|
|
267
|
+
}
|
|
268
|
+
return {
|
|
269
|
+
draft: next,
|
|
270
|
+
changedFields,
|
|
271
|
+
hasCookieUpdate
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
//# sourceMappingURL=requestUpdate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestUpdate.js","sourceRoot":"","sources":["../../src/ai/requestUpdate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAmB,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACnG,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AA0Q5E;;GAEG;AACH,SAAS,gBAAgB;IACvB,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC/C,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAIvC;IACC,IAAI,KAAK,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,QAAQ,CAAC;IACxB,CAAC;IAED,IAAI,KAAK,CAAC,SAAS,KAAK,YAAY,EAAE,CAAC;QACrC,OAAO,mBAAmB,CAAC,oBAAoB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/D,CAAC;IAED,IAAI,KAAK,CAAC,SAAS,KAAK,WAAW,EAAE,CAAC;QACpC,OAAO,kBAAkB,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,yBAAyB,EAAE,C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,CAAC,CAAC;IAC/B,CAAC;IAED,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,IAAI,OAAO,CAAC,CAAC;QACxF,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC;IAED,IAAI,eAAe,GAAG,KAAK,CAAC;IAC5B,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAC/B,eAAe,GAAG,IAAI,CAAC;QACvB,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC;IAED,OAAO;QACL,KAAK,EAAE,IAAI;QACX,aAAa;QACb,eAAe;KAChB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { ChatCompletionTool } from 'openai/resources/chat/completions';
|
|
2
|
+
import type { ChatStepResult, ScriptAskContext } from '../types';
|
|
3
|
+
export type { ScriptAskContext };
|
|
4
|
+
/**
|
|
5
|
+
* Parsed answer from the script `/ask` agent.
|
|
6
|
+
*/
|
|
7
|
+
export interface ScriptAskAnswer {
|
|
8
|
+
/**
|
|
9
|
+
* Short explanatory text inserted as `//` comment lines when no code is returned.
|
|
10
|
+
*/
|
|
11
|
+
note?: string;
|
|
12
|
+
/**
|
|
13
|
+
* JavaScript source that replaces the `/ask` command line.
|
|
14
|
+
*/
|
|
15
|
+
code?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* OpenAI tool definition for the script `/ask` mini-agent response.
|
|
19
|
+
*/
|
|
20
|
+
export declare const SCRIPT_ASK_TOOL: ChatCompletionTool;
|
|
21
|
+
/**
|
|
22
|
+
* Builds the system prompt for an inline script `/ask` request.
|
|
23
|
+
*
|
|
24
|
+
* @param context - Script source, slash-command line, and phase.
|
|
25
|
+
* @returns System prompt instructing the model to call answer_script.
|
|
26
|
+
*/
|
|
27
|
+
export declare function buildScriptAskSystemPrompt(context: ScriptAskContext): string;
|
|
28
|
+
/**
|
|
29
|
+
* Reads an answer_script tool call from a chat step result.
|
|
30
|
+
*
|
|
31
|
+
* @param result - One LLM completion step result.
|
|
32
|
+
* @returns Parsed answer, or null when no usable response is present.
|
|
33
|
+
*/
|
|
34
|
+
export declare function parseScriptAskResult(result: ChatStepResult): ScriptAskAnswer | null;
|
|
35
|
+
/**
|
|
36
|
+
* Renders a short note as one or more // comment lines.
|
|
37
|
+
*
|
|
38
|
+
* @param note - Plain-text explanation from the model.
|
|
39
|
+
* @returns Comment block suitable for insertion into a script.
|
|
40
|
+
*/
|
|
41
|
+
export declare function renderScriptAskNote(note: string): string;
|
|
42
|
+
/**
|
|
43
|
+
* Suffix appended to an inline `/ask` line while the model is thinking.
|
|
44
|
+
*/
|
|
45
|
+
export declare const SCRIPT_ASK_THINKING_SUFFIX = " Thinking...";
|
|
46
|
+
/**
|
|
47
|
+
* Returns whether a script line contains a slash `/ask` command.
|
|
48
|
+
*
|
|
49
|
+
* @param line - Single line of script source (without trailing newline).
|
|
50
|
+
*/
|
|
51
|
+
export declare function isScriptAskLine(line: string): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Removes the inline thinking suffix from a script line when present.
|
|
54
|
+
*
|
|
55
|
+
* @param line - Single line of script source.
|
|
56
|
+
* @returns Line without {@link SCRIPT_ASK_THINKING_SUFFIX}.
|
|
57
|
+
*/
|
|
58
|
+
export declare function stripScriptAskThinking(line: string): string;
|
|
59
|
+
/**
|
|
60
|
+
* Appends the thinking suffix to the target `/ask` line only.
|
|
61
|
+
*
|
|
62
|
+
* @param code - Current script source.
|
|
63
|
+
* @param lineNumber - 1-based line number of the `/ask` command.
|
|
64
|
+
* @returns Updated script source.
|
|
65
|
+
*/
|
|
66
|
+
export declare function appendScriptAskThinking(code: string, lineNumber: number): string;
|
|
67
|
+
/**
|
|
68
|
+
* Options for {@link applyScriptAskAtLine}.
|
|
69
|
+
*/
|
|
70
|
+
export interface ApplyScriptAskAtLineOptions {
|
|
71
|
+
/**
|
|
72
|
+
* When true, replaces the target line even when `/ask` is no longer present
|
|
73
|
+
* (for example after a premature cleanup or user edit while the modal is open).
|
|
74
|
+
*/
|
|
75
|
+
replaceMissingAskLine?: boolean;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Applies an answer by replacing the entire `/ask` line identified by line number.
|
|
79
|
+
*
|
|
80
|
+
* @param code - Current script source.
|
|
81
|
+
* @param lineNumber - 1-based line number of the `/ask` command.
|
|
82
|
+
* @param answer - Parsed note and/or code from the model.
|
|
83
|
+
* @param options - Optional apply behavior overrides.
|
|
84
|
+
* @returns Updated script source; unchanged when the target line is not `/ask` unless
|
|
85
|
+
* {@link ApplyScriptAskAtLineOptions.replaceMissingAskLine} is set.
|
|
86
|
+
*/
|
|
87
|
+
export declare function applyScriptAskAtLine(code: string, lineNumber: number, answer: ScriptAskAnswer, options?: ApplyScriptAskAtLineOptions): string;
|
|
88
|
+
/**
|
|
89
|
+
* Removes the entire `/ask` line when the modal closes without an answer.
|
|
90
|
+
*
|
|
91
|
+
* @param code - Current script source.
|
|
92
|
+
* @param lineNumber - 1-based line number of the `/ask` command.
|
|
93
|
+
* @returns Script source with the command line removed.
|
|
94
|
+
*/
|
|
95
|
+
export declare function removeScriptAskLine(code: string, lineNumber: number): string;
|
|
96
|
+
/**
|
|
97
|
+
* Applies an answer_script result by replacing the slash command span in the script.
|
|
98
|
+
*
|
|
99
|
+
* @param code - Current script source.
|
|
100
|
+
* @param from - Start offset of the slash command span (inclusive).
|
|
101
|
+
* @param to - End offset of the slash command span (exclusive).
|
|
102
|
+
* @param answer - Parsed note and/or code from the model.
|
|
103
|
+
* @returns Updated script source.
|
|
104
|
+
*/
|
|
105
|
+
export declare function applyScriptAsk(code: string, from: number, to: number, answer: ScriptAskAnswer): string;
|
|
106
|
+
/**
|
|
107
|
+
* Removes the slash command span from the script when the modal closes without an answer.
|
|
108
|
+
*
|
|
109
|
+
* @param code - Current script source.
|
|
110
|
+
* @param from - Start offset of the slash command span (inclusive).
|
|
111
|
+
* @param to - End offset of the slash command span (exclusive).
|
|
112
|
+
* @returns Script source with the command removed and adjacent blank lines tidied.
|
|
113
|
+
*/
|
|
114
|
+
export declare function removeScriptAskCommand(code: string, from: number, to: number): string;
|
|
115
|
+
//# sourceMappingURL=scriptAsk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scriptAsk.d.ts","sourceRoot":"","sources":["../../src/ai/scriptAsk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjE,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAEjC;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,kBAuB7B,CAAC;AAgBF;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAmB5E;AA0BD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,eAAe,GAAG,IAAI,CAmBnF;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKxD;AAED;;GAEG;AACH,eAAO,MAAM,0BAA0B,iBAAiB,CAAC;AAKzD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK3D;AAED;;;;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