mirror of
https://github.com/aaif-goose/goose.git
synced 2026-07-03 14:10:03 +02:00
protocol cleanup (#9147)
This commit is contained in:
@@ -3,7 +3,7 @@ import { getAcpClient } from './acpConnection';
|
||||
|
||||
export async function getConfiguredExtensions(): Promise<ExtensionResponse> {
|
||||
const client = await getAcpClient();
|
||||
const response = await client.goose.GooseConfigExtensions({});
|
||||
const response = await client.goose.configExtensionsList_unstable({});
|
||||
return {
|
||||
extensions: response.extensions as ExtensionEntry[],
|
||||
warnings: response.warnings,
|
||||
|
||||
@@ -44,7 +44,16 @@ export default async function main() {
|
||||
output: {
|
||||
path: OUTPUT_DIR,
|
||||
},
|
||||
plugins: ["zod", "@hey-api/typescript"],
|
||||
plugins: [
|
||||
{
|
||||
case: "preserve",
|
||||
name: "zod",
|
||||
},
|
||||
{
|
||||
case: "preserve",
|
||||
name: "@hey-api/typescript",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
await postProcessTypes();
|
||||
@@ -118,12 +127,27 @@ interface MethodMeta {
|
||||
}
|
||||
|
||||
function methodToCamelCase(method: string): string {
|
||||
return method
|
||||
.split(/[/_]/)
|
||||
let methodParts = method.split(/[/_]/).filter((part) => part.length > 0);
|
||||
|
||||
let suffix: string;
|
||||
if (methodParts[0] == "goose" && methodParts[1] == "unstable") {
|
||||
methodParts.shift();
|
||||
methodParts.shift();
|
||||
suffix = "_unstable";
|
||||
} else {
|
||||
suffix = "";
|
||||
}
|
||||
|
||||
let prefix = methodParts
|
||||
.map((part) =>
|
||||
part.replace(/[^a-zA-Z0-9]+(.)/g, (_, chr: string) => chr.toUpperCase()),
|
||||
)
|
||||
.map((part, i) =>
|
||||
i === 0 ? part : part.charAt(0).toUpperCase() + part.slice(1),
|
||||
)
|
||||
.join("");
|
||||
|
||||
return `${prefix}${suffix}`;
|
||||
}
|
||||
|
||||
async function generateClient(meta: { methods: MethodMeta[] }) {
|
||||
|
||||
@@ -77,8 +77,8 @@ const READ_ONLY_CHECKS = [
|
||||
call: (c) => c.goose.GooseDictationModelsList({}),
|
||||
},
|
||||
{
|
||||
name: "GooseConfigExtensions",
|
||||
call: (c) => c.goose.GooseConfigExtensions({}),
|
||||
name: "GooseConfigExtensionsList",
|
||||
call: (c) => c.goose.GooseConfigExtensionsList({}),
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
+532
-408
File diff suppressed because it is too large
Load Diff
+144
-144
@@ -1,36 +1,36 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type { AddConfigExtensionRequest, AddExtensionRequest, ArchiveSessionRequest, CreateSourceRequest, CreateSourceResponse, CustomProviderConfigDto, CustomProviderCreateRequest, CustomProviderCreateResponse, CustomProviderDeleteRequest, CustomProviderDeleteResponse, CustomProviderReadRequest, CustomProviderReadResponse, CustomProviderUpdateRequest, CustomProviderUpdateResponse, DefaultsReadRequest, DefaultsReadResponse, DefaultsSaveRequest, DeleteSessionRequest, DeleteSourceRequest, DictationConfigRequest, DictationConfigResponse, DictationDownloadProgress, DictationLocalModelStatus, DictationModelCancelRequest, DictationModelDeleteRequest, DictationModelDownloadProgressRequest, DictationModelDownloadProgressResponse, DictationModelDownloadRequest, DictationModelOption, DictationModelSelectRequest, DictationModelsListRequest, DictationModelsListResponse, DictationProviderStatusEntry, DictationSecretDeleteRequest, DictationSecretSaveRequest, DictationTranscribeRequest, DictationTranscribeResponse, EmptyResponse, ExportSessionRequest, ExportSessionResponse, ExportSourceRequest, ExportSourceResponse, ExtRequest, ExtResponse, GetExtensionsRequest, GetExtensionsResponse, GetSessionExtensionsRequest, GetSessionExtensionsResponse, GetToolsRequest, GetToolsResponse, GooseToolCallRequest, GooseToolCallResponse, ImportSessionRequest, ImportSessionResponse, ImportSourcesRequest, ImportSourcesResponse, ListProvidersRequest, ListProvidersResponse, ListSourcesRequest, ListSourcesResponse, OnboardingImportApplyRequest, OnboardingImportApplyResponse, OnboardingImportCandidate, OnboardingImportCounts, OnboardingImportScanRequest, OnboardingImportScanResponse, OnboardingImportSourceKind, PreferenceKey, PreferencesReadRequest, PreferencesReadResponse, PreferencesRemoveRequest, PreferencesSaveRequest, PreferenceValue, ProviderCatalogListRequest, ProviderCatalogListResponse, ProviderCatalogTemplateRequest, ProviderCatalogTemplateResponse, ProviderConfigAuthenticateRequest, ProviderConfigChangeResponse, ProviderConfigDeleteRequest, ProviderConfigFieldUpdate, ProviderConfigFieldValueDto, ProviderConfigKey, ProviderConfigReadRequest, ProviderConfigReadResponse, ProviderConfigSaveRequest, ProviderConfigStatusDto, ProviderConfigStatusRequest, ProviderConfigStatusResponse, ProviderInventoryEntryDto, ProviderInventoryModelDto, ProviderSetupCatalogEntryDto, ProviderSetupCatalogListRequest, ProviderSetupCatalogListResponse, ProviderSetupCategoryDto, ProviderSetupFieldDto, ProviderSetupGroupDto, ProviderSetupMethodDto, ProviderTemplateCapabilitiesDto, ProviderTemplateCatalogEntryDto, ProviderTemplateDto, ProviderTemplateModelDto, ReadResourceRequest, ReadResourceResponse, RefreshProviderInventoryRequest, RefreshProviderInventoryResponse, RefreshProviderInventorySkipDto, RefreshProviderInventorySkipReasonDto, RemoveConfigExtensionRequest, RemoveExtensionRequest, RenameSessionRequest, SourceEntry, SourceType, ToggleConfigExtensionRequest, UnarchiveSessionRequest, UpdateSessionProjectRequest, UpdateSourceRequest, UpdateSourceResponse, UpdateWorkingDirRequest } from './types.gen.js';
|
||||
export type { AddConfigExtensionRequest_unstable, AddExtensionRequest_unstable, ArchiveSessionRequest_unstable, CreateSourceRequest_unstable, CreateSourceResponse_unstable, CustomProviderConfigDto, CustomProviderCreateRequest_unstable, CustomProviderCreateResponse_unstable, CustomProviderDeleteRequest_unstable, CustomProviderDeleteResponse_unstable, CustomProviderReadRequest_unstable, CustomProviderReadResponse_unstable, CustomProviderUpdateRequest_unstable, CustomProviderUpdateResponse_unstable, DefaultsReadRequest_unstable, DefaultsReadResponse_unstable, DefaultsSaveRequest_unstable, DeleteSessionRequest, DeleteSourceRequest_unstable, DictationConfigRequest_unstable, DictationConfigResponse_unstable, DictationDownloadProgress, DictationLocalModelStatus, DictationModelCancelRequest_unstable, DictationModelDeleteRequest_unstable, DictationModelDownloadProgressRequest_unstable, DictationModelDownloadProgressResponse_unstable, DictationModelDownloadRequest_unstable, DictationModelOption, DictationModelSelectRequest_unstable, DictationModelsListRequest_unstable, DictationModelsListResponse_unstable, DictationProviderStatusEntry, DictationSecretDeleteRequest_unstable, DictationSecretSaveRequest_unstable, DictationTranscribeRequest_unstable, DictationTranscribeResponse_unstable, EmptyResponse, ExportSessionRequest_unstable, ExportSessionResponse_unstable, ExportSourceRequest_unstable, ExportSourceResponse_unstable, ExtRequest, ExtResponse, GetExtensionsRequest_unstable, GetExtensionsResponse_unstable, GetSessionExtensionsRequest_unstable, GetSessionExtensionsResponse_unstable, GetToolsRequest_unstable, GetToolsResponse_unstable, GooseToolCallRequest_unstable, GooseToolCallResponse_unstable, ImportSessionRequest_unstable, ImportSessionResponse_unstable, ImportSourcesRequest_unstable, ImportSourcesResponse_unstable, ListProvidersRequest_unstable, ListProvidersResponse_unstable, ListSourcesRequest_unstable, ListSourcesResponse_unstable, OnboardingImportApplyRequest_unstable, OnboardingImportApplyResponse_unstable, OnboardingImportCandidate, OnboardingImportCounts, OnboardingImportScanRequest_unstable, OnboardingImportScanResponse_unstable, OnboardingImportSourceKind, PreferenceKey, PreferencesReadRequest_unstable, PreferencesReadResponse_unstable, PreferencesRemoveRequest_unstable, PreferencesSaveRequest_unstable, PreferenceValue, ProviderCatalogListRequest_unstable, ProviderCatalogListResponse_unstable, ProviderCatalogTemplateRequest_unstable, ProviderCatalogTemplateResponse_unstable, ProviderConfigAuthenticateRequest_unstable, ProviderConfigChangeResponse_unstable, ProviderConfigDeleteRequest_unstable, ProviderConfigFieldUpdate, ProviderConfigFieldValueDto, ProviderConfigKey, ProviderConfigReadRequest_unstable, ProviderConfigReadResponse_unstable, ProviderConfigSaveRequest_unstable, ProviderConfigStatusDto, ProviderConfigStatusRequest_unstable, ProviderConfigStatusResponse_unstable, ProviderInventoryEntryDto, ProviderInventoryModelDto, ProviderSetupCatalogEntryDto, ProviderSetupCatalogListRequest_unstable, ProviderSetupCatalogListResponse_unstable, ProviderSetupCategoryDto, ProviderSetupFieldDto, ProviderSetupGroupDto, ProviderSetupMethodDto, ProviderTemplateCapabilitiesDto, ProviderTemplateCatalogEntryDto, ProviderTemplateDto, ProviderTemplateModelDto, ReadResourceRequest_unstable, ReadResourceResponse_unstable, RefreshProviderInventoryRequest_unstable, RefreshProviderInventoryResponse_unstable, RefreshProviderInventorySkipDto, RefreshProviderInventorySkipReasonDto, RemoveConfigExtensionRequest_unstable, RemoveExtensionRequest_unstable, RenameSessionRequest_unstable, SourceEntry, SourceScope, SourceType, ToggleConfigExtensionRequest_unstable, UnarchiveSessionRequest_unstable, UpdateSessionProjectRequest_unstable, UpdateSourceRequest_unstable, UpdateSourceResponse_unstable, UpdateWorkingDirRequest_unstable } from './types.gen.js';
|
||||
|
||||
export const GOOSE_EXT_METHODS = [
|
||||
{
|
||||
method: "_goose/extensions/add",
|
||||
requestType: "AddExtensionRequest",
|
||||
method: "_goose/unstable/session/extensions/add",
|
||||
requestType: "AddExtensionRequest_unstable",
|
||||
responseType: "EmptyResponse",
|
||||
},
|
||||
{
|
||||
method: "_goose/extensions/remove",
|
||||
requestType: "RemoveExtensionRequest",
|
||||
method: "_goose/unstable/session/extensions/remove",
|
||||
requestType: "RemoveExtensionRequest_unstable",
|
||||
responseType: "EmptyResponse",
|
||||
},
|
||||
{
|
||||
method: "_goose/tools",
|
||||
requestType: "GetToolsRequest",
|
||||
responseType: "GetToolsResponse",
|
||||
method: "_goose/unstable/tools/list",
|
||||
requestType: "GetToolsRequest_unstable",
|
||||
responseType: "GetToolsResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/tool/call",
|
||||
requestType: "GooseToolCallRequest",
|
||||
responseType: "GooseToolCallResponse",
|
||||
method: "_goose/unstable/tools/call",
|
||||
requestType: "GooseToolCallRequest_unstable",
|
||||
responseType: "GooseToolCallResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/resource/read",
|
||||
requestType: "ReadResourceRequest",
|
||||
responseType: "ReadResourceResponse",
|
||||
method: "_goose/unstable/resources/read",
|
||||
requestType: "ReadResourceRequest_unstable",
|
||||
responseType: "ReadResourceResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/working_dir/update",
|
||||
requestType: "UpdateWorkingDirRequest",
|
||||
method: "_goose/unstable/session/working-dir/update",
|
||||
requestType: "UpdateWorkingDirRequest_unstable",
|
||||
responseType: "EmptyResponse",
|
||||
},
|
||||
{
|
||||
@@ -39,243 +39,243 @@ export const GOOSE_EXT_METHODS = [
|
||||
responseType: "EmptyResponse",
|
||||
},
|
||||
{
|
||||
method: "_goose/config/extensions",
|
||||
requestType: "GetExtensionsRequest",
|
||||
responseType: "GetExtensionsResponse",
|
||||
method: "_goose/unstable/config/extensions/list",
|
||||
requestType: "GetExtensionsRequest_unstable",
|
||||
responseType: "GetExtensionsResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/config/extensions/add",
|
||||
requestType: "AddConfigExtensionRequest",
|
||||
method: "_goose/unstable/config/extensions/add",
|
||||
requestType: "AddConfigExtensionRequest_unstable",
|
||||
responseType: "EmptyResponse",
|
||||
},
|
||||
{
|
||||
method: "_goose/config/extensions/remove",
|
||||
requestType: "RemoveConfigExtensionRequest",
|
||||
method: "_goose/unstable/config/extensions/remove",
|
||||
requestType: "RemoveConfigExtensionRequest_unstable",
|
||||
responseType: "EmptyResponse",
|
||||
},
|
||||
{
|
||||
method: "_goose/config/extensions/toggle",
|
||||
requestType: "ToggleConfigExtensionRequest",
|
||||
method: "_goose/unstable/config/extensions/toggle",
|
||||
requestType: "ToggleConfigExtensionRequest_unstable",
|
||||
responseType: "EmptyResponse",
|
||||
},
|
||||
{
|
||||
method: "_goose/session/extensions",
|
||||
requestType: "GetSessionExtensionsRequest",
|
||||
responseType: "GetSessionExtensionsResponse",
|
||||
method: "_goose/unstable/session/extensions/list",
|
||||
requestType: "GetSessionExtensionsRequest_unstable",
|
||||
responseType: "GetSessionExtensionsResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/providers/list",
|
||||
requestType: "ListProvidersRequest",
|
||||
responseType: "ListProvidersResponse",
|
||||
method: "_goose/unstable/providers/list",
|
||||
requestType: "ListProvidersRequest_unstable",
|
||||
responseType: "ListProvidersResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/providers/catalog/list",
|
||||
requestType: "ProviderCatalogListRequest",
|
||||
responseType: "ProviderCatalogListResponse",
|
||||
method: "_goose/unstable/providers/catalog/list",
|
||||
requestType: "ProviderCatalogListRequest_unstable",
|
||||
responseType: "ProviderCatalogListResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/providers/setup/catalog/list",
|
||||
requestType: "ProviderSetupCatalogListRequest",
|
||||
responseType: "ProviderSetupCatalogListResponse",
|
||||
method: "_goose/unstable/providers/setup/catalog/list",
|
||||
requestType: "ProviderSetupCatalogListRequest_unstable",
|
||||
responseType: "ProviderSetupCatalogListResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/providers/catalog/template",
|
||||
requestType: "ProviderCatalogTemplateRequest",
|
||||
responseType: "ProviderCatalogTemplateResponse",
|
||||
method: "_goose/unstable/providers/catalog/template",
|
||||
requestType: "ProviderCatalogTemplateRequest_unstable",
|
||||
responseType: "ProviderCatalogTemplateResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/providers/custom/create",
|
||||
requestType: "CustomProviderCreateRequest",
|
||||
responseType: "CustomProviderCreateResponse",
|
||||
method: "_goose/unstable/providers/custom/create",
|
||||
requestType: "CustomProviderCreateRequest_unstable",
|
||||
responseType: "CustomProviderCreateResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/providers/custom/read",
|
||||
requestType: "CustomProviderReadRequest",
|
||||
responseType: "CustomProviderReadResponse",
|
||||
method: "_goose/unstable/providers/custom/read",
|
||||
requestType: "CustomProviderReadRequest_unstable",
|
||||
responseType: "CustomProviderReadResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/providers/custom/update",
|
||||
requestType: "CustomProviderUpdateRequest",
|
||||
responseType: "CustomProviderUpdateResponse",
|
||||
method: "_goose/unstable/providers/custom/update",
|
||||
requestType: "CustomProviderUpdateRequest_unstable",
|
||||
responseType: "CustomProviderUpdateResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/providers/custom/delete",
|
||||
requestType: "CustomProviderDeleteRequest",
|
||||
responseType: "CustomProviderDeleteResponse",
|
||||
method: "_goose/unstable/providers/custom/delete",
|
||||
requestType: "CustomProviderDeleteRequest_unstable",
|
||||
responseType: "CustomProviderDeleteResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/providers/inventory/refresh",
|
||||
requestType: "RefreshProviderInventoryRequest",
|
||||
responseType: "RefreshProviderInventoryResponse",
|
||||
method: "_goose/unstable/providers/inventory/refresh",
|
||||
requestType: "RefreshProviderInventoryRequest_unstable",
|
||||
responseType: "RefreshProviderInventoryResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/providers/config/read",
|
||||
requestType: "ProviderConfigReadRequest",
|
||||
responseType: "ProviderConfigReadResponse",
|
||||
method: "_goose/unstable/providers/config/read",
|
||||
requestType: "ProviderConfigReadRequest_unstable",
|
||||
responseType: "ProviderConfigReadResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/providers/config/status",
|
||||
requestType: "ProviderConfigStatusRequest",
|
||||
responseType: "ProviderConfigStatusResponse",
|
||||
method: "_goose/unstable/providers/config/status",
|
||||
requestType: "ProviderConfigStatusRequest_unstable",
|
||||
responseType: "ProviderConfigStatusResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/providers/config/save",
|
||||
requestType: "ProviderConfigSaveRequest",
|
||||
responseType: "ProviderConfigChangeResponse",
|
||||
method: "_goose/unstable/providers/config/save",
|
||||
requestType: "ProviderConfigSaveRequest_unstable",
|
||||
responseType: "ProviderConfigChangeResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/providers/config/delete",
|
||||
requestType: "ProviderConfigDeleteRequest",
|
||||
responseType: "ProviderConfigChangeResponse",
|
||||
method: "_goose/unstable/providers/config/delete",
|
||||
requestType: "ProviderConfigDeleteRequest_unstable",
|
||||
responseType: "ProviderConfigChangeResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/providers/config/authenticate",
|
||||
requestType: "ProviderConfigAuthenticateRequest",
|
||||
responseType: "ProviderConfigChangeResponse",
|
||||
method: "_goose/unstable/providers/config/authenticate",
|
||||
requestType: "ProviderConfigAuthenticateRequest_unstable",
|
||||
responseType: "ProviderConfigChangeResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/preferences/read",
|
||||
requestType: "PreferencesReadRequest",
|
||||
responseType: "PreferencesReadResponse",
|
||||
method: "_goose/unstable/preferences/read",
|
||||
requestType: "PreferencesReadRequest_unstable",
|
||||
responseType: "PreferencesReadResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/preferences/save",
|
||||
requestType: "PreferencesSaveRequest",
|
||||
method: "_goose/unstable/preferences/save",
|
||||
requestType: "PreferencesSaveRequest_unstable",
|
||||
responseType: "EmptyResponse",
|
||||
},
|
||||
{
|
||||
method: "_goose/preferences/remove",
|
||||
requestType: "PreferencesRemoveRequest",
|
||||
method: "_goose/unstable/preferences/remove",
|
||||
requestType: "PreferencesRemoveRequest_unstable",
|
||||
responseType: "EmptyResponse",
|
||||
},
|
||||
{
|
||||
method: "_goose/defaults/read",
|
||||
requestType: "DefaultsReadRequest",
|
||||
responseType: "DefaultsReadResponse",
|
||||
method: "_goose/unstable/defaults/read",
|
||||
requestType: "DefaultsReadRequest_unstable",
|
||||
responseType: "DefaultsReadResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/defaults/save",
|
||||
requestType: "DefaultsSaveRequest",
|
||||
responseType: "DefaultsReadResponse",
|
||||
method: "_goose/unstable/defaults/save",
|
||||
requestType: "DefaultsSaveRequest_unstable",
|
||||
responseType: "DefaultsReadResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/onboarding/import/scan",
|
||||
requestType: "OnboardingImportScanRequest",
|
||||
responseType: "OnboardingImportScanResponse",
|
||||
method: "_goose/unstable/onboarding/import/scan",
|
||||
requestType: "OnboardingImportScanRequest_unstable",
|
||||
responseType: "OnboardingImportScanResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/onboarding/import/apply",
|
||||
requestType: "OnboardingImportApplyRequest",
|
||||
responseType: "OnboardingImportApplyResponse",
|
||||
method: "_goose/unstable/onboarding/import/apply",
|
||||
requestType: "OnboardingImportApplyRequest_unstable",
|
||||
responseType: "OnboardingImportApplyResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/session/export",
|
||||
requestType: "ExportSessionRequest",
|
||||
responseType: "ExportSessionResponse",
|
||||
method: "_goose/unstable/session/export",
|
||||
requestType: "ExportSessionRequest_unstable",
|
||||
responseType: "ExportSessionResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/session/import",
|
||||
requestType: "ImportSessionRequest",
|
||||
responseType: "ImportSessionResponse",
|
||||
method: "_goose/unstable/session/import",
|
||||
requestType: "ImportSessionRequest_unstable",
|
||||
responseType: "ImportSessionResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/session/update_project",
|
||||
requestType: "UpdateSessionProjectRequest",
|
||||
method: "_goose/unstable/session/project/update",
|
||||
requestType: "UpdateSessionProjectRequest_unstable",
|
||||
responseType: "EmptyResponse",
|
||||
},
|
||||
{
|
||||
method: "_goose/session/rename",
|
||||
requestType: "RenameSessionRequest",
|
||||
method: "_goose/unstable/session/rename",
|
||||
requestType: "RenameSessionRequest_unstable",
|
||||
responseType: "EmptyResponse",
|
||||
},
|
||||
{
|
||||
method: "_goose/session/archive",
|
||||
requestType: "ArchiveSessionRequest",
|
||||
method: "_goose/unstable/session/archive",
|
||||
requestType: "ArchiveSessionRequest_unstable",
|
||||
responseType: "EmptyResponse",
|
||||
},
|
||||
{
|
||||
method: "_goose/session/unarchive",
|
||||
requestType: "UnarchiveSessionRequest",
|
||||
method: "_goose/unstable/session/unarchive",
|
||||
requestType: "UnarchiveSessionRequest_unstable",
|
||||
responseType: "EmptyResponse",
|
||||
},
|
||||
{
|
||||
method: "_goose/sources/create",
|
||||
requestType: "CreateSourceRequest",
|
||||
responseType: "CreateSourceResponse",
|
||||
method: "_goose/unstable/sources/create",
|
||||
requestType: "CreateSourceRequest_unstable",
|
||||
responseType: "CreateSourceResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/sources/list",
|
||||
requestType: "ListSourcesRequest",
|
||||
responseType: "ListSourcesResponse",
|
||||
method: "_goose/unstable/sources/list",
|
||||
requestType: "ListSourcesRequest_unstable",
|
||||
responseType: "ListSourcesResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/sources/update",
|
||||
requestType: "UpdateSourceRequest",
|
||||
responseType: "UpdateSourceResponse",
|
||||
method: "_goose/unstable/sources/update",
|
||||
requestType: "UpdateSourceRequest_unstable",
|
||||
responseType: "UpdateSourceResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/sources/delete",
|
||||
requestType: "DeleteSourceRequest",
|
||||
method: "_goose/unstable/sources/delete",
|
||||
requestType: "DeleteSourceRequest_unstable",
|
||||
responseType: "EmptyResponse",
|
||||
},
|
||||
{
|
||||
method: "_goose/sources/export",
|
||||
requestType: "ExportSourceRequest",
|
||||
responseType: "ExportSourceResponse",
|
||||
method: "_goose/unstable/sources/export",
|
||||
requestType: "ExportSourceRequest_unstable",
|
||||
responseType: "ExportSourceResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/sources/import",
|
||||
requestType: "ImportSourcesRequest",
|
||||
responseType: "ImportSourcesResponse",
|
||||
method: "_goose/unstable/sources/import",
|
||||
requestType: "ImportSourcesRequest_unstable",
|
||||
responseType: "ImportSourcesResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/dictation/transcribe",
|
||||
requestType: "DictationTranscribeRequest",
|
||||
responseType: "DictationTranscribeResponse",
|
||||
method: "_goose/unstable/dictation/transcribe",
|
||||
requestType: "DictationTranscribeRequest_unstable",
|
||||
responseType: "DictationTranscribeResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/dictation/config",
|
||||
requestType: "DictationConfigRequest",
|
||||
responseType: "DictationConfigResponse",
|
||||
method: "_goose/unstable/dictation/config",
|
||||
requestType: "DictationConfigRequest_unstable",
|
||||
responseType: "DictationConfigResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/dictation/secret/save",
|
||||
requestType: "DictationSecretSaveRequest",
|
||||
method: "_goose/unstable/dictation/secret/save",
|
||||
requestType: "DictationSecretSaveRequest_unstable",
|
||||
responseType: "EmptyResponse",
|
||||
},
|
||||
{
|
||||
method: "_goose/dictation/secret/delete",
|
||||
requestType: "DictationSecretDeleteRequest",
|
||||
method: "_goose/unstable/dictation/secret/delete",
|
||||
requestType: "DictationSecretDeleteRequest_unstable",
|
||||
responseType: "EmptyResponse",
|
||||
},
|
||||
{
|
||||
method: "_goose/dictation/models/list",
|
||||
requestType: "DictationModelsListRequest",
|
||||
responseType: "DictationModelsListResponse",
|
||||
method: "_goose/unstable/dictation/models/list",
|
||||
requestType: "DictationModelsListRequest_unstable",
|
||||
responseType: "DictationModelsListResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/dictation/models/download",
|
||||
requestType: "DictationModelDownloadRequest",
|
||||
method: "_goose/unstable/dictation/models/download",
|
||||
requestType: "DictationModelDownloadRequest_unstable",
|
||||
responseType: "EmptyResponse",
|
||||
},
|
||||
{
|
||||
method: "_goose/dictation/models/download/progress",
|
||||
requestType: "DictationModelDownloadProgressRequest",
|
||||
responseType: "DictationModelDownloadProgressResponse",
|
||||
method: "_goose/unstable/dictation/models/download/progress",
|
||||
requestType: "DictationModelDownloadProgressRequest_unstable",
|
||||
responseType: "DictationModelDownloadProgressResponse_unstable",
|
||||
},
|
||||
{
|
||||
method: "_goose/dictation/models/cancel",
|
||||
requestType: "DictationModelCancelRequest",
|
||||
method: "_goose/unstable/dictation/models/cancel",
|
||||
requestType: "DictationModelCancelRequest_unstable",
|
||||
responseType: "EmptyResponse",
|
||||
},
|
||||
{
|
||||
method: "_goose/dictation/models/delete",
|
||||
requestType: "DictationModelDeleteRequest",
|
||||
method: "_goose/unstable/dictation/models/delete",
|
||||
requestType: "DictationModelDeleteRequest_unstable",
|
||||
responseType: "EmptyResponse",
|
||||
},
|
||||
{
|
||||
method: "_goose/dictation/model/select",
|
||||
requestType: "DictationModelSelectRequest",
|
||||
method: "_goose/unstable/dictation/models/select",
|
||||
requestType: "DictationModelSelectRequest_unstable",
|
||||
responseType: "EmptyResponse",
|
||||
},
|
||||
] as const;
|
||||
|
||||
+109
-107
@@ -4,7 +4,7 @@
|
||||
/**
|
||||
* Add an extension to an active session.
|
||||
*/
|
||||
export type AddExtensionRequest = {
|
||||
export type AddExtensionRequest_unstable = {
|
||||
sessionId: string;
|
||||
/**
|
||||
* Extension configuration (see ExtensionConfig variants: Stdio, StreamableHttp, Builtin, Platform).
|
||||
@@ -22,7 +22,7 @@ export type EmptyResponse = {
|
||||
/**
|
||||
* Remove an extension from an active session.
|
||||
*/
|
||||
export type RemoveExtensionRequest = {
|
||||
export type RemoveExtensionRequest_unstable = {
|
||||
sessionId: string;
|
||||
name: string;
|
||||
};
|
||||
@@ -30,14 +30,14 @@ export type RemoveExtensionRequest = {
|
||||
/**
|
||||
* List all tools available in a session.
|
||||
*/
|
||||
export type GetToolsRequest = {
|
||||
export type GetToolsRequest_unstable = {
|
||||
sessionId: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Tools response.
|
||||
*/
|
||||
export type GetToolsResponse = {
|
||||
export type GetToolsResponse_unstable = {
|
||||
/**
|
||||
* Array of tool info objects with `name`, `description`, `parameters`, and optional `permission`.
|
||||
*/
|
||||
@@ -47,7 +47,7 @@ export type GetToolsResponse = {
|
||||
/**
|
||||
* Call a tool from an extension.
|
||||
*/
|
||||
export type GooseToolCallRequest = {
|
||||
export type GooseToolCallRequest_unstable = {
|
||||
sessionId: string;
|
||||
name: string;
|
||||
arguments?: unknown;
|
||||
@@ -56,7 +56,7 @@ export type GooseToolCallRequest = {
|
||||
/**
|
||||
* Tool call response.
|
||||
*/
|
||||
export type GooseToolCallResponse = {
|
||||
export type GooseToolCallResponse_unstable = {
|
||||
content?: Array<unknown>;
|
||||
structuredContent?: unknown;
|
||||
isError: boolean;
|
||||
@@ -66,7 +66,7 @@ export type GooseToolCallResponse = {
|
||||
/**
|
||||
* Read a resource from an extension.
|
||||
*/
|
||||
export type ReadResourceRequest = {
|
||||
export type ReadResourceRequest_unstable = {
|
||||
sessionId: string;
|
||||
uri: string;
|
||||
extensionName: string;
|
||||
@@ -75,7 +75,7 @@ export type ReadResourceRequest = {
|
||||
/**
|
||||
* Resource read response.
|
||||
*/
|
||||
export type ReadResourceResponse = {
|
||||
export type ReadResourceResponse_unstable = {
|
||||
/**
|
||||
* The resource result from the extension (MCP ReadResourceResult).
|
||||
*/
|
||||
@@ -85,7 +85,7 @@ export type ReadResourceResponse = {
|
||||
/**
|
||||
* Update the working directory for a session.
|
||||
*/
|
||||
export type UpdateWorkingDirRequest = {
|
||||
export type UpdateWorkingDirRequest_unstable = {
|
||||
sessionId: string;
|
||||
workingDir: string;
|
||||
};
|
||||
@@ -100,14 +100,14 @@ export type DeleteSessionRequest = {
|
||||
/**
|
||||
* List configured extensions and any warnings.
|
||||
*/
|
||||
export type GetExtensionsRequest = {
|
||||
export type GetExtensionsRequest_unstable = {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
|
||||
/**
|
||||
* List configured extensions and any warnings.
|
||||
*/
|
||||
export type GetExtensionsResponse = {
|
||||
export type GetExtensionsResponse_unstable = {
|
||||
/**
|
||||
* Array of ExtensionEntry objects with `enabled` flag, `configKey`, and flattened config details.
|
||||
*/
|
||||
@@ -118,7 +118,7 @@ export type GetExtensionsResponse = {
|
||||
/**
|
||||
* Persist a new extension to the user's global goose config.
|
||||
*/
|
||||
export type AddConfigExtensionRequest = {
|
||||
export type AddConfigExtensionRequest_unstable = {
|
||||
name: string;
|
||||
/**
|
||||
* Extension configuration. Must be a JSON object matching one of the
|
||||
@@ -132,30 +132,30 @@ export type AddConfigExtensionRequest = {
|
||||
/**
|
||||
* Remove a persisted extension from the user's global goose config.
|
||||
*/
|
||||
export type RemoveConfigExtensionRequest = {
|
||||
export type RemoveConfigExtensionRequest_unstable = {
|
||||
configKey: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Toggle the `enabled` flag for a persisted extension in the user's global goose config.
|
||||
*/
|
||||
export type ToggleConfigExtensionRequest = {
|
||||
export type ToggleConfigExtensionRequest_unstable = {
|
||||
configKey: string;
|
||||
enabled: boolean;
|
||||
};
|
||||
|
||||
export type GetSessionExtensionsRequest = {
|
||||
export type GetSessionExtensionsRequest_unstable = {
|
||||
sessionId: string;
|
||||
};
|
||||
|
||||
export type GetSessionExtensionsResponse = {
|
||||
export type GetSessionExtensionsResponse_unstable = {
|
||||
extensions: Array<unknown>;
|
||||
};
|
||||
|
||||
/**
|
||||
* List providers with setup metadata and the current model inventory snapshot.
|
||||
*/
|
||||
export type ListProvidersRequest = {
|
||||
export type ListProvidersRequest_unstable = {
|
||||
/**
|
||||
* Only return entries for these providers. Empty means all.
|
||||
*/
|
||||
@@ -165,7 +165,7 @@ export type ListProvidersRequest = {
|
||||
/**
|
||||
* Provider list response.
|
||||
*/
|
||||
export type ListProvidersResponse = {
|
||||
export type ListProvidersResponse_unstable = {
|
||||
entries: Array<ProviderInventoryEntryDto>;
|
||||
};
|
||||
|
||||
@@ -288,11 +288,11 @@ export type ProviderInventoryModelDto = {
|
||||
/**
|
||||
* List custom-provider catalog entries. Omit `format` to list all formats.
|
||||
*/
|
||||
export type ProviderCatalogListRequest = {
|
||||
export type ProviderCatalogListRequest_unstable = {
|
||||
format?: string | null;
|
||||
};
|
||||
|
||||
export type ProviderCatalogListResponse = {
|
||||
export type ProviderCatalogListResponse_unstable = {
|
||||
providers: Array<ProviderTemplateCatalogEntryDto>;
|
||||
};
|
||||
|
||||
@@ -309,11 +309,11 @@ export type ProviderTemplateCatalogEntryDto = {
|
||||
/**
|
||||
* List provider setup catalog entries
|
||||
*/
|
||||
export type ProviderSetupCatalogListRequest = {
|
||||
export type ProviderSetupCatalogListRequest_unstable = {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
|
||||
export type ProviderSetupCatalogListResponse = {
|
||||
export type ProviderSetupCatalogListResponse_unstable = {
|
||||
providers: Array<ProviderSetupCatalogEntryDto>;
|
||||
};
|
||||
|
||||
@@ -351,11 +351,11 @@ export type ProviderSetupGroupDto = 'default' | 'additional';
|
||||
/**
|
||||
* Return the editable template for one catalog provider.
|
||||
*/
|
||||
export type ProviderCatalogTemplateRequest = {
|
||||
export type ProviderCatalogTemplateRequest_unstable = {
|
||||
providerId: string;
|
||||
};
|
||||
|
||||
export type ProviderCatalogTemplateResponse = {
|
||||
export type ProviderCatalogTemplateResponse_unstable = {
|
||||
template: ProviderTemplateDto;
|
||||
};
|
||||
|
||||
@@ -388,7 +388,7 @@ export type ProviderTemplateCapabilitiesDto = {
|
||||
/**
|
||||
* Create a custom provider backed by Goose's declarative provider store.
|
||||
*/
|
||||
export type CustomProviderCreateRequest = {
|
||||
export type CustomProviderCreateRequest_unstable = {
|
||||
engine: string;
|
||||
displayName: string;
|
||||
apiUrl: string;
|
||||
@@ -404,10 +404,10 @@ export type CustomProviderCreateRequest = {
|
||||
preservesThinking?: boolean | null;
|
||||
};
|
||||
|
||||
export type CustomProviderCreateResponse = {
|
||||
export type CustomProviderCreateResponse_unstable = {
|
||||
providerId: string;
|
||||
status: ProviderConfigStatusDto;
|
||||
refresh: RefreshProviderInventoryResponse;
|
||||
refresh: RefreshProviderInventoryResponse_unstable;
|
||||
};
|
||||
|
||||
export type ProviderConfigStatusDto = {
|
||||
@@ -418,7 +418,7 @@ export type ProviderConfigStatusDto = {
|
||||
/**
|
||||
* Refresh acknowledgement.
|
||||
*/
|
||||
export type RefreshProviderInventoryResponse = {
|
||||
export type RefreshProviderInventoryResponse_unstable = {
|
||||
/**
|
||||
* Which providers will be refreshed.
|
||||
*/
|
||||
@@ -439,11 +439,11 @@ export type RefreshProviderInventorySkipReasonDto = 'unknown_provider' | 'not_co
|
||||
/**
|
||||
* Read a declarative provider config. Custom configs are editable; bundled configs are read-only.
|
||||
*/
|
||||
export type CustomProviderReadRequest = {
|
||||
export type CustomProviderReadRequest_unstable = {
|
||||
providerId: string;
|
||||
};
|
||||
|
||||
export type CustomProviderReadResponse = {
|
||||
export type CustomProviderReadResponse_unstable = {
|
||||
provider: CustomProviderConfigDto;
|
||||
editable: boolean;
|
||||
status: ProviderConfigStatusDto;
|
||||
@@ -470,7 +470,7 @@ export type CustomProviderConfigDto = {
|
||||
/**
|
||||
* Update a custom provider backed by Goose's declarative provider store.
|
||||
*/
|
||||
export type CustomProviderUpdateRequest = {
|
||||
export type CustomProviderUpdateRequest_unstable = {
|
||||
providerId: string;
|
||||
engine: string;
|
||||
displayName: string;
|
||||
@@ -487,28 +487,28 @@ export type CustomProviderUpdateRequest = {
|
||||
preservesThinking?: boolean | null;
|
||||
};
|
||||
|
||||
export type CustomProviderUpdateResponse = {
|
||||
export type CustomProviderUpdateResponse_unstable = {
|
||||
providerId: string;
|
||||
status: ProviderConfigStatusDto;
|
||||
refresh: RefreshProviderInventoryResponse;
|
||||
refresh: RefreshProviderInventoryResponse_unstable;
|
||||
};
|
||||
|
||||
/**
|
||||
* Delete a custom provider from Goose's declarative provider store.
|
||||
*/
|
||||
export type CustomProviderDeleteRequest = {
|
||||
export type CustomProviderDeleteRequest_unstable = {
|
||||
providerId: string;
|
||||
};
|
||||
|
||||
export type CustomProviderDeleteResponse = {
|
||||
export type CustomProviderDeleteResponse_unstable = {
|
||||
providerId: string;
|
||||
refresh: RefreshProviderInventoryResponse;
|
||||
refresh: RefreshProviderInventoryResponse_unstable;
|
||||
};
|
||||
|
||||
/**
|
||||
* Trigger a background refresh of provider inventories.
|
||||
*/
|
||||
export type RefreshProviderInventoryRequest = {
|
||||
export type RefreshProviderInventoryRequest_unstable = {
|
||||
/**
|
||||
* Which providers to refresh. Empty means all known providers.
|
||||
*/
|
||||
@@ -518,11 +518,11 @@ export type RefreshProviderInventoryRequest = {
|
||||
/**
|
||||
* Read saved configuration field values for one provider.
|
||||
*/
|
||||
export type ProviderConfigReadRequest = {
|
||||
export type ProviderConfigReadRequest_unstable = {
|
||||
providerId: string;
|
||||
};
|
||||
|
||||
export type ProviderConfigReadResponse = {
|
||||
export type ProviderConfigReadResponse_unstable = {
|
||||
fields: Array<ProviderConfigFieldValueDto>;
|
||||
};
|
||||
|
||||
@@ -537,18 +537,18 @@ export type ProviderConfigFieldValueDto = {
|
||||
/**
|
||||
* Return provider configured statuses. Empty provider_ids means all providers.
|
||||
*/
|
||||
export type ProviderConfigStatusRequest = {
|
||||
export type ProviderConfigStatusRequest_unstable = {
|
||||
providerIds?: Array<string>;
|
||||
};
|
||||
|
||||
export type ProviderConfigStatusResponse = {
|
||||
export type ProviderConfigStatusResponse_unstable = {
|
||||
statuses: Array<ProviderConfigStatusDto>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Save provider configuration fields and start an inventory refresh when supported.
|
||||
*/
|
||||
export type ProviderConfigSaveRequest = {
|
||||
export type ProviderConfigSaveRequest_unstable = {
|
||||
providerId: string;
|
||||
fields: Array<ProviderConfigFieldUpdate>;
|
||||
};
|
||||
@@ -558,35 +558,35 @@ export type ProviderConfigFieldUpdate = {
|
||||
value: string;
|
||||
};
|
||||
|
||||
export type ProviderConfigChangeResponse = {
|
||||
export type ProviderConfigChangeResponse_unstable = {
|
||||
status: ProviderConfigStatusDto;
|
||||
refresh: RefreshProviderInventoryResponse;
|
||||
refresh: RefreshProviderInventoryResponse_unstable;
|
||||
};
|
||||
|
||||
/**
|
||||
* Delete provider configuration fields and start an inventory refresh when supported.
|
||||
*/
|
||||
export type ProviderConfigDeleteRequest = {
|
||||
export type ProviderConfigDeleteRequest_unstable = {
|
||||
providerId: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Run a provider-owned native authentication flow and start an inventory refresh when supported.
|
||||
*/
|
||||
export type ProviderConfigAuthenticateRequest = {
|
||||
export type ProviderConfigAuthenticateRequest_unstable = {
|
||||
providerId: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Read allowlisted user preferences. Empty `keys` means all supported preferences.
|
||||
*/
|
||||
export type PreferencesReadRequest = {
|
||||
export type PreferencesReadRequest_unstable = {
|
||||
keys?: Array<PreferenceKey>;
|
||||
};
|
||||
|
||||
export type PreferenceKey = 'autoCompactThreshold' | 'voiceAutoSubmitPhrases' | 'voiceDictationProvider' | 'voiceDictationPreferredMic';
|
||||
|
||||
export type PreferencesReadResponse = {
|
||||
export type PreferencesReadResponse_unstable = {
|
||||
values: Array<PreferenceValue>;
|
||||
};
|
||||
|
||||
@@ -598,25 +598,25 @@ export type PreferenceValue = {
|
||||
/**
|
||||
* Save allowlisted user preferences.
|
||||
*/
|
||||
export type PreferencesSaveRequest = {
|
||||
export type PreferencesSaveRequest_unstable = {
|
||||
values?: Array<PreferenceValue>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Remove allowlisted user preferences.
|
||||
*/
|
||||
export type PreferencesRemoveRequest = {
|
||||
export type PreferencesRemoveRequest_unstable = {
|
||||
keys?: Array<PreferenceKey>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Read Goose default provider and model configuration.
|
||||
*/
|
||||
export type DefaultsReadRequest = {
|
||||
export type DefaultsReadRequest_unstable = {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
|
||||
export type DefaultsReadResponse = {
|
||||
export type DefaultsReadResponse_unstable = {
|
||||
providerId?: string | null;
|
||||
modelId?: string | null;
|
||||
};
|
||||
@@ -624,7 +624,7 @@ export type DefaultsReadResponse = {
|
||||
/**
|
||||
* Save Goose default provider and model configuration.
|
||||
*/
|
||||
export type DefaultsSaveRequest = {
|
||||
export type DefaultsSaveRequest_unstable = {
|
||||
providerId: string;
|
||||
modelId?: string | null;
|
||||
};
|
||||
@@ -632,7 +632,7 @@ export type DefaultsSaveRequest = {
|
||||
/**
|
||||
* Scan for existing Goose and compatible app data that onboarding can import.
|
||||
*/
|
||||
export type OnboardingImportScanRequest = {
|
||||
export type OnboardingImportScanRequest_unstable = {
|
||||
/**
|
||||
* Empty means all supported import sources.
|
||||
*/
|
||||
@@ -644,7 +644,7 @@ export type OnboardingImportScanRequest = {
|
||||
*/
|
||||
export type OnboardingImportSourceKind = 'goose_config' | 'claude_desktop';
|
||||
|
||||
export type OnboardingImportScanResponse = {
|
||||
export type OnboardingImportScanResponse_unstable = {
|
||||
candidates: Array<OnboardingImportCandidate>;
|
||||
};
|
||||
|
||||
@@ -669,43 +669,43 @@ export type OnboardingImportCounts = {
|
||||
/**
|
||||
* Import selected onboarding candidates.
|
||||
*/
|
||||
export type OnboardingImportApplyRequest = {
|
||||
export type OnboardingImportApplyRequest_unstable = {
|
||||
candidateIds?: Array<string>;
|
||||
enableImportedExtensions?: boolean;
|
||||
};
|
||||
|
||||
export type OnboardingImportApplyResponse = {
|
||||
export type OnboardingImportApplyResponse_unstable = {
|
||||
imported: OnboardingImportCounts;
|
||||
skipped: OnboardingImportCounts;
|
||||
warnings?: Array<string>;
|
||||
providerDefaults?: DefaultsReadResponse | null;
|
||||
providerDefaults?: DefaultsReadResponse_unstable | null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Export a session as a JSON string.
|
||||
*/
|
||||
export type ExportSessionRequest = {
|
||||
export type ExportSessionRequest_unstable = {
|
||||
sessionId: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Export session response — raw JSON of the goose session with `conversation`.
|
||||
*/
|
||||
export type ExportSessionResponse = {
|
||||
export type ExportSessionResponse_unstable = {
|
||||
data: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Import a session from a JSON string.
|
||||
*/
|
||||
export type ImportSessionRequest = {
|
||||
export type ImportSessionRequest_unstable = {
|
||||
data: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Import session response — metadata about the newly created session.
|
||||
*/
|
||||
export type ImportSessionResponse = {
|
||||
export type ImportSessionResponse_unstable = {
|
||||
sessionId: string;
|
||||
title?: string | null;
|
||||
updatedAt?: string | null;
|
||||
@@ -715,7 +715,7 @@ export type ImportSessionResponse = {
|
||||
/**
|
||||
* Update the project association for a session.
|
||||
*/
|
||||
export type UpdateSessionProjectRequest = {
|
||||
export type UpdateSessionProjectRequest_unstable = {
|
||||
sessionId: string;
|
||||
projectId?: string | null;
|
||||
};
|
||||
@@ -723,7 +723,7 @@ export type UpdateSessionProjectRequest = {
|
||||
/**
|
||||
* Rename a session.
|
||||
*/
|
||||
export type RenameSessionRequest = {
|
||||
export type RenameSessionRequest_unstable = {
|
||||
sessionId: string;
|
||||
title: string;
|
||||
};
|
||||
@@ -731,36 +731,26 @@ export type RenameSessionRequest = {
|
||||
/**
|
||||
* Archive a session (soft delete).
|
||||
*/
|
||||
export type ArchiveSessionRequest = {
|
||||
export type ArchiveSessionRequest_unstable = {
|
||||
sessionId: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Unarchive a previously archived session.
|
||||
*/
|
||||
export type UnarchiveSessionRequest = {
|
||||
export type UnarchiveSessionRequest_unstable = {
|
||||
sessionId: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Create a new source in an explicit target scope (global or project-scoped).
|
||||
*/
|
||||
export type CreateSourceRequest = {
|
||||
export type CreateSourceRequest_unstable = {
|
||||
type: SourceType;
|
||||
name: string;
|
||||
description: string;
|
||||
content: string;
|
||||
global: boolean;
|
||||
/**
|
||||
* Absolute path to the project root. Required when `global` is false.
|
||||
*/
|
||||
projectDir?: string | null;
|
||||
/**
|
||||
* Project source ID. When set with `global: false`, the backend resolves
|
||||
* the project's first working directory automatically. Takes precedence
|
||||
* over `project_dir`.
|
||||
*/
|
||||
projectId?: string | null;
|
||||
target: SourceScope;
|
||||
/**
|
||||
* Arbitrary key/value metadata.
|
||||
*/
|
||||
@@ -774,7 +764,20 @@ export type CreateSourceRequest = {
|
||||
*/
|
||||
export type SourceType = 'skill' | 'builtinSkill' | 'recipe' | 'subrecipe' | 'agent' | 'project';
|
||||
|
||||
export type CreateSourceResponse = {
|
||||
/**
|
||||
* Target scope for creating or importing sources.
|
||||
*/
|
||||
export type SourceScope = {
|
||||
scope: 'global';
|
||||
} | {
|
||||
projectDir: string;
|
||||
scope: 'projectDir';
|
||||
} | {
|
||||
projectId: string;
|
||||
scope: 'projectId';
|
||||
};
|
||||
|
||||
export type CreateSourceResponse_unstable = {
|
||||
source: SourceEntry;
|
||||
};
|
||||
|
||||
@@ -827,7 +830,7 @@ export type SourceEntry = {
|
||||
* set. If `type` is `builtinSkill`, this lists shipped read-only built-in
|
||||
* skills.
|
||||
*/
|
||||
export type ListSourcesRequest = {
|
||||
export type ListSourcesRequest_unstable = {
|
||||
type?: SourceType | null;
|
||||
projectDir?: string | null;
|
||||
/**
|
||||
@@ -837,14 +840,14 @@ export type ListSourcesRequest = {
|
||||
includeProjectSources?: boolean;
|
||||
};
|
||||
|
||||
export type ListSourcesResponse = {
|
||||
export type ListSourcesResponse_unstable = {
|
||||
sources: Array<SourceEntry>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Update an existing source's name, description, and content by absolute path.
|
||||
*/
|
||||
export type UpdateSourceRequest = {
|
||||
export type UpdateSourceRequest_unstable = {
|
||||
type: SourceType;
|
||||
path: string;
|
||||
name: string;
|
||||
@@ -862,14 +865,14 @@ export type UpdateSourceRequest = {
|
||||
} | null;
|
||||
};
|
||||
|
||||
export type UpdateSourceResponse = {
|
||||
export type UpdateSourceResponse_unstable = {
|
||||
source: SourceEntry;
|
||||
};
|
||||
|
||||
/**
|
||||
* Delete a source and its on-disk directory by absolute path.
|
||||
*/
|
||||
export type DeleteSourceRequest = {
|
||||
export type DeleteSourceRequest_unstable = {
|
||||
type: SourceType;
|
||||
path: string;
|
||||
};
|
||||
@@ -877,35 +880,34 @@ export type DeleteSourceRequest = {
|
||||
/**
|
||||
* Export a source at an absolute path as a portable JSON payload.
|
||||
*/
|
||||
export type ExportSourceRequest = {
|
||||
export type ExportSourceRequest_unstable = {
|
||||
type: SourceType;
|
||||
path: string;
|
||||
};
|
||||
|
||||
export type ExportSourceResponse = {
|
||||
export type ExportSourceResponse_unstable = {
|
||||
json: string;
|
||||
filename: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Import a source from a JSON export payload produced by `_goose/sources/export`.
|
||||
* Import a source from a JSON export payload produced by `_goose/unstable/sources/export`.
|
||||
* The imported source is written into the explicit target scope; on name
|
||||
* collisions a `-imported` suffix is appended.
|
||||
*/
|
||||
export type ImportSourcesRequest = {
|
||||
export type ImportSourcesRequest_unstable = {
|
||||
data: string;
|
||||
global: boolean;
|
||||
projectDir?: string | null;
|
||||
target: SourceScope;
|
||||
};
|
||||
|
||||
export type ImportSourcesResponse = {
|
||||
export type ImportSourcesResponse_unstable = {
|
||||
sources: Array<SourceEntry>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Transcribe audio via a dictation provider.
|
||||
*/
|
||||
export type DictationTranscribeRequest = {
|
||||
export type DictationTranscribeRequest_unstable = {
|
||||
/**
|
||||
* Base64-encoded audio data
|
||||
*/
|
||||
@@ -923,21 +925,21 @@ export type DictationTranscribeRequest = {
|
||||
/**
|
||||
* Transcription result.
|
||||
*/
|
||||
export type DictationTranscribeResponse = {
|
||||
export type DictationTranscribeResponse_unstable = {
|
||||
text: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the configuration status of all dictation providers.
|
||||
*/
|
||||
export type DictationConfigRequest = {
|
||||
export type DictationConfigRequest_unstable = {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
|
||||
/**
|
||||
* Dictation config response — map of provider name to status.
|
||||
*/
|
||||
export type DictationConfigResponse = {
|
||||
export type DictationConfigResponse_unstable = {
|
||||
providers: {
|
||||
[key: string]: DictationProviderStatusEntry;
|
||||
};
|
||||
@@ -968,7 +970,7 @@ export type DictationModelOption = {
|
||||
/**
|
||||
* Set a dictation provider secret value.
|
||||
*/
|
||||
export type DictationSecretSaveRequest = {
|
||||
export type DictationSecretSaveRequest_unstable = {
|
||||
provider: string;
|
||||
value: string;
|
||||
};
|
||||
@@ -976,18 +978,18 @@ export type DictationSecretSaveRequest = {
|
||||
/**
|
||||
* Remove a dictation provider secret value.
|
||||
*/
|
||||
export type DictationSecretDeleteRequest = {
|
||||
export type DictationSecretDeleteRequest_unstable = {
|
||||
provider: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* List available local Whisper models with their download status.
|
||||
*/
|
||||
export type DictationModelsListRequest = {
|
||||
export type DictationModelsListRequest_unstable = {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
|
||||
export type DictationModelsListResponse = {
|
||||
export type DictationModelsListResponse_unstable = {
|
||||
models: Array<DictationLocalModelStatus>;
|
||||
};
|
||||
|
||||
@@ -1003,18 +1005,18 @@ export type DictationLocalModelStatus = {
|
||||
/**
|
||||
* Kick off a background download of a local Whisper model.
|
||||
*/
|
||||
export type DictationModelDownloadRequest = {
|
||||
export type DictationModelDownloadRequest_unstable = {
|
||||
modelId: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Poll the progress of an in-flight download.
|
||||
*/
|
||||
export type DictationModelDownloadProgressRequest = {
|
||||
export type DictationModelDownloadProgressRequest_unstable = {
|
||||
modelId: string;
|
||||
};
|
||||
|
||||
export type DictationModelDownloadProgressResponse = {
|
||||
export type DictationModelDownloadProgressResponse_unstable = {
|
||||
/**
|
||||
* None when no download is active for this model id.
|
||||
*/
|
||||
@@ -1035,21 +1037,21 @@ export type DictationDownloadProgress = {
|
||||
/**
|
||||
* Cancel an in-flight download.
|
||||
*/
|
||||
export type DictationModelCancelRequest = {
|
||||
export type DictationModelCancelRequest_unstable = {
|
||||
modelId: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Delete a downloaded local Whisper model from disk.
|
||||
*/
|
||||
export type DictationModelDeleteRequest = {
|
||||
export type DictationModelDeleteRequest_unstable = {
|
||||
modelId: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Persist the user's model selection for a given provider.
|
||||
*/
|
||||
export type DictationModelSelectRequest = {
|
||||
export type DictationModelSelectRequest_unstable = {
|
||||
provider: string;
|
||||
modelId: string;
|
||||
};
|
||||
@@ -1057,14 +1059,14 @@ export type DictationModelSelectRequest = {
|
||||
export type ExtRequest = {
|
||||
id: string;
|
||||
method: string;
|
||||
params?: AddExtensionRequest | RemoveExtensionRequest | GetToolsRequest | GooseToolCallRequest | ReadResourceRequest | UpdateWorkingDirRequest | DeleteSessionRequest | GetExtensionsRequest | AddConfigExtensionRequest | RemoveConfigExtensionRequest | ToggleConfigExtensionRequest | GetSessionExtensionsRequest | ListProvidersRequest | ProviderCatalogListRequest | ProviderSetupCatalogListRequest | ProviderCatalogTemplateRequest | CustomProviderCreateRequest | CustomProviderReadRequest | CustomProviderUpdateRequest | CustomProviderDeleteRequest | RefreshProviderInventoryRequest | ProviderConfigReadRequest | ProviderConfigStatusRequest | ProviderConfigSaveRequest | ProviderConfigDeleteRequest | ProviderConfigAuthenticateRequest | PreferencesReadRequest | PreferencesSaveRequest | PreferencesRemoveRequest | DefaultsReadRequest | DefaultsSaveRequest | OnboardingImportScanRequest | OnboardingImportApplyRequest | ExportSessionRequest | ImportSessionRequest | UpdateSessionProjectRequest | RenameSessionRequest | ArchiveSessionRequest | UnarchiveSessionRequest | CreateSourceRequest | ListSourcesRequest | UpdateSourceRequest | DeleteSourceRequest | ExportSourceRequest | ImportSourcesRequest | DictationTranscribeRequest | DictationConfigRequest | DictationSecretSaveRequest | DictationSecretDeleteRequest | DictationModelsListRequest | DictationModelDownloadRequest | DictationModelDownloadProgressRequest | DictationModelCancelRequest | DictationModelDeleteRequest | DictationModelSelectRequest | {
|
||||
params?: AddExtensionRequest_unstable | RemoveExtensionRequest_unstable | GetToolsRequest_unstable | GooseToolCallRequest_unstable | ReadResourceRequest_unstable | UpdateWorkingDirRequest_unstable | DeleteSessionRequest | GetExtensionsRequest_unstable | AddConfigExtensionRequest_unstable | RemoveConfigExtensionRequest_unstable | ToggleConfigExtensionRequest_unstable | GetSessionExtensionsRequest_unstable | ListProvidersRequest_unstable | ProviderCatalogListRequest_unstable | ProviderSetupCatalogListRequest_unstable | ProviderCatalogTemplateRequest_unstable | CustomProviderCreateRequest_unstable | CustomProviderReadRequest_unstable | CustomProviderUpdateRequest_unstable | CustomProviderDeleteRequest_unstable | RefreshProviderInventoryRequest_unstable | ProviderConfigReadRequest_unstable | ProviderConfigStatusRequest_unstable | ProviderConfigSaveRequest_unstable | ProviderConfigDeleteRequest_unstable | ProviderConfigAuthenticateRequest_unstable | PreferencesReadRequest_unstable | PreferencesSaveRequest_unstable | PreferencesRemoveRequest_unstable | DefaultsReadRequest_unstable | DefaultsSaveRequest_unstable | OnboardingImportScanRequest_unstable | OnboardingImportApplyRequest_unstable | ExportSessionRequest_unstable | ImportSessionRequest_unstable | UpdateSessionProjectRequest_unstable | RenameSessionRequest_unstable | ArchiveSessionRequest_unstable | UnarchiveSessionRequest_unstable | CreateSourceRequest_unstable | ListSourcesRequest_unstable | UpdateSourceRequest_unstable | DeleteSourceRequest_unstable | ExportSourceRequest_unstable | ImportSourcesRequest_unstable | DictationTranscribeRequest_unstable | DictationConfigRequest_unstable | DictationSecretSaveRequest_unstable | DictationSecretDeleteRequest_unstable | DictationModelsListRequest_unstable | DictationModelDownloadRequest_unstable | DictationModelDownloadProgressRequest_unstable | DictationModelCancelRequest_unstable | DictationModelDeleteRequest_unstable | DictationModelSelectRequest_unstable | {
|
||||
[key: string]: unknown;
|
||||
} | null;
|
||||
};
|
||||
|
||||
export type ExtResponse = {
|
||||
id: string;
|
||||
result?: EmptyResponse | GetToolsResponse | GooseToolCallResponse | ReadResourceResponse | GetExtensionsResponse | GetSessionExtensionsResponse | ListProvidersResponse | ProviderCatalogListResponse | ProviderSetupCatalogListResponse | ProviderCatalogTemplateResponse | CustomProviderCreateResponse | CustomProviderReadResponse | CustomProviderUpdateResponse | CustomProviderDeleteResponse | RefreshProviderInventoryResponse | ProviderConfigReadResponse | ProviderConfigStatusResponse | ProviderConfigChangeResponse | PreferencesReadResponse | DefaultsReadResponse | OnboardingImportScanResponse | OnboardingImportApplyResponse | ExportSessionResponse | ImportSessionResponse | CreateSourceResponse | ListSourcesResponse | UpdateSourceResponse | ExportSourceResponse | ImportSourcesResponse | DictationTranscribeResponse | DictationConfigResponse | DictationModelsListResponse | DictationModelDownloadProgressResponse | unknown;
|
||||
result?: EmptyResponse | GetToolsResponse_unstable | GooseToolCallResponse_unstable | ReadResourceResponse_unstable | GetExtensionsResponse_unstable | GetSessionExtensionsResponse_unstable | ListProvidersResponse_unstable | ProviderCatalogListResponse_unstable | ProviderSetupCatalogListResponse_unstable | ProviderCatalogTemplateResponse_unstable | CustomProviderCreateResponse_unstable | CustomProviderReadResponse_unstable | CustomProviderUpdateResponse_unstable | CustomProviderDeleteResponse_unstable | RefreshProviderInventoryResponse_unstable | ProviderConfigReadResponse_unstable | ProviderConfigStatusResponse_unstable | ProviderConfigChangeResponse_unstable | PreferencesReadResponse_unstable | DefaultsReadResponse_unstable | OnboardingImportScanResponse_unstable | OnboardingImportApplyResponse_unstable | ExportSessionResponse_unstable | ImportSessionResponse_unstable | CreateSourceResponse_unstable | ListSourcesResponse_unstable | UpdateSourceResponse_unstable | ExportSourceResponse_unstable | ImportSourcesResponse_unstable | DictationTranscribeResponse_unstable | DictationConfigResponse_unstable | DictationModelsListResponse_unstable | DictationModelDownloadProgressResponse_unstable | unknown;
|
||||
} | {
|
||||
error: {
|
||||
code: number;
|
||||
|
||||
+197
-192
@@ -5,7 +5,7 @@ import { z } from 'zod';
|
||||
/**
|
||||
* Add an extension to an active session.
|
||||
*/
|
||||
export const zAddExtensionRequest = z.object({
|
||||
export const zAddExtensionRequest_unstable = z.object({
|
||||
sessionId: z.string(),
|
||||
config: z.unknown().optional().default(null)
|
||||
});
|
||||
@@ -18,7 +18,7 @@ export const zEmptyResponse = z.record(z.unknown());
|
||||
/**
|
||||
* Remove an extension from an active session.
|
||||
*/
|
||||
export const zRemoveExtensionRequest = z.object({
|
||||
export const zRemoveExtensionRequest_unstable = z.object({
|
||||
sessionId: z.string(),
|
||||
name: z.string()
|
||||
});
|
||||
@@ -26,21 +26,21 @@ export const zRemoveExtensionRequest = z.object({
|
||||
/**
|
||||
* List all tools available in a session.
|
||||
*/
|
||||
export const zGetToolsRequest = z.object({
|
||||
export const zGetToolsRequest_unstable = z.object({
|
||||
sessionId: z.string()
|
||||
});
|
||||
|
||||
/**
|
||||
* Tools response.
|
||||
*/
|
||||
export const zGetToolsResponse = z.object({
|
||||
export const zGetToolsResponse_unstable = z.object({
|
||||
tools: z.array(z.unknown())
|
||||
});
|
||||
|
||||
/**
|
||||
* Call a tool from an extension.
|
||||
*/
|
||||
export const zGooseToolCallRequest = z.object({
|
||||
export const zGooseToolCallRequest_unstable = z.object({
|
||||
sessionId: z.string(),
|
||||
name: z.string(),
|
||||
arguments: z.unknown().optional().default(null)
|
||||
@@ -49,7 +49,7 @@ export const zGooseToolCallRequest = z.object({
|
||||
/**
|
||||
* Tool call response.
|
||||
*/
|
||||
export const zGooseToolCallResponse = z.object({
|
||||
export const zGooseToolCallResponse_unstable = z.object({
|
||||
content: z.array(z.unknown()).optional().default([]),
|
||||
structuredContent: z.unknown().optional(),
|
||||
isError: z.boolean(),
|
||||
@@ -59,7 +59,7 @@ export const zGooseToolCallResponse = z.object({
|
||||
/**
|
||||
* Read a resource from an extension.
|
||||
*/
|
||||
export const zReadResourceRequest = z.object({
|
||||
export const zReadResourceRequest_unstable = z.object({
|
||||
sessionId: z.string(),
|
||||
uri: z.string(),
|
||||
extensionName: z.string()
|
||||
@@ -68,14 +68,14 @@ export const zReadResourceRequest = z.object({
|
||||
/**
|
||||
* Resource read response.
|
||||
*/
|
||||
export const zReadResourceResponse = z.object({
|
||||
export const zReadResourceResponse_unstable = z.object({
|
||||
result: z.unknown().optional().default(null)
|
||||
});
|
||||
|
||||
/**
|
||||
* Update the working directory for a session.
|
||||
*/
|
||||
export const zUpdateWorkingDirRequest = z.object({
|
||||
export const zUpdateWorkingDirRequest_unstable = z.object({
|
||||
sessionId: z.string(),
|
||||
workingDir: z.string()
|
||||
});
|
||||
@@ -90,12 +90,12 @@ export const zDeleteSessionRequest = z.object({
|
||||
/**
|
||||
* List configured extensions and any warnings.
|
||||
*/
|
||||
export const zGetExtensionsRequest = z.record(z.unknown());
|
||||
export const zGetExtensionsRequest_unstable = z.record(z.unknown());
|
||||
|
||||
/**
|
||||
* List configured extensions and any warnings.
|
||||
*/
|
||||
export const zGetExtensionsResponse = z.object({
|
||||
export const zGetExtensionsResponse_unstable = z.object({
|
||||
extensions: z.array(z.unknown()),
|
||||
warnings: z.array(z.string())
|
||||
});
|
||||
@@ -103,7 +103,7 @@ export const zGetExtensionsResponse = z.object({
|
||||
/**
|
||||
* Persist a new extension to the user's global goose config.
|
||||
*/
|
||||
export const zAddConfigExtensionRequest = z.object({
|
||||
export const zAddConfigExtensionRequest_unstable = z.object({
|
||||
name: z.string(),
|
||||
extensionConfig: z.unknown().optional().default(null),
|
||||
enabled: z.boolean().optional().default(false)
|
||||
@@ -112,30 +112,30 @@ export const zAddConfigExtensionRequest = z.object({
|
||||
/**
|
||||
* Remove a persisted extension from the user's global goose config.
|
||||
*/
|
||||
export const zRemoveConfigExtensionRequest = z.object({
|
||||
export const zRemoveConfigExtensionRequest_unstable = z.object({
|
||||
configKey: z.string()
|
||||
});
|
||||
|
||||
/**
|
||||
* Toggle the `enabled` flag for a persisted extension in the user's global goose config.
|
||||
*/
|
||||
export const zToggleConfigExtensionRequest = z.object({
|
||||
export const zToggleConfigExtensionRequest_unstable = z.object({
|
||||
configKey: z.string(),
|
||||
enabled: z.boolean()
|
||||
});
|
||||
|
||||
export const zGetSessionExtensionsRequest = z.object({
|
||||
export const zGetSessionExtensionsRequest_unstable = z.object({
|
||||
sessionId: z.string()
|
||||
});
|
||||
|
||||
export const zGetSessionExtensionsResponse = z.object({
|
||||
export const zGetSessionExtensionsResponse_unstable = z.object({
|
||||
extensions: z.array(z.unknown())
|
||||
});
|
||||
|
||||
/**
|
||||
* List providers with setup metadata and the current model inventory snapshot.
|
||||
*/
|
||||
export const zListProvidersRequest = z.object({
|
||||
export const zListProvidersRequest_unstable = z.object({
|
||||
providerIds: z.array(z.string()).optional().default([])
|
||||
});
|
||||
|
||||
@@ -213,14 +213,14 @@ export const zProviderInventoryEntryDto = z.object({
|
||||
/**
|
||||
* Provider list response.
|
||||
*/
|
||||
export const zListProvidersResponse = z.object({
|
||||
export const zListProvidersResponse_unstable = z.object({
|
||||
entries: z.array(zProviderInventoryEntryDto)
|
||||
});
|
||||
|
||||
/**
|
||||
* List custom-provider catalog entries. Omit `format` to list all formats.
|
||||
*/
|
||||
export const zProviderCatalogListRequest = z.object({
|
||||
export const zProviderCatalogListRequest_unstable = z.object({
|
||||
format: z.union([
|
||||
z.string(),
|
||||
z.null()
|
||||
@@ -237,14 +237,14 @@ export const zProviderTemplateCatalogEntryDto = z.object({
|
||||
envVar: z.string()
|
||||
});
|
||||
|
||||
export const zProviderCatalogListResponse = z.object({
|
||||
export const zProviderCatalogListResponse_unstable = z.object({
|
||||
providers: z.array(zProviderTemplateCatalogEntryDto)
|
||||
});
|
||||
|
||||
/**
|
||||
* List provider setup catalog entries
|
||||
*/
|
||||
export const zProviderSetupCatalogListRequest = z.record(z.unknown());
|
||||
export const zProviderSetupCatalogListRequest_unstable = z.record(z.unknown());
|
||||
|
||||
export const zProviderSetupMethodDto = z.enum([
|
||||
'none',
|
||||
@@ -302,14 +302,14 @@ export const zProviderSetupCatalogEntryDto = z.object({
|
||||
supportsAuthStatus: z.boolean()
|
||||
});
|
||||
|
||||
export const zProviderSetupCatalogListResponse = z.object({
|
||||
export const zProviderSetupCatalogListResponse_unstable = z.object({
|
||||
providers: z.array(zProviderSetupCatalogEntryDto)
|
||||
});
|
||||
|
||||
/**
|
||||
* Return the editable template for one catalog provider.
|
||||
*/
|
||||
export const zProviderCatalogTemplateRequest = z.object({
|
||||
export const zProviderCatalogTemplateRequest_unstable = z.object({
|
||||
providerId: z.string()
|
||||
});
|
||||
|
||||
@@ -339,14 +339,14 @@ export const zProviderTemplateDto = z.object({
|
||||
docUrl: z.string()
|
||||
});
|
||||
|
||||
export const zProviderCatalogTemplateResponse = z.object({
|
||||
export const zProviderCatalogTemplateResponse_unstable = z.object({
|
||||
template: zProviderTemplateDto
|
||||
});
|
||||
|
||||
/**
|
||||
* Create a custom provider backed by Goose's declarative provider store.
|
||||
*/
|
||||
export const zCustomProviderCreateRequest = z.object({
|
||||
export const zCustomProviderCreateRequest_unstable = z.object({
|
||||
engine: z.string(),
|
||||
displayName: z.string(),
|
||||
apiUrl: z.string(),
|
||||
@@ -395,21 +395,21 @@ export const zRefreshProviderInventorySkipDto = z.object({
|
||||
/**
|
||||
* Refresh acknowledgement.
|
||||
*/
|
||||
export const zRefreshProviderInventoryResponse = z.object({
|
||||
export const zRefreshProviderInventoryResponse_unstable = z.object({
|
||||
started: z.array(z.string()),
|
||||
skipped: z.array(zRefreshProviderInventorySkipDto).optional().default([])
|
||||
});
|
||||
|
||||
export const zCustomProviderCreateResponse = z.object({
|
||||
export const zCustomProviderCreateResponse_unstable = z.object({
|
||||
providerId: z.string(),
|
||||
status: zProviderConfigStatusDto,
|
||||
refresh: zRefreshProviderInventoryResponse
|
||||
refresh: zRefreshProviderInventoryResponse_unstable
|
||||
});
|
||||
|
||||
/**
|
||||
* Read a declarative provider config. Custom configs are editable; bundled configs are read-only.
|
||||
*/
|
||||
export const zCustomProviderReadRequest = z.object({
|
||||
export const zCustomProviderReadRequest_unstable = z.object({
|
||||
providerId: z.string()
|
||||
});
|
||||
|
||||
@@ -441,7 +441,7 @@ export const zCustomProviderConfigDto = z.object({
|
||||
preservesThinking: z.boolean()
|
||||
});
|
||||
|
||||
export const zCustomProviderReadResponse = z.object({
|
||||
export const zCustomProviderReadResponse_unstable = z.object({
|
||||
provider: zCustomProviderConfigDto,
|
||||
editable: z.boolean(),
|
||||
status: zProviderConfigStatusDto
|
||||
@@ -450,7 +450,7 @@ export const zCustomProviderReadResponse = z.object({
|
||||
/**
|
||||
* Update a custom provider backed by Goose's declarative provider store.
|
||||
*/
|
||||
export const zCustomProviderUpdateRequest = z.object({
|
||||
export const zCustomProviderUpdateRequest_unstable = z.object({
|
||||
providerId: z.string(),
|
||||
engine: z.string(),
|
||||
displayName: z.string(),
|
||||
@@ -480,35 +480,35 @@ export const zCustomProviderUpdateRequest = z.object({
|
||||
]).optional()
|
||||
});
|
||||
|
||||
export const zCustomProviderUpdateResponse = z.object({
|
||||
export const zCustomProviderUpdateResponse_unstable = z.object({
|
||||
providerId: z.string(),
|
||||
status: zProviderConfigStatusDto,
|
||||
refresh: zRefreshProviderInventoryResponse
|
||||
refresh: zRefreshProviderInventoryResponse_unstable
|
||||
});
|
||||
|
||||
/**
|
||||
* Delete a custom provider from Goose's declarative provider store.
|
||||
*/
|
||||
export const zCustomProviderDeleteRequest = z.object({
|
||||
export const zCustomProviderDeleteRequest_unstable = z.object({
|
||||
providerId: z.string()
|
||||
});
|
||||
|
||||
export const zCustomProviderDeleteResponse = z.object({
|
||||
export const zCustomProviderDeleteResponse_unstable = z.object({
|
||||
providerId: z.string(),
|
||||
refresh: zRefreshProviderInventoryResponse
|
||||
refresh: zRefreshProviderInventoryResponse_unstable
|
||||
});
|
||||
|
||||
/**
|
||||
* Trigger a background refresh of provider inventories.
|
||||
*/
|
||||
export const zRefreshProviderInventoryRequest = z.object({
|
||||
export const zRefreshProviderInventoryRequest_unstable = z.object({
|
||||
providerIds: z.array(z.string()).optional().default([])
|
||||
});
|
||||
|
||||
/**
|
||||
* Read saved configuration field values for one provider.
|
||||
*/
|
||||
export const zProviderConfigReadRequest = z.object({
|
||||
export const zProviderConfigReadRequest_unstable = z.object({
|
||||
providerId: z.string()
|
||||
});
|
||||
|
||||
@@ -523,18 +523,18 @@ export const zProviderConfigFieldValueDto = z.object({
|
||||
required: z.boolean()
|
||||
});
|
||||
|
||||
export const zProviderConfigReadResponse = z.object({
|
||||
export const zProviderConfigReadResponse_unstable = z.object({
|
||||
fields: z.array(zProviderConfigFieldValueDto)
|
||||
});
|
||||
|
||||
/**
|
||||
* Return provider configured statuses. Empty provider_ids means all providers.
|
||||
*/
|
||||
export const zProviderConfigStatusRequest = z.object({
|
||||
export const zProviderConfigStatusRequest_unstable = z.object({
|
||||
providerIds: z.array(z.string()).optional().default([])
|
||||
});
|
||||
|
||||
export const zProviderConfigStatusResponse = z.object({
|
||||
export const zProviderConfigStatusResponse_unstable = z.object({
|
||||
statuses: z.array(zProviderConfigStatusDto)
|
||||
});
|
||||
|
||||
@@ -546,27 +546,27 @@ export const zProviderConfigFieldUpdate = z.object({
|
||||
/**
|
||||
* Save provider configuration fields and start an inventory refresh when supported.
|
||||
*/
|
||||
export const zProviderConfigSaveRequest = z.object({
|
||||
export const zProviderConfigSaveRequest_unstable = z.object({
|
||||
providerId: z.string(),
|
||||
fields: z.array(zProviderConfigFieldUpdate)
|
||||
});
|
||||
|
||||
export const zProviderConfigChangeResponse = z.object({
|
||||
export const zProviderConfigChangeResponse_unstable = z.object({
|
||||
status: zProviderConfigStatusDto,
|
||||
refresh: zRefreshProviderInventoryResponse
|
||||
refresh: zRefreshProviderInventoryResponse_unstable
|
||||
});
|
||||
|
||||
/**
|
||||
* Delete provider configuration fields and start an inventory refresh when supported.
|
||||
*/
|
||||
export const zProviderConfigDeleteRequest = z.object({
|
||||
export const zProviderConfigDeleteRequest_unstable = z.object({
|
||||
providerId: z.string()
|
||||
});
|
||||
|
||||
/**
|
||||
* Run a provider-owned native authentication flow and start an inventory refresh when supported.
|
||||
*/
|
||||
export const zProviderConfigAuthenticateRequest = z.object({
|
||||
export const zProviderConfigAuthenticateRequest_unstable = z.object({
|
||||
providerId: z.string()
|
||||
});
|
||||
|
||||
@@ -580,7 +580,7 @@ export const zPreferenceKey = z.enum([
|
||||
/**
|
||||
* Read allowlisted user preferences. Empty `keys` means all supported preferences.
|
||||
*/
|
||||
export const zPreferencesReadRequest = z.object({
|
||||
export const zPreferencesReadRequest_unstable = z.object({
|
||||
keys: z.array(zPreferenceKey).optional().default([])
|
||||
});
|
||||
|
||||
@@ -589,30 +589,30 @@ export const zPreferenceValue = z.object({
|
||||
value: z.unknown().optional().default(null)
|
||||
});
|
||||
|
||||
export const zPreferencesReadResponse = z.object({
|
||||
export const zPreferencesReadResponse_unstable = z.object({
|
||||
values: z.array(zPreferenceValue)
|
||||
});
|
||||
|
||||
/**
|
||||
* Save allowlisted user preferences.
|
||||
*/
|
||||
export const zPreferencesSaveRequest = z.object({
|
||||
export const zPreferencesSaveRequest_unstable = z.object({
|
||||
values: z.array(zPreferenceValue).optional().default([])
|
||||
});
|
||||
|
||||
/**
|
||||
* Remove allowlisted user preferences.
|
||||
*/
|
||||
export const zPreferencesRemoveRequest = z.object({
|
||||
export const zPreferencesRemoveRequest_unstable = z.object({
|
||||
keys: z.array(zPreferenceKey).optional().default([])
|
||||
});
|
||||
|
||||
/**
|
||||
* Read Goose default provider and model configuration.
|
||||
*/
|
||||
export const zDefaultsReadRequest = z.record(z.unknown());
|
||||
export const zDefaultsReadRequest_unstable = z.record(z.unknown());
|
||||
|
||||
export const zDefaultsReadResponse = z.object({
|
||||
export const zDefaultsReadResponse_unstable = z.object({
|
||||
providerId: z.union([
|
||||
z.string(),
|
||||
z.null()
|
||||
@@ -626,7 +626,7 @@ export const zDefaultsReadResponse = z.object({
|
||||
/**
|
||||
* Save Goose default provider and model configuration.
|
||||
*/
|
||||
export const zDefaultsSaveRequest = z.object({
|
||||
export const zDefaultsSaveRequest_unstable = z.object({
|
||||
providerId: z.string(),
|
||||
modelId: z.union([
|
||||
z.string(),
|
||||
@@ -642,7 +642,7 @@ export const zOnboardingImportSourceKind = z.enum(['goose_config', 'claude_deskt
|
||||
/**
|
||||
* Scan for existing Goose and compatible app data that onboarding can import.
|
||||
*/
|
||||
export const zOnboardingImportScanRequest = z.object({
|
||||
export const zOnboardingImportScanRequest_unstable = z.object({
|
||||
sources: z.array(zOnboardingImportSourceKind).optional().default([])
|
||||
});
|
||||
|
||||
@@ -664,24 +664,24 @@ export const zOnboardingImportCandidate = z.object({
|
||||
warnings: z.array(z.string()).optional().default([])
|
||||
});
|
||||
|
||||
export const zOnboardingImportScanResponse = z.object({
|
||||
export const zOnboardingImportScanResponse_unstable = z.object({
|
||||
candidates: z.array(zOnboardingImportCandidate)
|
||||
});
|
||||
|
||||
/**
|
||||
* Import selected onboarding candidates.
|
||||
*/
|
||||
export const zOnboardingImportApplyRequest = z.object({
|
||||
export const zOnboardingImportApplyRequest_unstable = z.object({
|
||||
candidateIds: z.array(z.string()).optional().default([]),
|
||||
enableImportedExtensions: z.boolean().optional().default(false)
|
||||
});
|
||||
|
||||
export const zOnboardingImportApplyResponse = z.object({
|
||||
export const zOnboardingImportApplyResponse_unstable = z.object({
|
||||
imported: zOnboardingImportCounts,
|
||||
skipped: zOnboardingImportCounts,
|
||||
warnings: z.array(z.string()).optional().default([]),
|
||||
providerDefaults: z.union([
|
||||
zDefaultsReadResponse,
|
||||
zDefaultsReadResponse_unstable,
|
||||
z.null()
|
||||
]).optional()
|
||||
});
|
||||
@@ -689,28 +689,28 @@ export const zOnboardingImportApplyResponse = z.object({
|
||||
/**
|
||||
* Export a session as a JSON string.
|
||||
*/
|
||||
export const zExportSessionRequest = z.object({
|
||||
export const zExportSessionRequest_unstable = z.object({
|
||||
sessionId: z.string()
|
||||
});
|
||||
|
||||
/**
|
||||
* Export session response — raw JSON of the goose session with `conversation`.
|
||||
*/
|
||||
export const zExportSessionResponse = z.object({
|
||||
export const zExportSessionResponse_unstable = z.object({
|
||||
data: z.string()
|
||||
});
|
||||
|
||||
/**
|
||||
* Import a session from a JSON string.
|
||||
*/
|
||||
export const zImportSessionRequest = z.object({
|
||||
export const zImportSessionRequest_unstable = z.object({
|
||||
data: z.string()
|
||||
});
|
||||
|
||||
/**
|
||||
* Import session response — metadata about the newly created session.
|
||||
*/
|
||||
export const zImportSessionResponse = z.object({
|
||||
export const zImportSessionResponse_unstable = z.object({
|
||||
sessionId: z.string(),
|
||||
title: z.union([
|
||||
z.string(),
|
||||
@@ -726,7 +726,7 @@ export const zImportSessionResponse = z.object({
|
||||
/**
|
||||
* Update the project association for a session.
|
||||
*/
|
||||
export const zUpdateSessionProjectRequest = z.object({
|
||||
export const zUpdateSessionProjectRequest_unstable = z.object({
|
||||
sessionId: z.string(),
|
||||
projectId: z.union([
|
||||
z.string(),
|
||||
@@ -737,7 +737,7 @@ export const zUpdateSessionProjectRequest = z.object({
|
||||
/**
|
||||
* Rename a session.
|
||||
*/
|
||||
export const zRenameSessionRequest = z.object({
|
||||
export const zRenameSessionRequest_unstable = z.object({
|
||||
sessionId: z.string(),
|
||||
title: z.string()
|
||||
});
|
||||
@@ -745,14 +745,14 @@ export const zRenameSessionRequest = z.object({
|
||||
/**
|
||||
* Archive a session (soft delete).
|
||||
*/
|
||||
export const zArchiveSessionRequest = z.object({
|
||||
export const zArchiveSessionRequest_unstable = z.object({
|
||||
sessionId: z.string()
|
||||
});
|
||||
|
||||
/**
|
||||
* Unarchive a previously archived session.
|
||||
*/
|
||||
export const zUnarchiveSessionRequest = z.object({
|
||||
export const zUnarchiveSessionRequest_unstable = z.object({
|
||||
sessionId: z.string()
|
||||
});
|
||||
|
||||
@@ -768,23 +768,32 @@ export const zSourceType = z.enum([
|
||||
'project'
|
||||
]);
|
||||
|
||||
/**
|
||||
* Target scope for creating or importing sources.
|
||||
*/
|
||||
export const zSourceScope = z.union([
|
||||
z.object({
|
||||
scope: z.literal('global')
|
||||
}),
|
||||
z.object({
|
||||
projectDir: z.string(),
|
||||
scope: z.literal('projectDir')
|
||||
}),
|
||||
z.object({
|
||||
projectId: z.string(),
|
||||
scope: z.literal('projectId')
|
||||
})
|
||||
]);
|
||||
|
||||
/**
|
||||
* Create a new source in an explicit target scope (global or project-scoped).
|
||||
*/
|
||||
export const zCreateSourceRequest = z.object({
|
||||
export const zCreateSourceRequest_unstable = z.object({
|
||||
type: zSourceType,
|
||||
name: z.string(),
|
||||
description: z.string(),
|
||||
content: z.string(),
|
||||
global: z.boolean(),
|
||||
projectDir: z.union([
|
||||
z.string(),
|
||||
z.null()
|
||||
]).optional(),
|
||||
projectId: z.union([
|
||||
z.string(),
|
||||
z.null()
|
||||
]).optional(),
|
||||
target: zSourceScope,
|
||||
properties: z.record(z.unknown()).optional()
|
||||
});
|
||||
|
||||
@@ -805,7 +814,7 @@ export const zSourceEntry = z.object({
|
||||
properties: z.record(z.unknown()).optional()
|
||||
});
|
||||
|
||||
export const zCreateSourceResponse = z.object({
|
||||
export const zCreateSourceResponse_unstable = z.object({
|
||||
source: zSourceEntry
|
||||
});
|
||||
|
||||
@@ -817,7 +826,7 @@ export const zCreateSourceResponse = z.object({
|
||||
* set. If `type` is `builtinSkill`, this lists shipped read-only built-in
|
||||
* skills.
|
||||
*/
|
||||
export const zListSourcesRequest = z.object({
|
||||
export const zListSourcesRequest_unstable = z.object({
|
||||
type: z.union([
|
||||
zSourceType,
|
||||
z.null()
|
||||
@@ -829,14 +838,14 @@ export const zListSourcesRequest = z.object({
|
||||
includeProjectSources: z.boolean().optional().default(false)
|
||||
});
|
||||
|
||||
export const zListSourcesResponse = z.object({
|
||||
export const zListSourcesResponse_unstable = z.object({
|
||||
sources: z.array(zSourceEntry)
|
||||
});
|
||||
|
||||
/**
|
||||
* Update an existing source's name, description, and content by absolute path.
|
||||
*/
|
||||
export const zUpdateSourceRequest = z.object({
|
||||
export const zUpdateSourceRequest_unstable = z.object({
|
||||
type: zSourceType,
|
||||
path: z.string(),
|
||||
name: z.string(),
|
||||
@@ -848,14 +857,14 @@ export const zUpdateSourceRequest = z.object({
|
||||
]).optional()
|
||||
});
|
||||
|
||||
export const zUpdateSourceResponse = z.object({
|
||||
export const zUpdateSourceResponse_unstable = z.object({
|
||||
source: zSourceEntry
|
||||
});
|
||||
|
||||
/**
|
||||
* Delete a source and its on-disk directory by absolute path.
|
||||
*/
|
||||
export const zDeleteSourceRequest = z.object({
|
||||
export const zDeleteSourceRequest_unstable = z.object({
|
||||
type: zSourceType,
|
||||
path: z.string()
|
||||
});
|
||||
@@ -863,38 +872,34 @@ export const zDeleteSourceRequest = z.object({
|
||||
/**
|
||||
* Export a source at an absolute path as a portable JSON payload.
|
||||
*/
|
||||
export const zExportSourceRequest = z.object({
|
||||
export const zExportSourceRequest_unstable = z.object({
|
||||
type: zSourceType,
|
||||
path: z.string()
|
||||
});
|
||||
|
||||
export const zExportSourceResponse = z.object({
|
||||
export const zExportSourceResponse_unstable = z.object({
|
||||
json: z.string(),
|
||||
filename: z.string()
|
||||
});
|
||||
|
||||
/**
|
||||
* Import a source from a JSON export payload produced by `_goose/sources/export`.
|
||||
* Import a source from a JSON export payload produced by `_goose/unstable/sources/export`.
|
||||
* The imported source is written into the explicit target scope; on name
|
||||
* collisions a `-imported` suffix is appended.
|
||||
*/
|
||||
export const zImportSourcesRequest = z.object({
|
||||
export const zImportSourcesRequest_unstable = z.object({
|
||||
data: z.string(),
|
||||
global: z.boolean(),
|
||||
projectDir: z.union([
|
||||
z.string(),
|
||||
z.null()
|
||||
]).optional()
|
||||
target: zSourceScope
|
||||
});
|
||||
|
||||
export const zImportSourcesResponse = z.object({
|
||||
export const zImportSourcesResponse_unstable = z.object({
|
||||
sources: z.array(zSourceEntry)
|
||||
});
|
||||
|
||||
/**
|
||||
* Transcribe audio via a dictation provider.
|
||||
*/
|
||||
export const zDictationTranscribeRequest = z.object({
|
||||
export const zDictationTranscribeRequest_unstable = z.object({
|
||||
audio: z.string(),
|
||||
mimeType: z.string(),
|
||||
provider: z.string()
|
||||
@@ -903,14 +908,14 @@ export const zDictationTranscribeRequest = z.object({
|
||||
/**
|
||||
* Transcription result.
|
||||
*/
|
||||
export const zDictationTranscribeResponse = z.object({
|
||||
export const zDictationTranscribeResponse_unstable = z.object({
|
||||
text: z.string()
|
||||
});
|
||||
|
||||
/**
|
||||
* Get the configuration status of all dictation providers.
|
||||
*/
|
||||
export const zDictationConfigRequest = z.record(z.unknown());
|
||||
export const zDictationConfigRequest_unstable = z.record(z.unknown());
|
||||
|
||||
export const zDictationModelOption = z.object({
|
||||
id: z.string(),
|
||||
@@ -955,14 +960,14 @@ export const zDictationProviderStatusEntry = z.object({
|
||||
/**
|
||||
* Dictation config response — map of provider name to status.
|
||||
*/
|
||||
export const zDictationConfigResponse = z.object({
|
||||
export const zDictationConfigResponse_unstable = z.object({
|
||||
providers: z.record(zDictationProviderStatusEntry)
|
||||
});
|
||||
|
||||
/**
|
||||
* Set a dictation provider secret value.
|
||||
*/
|
||||
export const zDictationSecretSaveRequest = z.object({
|
||||
export const zDictationSecretSaveRequest_unstable = z.object({
|
||||
provider: z.string(),
|
||||
value: z.string()
|
||||
});
|
||||
@@ -970,14 +975,14 @@ export const zDictationSecretSaveRequest = z.object({
|
||||
/**
|
||||
* Remove a dictation provider secret value.
|
||||
*/
|
||||
export const zDictationSecretDeleteRequest = z.object({
|
||||
export const zDictationSecretDeleteRequest_unstable = z.object({
|
||||
provider: z.string()
|
||||
});
|
||||
|
||||
/**
|
||||
* List available local Whisper models with their download status.
|
||||
*/
|
||||
export const zDictationModelsListRequest = z.record(z.unknown());
|
||||
export const zDictationModelsListRequest_unstable = z.record(z.unknown());
|
||||
|
||||
export const zDictationLocalModelStatus = z.object({
|
||||
id: z.string(),
|
||||
@@ -988,21 +993,21 @@ export const zDictationLocalModelStatus = z.object({
|
||||
downloadInProgress: z.boolean()
|
||||
});
|
||||
|
||||
export const zDictationModelsListResponse = z.object({
|
||||
export const zDictationModelsListResponse_unstable = z.object({
|
||||
models: z.array(zDictationLocalModelStatus)
|
||||
});
|
||||
|
||||
/**
|
||||
* Kick off a background download of a local Whisper model.
|
||||
*/
|
||||
export const zDictationModelDownloadRequest = z.object({
|
||||
export const zDictationModelDownloadRequest_unstable = z.object({
|
||||
modelId: z.string()
|
||||
});
|
||||
|
||||
/**
|
||||
* Poll the progress of an in-flight download.
|
||||
*/
|
||||
export const zDictationModelDownloadProgressRequest = z.object({
|
||||
export const zDictationModelDownloadProgressRequest_unstable = z.object({
|
||||
modelId: z.string()
|
||||
});
|
||||
|
||||
@@ -1017,7 +1022,7 @@ export const zDictationDownloadProgress = z.object({
|
||||
]).optional()
|
||||
});
|
||||
|
||||
export const zDictationModelDownloadProgressResponse = z.object({
|
||||
export const zDictationModelDownloadProgressResponse_unstable = z.object({
|
||||
progress: z.union([
|
||||
zDictationDownloadProgress,
|
||||
z.null()
|
||||
@@ -1027,21 +1032,21 @@ export const zDictationModelDownloadProgressResponse = z.object({
|
||||
/**
|
||||
* Cancel an in-flight download.
|
||||
*/
|
||||
export const zDictationModelCancelRequest = z.object({
|
||||
export const zDictationModelCancelRequest_unstable = z.object({
|
||||
modelId: z.string()
|
||||
});
|
||||
|
||||
/**
|
||||
* Delete a downloaded local Whisper model from disk.
|
||||
*/
|
||||
export const zDictationModelDeleteRequest = z.object({
|
||||
export const zDictationModelDeleteRequest_unstable = z.object({
|
||||
modelId: z.string()
|
||||
});
|
||||
|
||||
/**
|
||||
* Persist the user's model selection for a given provider.
|
||||
*/
|
||||
export const zDictationModelSelectRequest = z.object({
|
||||
export const zDictationModelSelectRequest_unstable = z.object({
|
||||
provider: z.string(),
|
||||
modelId: z.string()
|
||||
});
|
||||
@@ -1051,61 +1056,61 @@ export const zExtRequest = z.object({
|
||||
method: z.string(),
|
||||
params: z.union([
|
||||
z.union([
|
||||
zAddExtensionRequest,
|
||||
zRemoveExtensionRequest,
|
||||
zGetToolsRequest,
|
||||
zGooseToolCallRequest,
|
||||
zReadResourceRequest,
|
||||
zUpdateWorkingDirRequest,
|
||||
zAddExtensionRequest_unstable,
|
||||
zRemoveExtensionRequest_unstable,
|
||||
zGetToolsRequest_unstable,
|
||||
zGooseToolCallRequest_unstable,
|
||||
zReadResourceRequest_unstable,
|
||||
zUpdateWorkingDirRequest_unstable,
|
||||
zDeleteSessionRequest,
|
||||
zGetExtensionsRequest,
|
||||
zAddConfigExtensionRequest,
|
||||
zRemoveConfigExtensionRequest,
|
||||
zToggleConfigExtensionRequest,
|
||||
zGetSessionExtensionsRequest,
|
||||
zListProvidersRequest,
|
||||
zProviderCatalogListRequest,
|
||||
zProviderSetupCatalogListRequest,
|
||||
zProviderCatalogTemplateRequest,
|
||||
zCustomProviderCreateRequest,
|
||||
zCustomProviderReadRequest,
|
||||
zCustomProviderUpdateRequest,
|
||||
zCustomProviderDeleteRequest,
|
||||
zRefreshProviderInventoryRequest,
|
||||
zProviderConfigReadRequest,
|
||||
zProviderConfigStatusRequest,
|
||||
zProviderConfigSaveRequest,
|
||||
zProviderConfigDeleteRequest,
|
||||
zProviderConfigAuthenticateRequest,
|
||||
zPreferencesReadRequest,
|
||||
zPreferencesSaveRequest,
|
||||
zPreferencesRemoveRequest,
|
||||
zDefaultsReadRequest,
|
||||
zDefaultsSaveRequest,
|
||||
zOnboardingImportScanRequest,
|
||||
zOnboardingImportApplyRequest,
|
||||
zExportSessionRequest,
|
||||
zImportSessionRequest,
|
||||
zUpdateSessionProjectRequest,
|
||||
zRenameSessionRequest,
|
||||
zArchiveSessionRequest,
|
||||
zUnarchiveSessionRequest,
|
||||
zCreateSourceRequest,
|
||||
zListSourcesRequest,
|
||||
zUpdateSourceRequest,
|
||||
zDeleteSourceRequest,
|
||||
zExportSourceRequest,
|
||||
zImportSourcesRequest,
|
||||
zDictationTranscribeRequest,
|
||||
zDictationConfigRequest,
|
||||
zDictationSecretSaveRequest,
|
||||
zDictationSecretDeleteRequest,
|
||||
zDictationModelsListRequest,
|
||||
zDictationModelDownloadRequest,
|
||||
zDictationModelDownloadProgressRequest,
|
||||
zDictationModelCancelRequest,
|
||||
zDictationModelDeleteRequest,
|
||||
zDictationModelSelectRequest
|
||||
zGetExtensionsRequest_unstable,
|
||||
zAddConfigExtensionRequest_unstable,
|
||||
zRemoveConfigExtensionRequest_unstable,
|
||||
zToggleConfigExtensionRequest_unstable,
|
||||
zGetSessionExtensionsRequest_unstable,
|
||||
zListProvidersRequest_unstable,
|
||||
zProviderCatalogListRequest_unstable,
|
||||
zProviderSetupCatalogListRequest_unstable,
|
||||
zProviderCatalogTemplateRequest_unstable,
|
||||
zCustomProviderCreateRequest_unstable,
|
||||
zCustomProviderReadRequest_unstable,
|
||||
zCustomProviderUpdateRequest_unstable,
|
||||
zCustomProviderDeleteRequest_unstable,
|
||||
zRefreshProviderInventoryRequest_unstable,
|
||||
zProviderConfigReadRequest_unstable,
|
||||
zProviderConfigStatusRequest_unstable,
|
||||
zProviderConfigSaveRequest_unstable,
|
||||
zProviderConfigDeleteRequest_unstable,
|
||||
zProviderConfigAuthenticateRequest_unstable,
|
||||
zPreferencesReadRequest_unstable,
|
||||
zPreferencesSaveRequest_unstable,
|
||||
zPreferencesRemoveRequest_unstable,
|
||||
zDefaultsReadRequest_unstable,
|
||||
zDefaultsSaveRequest_unstable,
|
||||
zOnboardingImportScanRequest_unstable,
|
||||
zOnboardingImportApplyRequest_unstable,
|
||||
zExportSessionRequest_unstable,
|
||||
zImportSessionRequest_unstable,
|
||||
zUpdateSessionProjectRequest_unstable,
|
||||
zRenameSessionRequest_unstable,
|
||||
zArchiveSessionRequest_unstable,
|
||||
zUnarchiveSessionRequest_unstable,
|
||||
zCreateSourceRequest_unstable,
|
||||
zListSourcesRequest_unstable,
|
||||
zUpdateSourceRequest_unstable,
|
||||
zDeleteSourceRequest_unstable,
|
||||
zExportSourceRequest_unstable,
|
||||
zImportSourcesRequest_unstable,
|
||||
zDictationTranscribeRequest_unstable,
|
||||
zDictationConfigRequest_unstable,
|
||||
zDictationSecretSaveRequest_unstable,
|
||||
zDictationSecretDeleteRequest_unstable,
|
||||
zDictationModelsListRequest_unstable,
|
||||
zDictationModelDownloadRequest_unstable,
|
||||
zDictationModelDownloadProgressRequest_unstable,
|
||||
zDictationModelCancelRequest_unstable,
|
||||
zDictationModelDeleteRequest_unstable,
|
||||
zDictationModelSelectRequest_unstable
|
||||
]),
|
||||
z.union([
|
||||
z.record(z.unknown()),
|
||||
@@ -1120,38 +1125,38 @@ export const zExtResponse = z.union([
|
||||
result: z.union([
|
||||
z.union([
|
||||
zEmptyResponse,
|
||||
zGetToolsResponse,
|
||||
zGooseToolCallResponse,
|
||||
zReadResourceResponse,
|
||||
zGetExtensionsResponse,
|
||||
zGetSessionExtensionsResponse,
|
||||
zListProvidersResponse,
|
||||
zProviderCatalogListResponse,
|
||||
zProviderSetupCatalogListResponse,
|
||||
zProviderCatalogTemplateResponse,
|
||||
zCustomProviderCreateResponse,
|
||||
zCustomProviderReadResponse,
|
||||
zCustomProviderUpdateResponse,
|
||||
zCustomProviderDeleteResponse,
|
||||
zRefreshProviderInventoryResponse,
|
||||
zProviderConfigReadResponse,
|
||||
zProviderConfigStatusResponse,
|
||||
zProviderConfigChangeResponse,
|
||||
zPreferencesReadResponse,
|
||||
zDefaultsReadResponse,
|
||||
zOnboardingImportScanResponse,
|
||||
zOnboardingImportApplyResponse,
|
||||
zExportSessionResponse,
|
||||
zImportSessionResponse,
|
||||
zCreateSourceResponse,
|
||||
zListSourcesResponse,
|
||||
zUpdateSourceResponse,
|
||||
zExportSourceResponse,
|
||||
zImportSourcesResponse,
|
||||
zDictationTranscribeResponse,
|
||||
zDictationConfigResponse,
|
||||
zDictationModelsListResponse,
|
||||
zDictationModelDownloadProgressResponse
|
||||
zGetToolsResponse_unstable,
|
||||
zGooseToolCallResponse_unstable,
|
||||
zReadResourceResponse_unstable,
|
||||
zGetExtensionsResponse_unstable,
|
||||
zGetSessionExtensionsResponse_unstable,
|
||||
zListProvidersResponse_unstable,
|
||||
zProviderCatalogListResponse_unstable,
|
||||
zProviderSetupCatalogListResponse_unstable,
|
||||
zProviderCatalogTemplateResponse_unstable,
|
||||
zCustomProviderCreateResponse_unstable,
|
||||
zCustomProviderReadResponse_unstable,
|
||||
zCustomProviderUpdateResponse_unstable,
|
||||
zCustomProviderDeleteResponse_unstable,
|
||||
zRefreshProviderInventoryResponse_unstable,
|
||||
zProviderConfigReadResponse_unstable,
|
||||
zProviderConfigStatusResponse_unstable,
|
||||
zProviderConfigChangeResponse_unstable,
|
||||
zPreferencesReadResponse_unstable,
|
||||
zDefaultsReadResponse_unstable,
|
||||
zOnboardingImportScanResponse_unstable,
|
||||
zOnboardingImportApplyResponse_unstable,
|
||||
zExportSessionResponse_unstable,
|
||||
zImportSessionResponse_unstable,
|
||||
zCreateSourceResponse_unstable,
|
||||
zListSourcesResponse_unstable,
|
||||
zUpdateSourceResponse_unstable,
|
||||
zExportSourceResponse_unstable,
|
||||
zImportSourcesResponse_unstable,
|
||||
zDictationTranscribeResponse_unstable,
|
||||
zDictationConfigResponse_unstable,
|
||||
zDictationModelsListResponse_unstable,
|
||||
zDictationModelDownloadProgressResponse_unstable
|
||||
]),
|
||||
z.unknown()
|
||||
]).optional()
|
||||
|
||||
+66
-28
@@ -60,7 +60,9 @@ const ModelSelector = React.memo(function ModelSelector({
|
||||
useEffect(() => {
|
||||
const availableModels = provider.models.map((model) => model.id);
|
||||
setModels(availableModels);
|
||||
const defaultIdx = availableModels.findIndex((model) => model === provider.defaultModel);
|
||||
const defaultIdx = availableModels.findIndex(
|
||||
(model) => model === provider.defaultModel,
|
||||
);
|
||||
setSelectedIdx(defaultIdx >= 0 ? defaultIdx : 0);
|
||||
setLoading(false);
|
||||
}, [provider.models, provider.defaultModel]);
|
||||
@@ -154,10 +156,14 @@ const ModelSelector = React.memo(function ModelSelector({
|
||||
<Box flexDirection="column" height={height} width={columns} paddingX={2}>
|
||||
<Box marginTop={1} />
|
||||
<Box justifyContent="center" marginBottom={1}>
|
||||
<Text color={TEXT_PRIMARY} bold>◆ Select model ◆</Text>
|
||||
<Text color={TEXT_PRIMARY} bold>
|
||||
◆ Select model ◆
|
||||
</Text>
|
||||
</Box>
|
||||
<Box justifyContent="center" marginBottom={2}>
|
||||
<Text color={TEXT_DIM}>Loading models for {provider.providerName}…</Text>
|
||||
<Text color={TEXT_DIM}>
|
||||
Loading models for {provider.providerName}…
|
||||
</Text>
|
||||
</Box>
|
||||
<Box justifyContent="center" flexGrow={1} alignItems="center">
|
||||
<Spinner idx={0} />
|
||||
@@ -171,7 +177,9 @@ const ModelSelector = React.memo(function ModelSelector({
|
||||
<Box flexDirection="column" height={height} width={columns} paddingX={2}>
|
||||
<Box marginTop={1} />
|
||||
<Box justifyContent="center" marginBottom={1}>
|
||||
<Text color={TEXT_PRIMARY} bold>◆ Select model ◆</Text>
|
||||
<Text color={TEXT_PRIMARY} bold>
|
||||
◆ Select model ◆
|
||||
</Text>
|
||||
</Box>
|
||||
<Box justifyContent="center" marginBottom={2}>
|
||||
<Text color={GOLD}>⚠ No models available</Text>
|
||||
@@ -193,18 +201,23 @@ const ModelSelector = React.memo(function ModelSelector({
|
||||
if (manualEntry) {
|
||||
const inputWidth = Math.min(60, maxWidth - 4);
|
||||
const displayText = searchQuery || "type model name…";
|
||||
const truncatedText = displayText.length > inputWidth - 6
|
||||
? displayText.slice(0, inputWidth - 9) + "…"
|
||||
: displayText;
|
||||
const truncatedText =
|
||||
displayText.length > inputWidth - 6
|
||||
? displayText.slice(0, inputWidth - 9) + "…"
|
||||
: displayText;
|
||||
|
||||
return (
|
||||
<Box flexDirection="column" height={height} width={columns} paddingX={2}>
|
||||
<Box marginTop={1} />
|
||||
<Box justifyContent="center" marginBottom={1}>
|
||||
<Text color={TEXT_PRIMARY} bold>◆ Enter model name ◆</Text>
|
||||
<Text color={TEXT_PRIMARY} bold>
|
||||
◆ Enter model name ◆
|
||||
</Text>
|
||||
</Box>
|
||||
<Box justifyContent="center" marginBottom={2}>
|
||||
<Text color={TEXT_DIM}>Type a model identifier for {provider.providerName}</Text>
|
||||
<Text color={TEXT_DIM}>
|
||||
Type a model identifier for {provider.providerName}
|
||||
</Text>
|
||||
</Box>
|
||||
|
||||
<Box justifyContent="center">
|
||||
@@ -214,7 +227,9 @@ const ModelSelector = React.memo(function ModelSelector({
|
||||
paddingX={2}
|
||||
width={inputWidth}
|
||||
>
|
||||
<Text color={GOLD} bold>{"❯ "}</Text>
|
||||
<Text color={GOLD} bold>
|
||||
{"❯ "}
|
||||
</Text>
|
||||
<Text color={searchQuery ? TEXT_PRIMARY : TEXT_DIM}>
|
||||
{truncatedText}
|
||||
</Text>
|
||||
@@ -236,7 +251,9 @@ const ModelSelector = React.memo(function ModelSelector({
|
||||
{/* Header */}
|
||||
<Box marginTop={1} />
|
||||
<Box justifyContent="center" marginBottom={1}>
|
||||
<Text color={TEXT_PRIMARY} bold>◆ Select model ◆</Text>
|
||||
<Text color={TEXT_PRIMARY} bold>
|
||||
◆ Select model ◆
|
||||
</Text>
|
||||
</Box>
|
||||
<Box justifyContent="center" marginBottom={2}>
|
||||
<Text color={TEXT_DIM}>Choose a model for {provider.providerName}</Text>
|
||||
@@ -250,7 +267,9 @@ const ModelSelector = React.memo(function ModelSelector({
|
||||
paddingX={2}
|
||||
width={searchBoxWidth}
|
||||
>
|
||||
<Text color={CRANBERRY} bold>{"❯ "}</Text>
|
||||
<Text color={CRANBERRY} bold>
|
||||
{"❯ "}
|
||||
</Text>
|
||||
<Box width={searchBoxWidth - 8}>
|
||||
<Text color={searchQuery ? TEXT_PRIMARY : TEXT_DIM} wrap="truncate">
|
||||
{searchQuery || "search models…"}
|
||||
@@ -262,7 +281,11 @@ const ModelSelector = React.memo(function ModelSelector({
|
||||
{/* Model List */}
|
||||
<Box flexDirection="column" flexGrow={1} justifyContent="flex-start">
|
||||
{filtered.length === 0 ? (
|
||||
<Box justifyContent="center" alignItems="center" height={Math.max(listHeight, 1)}>
|
||||
<Box
|
||||
justifyContent="center"
|
||||
alignItems="center"
|
||||
height={Math.max(listHeight, 1)}
|
||||
>
|
||||
<Text color={TEXT_DIM}>No matching models</Text>
|
||||
</Box>
|
||||
) : (
|
||||
@@ -279,16 +302,20 @@ const ModelSelector = React.memo(function ModelSelector({
|
||||
const active = idx === selectedIdx;
|
||||
const isDefault = model === provider.defaultModel;
|
||||
const modelWidth = maxWidth - 8;
|
||||
const truncatedModel = model.length > modelWidth
|
||||
? model.slice(0, modelWidth - 1) + "…"
|
||||
: model;
|
||||
const truncatedModel =
|
||||
model.length > modelWidth
|
||||
? model.slice(0, modelWidth - 1) + "…"
|
||||
: model;
|
||||
|
||||
return (
|
||||
<Box key={model}>
|
||||
<Text color={active ? GOLD : TEXT_DIM}>
|
||||
{active ? "▸ " : " "}
|
||||
</Text>
|
||||
<Text color={active ? TEXT_PRIMARY : TEXT_DIM} bold={active}>
|
||||
<Text
|
||||
color={active ? TEXT_PRIMARY : TEXT_DIM}
|
||||
bold={active}
|
||||
>
|
||||
{truncatedModel}
|
||||
</Text>
|
||||
{isDefault && <Text color={TEAL}> (default)</Text>}
|
||||
@@ -329,7 +356,8 @@ export default function ConfigureScreen({
|
||||
}: ConfigureProps) {
|
||||
const [phase, setPhase] = useState<Phase>("loading");
|
||||
const [providers, setProviders] = useState<ProviderInventoryEntryDto[]>([]);
|
||||
const [selectedProvider, setSelectedProvider] = useState<ProviderInventoryEntryDto | null>(null);
|
||||
const [selectedProvider, setSelectedProvider] =
|
||||
useState<ProviderInventoryEntryDto | null>(null);
|
||||
const [errorMsg, setErrorMsg] = useState("");
|
||||
const [spinIdx, setSpinIdx] = useState(0);
|
||||
const [fetchKey, setFetchKey] = useState(0);
|
||||
@@ -347,7 +375,9 @@ export default function ConfigureScreen({
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
const resp = await client.goose.GooseProvidersList({ providerIds: [] });
|
||||
const resp = await client.goose.providersList_unstable({
|
||||
providerIds: [],
|
||||
});
|
||||
if (cancelled) return;
|
||||
const sorted = [...resp.entries].sort((a, b) => {
|
||||
const aP = a.providerType === "Preferred" ? 0 : 1;
|
||||
@@ -359,7 +389,7 @@ export default function ConfigureScreen({
|
||||
|
||||
if (initialIntent === "model") {
|
||||
try {
|
||||
const cfg = await client.goose.GooseDefaultsRead({});
|
||||
const cfg = await client.goose.defaultsRead_unstable({});
|
||||
if (cancelled) return;
|
||||
const current = sorted.find((p) => p.providerId === cfg.providerId);
|
||||
if (current) {
|
||||
@@ -395,7 +425,7 @@ export default function ConfigureScreen({
|
||||
) => {
|
||||
setPhase("saving");
|
||||
try {
|
||||
await client.goose.GooseProvidersConfigSave({
|
||||
await client.goose.providersConfigSave_unstable({
|
||||
providerId: provider.providerId,
|
||||
fields: Object.entries(configValues).map(([key, value]) => ({
|
||||
key,
|
||||
@@ -421,7 +451,9 @@ export default function ConfigureScreen({
|
||||
[client, sessionId, onComplete],
|
||||
);
|
||||
|
||||
const [pendingConfigValues, setPendingConfigValues] = useState<Record<string, string>>({});
|
||||
const [pendingConfigValues, setPendingConfigValues] = useState<
|
||||
Record<string, string>
|
||||
>({});
|
||||
|
||||
const handleProviderSelected = useCallback(
|
||||
(provider: ProviderInventoryEntryDto) => {
|
||||
@@ -463,15 +495,19 @@ export default function ConfigureScreen({
|
||||
}, []);
|
||||
|
||||
if (phase === "loading" || phase === "loading_models" || phase === "saving") {
|
||||
const label =
|
||||
phase === "loading" ? "Loading providers…" :
|
||||
phase === "loading_models" ? "Loading models…" :
|
||||
"Applying changes…";
|
||||
const label =
|
||||
phase === "loading"
|
||||
? "Loading providers…"
|
||||
: phase === "loading_models"
|
||||
? "Loading models…"
|
||||
: "Applying changes…";
|
||||
return (
|
||||
<Box flexDirection="column" height={height} width={width} paddingX={2}>
|
||||
<Box marginTop={1} />
|
||||
<Box justifyContent="center" marginBottom={1}>
|
||||
<Text color={TEXT_PRIMARY} bold>◆ Configure provider ◆</Text>
|
||||
<Text color={TEXT_PRIMARY} bold>
|
||||
◆ Configure provider ◆
|
||||
</Text>
|
||||
</Box>
|
||||
<Box justifyContent="center" marginBottom={2}>
|
||||
<Text color={TEXT_DIM}>{label}</Text>
|
||||
@@ -488,7 +524,9 @@ export default function ConfigureScreen({
|
||||
<Box flexDirection="column" height={height} width={width} paddingX={2}>
|
||||
<Box marginTop={1} />
|
||||
<Box justifyContent="center" marginBottom={1}>
|
||||
<Text color={TEXT_PRIMARY} bold>◆ Configure provider ◆</Text>
|
||||
<Text color={TEXT_PRIMARY} bold>
|
||||
◆ Configure provider ◆
|
||||
</Text>
|
||||
</Box>
|
||||
<ErrorScreen errorMsg={errorMsg} onRetry={handleRetry} />
|
||||
</Box>
|
||||
|
||||
+296
-95
@@ -1,10 +1,17 @@
|
||||
import React, {useCallback, useEffect, useState} from "react";
|
||||
import {Box, Text, useInput, useStdout} from "ink";
|
||||
import {TextInput} from "@inkjs/ui";
|
||||
import type {GooseClient} from "@aaif/goose-sdk";
|
||||
import {CRANBERRY, GOLD, RULE_COLOR, TEAL, TEXT_DIM, TEXT_PRIMARY} from "./colors.js";
|
||||
import {Spinner, SPINNER_FRAMES} from "./components/Spinner.js";
|
||||
import {ErrorScreen} from "./components/ErrorScreen.js";
|
||||
import React, { useCallback, useEffect, useState } from "react";
|
||||
import { Box, Text, useInput, useStdout } from "ink";
|
||||
import { TextInput } from "@inkjs/ui";
|
||||
import type { GooseClient } from "@aaif/goose-sdk";
|
||||
import {
|
||||
CRANBERRY,
|
||||
GOLD,
|
||||
RULE_COLOR,
|
||||
TEAL,
|
||||
TEXT_DIM,
|
||||
TEXT_PRIMARY,
|
||||
} from "./colors.js";
|
||||
import { Spinner, SPINNER_FRAMES } from "./components/Spinner.js";
|
||||
import { ErrorScreen } from "./components/ErrorScreen.js";
|
||||
|
||||
type ExtEntry = {
|
||||
enabled: boolean;
|
||||
@@ -15,29 +22,65 @@ type ExtEntry = {
|
||||
};
|
||||
|
||||
function isExtEntry(v: unknown): v is ExtEntry {
|
||||
return !!v && typeof v === "object" && "enabled" in v && "type" in v && "name" in v
|
||||
&& typeof (v as ExtEntry).enabled === "boolean"
|
||||
&& typeof (v as ExtEntry).type === "string"
|
||||
&& typeof (v as ExtEntry).name === "string";
|
||||
return (
|
||||
!!v &&
|
||||
typeof v === "object" &&
|
||||
"enabled" in v &&
|
||||
"type" in v &&
|
||||
"name" in v &&
|
||||
typeof (v as ExtEntry).enabled === "boolean" &&
|
||||
typeof (v as ExtEntry).type === "string" &&
|
||||
typeof (v as ExtEntry).name === "string"
|
||||
);
|
||||
}
|
||||
|
||||
type AddType = "stdio" | "streamable_http";
|
||||
type Phase = "loading" | "list" | "add_type" | "add_value" | "add_name" | "add_desc" | "saving" | "error";
|
||||
type Phase =
|
||||
| "loading"
|
||||
| "list"
|
||||
| "add_type"
|
||||
| "add_value"
|
||||
| "add_name"
|
||||
| "add_desc"
|
||||
| "saving"
|
||||
| "error";
|
||||
|
||||
function deriveNameFromValue(addType: AddType, value: string): string {
|
||||
if (addType === "stdio") {
|
||||
const cmd = value.trim().split(/\s+/)[0] ?? "";
|
||||
return cmd.split("/").pop() ?? cmd;
|
||||
}
|
||||
try { return new URL(value.trim()).hostname; } catch { return value.trim(); }
|
||||
try {
|
||||
return new URL(value.trim()).hostname;
|
||||
} catch {
|
||||
return value.trim();
|
||||
}
|
||||
}
|
||||
|
||||
function buildConfig(addType: AddType, value: string, name: string, description: string): ExtEntry {
|
||||
function buildConfig(
|
||||
addType: AddType,
|
||||
value: string,
|
||||
name: string,
|
||||
description: string,
|
||||
): ExtEntry {
|
||||
if (addType === "stdio") {
|
||||
const parts = value.trim().split(/\s+/);
|
||||
return {type: "stdio", enabled: true, name, description, cmd: parts[0] ?? "", args: parts.slice(1)};
|
||||
return {
|
||||
type: "stdio",
|
||||
enabled: true,
|
||||
name,
|
||||
description,
|
||||
cmd: parts[0] ?? "",
|
||||
args: parts.slice(1),
|
||||
};
|
||||
}
|
||||
return {type: "streamable_http", enabled: true, name, description, uri: value.trim()};
|
||||
return {
|
||||
type: "streamable_http",
|
||||
enabled: true,
|
||||
name,
|
||||
description,
|
||||
uri: value.trim(),
|
||||
};
|
||||
}
|
||||
|
||||
export default function ExtensionsManager({
|
||||
@@ -51,7 +94,7 @@ export default function ExtensionsManager({
|
||||
height: number;
|
||||
onClose: () => void;
|
||||
}) {
|
||||
const {stdout} = useStdout();
|
||||
const { stdout } = useStdout();
|
||||
const columns = stdout?.columns ?? 80;
|
||||
|
||||
const [phase, setPhase] = useState<Phase>("loading");
|
||||
@@ -68,7 +111,10 @@ export default function ExtensionsManager({
|
||||
const [inputKey, setInputKey] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
const t = setInterval(() => setSpinIdx(i => (i + 1) % SPINNER_FRAMES.length), 300);
|
||||
const t = setInterval(
|
||||
() => setSpinIdx((i) => (i + 1) % SPINNER_FRAMES.length),
|
||||
300,
|
||||
);
|
||||
return () => clearInterval(t);
|
||||
}, []);
|
||||
|
||||
@@ -76,16 +122,23 @@ export default function ExtensionsManager({
|
||||
setPhase("loading");
|
||||
try {
|
||||
const [configResp, sessionResp] = await Promise.all([
|
||||
client.goose.GooseConfigExtensions({}),
|
||||
client.goose.GooseSessionExtensions({sessionId}),
|
||||
client.goose.configExtensionsList_unstable({}),
|
||||
client.goose.sessionExtensionsList_unstable({ sessionId }),
|
||||
]);
|
||||
|
||||
const allExtensions = (configResp.extensions as unknown[]).filter(isExtEntry);
|
||||
const allExtensions = (configResp.extensions as unknown[]).filter(
|
||||
isExtEntry,
|
||||
);
|
||||
const activeNames = new Set(
|
||||
(sessionResp.extensions as Array<{name?: string}>).map(e => e.name),
|
||||
(sessionResp.extensions as Array<{ name?: string }>).map((e) => e.name),
|
||||
);
|
||||
|
||||
setEntries(allExtensions.map(ext => ({...ext, enabled: activeNames.has(ext.name)})));
|
||||
setEntries(
|
||||
allExtensions.map((ext) => ({
|
||||
...ext,
|
||||
enabled: activeNames.has(ext.name),
|
||||
})),
|
||||
);
|
||||
setWarnings(configResp.warnings ?? []);
|
||||
setPhase("list");
|
||||
} catch (e: unknown) {
|
||||
@@ -94,60 +147,115 @@ export default function ExtensionsManager({
|
||||
}
|
||||
}, [client, sessionId]);
|
||||
|
||||
useEffect(() => { reload(); }, [reload]);
|
||||
|
||||
const withSaving = useCallback(async (fn: () => Promise<void>) => {
|
||||
setPhase("saving");
|
||||
try {
|
||||
await fn();
|
||||
await reload();
|
||||
} catch (e: unknown) {
|
||||
setErrorMsg(e instanceof Error ? e.message : String(e));
|
||||
setPhase("error");
|
||||
}
|
||||
useEffect(() => {
|
||||
reload();
|
||||
}, [reload]);
|
||||
|
||||
const withSaving = useCallback(
|
||||
async (fn: () => Promise<void>) => {
|
||||
setPhase("saving");
|
||||
try {
|
||||
await fn();
|
||||
await reload();
|
||||
} catch (e: unknown) {
|
||||
setErrorMsg(e instanceof Error ? e.message : String(e));
|
||||
setPhase("error");
|
||||
}
|
||||
},
|
||||
[reload],
|
||||
);
|
||||
|
||||
const toggleSelected = useCallback(() => {
|
||||
const sel = entries[selectedIdx];
|
||||
if (!sel) return;
|
||||
withSaving(async () => {
|
||||
if (sel.enabled) {
|
||||
await client.goose.GooseExtensionsRemove({sessionId, name: sel.name});
|
||||
await client.goose.sessionExtensionsRemove_unstable({
|
||||
sessionId,
|
||||
name: sel.name,
|
||||
});
|
||||
} else {
|
||||
await client.goose.GooseExtensionsAdd({sessionId, config: sel as any});
|
||||
await client.goose.sessionExtensionsAdd_unstable({
|
||||
sessionId,
|
||||
config: sel as any,
|
||||
});
|
||||
}
|
||||
});
|
||||
}, [entries, selectedIdx, client, sessionId, withSaving]);
|
||||
|
||||
const saveNewExtension = useCallback((description: string) => {
|
||||
const config = buildConfig(addType, addValue, addName, description);
|
||||
withSaving(async () => {
|
||||
await client.goose.GooseConfigExtensionsAdd({
|
||||
name: config.name,
|
||||
extensionConfig: config as any,
|
||||
enabled: true,
|
||||
const saveNewExtension = useCallback(
|
||||
(description: string) => {
|
||||
const config = buildConfig(addType, addValue, addName, description);
|
||||
withSaving(async () => {
|
||||
await client.goose.configExtensionsAdd_unstable({
|
||||
name: config.name,
|
||||
extensionConfig: config as any,
|
||||
enabled: true,
|
||||
});
|
||||
await client.goose.sessionExtensionsAdd_unstable({
|
||||
sessionId,
|
||||
config: config as any,
|
||||
});
|
||||
});
|
||||
await client.goose.GooseExtensionsAdd({sessionId, config: config as any});
|
||||
});
|
||||
}, [addType, addValue, addName, client, sessionId, withSaving]);
|
||||
},
|
||||
[addType, addValue, addName, client, sessionId, withSaving],
|
||||
);
|
||||
|
||||
useInput((ch, key) => {
|
||||
if (phase === "list") {
|
||||
if (key.escape) { onClose(); return; }
|
||||
if (key.upArrow) { setSelectedIdx(i => Math.max(i - 1, 0)); return; }
|
||||
if (key.downArrow) { setSelectedIdx(i => Math.min(i + 1, entries.length - 1)); return; }
|
||||
if (ch === " " || key.return) { toggleSelected(); return; }
|
||||
if (ch === "a") { setAddType("stdio"); setPhase("add_type"); return; }
|
||||
if (key.escape) {
|
||||
onClose();
|
||||
return;
|
||||
}
|
||||
if (key.upArrow) {
|
||||
setSelectedIdx((i) => Math.max(i - 1, 0));
|
||||
return;
|
||||
}
|
||||
if (key.downArrow) {
|
||||
setSelectedIdx((i) => Math.min(i + 1, entries.length - 1));
|
||||
return;
|
||||
}
|
||||
if (ch === " " || key.return) {
|
||||
toggleSelected();
|
||||
return;
|
||||
}
|
||||
if (ch === "a") {
|
||||
setAddType("stdio");
|
||||
setPhase("add_type");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (phase === "add_type") {
|
||||
if (key.escape) { setPhase("list"); return; }
|
||||
if (key.upArrow || key.downArrow) { setAddType(t => t === "stdio" ? "streamable_http" : "stdio"); return; }
|
||||
if (key.return) { setAddValue(""); setInputKey(k => k + 1); setPhase("add_value"); return; }
|
||||
if (key.escape) {
|
||||
setPhase("list");
|
||||
return;
|
||||
}
|
||||
if (key.upArrow || key.downArrow) {
|
||||
setAddType((t) => (t === "stdio" ? "streamable_http" : "stdio"));
|
||||
return;
|
||||
}
|
||||
if (key.return) {
|
||||
setAddValue("");
|
||||
setInputKey((k) => k + 1);
|
||||
setPhase("add_value");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (key.escape) {
|
||||
if (phase === "add_value") { setPhase("add_type"); return; }
|
||||
if (phase === "add_name") { setInputKey(k => k + 1); setPhase("add_value"); return; }
|
||||
if (phase === "add_desc") { setInputKey(k => k + 1); setPhase("add_name"); return; }
|
||||
if (phase === "add_value") {
|
||||
setPhase("add_type");
|
||||
return;
|
||||
}
|
||||
if (phase === "add_name") {
|
||||
setInputKey((k) => k + 1);
|
||||
setPhase("add_value");
|
||||
return;
|
||||
}
|
||||
if (phase === "add_desc") {
|
||||
setInputKey((k) => k + 1);
|
||||
setPhase("add_name");
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -156,10 +264,14 @@ export default function ExtensionsManager({
|
||||
<Box flexDirection="column" height={height} width={columns} paddingX={2}>
|
||||
<Box marginTop={1} />
|
||||
<Box justifyContent="center" marginBottom={1}>
|
||||
<Text color={TEXT_PRIMARY} bold>◆ Manage extensions ◆</Text>
|
||||
<Text color={TEXT_PRIMARY} bold>
|
||||
◆ Manage extensions ◆
|
||||
</Text>
|
||||
</Box>
|
||||
<Box justifyContent="center" marginBottom={2}>
|
||||
<Text color={TEXT_DIM}>{phase === "loading" ? "Loading extensions…" : "Saving…"}</Text>
|
||||
<Text color={TEXT_DIM}>
|
||||
{phase === "loading" ? "Loading extensions…" : "Saving…"}
|
||||
</Text>
|
||||
</Box>
|
||||
<Box justifyContent="center" flexGrow={1} alignItems="center">
|
||||
<Spinner idx={spinIdx} />
|
||||
@@ -173,7 +285,9 @@ export default function ExtensionsManager({
|
||||
<Box flexDirection="column" height={height} width={columns} paddingX={2}>
|
||||
<Box marginTop={1} />
|
||||
<Box justifyContent="center" marginBottom={1}>
|
||||
<Text color={TEXT_PRIMARY} bold>◆ Manage extensions ◆</Text>
|
||||
<Text color={TEXT_PRIMARY} bold>
|
||||
◆ Manage extensions ◆
|
||||
</Text>
|
||||
</Box>
|
||||
<ErrorScreen errorMsg={errorMsg} onRetry={() => reload()} />
|
||||
</Box>
|
||||
@@ -184,28 +298,38 @@ export default function ExtensionsManager({
|
||||
const inputW = Math.min(maxW - 10, 70);
|
||||
|
||||
if (phase === "add_type") {
|
||||
const types: {value: AddType; label: string; hint: string}[] = [
|
||||
{value: "stdio", label: "Command (stdio)", hint: "run a local command"},
|
||||
{value: "streamable_http", label: "Endpoint (HTTP)", hint: "connect to a remote server"},
|
||||
const types: { value: AddType; label: string; hint: string }[] = [
|
||||
{ value: "stdio", label: "Command (stdio)", hint: "run a local command" },
|
||||
{
|
||||
value: "streamable_http",
|
||||
label: "Endpoint (HTTP)",
|
||||
hint: "connect to a remote server",
|
||||
},
|
||||
];
|
||||
return (
|
||||
<Box flexDirection="column" width={columns} height={height} paddingX={2}>
|
||||
<Box marginTop={1} />
|
||||
<Box justifyContent="center" marginBottom={1}>
|
||||
<Text color={TEXT_PRIMARY} bold>◆ Add extension ◆</Text>
|
||||
<Text color={TEXT_PRIMARY} bold>
|
||||
◆ Add extension ◆
|
||||
</Text>
|
||||
</Box>
|
||||
<Box justifyContent="center" marginBottom={2}>
|
||||
<Text color={TEXT_DIM}>Choose a connection type</Text>
|
||||
</Box>
|
||||
<Box justifyContent="center">
|
||||
<Box flexDirection="column">
|
||||
{types.map(t => {
|
||||
{types.map((t) => {
|
||||
const active = addType === t.value;
|
||||
return (
|
||||
<Box key={t.value}>
|
||||
<Text color={active ? GOLD : TEXT_DIM}>{active ? "▸ " : " "}</Text>
|
||||
<Text color={active ? TEXT_PRIMARY : TEXT_DIM} bold={active}>{t.label}</Text>
|
||||
<Text color={TEXT_DIM}> {t.hint}</Text>
|
||||
<Text color={active ? GOLD : TEXT_DIM}>
|
||||
{active ? "▸ " : " "}
|
||||
</Text>
|
||||
<Text color={active ? TEXT_PRIMARY : TEXT_DIM} bold={active}>
|
||||
{t.label}
|
||||
</Text>
|
||||
<Text color={TEXT_DIM}> {t.hint}</Text>
|
||||
</Box>
|
||||
);
|
||||
})}
|
||||
@@ -227,14 +351,27 @@ export default function ExtensionsManager({
|
||||
<Box flexDirection="column" width={columns} height={height} paddingX={2}>
|
||||
<Box marginTop={1} />
|
||||
<Box justifyContent="center" marginBottom={1}>
|
||||
<Text color={TEXT_PRIMARY} bold>◆ {isStdio ? "Enter command" : "Enter endpoint URL"} ◆</Text>
|
||||
<Text color={TEXT_PRIMARY} bold>
|
||||
◆ {isStdio ? "Enter command" : "Enter endpoint URL"} ◆
|
||||
</Text>
|
||||
</Box>
|
||||
<Box justifyContent="center" marginBottom={2}>
|
||||
<Text color={TEXT_DIM}>{isStdio ? "The command to launch the extension" : "URL of the remote MCP server"}</Text>
|
||||
<Text color={TEXT_DIM}>
|
||||
{isStdio
|
||||
? "The command to launch the extension"
|
||||
: "URL of the remote MCP server"}
|
||||
</Text>
|
||||
</Box>
|
||||
<Box justifyContent="center">
|
||||
<Box borderStyle="round" borderColor={RULE_COLOR} paddingX={2} width={inputW}>
|
||||
<Text color={CRANBERRY} bold>{"❯ "}</Text>
|
||||
<Box
|
||||
borderStyle="round"
|
||||
borderColor={RULE_COLOR}
|
||||
paddingX={2}
|
||||
width={inputW}
|
||||
>
|
||||
<Text color={CRANBERRY} bold>
|
||||
{"❯ "}
|
||||
</Text>
|
||||
<TextInput
|
||||
key={`value-${inputKey}`}
|
||||
placeholder={placeholder}
|
||||
@@ -243,7 +380,7 @@ export default function ExtensionsManager({
|
||||
if (!v.trim()) return;
|
||||
setAddValue(v);
|
||||
setAddName(deriveNameFromValue(addType, v));
|
||||
setInputKey(k => k + 1);
|
||||
setInputKey((k) => k + 1);
|
||||
setPhase("add_name");
|
||||
}}
|
||||
/>
|
||||
@@ -261,14 +398,23 @@ export default function ExtensionsManager({
|
||||
<Box flexDirection="column" width={columns} height={height} paddingX={2}>
|
||||
<Box marginTop={1} />
|
||||
<Box justifyContent="center" marginBottom={1}>
|
||||
<Text color={TEXT_PRIMARY} bold>◆ Name this extension ◆</Text>
|
||||
<Text color={TEXT_PRIMARY} bold>
|
||||
◆ Name this extension ◆
|
||||
</Text>
|
||||
</Box>
|
||||
<Box justifyContent="center" marginBottom={2}>
|
||||
<Text color={TEXT_DIM}>A short name to identify this extension</Text>
|
||||
</Box>
|
||||
<Box justifyContent="center">
|
||||
<Box borderStyle="round" borderColor={RULE_COLOR} paddingX={2} width={inputW}>
|
||||
<Text color={CRANBERRY} bold>{"❯ "}</Text>
|
||||
<Box
|
||||
borderStyle="round"
|
||||
borderColor={RULE_COLOR}
|
||||
paddingX={2}
|
||||
width={inputW}
|
||||
>
|
||||
<Text color={CRANBERRY} bold>
|
||||
{"❯ "}
|
||||
</Text>
|
||||
<TextInput
|
||||
key={`name-${inputKey}`}
|
||||
defaultValue={addName}
|
||||
@@ -278,7 +424,7 @@ export default function ExtensionsManager({
|
||||
if (!v.trim()) return;
|
||||
setAddName(v.trim());
|
||||
setAddDesc("");
|
||||
setInputKey(k => k + 1);
|
||||
setInputKey((k) => k + 1);
|
||||
setPhase("add_desc");
|
||||
}}
|
||||
/>
|
||||
@@ -296,14 +442,23 @@ export default function ExtensionsManager({
|
||||
<Box flexDirection="column" width={columns} height={height} paddingX={2}>
|
||||
<Box marginTop={1} />
|
||||
<Box justifyContent="center" marginBottom={1}>
|
||||
<Text color={TEXT_PRIMARY} bold>◆ Description ◆</Text>
|
||||
<Text color={TEXT_PRIMARY} bold>
|
||||
◆ Description ◆
|
||||
</Text>
|
||||
</Box>
|
||||
<Box justifyContent="center" marginBottom={2}>
|
||||
<Text color={TEXT_DIM}>What does this extension do? (optional)</Text>
|
||||
</Box>
|
||||
<Box justifyContent="center">
|
||||
<Box borderStyle="round" borderColor={RULE_COLOR} paddingX={2} width={inputW}>
|
||||
<Text color={CRANBERRY} bold>{"❯ "}</Text>
|
||||
<Box
|
||||
borderStyle="round"
|
||||
borderColor={RULE_COLOR}
|
||||
paddingX={2}
|
||||
width={inputW}
|
||||
>
|
||||
<Text color={CRANBERRY} bold>
|
||||
{"❯ "}
|
||||
</Text>
|
||||
<TextInput
|
||||
key={`desc-${inputKey}`}
|
||||
placeholder="what does this extension do?"
|
||||
@@ -313,7 +468,9 @@ export default function ExtensionsManager({
|
||||
</Box>
|
||||
</Box>
|
||||
<Box justifyContent="center" marginTop={2}>
|
||||
<Text color={TEXT_DIM}>enter save (leave empty to skip) · esc back</Text>
|
||||
<Text color={TEXT_DIM}>
|
||||
enter save (leave empty to skip) · esc back
|
||||
</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
@@ -322,12 +479,15 @@ export default function ExtensionsManager({
|
||||
const layoutW = maxW;
|
||||
const GUTTER = 2;
|
||||
const STATUS_W = 10;
|
||||
const nameW = Math.max(16, Math.floor(layoutW * 0.30));
|
||||
const nameW = Math.max(16, Math.floor(layoutW * 0.3));
|
||||
const descW = Math.max(8, layoutW - 2 - STATUS_W - nameW - 2 * GUTTER);
|
||||
|
||||
const rows = Math.max(height - 9, 4);
|
||||
const maxStart = Math.max(0, entries.length - rows);
|
||||
const start = Math.min(maxStart, Math.max(0, selectedIdx - Math.floor(rows / 2)));
|
||||
const start = Math.min(
|
||||
maxStart,
|
||||
Math.max(0, selectedIdx - Math.floor(rows / 2)),
|
||||
);
|
||||
const end = Math.min(entries.length, start + rows);
|
||||
const windowed = entries.slice(start, end);
|
||||
|
||||
@@ -336,17 +496,27 @@ export default function ExtensionsManager({
|
||||
{/* Header */}
|
||||
<Box marginTop={1} />
|
||||
<Box justifyContent="center" marginBottom={1}>
|
||||
<Text color={TEXT_PRIMARY} bold>◆ Manage extensions ◆</Text>
|
||||
<Text color={TEXT_PRIMARY} bold>
|
||||
◆ Manage extensions ◆
|
||||
</Text>
|
||||
</Box>
|
||||
<Box justifyContent="center" marginBottom={2}>
|
||||
<Text color={TEXT_DIM}>Toggle, add, or remove extensions for this session</Text>
|
||||
<Text color={TEXT_DIM}>
|
||||
Toggle, add, or remove extensions for this session
|
||||
</Text>
|
||||
</Box>
|
||||
|
||||
{/* Extension List */}
|
||||
<Box flexDirection="column" flexGrow={1} justifyContent="flex-start">
|
||||
{entries.length === 0 ? (
|
||||
<Box justifyContent="center" alignItems="center" height={Math.max(rows - 1, 1)}>
|
||||
<Text color={TEXT_DIM}>No extensions configured — press a to add one</Text>
|
||||
<Box
|
||||
justifyContent="center"
|
||||
alignItems="center"
|
||||
height={Math.max(rows - 1, 1)}
|
||||
>
|
||||
<Text color={TEXT_DIM}>
|
||||
No extensions configured — press a to add one
|
||||
</Text>
|
||||
</Box>
|
||||
) : (
|
||||
<>
|
||||
@@ -362,12 +532,37 @@ export default function ExtensionsManager({
|
||||
const active = globalIdx === selectedIdx;
|
||||
return (
|
||||
<Box key={`${ext.type}:${ext.name}`} width={layoutW}>
|
||||
<Text color={active ? GOLD : TEXT_DIM}>{active ? "▸ " : " "}</Text>
|
||||
<Box width={nameW}><Text color={active ? TEXT_PRIMARY : TEXT_DIM} bold={active} wrap="truncate">{ext.name}</Text></Box>
|
||||
<Box width={GUTTER}><Text>{" ".repeat(GUTTER)}</Text></Box>
|
||||
<Box width={descW}><Text color={TEXT_DIM} wrap="truncate">{ext.description || ""}</Text></Box>
|
||||
<Box width={GUTTER}><Text>{" ".repeat(GUTTER)}</Text></Box>
|
||||
<Box width={STATUS_W}><Text color={ext.enabled ? TEAL : TEXT_DIM} wrap="truncate">{ext.enabled ? "enabled" : "disabled"}</Text></Box>
|
||||
<Text color={active ? GOLD : TEXT_DIM}>
|
||||
{active ? "▸ " : " "}
|
||||
</Text>
|
||||
<Box width={nameW}>
|
||||
<Text
|
||||
color={active ? TEXT_PRIMARY : TEXT_DIM}
|
||||
bold={active}
|
||||
wrap="truncate"
|
||||
>
|
||||
{ext.name}
|
||||
</Text>
|
||||
</Box>
|
||||
<Box width={GUTTER}>
|
||||
<Text>{" ".repeat(GUTTER)}</Text>
|
||||
</Box>
|
||||
<Box width={descW}>
|
||||
<Text color={TEXT_DIM} wrap="truncate">
|
||||
{ext.description || ""}
|
||||
</Text>
|
||||
</Box>
|
||||
<Box width={GUTTER}>
|
||||
<Text>{" ".repeat(GUTTER)}</Text>
|
||||
</Box>
|
||||
<Box width={STATUS_W}>
|
||||
<Text
|
||||
color={ext.enabled ? TEAL : TEXT_DIM}
|
||||
wrap="truncate"
|
||||
>
|
||||
{ext.enabled ? "enabled" : "disabled"}
|
||||
</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
})}
|
||||
@@ -375,7 +570,9 @@ export default function ExtensionsManager({
|
||||
</Box>
|
||||
{end < entries.length && (
|
||||
<Box justifyContent="center" marginTop={1}>
|
||||
<Text color={TEXT_DIM}>▼ {entries.length - end} more below</Text>
|
||||
<Text color={TEXT_DIM}>
|
||||
▼ {entries.length - end} more below
|
||||
</Text>
|
||||
</Box>
|
||||
)}
|
||||
</>
|
||||
@@ -387,7 +584,11 @@ export default function ExtensionsManager({
|
||||
<Box width={layoutW} flexDirection="column">
|
||||
<Text color={GOLD}>Warnings</Text>
|
||||
{warnings.map((w, i) => (
|
||||
<Box key={i} width={layoutW}><Text color={TEXT_DIM} wrap="truncate">• {w}</Text></Box>
|
||||
<Box key={i} width={layoutW}>
|
||||
<Text color={TEXT_DIM} wrap="truncate">
|
||||
• {w}
|
||||
</Text>
|
||||
</Box>
|
||||
))}
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
+117
-65
@@ -1,6 +1,6 @@
|
||||
import React, { useState, useEffect, useCallback } from "react";
|
||||
import { Box, Text, useInput, useStdout } from "ink";
|
||||
import { TextInput, PasswordInput } from '@inkjs/ui';
|
||||
import { TextInput, PasswordInput } from "@inkjs/ui";
|
||||
import type { GooseClient, ProviderInventoryEntryDto } from "@aaif/goose-sdk";
|
||||
import {
|
||||
CRANBERRY,
|
||||
@@ -38,7 +38,14 @@ export interface ProviderSelectorProps {
|
||||
onBack?: () => void;
|
||||
}
|
||||
|
||||
export const ProviderSelector = React.memo(function ProviderSelector({ providers, height, onSelect, title, subtitle, onBack }: ProviderSelectorProps) {
|
||||
export const ProviderSelector = React.memo(function ProviderSelector({
|
||||
providers,
|
||||
height,
|
||||
onSelect,
|
||||
title,
|
||||
subtitle,
|
||||
onBack,
|
||||
}: ProviderSelectorProps) {
|
||||
const [selectedIdx, setSelectedIdx] = useState(0);
|
||||
const [searchQuery, setSearchQuery] = useState("");
|
||||
const { stdout } = useStdout();
|
||||
@@ -55,27 +62,38 @@ export const ProviderSelector = React.memo(function ProviderSelector({ providers
|
||||
})();
|
||||
|
||||
// Calculate grid dimensions based on terminal size
|
||||
const cardWidth = 36; // Width of each provider card
|
||||
const cardHeight = 8; // Height of each provider card
|
||||
const minSpacing = 2; // Minimum spacing between cards
|
||||
|
||||
const cardWidth = 36; // Width of each provider card
|
||||
const cardHeight = 8; // Height of each provider card
|
||||
const minSpacing = 2; // Minimum spacing between cards
|
||||
|
||||
const availableWidth = columns - 4; // Leave margins
|
||||
// Header: marginTop(1) + title+mb(2) + subtitle+mb(3) + searchbar+mb(5) = 11
|
||||
// Footer: mt(2) + text(1) = 3, plus potential scroll indicators(2)
|
||||
const availableHeight = height - 16;
|
||||
|
||||
const cardsPerRow = Math.max(1, Math.floor(availableWidth / (cardWidth + minSpacing)));
|
||||
|
||||
const cardsPerRow = Math.max(
|
||||
1,
|
||||
Math.floor(availableWidth / (cardWidth + minSpacing)),
|
||||
);
|
||||
// Cap horizontal gap so it doesn't grow unbounded on wide terminals
|
||||
const columnSpacing = Math.min(minSpacing, Math.floor((availableWidth - (cardsPerRow * cardWidth)) / Math.max(1, cardsPerRow - 1)));
|
||||
const columnSpacing = Math.min(
|
||||
minSpacing,
|
||||
Math.floor(
|
||||
(availableWidth - cardsPerRow * cardWidth) / Math.max(1, cardsPerRow - 1),
|
||||
),
|
||||
);
|
||||
// Terminal chars are ~2× taller than wide, so 1 row ≈ 2 columns visually
|
||||
const rowSpacing = 1;
|
||||
const rowsVisible = Math.max(1, Math.floor((availableHeight + rowSpacing) / (cardHeight + rowSpacing)));
|
||||
|
||||
const rowsVisible = Math.max(
|
||||
1,
|
||||
Math.floor((availableHeight + rowSpacing) / (cardHeight + rowSpacing)),
|
||||
);
|
||||
|
||||
const totalRows = Math.ceil(filtered.length / cardsPerRow);
|
||||
const selectedRow = Math.floor(selectedIdx / cardsPerRow);
|
||||
// Calculate scroll offset for rows
|
||||
const [scrollRow, setScrollRow] = useState(0);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (selectedRow < scrollRow) {
|
||||
setScrollRow(selectedRow);
|
||||
@@ -159,7 +177,7 @@ export const ProviderSelector = React.memo(function ProviderSelector({ providers
|
||||
const cardBorder = isSelected ? "double" : "single";
|
||||
const cardBorderColor = isSelected ? GOLD : RULE_COLOR;
|
||||
const textColor = isSelected ? TEXT_PRIMARY : TEXT_SECONDARY;
|
||||
|
||||
|
||||
// Calculate actual content width: cardWidth - borders (2) - paddingX (2)
|
||||
const contentWidth = cardWidth - 4;
|
||||
// Width for title (leave space for icons: 2-3 chars)
|
||||
@@ -167,7 +185,7 @@ export const ProviderSelector = React.memo(function ProviderSelector({ providers
|
||||
// Available lines for description: cardHeight - borders (2) - title (1) - margin (1) - name (1) - margin (1)
|
||||
const descriptionMaxLines = Math.max(1, cardHeight - 6);
|
||||
const descriptionMaxChars = descriptionMaxLines * contentWidth;
|
||||
|
||||
|
||||
return (
|
||||
<Box
|
||||
key={provider.providerId}
|
||||
@@ -189,12 +207,10 @@ export const ProviderSelector = React.memo(function ProviderSelector({ providers
|
||||
{provider.providerType === "Preferred" && (
|
||||
<Text color={TEAL}>★</Text>
|
||||
)}
|
||||
{provider.configured && (
|
||||
<Text color={TEAL}>✓</Text>
|
||||
)}
|
||||
{provider.configured && <Text color={TEAL}>✓</Text>}
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
|
||||
<Box marginTop={1} flexDirection="column" flexGrow={1}>
|
||||
<Box width={contentWidth}>
|
||||
<Text color={TEXT_DIM} wrap="truncate">
|
||||
@@ -216,22 +232,33 @@ export const ProviderSelector = React.memo(function ProviderSelector({ providers
|
||||
};
|
||||
|
||||
const visibleRows = [];
|
||||
for (let row = scrollRow; row < Math.min(scrollRow + rowsVisible, totalRows); row++) {
|
||||
for (
|
||||
let row = scrollRow;
|
||||
row < Math.min(scrollRow + rowsVisible, totalRows);
|
||||
row++
|
||||
) {
|
||||
const rowProviders = [];
|
||||
for (let col = 0; col < cardsPerRow; col++) {
|
||||
const index = row * cardsPerRow + col;
|
||||
if (index < filtered.length) {
|
||||
const isSelected = index === selectedIdx;
|
||||
rowProviders.push(renderProviderCard(filtered[index], index, isSelected));
|
||||
rowProviders.push(
|
||||
renderProviderCard(filtered[index], index, isSelected),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (rowProviders.length > 0) {
|
||||
const isLastVisibleRow = row === Math.min(scrollRow + rowsVisible, totalRows) - 1;
|
||||
const isLastVisibleRow =
|
||||
row === Math.min(scrollRow + rowsVisible, totalRows) - 1;
|
||||
visibleRows.push(
|
||||
<Box key={row} gap={columnSpacing} marginBottom={isLastVisibleRow ? 0 : rowSpacing}>
|
||||
<Box
|
||||
key={row}
|
||||
gap={columnSpacing}
|
||||
marginBottom={isLastVisibleRow ? 0 : rowSpacing}
|
||||
>
|
||||
{rowProviders}
|
||||
</Box>
|
||||
</Box>,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -250,7 +277,7 @@ export const ProviderSelector = React.memo(function ProviderSelector({ providers
|
||||
{subtitle ?? "Connect an AI model provider to get started"}
|
||||
</Text>
|
||||
</Box>
|
||||
|
||||
|
||||
{/* Search Bar */}
|
||||
<Box justifyContent="center" marginBottom={2}>
|
||||
<Box
|
||||
@@ -278,20 +305,21 @@ export const ProviderSelector = React.memo(function ProviderSelector({ providers
|
||||
<>
|
||||
{scrollRow > 0 && (
|
||||
<Box justifyContent="center" marginBottom={1}>
|
||||
<Text color={TEXT_DIM}>▲ {scrollRow * cardsPerRow} more above</Text>
|
||||
<Text color={TEXT_DIM}>
|
||||
▲ {scrollRow * cardsPerRow} more above
|
||||
</Text>
|
||||
</Box>
|
||||
)}
|
||||
|
||||
|
||||
<Box justifyContent="center">
|
||||
<Box flexDirection="column">
|
||||
{visibleRows}
|
||||
</Box>
|
||||
<Box flexDirection="column">{visibleRows}</Box>
|
||||
</Box>
|
||||
|
||||
|
||||
{scrollRow + rowsVisible < totalRows && (
|
||||
<Box justifyContent="center" marginTop={1}>
|
||||
<Text color={TEXT_DIM}>
|
||||
▼ {filtered.length - (scrollRow + rowsVisible) * cardsPerRow} more below
|
||||
▼ {filtered.length - (scrollRow + rowsVisible) * cardsPerRow}{" "}
|
||||
more below
|
||||
</Text>
|
||||
</Box>
|
||||
)}
|
||||
@@ -302,7 +330,8 @@ export const ProviderSelector = React.memo(function ProviderSelector({ providers
|
||||
{/* Footer */}
|
||||
<Box justifyContent="center" marginTop={2}>
|
||||
<Text color={TEXT_DIM}>
|
||||
↑↓←→ navigate · enter select · type to search{onBack ? " · esc back" : " · esc clear"}
|
||||
↑↓←→ navigate · enter select · type to search
|
||||
{onBack ? " · esc back" : " · esc clear"}
|
||||
</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
@@ -316,7 +345,12 @@ export interface ProviderConfiguratorProps {
|
||||
onBack: () => void;
|
||||
}
|
||||
|
||||
export const ProviderConfigurator = React.memo(function ProviderConfigurator({ provider, height, onComplete, onBack }: ProviderConfiguratorProps) {
|
||||
export const ProviderConfigurator = React.memo(function ProviderConfigurator({
|
||||
provider,
|
||||
height,
|
||||
onComplete,
|
||||
onBack,
|
||||
}: ProviderConfiguratorProps) {
|
||||
const [keyValues, setKeyValues] = useState<Record<string, string>>({});
|
||||
const [activeKeyIdx, setActiveKeyIdx] = useState(0);
|
||||
const [showMasked, setShowMasked] = useState<Record<string, boolean>>({});
|
||||
@@ -354,7 +388,7 @@ export const ProviderConfigurator = React.memo(function ProviderConfigurator({ p
|
||||
if (activeKeyIdx < keys.length - 1) {
|
||||
setActiveKeyIdx(activeKeyIdx + 1);
|
||||
setShowMasked({});
|
||||
setInputKey(prev => prev + 1); // Force new input component
|
||||
setInputKey((prev) => prev + 1); // Force new input component
|
||||
} else {
|
||||
onComplete(newValues);
|
||||
}
|
||||
@@ -376,12 +410,20 @@ export const ProviderConfigurator = React.memo(function ProviderConfigurator({ p
|
||||
const headerHeight = 1 + (provider.description ? 2 : 0) + 1; // title + description + spacer
|
||||
const keysHeight = keys.length; // one line per key
|
||||
const inputHeight = currentKey ? 3 : 0; // input + help text + spacing
|
||||
const setupStepsHeight = provider.setupSteps?.length ? provider.setupSteps.length + 1 : 0;
|
||||
const contentHeight = headerHeight + keysHeight + inputHeight + setupStepsHeight;
|
||||
const setupStepsHeight = provider.setupSteps?.length
|
||||
? provider.setupSteps.length + 1
|
||||
: 0;
|
||||
const contentHeight =
|
||||
headerHeight + keysHeight + inputHeight + setupStepsHeight;
|
||||
const topPad = Math.max(0, Math.floor((height - contentHeight) / 2));
|
||||
|
||||
return (
|
||||
<Box flexDirection="column" height={height} alignItems="center" width={columns}>
|
||||
<Box
|
||||
flexDirection="column"
|
||||
height={height}
|
||||
alignItems="center"
|
||||
width={columns}
|
||||
>
|
||||
{topPad > 0 && <Box height={topPad} />}
|
||||
<Box flexDirection="column" width={maxWidth} paddingX={2}>
|
||||
{/* Header */}
|
||||
@@ -393,7 +435,9 @@ export const ProviderConfigurator = React.memo(function ProviderConfigurator({ p
|
||||
{provider.description && (
|
||||
<Box justifyContent="center" marginBottom={1}>
|
||||
<Box width={maxWidth - 4}>
|
||||
<Text color={TEXT_DIM} wrap="wrap">{provider.description}</Text>
|
||||
<Text color={TEXT_DIM} wrap="wrap">
|
||||
{provider.description}
|
||||
</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
)}
|
||||
@@ -411,9 +455,7 @@ export const ProviderConfigurator = React.memo(function ProviderConfigurator({ p
|
||||
>
|
||||
{k.name}
|
||||
</Text>
|
||||
{i < activeKeyIdx && (
|
||||
<Text color={TEAL}> ••••••</Text>
|
||||
)}
|
||||
{i < activeKeyIdx && <Text color={TEAL}> ••••••</Text>}
|
||||
</Box>
|
||||
))}
|
||||
|
||||
@@ -458,19 +500,18 @@ export const ProviderConfigurator = React.memo(function ProviderConfigurator({ p
|
||||
)}
|
||||
|
||||
{/* Setup Steps */}
|
||||
{provider.setupSteps &&
|
||||
provider.setupSteps.length > 0 && (
|
||||
<Box marginTop={2} flexDirection="column">
|
||||
<Text color={TEXT_DIM}>Setup steps:</Text>
|
||||
{provider.setupSteps.map((step, i) => (
|
||||
<Box key={i} width={maxWidth - 4} marginTop={1}>
|
||||
<Text color={TEXT_DIM} wrap="wrap">
|
||||
{i + 1}. {step}
|
||||
</Text>
|
||||
</Box>
|
||||
))}
|
||||
</Box>
|
||||
)}
|
||||
{provider.setupSteps && provider.setupSteps.length > 0 && (
|
||||
<Box marginTop={2} flexDirection="column">
|
||||
<Text color={TEXT_DIM}>Setup steps:</Text>
|
||||
{provider.setupSteps.map((step, i) => (
|
||||
<Box key={i} width={maxWidth - 4} marginTop={1}>
|
||||
<Text color={TEXT_DIM} wrap="wrap">
|
||||
{i + 1}. {step}
|
||||
</Text>
|
||||
</Box>
|
||||
))}
|
||||
</Box>
|
||||
)}
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
@@ -481,7 +522,10 @@ interface SuccessScreenProps {
|
||||
height: number;
|
||||
}
|
||||
|
||||
const SuccessScreen = React.memo(function SuccessScreen({ provider, height }: SuccessScreenProps) {
|
||||
const SuccessScreen = React.memo(function SuccessScreen({
|
||||
provider,
|
||||
height,
|
||||
}: SuccessScreenProps) {
|
||||
const { stdout } = useStdout();
|
||||
const columns = stdout?.columns ?? 80;
|
||||
|
||||
@@ -539,7 +583,9 @@ export default function Onboarding({
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
try {
|
||||
const resp = await client.goose.GooseProvidersList({ providerIds: [] });
|
||||
const resp = await client.goose.providersList_unstable({
|
||||
providerIds: [],
|
||||
});
|
||||
const sorted = [...resp.entries].sort((a, b) => {
|
||||
const aP = a.providerType === "Preferred" ? 0 : 1;
|
||||
const bP = b.providerType === "Preferred" ? 0 : 1;
|
||||
@@ -556,10 +602,13 @@ export default function Onboarding({
|
||||
}, [client, fetchKey]);
|
||||
|
||||
const saveProvider = useCallback(
|
||||
async (provider: ProviderInventoryEntryDto, values: Record<string, string>) => {
|
||||
async (
|
||||
provider: ProviderInventoryEntryDto,
|
||||
values: Record<string, string>,
|
||||
) => {
|
||||
setPhase("saving");
|
||||
try {
|
||||
await client.goose.GooseProvidersConfigSave({
|
||||
await client.goose.providersConfigSave_unstable({
|
||||
providerId: provider.providerId,
|
||||
fields: Object.entries(values).map(([key, value]) => ({
|
||||
key,
|
||||
@@ -600,7 +649,7 @@ export default function Onboarding({
|
||||
if (phase === "loading") {
|
||||
const contentHeight = 3; // spinner + text + spacing
|
||||
const topPad = Math.max(0, Math.floor((height - contentHeight) / 2));
|
||||
|
||||
|
||||
return (
|
||||
<Box
|
||||
flexDirection="column"
|
||||
@@ -622,7 +671,12 @@ export default function Onboarding({
|
||||
|
||||
if (phase === "error") {
|
||||
return (
|
||||
<Box flexDirection="column" height={height} alignItems="center" width={width}>
|
||||
<Box
|
||||
flexDirection="column"
|
||||
height={height}
|
||||
alignItems="center"
|
||||
width={width}
|
||||
>
|
||||
<ErrorScreen errorMsg={errorMsg} onRetry={handleRetry} />
|
||||
</Box>
|
||||
);
|
||||
@@ -631,7 +685,7 @@ export default function Onboarding({
|
||||
if (phase === "saving") {
|
||||
const contentHeight = 3; // spinner + text + spacing
|
||||
const topPad = Math.max(0, Math.floor((height - contentHeight) / 2));
|
||||
|
||||
|
||||
return (
|
||||
<Box
|
||||
flexDirection="column"
|
||||
@@ -652,9 +706,7 @@ export default function Onboarding({
|
||||
}
|
||||
|
||||
if (phase === "success") {
|
||||
return (
|
||||
<SuccessScreen provider={selectedProvider} height={height} />
|
||||
);
|
||||
return <SuccessScreen provider={selectedProvider} height={height} />;
|
||||
}
|
||||
|
||||
if (phase === "configure" && selectedProvider) {
|
||||
|
||||
+36
-29
@@ -1,5 +1,11 @@
|
||||
#!/usr/bin/env node
|
||||
import React, { useState, useEffect, useCallback, useMemo, useRef } from "react";
|
||||
import React, {
|
||||
useState,
|
||||
useEffect,
|
||||
useCallback,
|
||||
useMemo,
|
||||
useRef,
|
||||
} from "react";
|
||||
import { Box, Text, render, useApp, useInput, useStdout } from "ink";
|
||||
import { MultilineInput } from "ink-multiline-input";
|
||||
import meow from "meow";
|
||||
@@ -172,7 +178,9 @@ const InputBar = React.memo(function InputBar({
|
||||
</Text>
|
||||
</Box>
|
||||
{scrollHint && (
|
||||
<Text color={TEXT_DIM}>↑↓ scroll · ⌥↑↓ fast · shift+↑↓ history</Text>
|
||||
<Text color={TEXT_DIM}>
|
||||
↑↓ scroll · ⌥↑↓ fast · shift+↑↓ history
|
||||
</Text>
|
||||
)}
|
||||
</Box>
|
||||
) : (
|
||||
@@ -200,7 +208,9 @@ const InputBar = React.memo(function InputBar({
|
||||
}}
|
||||
/>
|
||||
{scrollHint && (
|
||||
<Text color={TEXT_DIM}>↑↓ scroll · ⌥↑↓ fast · shift+↑↓ history</Text>
|
||||
<Text color={TEXT_DIM}>
|
||||
↑↓ scroll · ⌥↑↓ fast · shift+↑↓ history
|
||||
</Text>
|
||||
)}
|
||||
</Box>
|
||||
)}
|
||||
@@ -792,7 +802,7 @@ function App({
|
||||
setStatus("checking provider…");
|
||||
let hasProvider = false;
|
||||
try {
|
||||
const resp = await client.goose.GooseDefaultsRead({});
|
||||
const resp = await client.goose.defaultsRead_unstable({});
|
||||
hasProvider =
|
||||
resp.providerId != null &&
|
||||
resp.providerId !== "" &&
|
||||
@@ -831,31 +841,28 @@ function App({
|
||||
exit,
|
||||
]);
|
||||
|
||||
const addLocalTurn = useCallback(
|
||||
(userText: string, message?: string) => {
|
||||
setTurns((prev) => [
|
||||
...prev,
|
||||
{
|
||||
userText,
|
||||
responseItems: message
|
||||
? [
|
||||
{
|
||||
itemType: "content_chunk",
|
||||
content: { type: "text", text: message },
|
||||
},
|
||||
]
|
||||
: [],
|
||||
toolCallsById: new Map(),
|
||||
},
|
||||
]);
|
||||
setViewTurnIdx(-1);
|
||||
setSelectedToolCallIdx(null);
|
||||
setToolCallExpanded(false);
|
||||
setToolCallExpandedScroll(0);
|
||||
setScrollOffset(0);
|
||||
},
|
||||
[],
|
||||
);
|
||||
const addLocalTurn = useCallback((userText: string, message?: string) => {
|
||||
setTurns((prev) => [
|
||||
...prev,
|
||||
{
|
||||
userText,
|
||||
responseItems: message
|
||||
? [
|
||||
{
|
||||
itemType: "content_chunk",
|
||||
content: { type: "text", text: message },
|
||||
},
|
||||
]
|
||||
: [],
|
||||
toolCallsById: new Map(),
|
||||
},
|
||||
]);
|
||||
setViewTurnIdx(-1);
|
||||
setSelectedToolCallIdx(null);
|
||||
setToolCallExpanded(false);
|
||||
setToolCallExpandedScroll(0);
|
||||
setScrollOffset(0);
|
||||
}, []);
|
||||
|
||||
const runSlashCommand = useCallback(
|
||||
(raw: string): boolean => {
|
||||
|
||||
Reference in New Issue
Block a user