2406 lines
68 KiB
TypeScript
2406 lines
68 KiB
TypeScript
// This file is auto-generated by @hey-api/openapi-ts
|
|
|
|
import * as z from 'zod';
|
|
|
|
/**
|
|
* An HTTP header to set when making requests to the MCP server.
|
|
*/
|
|
export const zHttpHeader = z.object({
|
|
name: z.string(),
|
|
value: z.string(),
|
|
_meta: z.record(z.string(), z.unknown()).nullish()
|
|
});
|
|
|
|
/**
|
|
* HTTP transport configuration for MCP.
|
|
*/
|
|
export const zMcpServerHttp = z.object({
|
|
name: z.string(),
|
|
url: z.string(),
|
|
headers: z.array(zHttpHeader),
|
|
_meta: z.record(z.string(), z.unknown()).nullish(),
|
|
type: z.literal('http')
|
|
});
|
|
|
|
/**
|
|
* SSE transport configuration for MCP.
|
|
*/
|
|
export const zMcpServerSse = z.object({
|
|
name: z.string(),
|
|
url: z.string(),
|
|
headers: z.array(zHttpHeader),
|
|
_meta: z.record(z.string(), z.unknown()).nullish(),
|
|
type: z.literal('sse')
|
|
});
|
|
|
|
/**
|
|
* An environment variable to set when launching an MCP server.
|
|
*/
|
|
export const zEnvVariable = z.object({
|
|
name: z.string(),
|
|
value: z.string(),
|
|
_meta: z.record(z.string(), z.unknown()).nullish()
|
|
});
|
|
|
|
/**
|
|
* Stdio transport configuration for MCP.
|
|
*/
|
|
export const zMcpServerStdio = z.object({
|
|
name: z.string(),
|
|
command: z.string(),
|
|
args: z.array(z.string()),
|
|
env: z.array(zEnvVariable),
|
|
_meta: z.record(z.string(), z.unknown()).nullish()
|
|
});
|
|
|
|
/**
|
|
* Configuration for connecting to an MCP (Model Context Protocol) server.
|
|
*
|
|
* MCP servers provide tools and context that the agent can use when
|
|
* processing prompts.
|
|
*
|
|
* See protocol docs: [MCP Servers](https://agentclientprotocol.com/protocol/session-setup#mcp-servers)
|
|
*/
|
|
export const zMcpServer = z.union([
|
|
zMcpServerHttp,
|
|
zMcpServerSse,
|
|
zMcpServerStdio
|
|
]);
|
|
|
|
export const zGooseExtension = z.union([
|
|
z.object({
|
|
name: z.string(),
|
|
description: z.string().nullish(),
|
|
display_name: z.string().nullish(),
|
|
timeout: z.int().gte(0).nullish(),
|
|
bundled: z.boolean().nullish(),
|
|
available_tools: z.array(z.string()).nullish(),
|
|
type: z.literal('builtin')
|
|
}),
|
|
z.object({
|
|
name: z.string(),
|
|
description: z.string().nullish(),
|
|
display_name: z.string().nullish(),
|
|
bundled: z.boolean().nullish(),
|
|
available_tools: z.array(z.string()).nullish(),
|
|
type: z.literal('platform')
|
|
}),
|
|
z.object({
|
|
server: zMcpServer,
|
|
envKeys: z.array(z.string()).optional(),
|
|
description: z.string().nullish(),
|
|
timeout: z.int().gte(0).nullish(),
|
|
socket: z.string().nullish(),
|
|
clientId: z.string().nullish(),
|
|
clientSecretKey: z.string().nullish(),
|
|
scopes: z.array(z.string()).optional(),
|
|
bundled: z.boolean().nullish(),
|
|
available_tools: z.array(z.string()).nullish(),
|
|
type: z.literal('mcp')
|
|
})
|
|
]);
|
|
|
|
/**
|
|
* Add an extension to an active session.
|
|
*/
|
|
export const zAddSessionExtensionRequest_unstable = z.object({
|
|
sessionId: z.string(),
|
|
extension: zGooseExtension
|
|
});
|
|
|
|
/**
|
|
* Empty success response for operations that return no data.
|
|
*/
|
|
export const zEmptyResponse = z.record(z.string(), z.unknown());
|
|
|
|
/**
|
|
* Remove an extension from an active session.
|
|
*/
|
|
export const zRemoveSessionExtensionRequest_unstable = z.object({
|
|
sessionId: z.string(),
|
|
extensionKey: z.string()
|
|
});
|
|
|
|
/**
|
|
* List all tools available in a session.
|
|
*/
|
|
export const zGetToolsRequest_unstable = z.object({
|
|
sessionId: z.string(),
|
|
extensionName: z.string().nullish()
|
|
});
|
|
|
|
/**
|
|
* Permission level for a tool.
|
|
*/
|
|
export const zToolPermissionLevel = z.enum([
|
|
'always_allow',
|
|
'ask_before',
|
|
'never_allow'
|
|
]);
|
|
|
|
/**
|
|
* A single tool item returned by the tools list endpoint.
|
|
*/
|
|
export const zToolListItem = z.object({
|
|
name: z.string(),
|
|
description: z.string(),
|
|
parameters: z.array(z.string()),
|
|
permission: zToolPermissionLevel.nullish(),
|
|
inputSchema: z.unknown(),
|
|
outputSchema: z.unknown().optional()
|
|
});
|
|
|
|
/**
|
|
* Tools response.
|
|
*/
|
|
export const zGetToolsResponse_unstable = z.object({
|
|
tools: z.array(zToolListItem)
|
|
});
|
|
|
|
/**
|
|
* A single tool permission entry.
|
|
*/
|
|
export const zToolPermissionEntry = z.object({
|
|
toolName: z.string(),
|
|
permission: zToolPermissionLevel
|
|
});
|
|
|
|
/**
|
|
* Set permission levels for one or more tools.
|
|
*/
|
|
export const zSetToolPermissionsRequest_unstable = z.object({
|
|
toolPermissions: z.array(zToolPermissionEntry)
|
|
});
|
|
|
|
export const zSetToolPermissionsResponse_unstable = z.record(z.string(), z.unknown());
|
|
|
|
/**
|
|
* Call a tool from an extension.
|
|
*/
|
|
export const zGooseToolCallRequest_unstable = z.object({
|
|
sessionId: z.string(),
|
|
name: z.string(),
|
|
arguments: z.unknown().optional().default(null)
|
|
});
|
|
|
|
/**
|
|
* Tool call response.
|
|
*/
|
|
export const zGooseToolCallResponse_unstable = z.object({
|
|
content: z.array(z.unknown()).optional().default([]),
|
|
structuredContent: z.unknown().optional(),
|
|
isError: z.boolean(),
|
|
_meta: z.unknown().optional()
|
|
});
|
|
|
|
/**
|
|
* Read a resource from an extension.
|
|
*/
|
|
export const zReadResourceRequest_unstable = z.object({
|
|
sessionId: z.string(),
|
|
uri: z.string(),
|
|
extensionName: z.string()
|
|
});
|
|
|
|
/**
|
|
* Resource read response.
|
|
*/
|
|
export const zReadResourceResponse_unstable = z.object({
|
|
result: z.unknown().optional().default(null)
|
|
});
|
|
|
|
export const zAppsListRequest_unstable = z.object({
|
|
sessionId: z.string().nullish()
|
|
});
|
|
|
|
export const zAppsListResponse_unstable = z.object({
|
|
apps: z.array(z.unknown()).optional().default([])
|
|
});
|
|
|
|
export const zAppsExportRequest_unstable = z.object({
|
|
name: z.string()
|
|
});
|
|
|
|
export const zAppsExportResponse_unstable = z.object({
|
|
html: z.string()
|
|
});
|
|
|
|
export const zAppsImportRequest_unstable = z.object({
|
|
html: z.string()
|
|
});
|
|
|
|
export const zAppsImportResponse_unstable = z.object({
|
|
name: z.string(),
|
|
message: z.string()
|
|
});
|
|
|
|
export const zAppsDeleteRequest_unstable = z.object({
|
|
name: z.string()
|
|
});
|
|
|
|
export const zAppsDeleteResponse_unstable = z.object({
|
|
name: z.string(),
|
|
message: z.string()
|
|
});
|
|
|
|
/**
|
|
* Update the working directory for a session.
|
|
*/
|
|
export const zUpdateWorkingDirRequest_unstable = z.object({
|
|
sessionId: z.string(),
|
|
workingDir: z.string()
|
|
});
|
|
|
|
/**
|
|
* How a session system prompt update should be applied.
|
|
*/
|
|
export const zSessionSystemPromptMode = z.union([
|
|
z.literal('set'),
|
|
z.literal('append')
|
|
]);
|
|
|
|
/**
|
|
* Set, append, or clear system prompt text for a session.
|
|
*
|
|
* `mode: "set"` replaces Goose's base system prompt. `mode: "append"` adds an
|
|
* instruction under "Additional Instructions". Reusing a key replaces the
|
|
* previous value for that mode/key; sending empty text clears it.
|
|
*/
|
|
export const zSetSessionSystemPromptRequest_unstable = z.object({
|
|
sessionId: z.string(),
|
|
mode: zSessionSystemPromptMode.optional().default('append'),
|
|
key: z.string().nullish(),
|
|
text: z.string()
|
|
});
|
|
|
|
/**
|
|
* The sender or recipient of messages and data in a conversation.
|
|
*/
|
|
export const zRole = z.union([
|
|
z.literal('assistant'),
|
|
z.literal('user')
|
|
]);
|
|
|
|
/**
|
|
* Optional annotations for the client. The client can use annotations to inform how objects are used or displayed
|
|
*/
|
|
export const zAnnotations = z.object({
|
|
audience: z.array(zRole).nullish(),
|
|
lastModified: z.string().nullish(),
|
|
priority: z.number().nullish(),
|
|
_meta: z.record(z.string(), z.unknown()).nullish()
|
|
});
|
|
|
|
/**
|
|
* Text provided to or from an LLM.
|
|
*/
|
|
export const zTextContent = z.object({
|
|
annotations: zAnnotations.nullish(),
|
|
text: z.string(),
|
|
_meta: z.record(z.string(), z.unknown()).nullish()
|
|
});
|
|
|
|
/**
|
|
* An image provided to or from an LLM.
|
|
*/
|
|
export const zImageContent = z.object({
|
|
annotations: zAnnotations.nullish(),
|
|
data: z.string(),
|
|
mimeType: z.string(),
|
|
uri: z.string().nullish(),
|
|
_meta: z.record(z.string(), z.unknown()).nullish()
|
|
});
|
|
|
|
/**
|
|
* Audio provided to or from an LLM.
|
|
*/
|
|
export const zAudioContent = z.object({
|
|
annotations: zAnnotations.nullish(),
|
|
data: z.string(),
|
|
mimeType: z.string(),
|
|
_meta: z.record(z.string(), z.unknown()).nullish()
|
|
});
|
|
|
|
/**
|
|
* A resource that the server is capable of reading, included in a prompt or tool call result.
|
|
*/
|
|
export const zResourceLink = z.object({
|
|
annotations: zAnnotations.nullish(),
|
|
description: z.string().nullish(),
|
|
mimeType: z.string().nullish(),
|
|
name: z.string(),
|
|
size: z.int().nullish(),
|
|
title: z.string().nullish(),
|
|
uri: z.string(),
|
|
_meta: z.record(z.string(), z.unknown()).nullish()
|
|
});
|
|
|
|
/**
|
|
* Text-based resource contents.
|
|
*/
|
|
export const zTextResourceContents = z.object({
|
|
mimeType: z.string().nullish(),
|
|
text: z.string(),
|
|
uri: z.string(),
|
|
_meta: z.record(z.string(), z.unknown()).nullish()
|
|
});
|
|
|
|
/**
|
|
* Binary resource contents.
|
|
*/
|
|
export const zBlobResourceContents = z.object({
|
|
blob: z.string(),
|
|
mimeType: z.string().nullish(),
|
|
uri: z.string(),
|
|
_meta: z.record(z.string(), z.unknown()).nullish()
|
|
});
|
|
|
|
/**
|
|
* Resource content that can be embedded in a message.
|
|
*/
|
|
export const zEmbeddedResourceResource = z.union([
|
|
zTextResourceContents,
|
|
zBlobResourceContents
|
|
]);
|
|
|
|
/**
|
|
* The contents of a resource, embedded into a prompt or tool call result.
|
|
*/
|
|
export const zEmbeddedResource = z.object({
|
|
annotations: zAnnotations.nullish(),
|
|
resource: zEmbeddedResourceResource,
|
|
_meta: z.record(z.string(), z.unknown()).nullish()
|
|
});
|
|
|
|
/**
|
|
* Content blocks represent displayable information in the Agent Client Protocol.
|
|
*
|
|
* They provide a structured way to handle various types of user-facing content—whether
|
|
* it's text from language models, images for analysis, or embedded resources for context.
|
|
*
|
|
* Content blocks appear in:
|
|
* - User prompts sent via `session/prompt`
|
|
* - Language model output streamed through `session/update` notifications
|
|
* - Progress updates and results from tool calls
|
|
*
|
|
* This structure is compatible with the Model Context Protocol (MCP), enabling
|
|
* agents to seamlessly forward content from MCP tool outputs without transformation.
|
|
*
|
|
* See protocol docs: [Content](https://agentclientprotocol.com/protocol/content)
|
|
*/
|
|
export const zContentBlock = z.discriminatedUnion('type', [
|
|
zTextContent.extend({ type: z.literal('TextContent') }),
|
|
zImageContent.extend({ type: z.literal('ImageContent') }),
|
|
zAudioContent.extend({ type: z.literal('AudioContent') }),
|
|
zResourceLink.extend({ type: z.literal('ResourceLink') }),
|
|
zEmbeddedResource.extend({ type: z.literal('EmbeddedResource') })
|
|
]);
|
|
|
|
/**
|
|
* Add user input to the currently active prompt without starting a new prompt.
|
|
*/
|
|
export const zSteerSessionRequest_unstable = z.object({
|
|
sessionId: z.string(),
|
|
prompt: z.array(zContentBlock).optional().default([]),
|
|
expectedRunId: z.string()
|
|
});
|
|
|
|
export const zSteerSessionResponse_unstable = z.object({
|
|
runId: z.string(),
|
|
messageId: z.string()
|
|
});
|
|
|
|
export const zDiagnosticsReportLevel = z.enum(['summary', 'full']);
|
|
|
|
export const zDiagnosticsGetRequest_unstable = z.object({
|
|
sessionId: z.string(),
|
|
level: zDiagnosticsReportLevel.optional().default('summary')
|
|
});
|
|
|
|
export const zDiagnosticsGetResponse_unstable = z.object({
|
|
report: z.unknown()
|
|
});
|
|
|
|
/**
|
|
* List all available Goose prompt templates.
|
|
*/
|
|
export const zListPromptsRequest_unstable = z.record(z.string(), z.unknown());
|
|
|
|
/**
|
|
* Information about a prompt template, including its default content and customization status.
|
|
*/
|
|
export const zPromptTemplateEntry = z.object({
|
|
name: z.string(),
|
|
description: z.string(),
|
|
defaultContent: z.string(),
|
|
userContent: z.string().nullish(),
|
|
isCustomized: z.boolean()
|
|
});
|
|
|
|
export const zListPromptsResponse_unstable = z.object({
|
|
prompts: z.array(zPromptTemplateEntry)
|
|
});
|
|
|
|
/**
|
|
* Read a Goose prompt template.
|
|
*/
|
|
export const zGetPromptRequest_unstable = z.object({
|
|
name: z.string()
|
|
});
|
|
|
|
export const zGetPromptResponse_unstable = z.object({
|
|
name: z.string(),
|
|
content: z.string(),
|
|
defaultContent: z.string(),
|
|
isCustomized: z.boolean()
|
|
});
|
|
|
|
/**
|
|
* Save a custom Goose prompt template.
|
|
*/
|
|
export const zSavePromptRequest_unstable = z.object({
|
|
name: z.string(),
|
|
content: z.string()
|
|
});
|
|
|
|
export const zPromptOperationResponse_unstable = z.object({
|
|
message: z.string()
|
|
});
|
|
|
|
/**
|
|
* Reset a Goose prompt template to its default content.
|
|
*/
|
|
export const zResetPromptRequest_unstable = z.object({
|
|
name: z.string()
|
|
});
|
|
|
|
/**
|
|
* List configured extensions and any warnings.
|
|
*/
|
|
export const zGetConfigExtensionsRequest_unstable = z.record(z.string(), z.unknown());
|
|
|
|
export const zGooseExtensionEntry = z.object({
|
|
extension: zGooseExtension,
|
|
enabled: z.boolean(),
|
|
configKey: z.string().nullish()
|
|
});
|
|
|
|
/**
|
|
* List configured extensions and any warnings.
|
|
*/
|
|
export const zGetConfigExtensionsResponse_unstable = z.object({
|
|
extensions: z.array(zGooseExtensionEntry),
|
|
warnings: z.array(z.string()).optional().default([])
|
|
});
|
|
|
|
/**
|
|
* Persist a new extension to the user's global goose config.
|
|
*/
|
|
export const zAddConfigExtensionRequest_unstable = z.object({
|
|
extension: zGooseExtension,
|
|
enabled: z.boolean().optional().default(false)
|
|
});
|
|
|
|
/**
|
|
* Remove a persisted extension from the user's global goose config.
|
|
*/
|
|
export const zRemoveConfigExtensionRequest_unstable = z.object({
|
|
configKey: z.string()
|
|
});
|
|
|
|
/**
|
|
* Set the `enabled` flag for a persisted extension in the user's global goose config.
|
|
*/
|
|
export const zSetConfigExtensionEnabledRequest_unstable = z.object({
|
|
configKey: z.string(),
|
|
enabled: z.boolean()
|
|
});
|
|
|
|
export const zGetSessionExtensionsRequest_unstable = z.object({
|
|
sessionId: z.string()
|
|
});
|
|
|
|
export const zSessionExtensionEntry = z.object({
|
|
extension: zGooseExtension,
|
|
extensionKey: z.string()
|
|
});
|
|
|
|
export const zGetSessionExtensionsResponse_unstable = z.object({
|
|
extensions: z.array(zSessionExtensionEntry)
|
|
});
|
|
|
|
/**
|
|
* List providers with setup metadata and the current model inventory snapshot.
|
|
*/
|
|
export const zListProvidersRequest_unstable = z.object({
|
|
providerIds: z.array(z.string()).optional().default([])
|
|
});
|
|
|
|
export const zProviderSetupCategoryDto = z.enum(['agent', 'model']);
|
|
|
|
export const zProviderConfigKey = z.object({
|
|
name: z.string(),
|
|
required: z.boolean(),
|
|
secret: z.boolean(),
|
|
default: z.string().nullish().default(null),
|
|
oauthFlow: z.boolean().optional().default(false),
|
|
deviceCodeFlow: z.boolean().optional().default(false),
|
|
primary: z.boolean().optional().default(false)
|
|
});
|
|
|
|
/**
|
|
* A single model in provider inventory.
|
|
*/
|
|
export const zProviderInventoryModelDto = z.object({
|
|
id: z.string(),
|
|
name: z.string(),
|
|
family: z.string().nullish(),
|
|
contextLimit: z.int().gte(0).nullish(),
|
|
reasoning: z.boolean().nullish(),
|
|
recommended: z.boolean().optional().default(false)
|
|
});
|
|
|
|
/**
|
|
* Provider inventory entry.
|
|
*/
|
|
export const zProviderInventoryEntryDto = z.object({
|
|
providerId: z.string(),
|
|
providerName: z.string(),
|
|
description: z.string(),
|
|
defaultModel: z.string(),
|
|
configured: z.boolean(),
|
|
available: z.boolean(),
|
|
providerType: z.string(),
|
|
category: zProviderSetupCategoryDto,
|
|
acp: z.boolean().optional().default(false),
|
|
visibleInSetup: z.boolean(),
|
|
deprecated: z.boolean(),
|
|
replacement: z.string().nullish(),
|
|
configKeys: z.array(zProviderConfigKey),
|
|
setupSteps: z.array(z.string()),
|
|
supportsRefresh: z.boolean(),
|
|
refreshing: z.boolean(),
|
|
models: z.array(zProviderInventoryModelDto),
|
|
lastUpdatedAt: z.string().nullish(),
|
|
lastRefreshAttemptAt: z.string().nullish(),
|
|
lastRefreshError: z.string().nullish(),
|
|
stale: z.boolean(),
|
|
modelSelectionHint: z.string().nullish()
|
|
});
|
|
|
|
/**
|
|
* Provider list response.
|
|
*/
|
|
export const zListProvidersResponse_unstable = z.object({
|
|
entries: z.array(zProviderInventoryEntryDto)
|
|
});
|
|
|
|
/**
|
|
* List the raw model identifiers returned by a provider's live supported-models API.
|
|
*/
|
|
export const zProviderSupportedModelsListRequest_unstable = z.object({
|
|
providerId: z.string()
|
|
});
|
|
|
|
export const zProviderSupportedModelsListResponse_unstable = z.object({
|
|
providerId: z.string(),
|
|
models: z.array(z.string())
|
|
});
|
|
|
|
/**
|
|
* List custom-provider catalog entries. Omit `format` to list all formats.
|
|
*/
|
|
export const zProviderCatalogListRequest_unstable = z.object({
|
|
format: z.string().nullish()
|
|
});
|
|
|
|
export const zProviderTemplateCatalogEntryDto = z.object({
|
|
providerId: z.string(),
|
|
name: z.string(),
|
|
format: z.string(),
|
|
apiUrl: z.string(),
|
|
modelCount: z.int().gte(0),
|
|
docUrl: z.string(),
|
|
envVar: z.string()
|
|
});
|
|
|
|
export const zProviderCatalogListResponse_unstable = z.object({
|
|
providers: z.array(zProviderTemplateCatalogEntryDto)
|
|
});
|
|
|
|
/**
|
|
* List provider setup catalog entries
|
|
*/
|
|
export const zProviderSetupCatalogListRequest_unstable = z.record(z.string(), z.unknown());
|
|
|
|
export const zProviderSetupMethodDto = z.enum([
|
|
'none',
|
|
'single_api_key',
|
|
'config_fields',
|
|
'host_with_oauth_fallback',
|
|
'oauth_browser',
|
|
'oauth_device_code',
|
|
'cloud_credentials',
|
|
'local',
|
|
'cli_auth'
|
|
]);
|
|
|
|
export const zProviderSetupFieldDto = z.object({
|
|
key: z.string(),
|
|
label: z.string(),
|
|
secret: z.boolean(),
|
|
required: z.boolean(),
|
|
placeholder: z.string().nullish(),
|
|
defaultValue: z.string().nullish()
|
|
});
|
|
|
|
export const zProviderSetupGroupDto = z.enum(['default', 'additional']);
|
|
|
|
export const zProviderSetupCatalogEntryDto = z.object({
|
|
providerId: z.string(),
|
|
name: z.string(),
|
|
category: zProviderSetupCategoryDto,
|
|
acp: z.boolean().optional().default(false),
|
|
description: z.string(),
|
|
setupMethod: zProviderSetupMethodDto,
|
|
nativeConnectQuery: z.string().nullish(),
|
|
fields: z.array(zProviderSetupFieldDto).optional().default([]),
|
|
binaryName: z.string().nullish(),
|
|
docUrl: z.string().nullish(),
|
|
group: zProviderSetupGroupDto,
|
|
showOnlyWhenInstalled: z.boolean(),
|
|
aliases: z.array(z.string()).optional().default([]),
|
|
supportsInstall: z.boolean(),
|
|
supportsAuth: z.boolean(),
|
|
supportsAuthStatus: z.boolean()
|
|
});
|
|
|
|
export const zProviderSetupCatalogListResponse_unstable = z.object({
|
|
providers: z.array(zProviderSetupCatalogEntryDto)
|
|
});
|
|
|
|
/**
|
|
* Return the editable template for one catalog provider.
|
|
*/
|
|
export const zProviderCatalogTemplateRequest_unstable = z.object({
|
|
providerId: z.string()
|
|
});
|
|
|
|
export const zProviderTemplateCapabilitiesDto = z.object({
|
|
toolCall: z.boolean(),
|
|
reasoning: z.boolean(),
|
|
attachment: z.boolean(),
|
|
temperature: z.boolean()
|
|
});
|
|
|
|
export const zProviderTemplateModelDto = z.object({
|
|
id: z.string(),
|
|
name: z.string(),
|
|
contextLimit: z.int().gte(0),
|
|
capabilities: zProviderTemplateCapabilitiesDto,
|
|
deprecated: z.boolean()
|
|
});
|
|
|
|
export const zProviderTemplateDto = z.object({
|
|
providerId: z.string(),
|
|
name: z.string(),
|
|
format: z.string(),
|
|
apiUrl: z.string(),
|
|
models: z.array(zProviderTemplateModelDto),
|
|
supportsStreaming: z.boolean(),
|
|
envVar: z.string(),
|
|
docUrl: z.string()
|
|
});
|
|
|
|
export const zProviderCatalogTemplateResponse_unstable = z.object({
|
|
template: zProviderTemplateDto
|
|
});
|
|
|
|
/**
|
|
* Create a custom provider backed by Goose's declarative provider store.
|
|
*/
|
|
export const zCustomProviderCreateRequest_unstable = z.object({
|
|
engine: z.string(),
|
|
displayName: z.string(),
|
|
apiUrl: z.string(),
|
|
apiKey: z.string().nullish(),
|
|
models: z.array(z.string()).optional().default([]),
|
|
supportsStreaming: z.boolean().nullish(),
|
|
headers: z.record(z.string(), z.string()).optional().default({}),
|
|
requiresAuth: z.boolean(),
|
|
catalogProviderId: z.string().nullish(),
|
|
basePath: z.string().nullish(),
|
|
preservesThinking: z.boolean().nullish()
|
|
});
|
|
|
|
export const zProviderConfigStatusDto = z.object({
|
|
providerId: z.string(),
|
|
isConfigured: z.boolean()
|
|
});
|
|
|
|
export const zRefreshProviderInventorySkipReasonDto = z.enum([
|
|
'unknown_provider',
|
|
'not_configured',
|
|
'does_not_support_refresh',
|
|
'already_refreshing'
|
|
]);
|
|
|
|
export const zRefreshProviderInventorySkipDto = z.object({
|
|
providerId: z.string(),
|
|
reason: zRefreshProviderInventorySkipReasonDto
|
|
});
|
|
|
|
/**
|
|
* Refresh acknowledgement.
|
|
*/
|
|
export const zRefreshProviderInventoryResponse_unstable = z.object({
|
|
started: z.array(z.string()),
|
|
skipped: z.array(zRefreshProviderInventorySkipDto).optional().default([])
|
|
});
|
|
|
|
export const zCustomProviderCreateResponse_unstable = z.object({
|
|
providerId: z.string(),
|
|
status: zProviderConfigStatusDto,
|
|
refresh: zRefreshProviderInventoryResponse_unstable
|
|
});
|
|
|
|
/**
|
|
* Read a declarative provider config. Custom configs are editable; bundled configs are read-only.
|
|
*/
|
|
export const zCustomProviderReadRequest_unstable = z.object({
|
|
providerId: z.string()
|
|
});
|
|
|
|
export const zCustomProviderConfigDto = z.object({
|
|
providerId: z.string(),
|
|
engine: z.string(),
|
|
displayName: z.string(),
|
|
apiUrl: z.string(),
|
|
models: z.array(z.string()).optional().default([]),
|
|
supportsStreaming: z.boolean().nullish(),
|
|
headers: z.record(z.string(), z.string()).optional().default({}),
|
|
requiresAuth: z.boolean(),
|
|
catalogProviderId: z.string().nullish(),
|
|
basePath: z.string().nullish(),
|
|
apiKeyEnv: z.string().nullish(),
|
|
apiKeySet: z.boolean(),
|
|
preservesThinking: z.boolean()
|
|
});
|
|
|
|
export const zCustomProviderReadResponse_unstable = z.object({
|
|
provider: zCustomProviderConfigDto,
|
|
editable: z.boolean(),
|
|
status: zProviderConfigStatusDto
|
|
});
|
|
|
|
/**
|
|
* Update a custom provider backed by Goose's declarative provider store.
|
|
*/
|
|
export const zCustomProviderUpdateRequest_unstable = z.object({
|
|
providerId: z.string(),
|
|
engine: z.string(),
|
|
displayName: z.string(),
|
|
apiUrl: z.string(),
|
|
apiKey: z.string().nullish(),
|
|
models: z.array(z.string()).optional().default([]),
|
|
supportsStreaming: z.boolean().nullish(),
|
|
headers: z.record(z.string(), z.string()).optional().default({}),
|
|
requiresAuth: z.boolean(),
|
|
catalogProviderId: z.string().nullish(),
|
|
basePath: z.string().nullish(),
|
|
preservesThinking: z.boolean().nullish()
|
|
});
|
|
|
|
export const zCustomProviderUpdateResponse_unstable = z.object({
|
|
providerId: z.string(),
|
|
status: zProviderConfigStatusDto,
|
|
refresh: zRefreshProviderInventoryResponse_unstable
|
|
});
|
|
|
|
/**
|
|
* Delete a custom provider from Goose's declarative provider store.
|
|
*/
|
|
export const zCustomProviderDeleteRequest_unstable = z.object({
|
|
providerId: z.string()
|
|
});
|
|
|
|
export const zCustomProviderDeleteResponse_unstable = z.object({
|
|
providerId: z.string(),
|
|
refresh: zRefreshProviderInventoryResponse_unstable
|
|
});
|
|
|
|
/**
|
|
* Trigger a background refresh of provider inventories.
|
|
*/
|
|
export const zRefreshProviderInventoryRequest_unstable = z.object({
|
|
providerIds: z.array(z.string()).optional().default([])
|
|
});
|
|
|
|
/**
|
|
* Check whether an ACP provider can initialize and create a session.
|
|
*/
|
|
export const zProviderReadinessCheckRequest_unstable = z.object({
|
|
providerId: z.string()
|
|
});
|
|
|
|
export const zProviderReadinessCheckResponse_unstable = z.object({
|
|
providerId: z.string(),
|
|
ready: z.boolean(),
|
|
error: z.string().nullish()
|
|
});
|
|
|
|
/**
|
|
* Read saved configuration field values for one provider.
|
|
*/
|
|
export const zProviderConfigReadRequest_unstable = z.object({
|
|
providerId: z.string()
|
|
});
|
|
|
|
export const zProviderConfigFieldValueDto = z.object({
|
|
key: z.string(),
|
|
value: z.string().nullish().default(null),
|
|
isSet: z.boolean(),
|
|
isSecret: z.boolean(),
|
|
required: z.boolean()
|
|
});
|
|
|
|
export const zProviderConfigReadResponse_unstable = z.object({
|
|
fields: z.array(zProviderConfigFieldValueDto)
|
|
});
|
|
|
|
/**
|
|
* Return provider configured statuses. Empty provider_ids means all providers.
|
|
*/
|
|
export const zProviderConfigStatusRequest_unstable = z.object({
|
|
providerIds: z.array(z.string()).optional().default([])
|
|
});
|
|
|
|
export const zProviderConfigStatusResponse_unstable = z.object({
|
|
statuses: z.array(zProviderConfigStatusDto)
|
|
});
|
|
|
|
export const zProviderConfigFieldUpdate = z.object({
|
|
key: z.string(),
|
|
value: z.string()
|
|
});
|
|
|
|
/**
|
|
* Save provider configuration fields and start an inventory refresh when supported.
|
|
*/
|
|
export const zProviderConfigSaveRequest_unstable = z.object({
|
|
providerId: z.string(),
|
|
fields: z.array(zProviderConfigFieldUpdate)
|
|
});
|
|
|
|
export const zProviderConfigChangeResponse_unstable = z.object({
|
|
status: zProviderConfigStatusDto,
|
|
refresh: zRefreshProviderInventoryResponse_unstable
|
|
});
|
|
|
|
/**
|
|
* Delete provider configuration fields and start an inventory refresh when supported.
|
|
*/
|
|
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_unstable = z.object({
|
|
providerId: z.string()
|
|
});
|
|
|
|
/**
|
|
* List provider credentials stored locally by Goose.
|
|
*/
|
|
export const zProviderSecretsListRequest_unstable = z.record(z.string(), z.unknown());
|
|
|
|
export const zProviderSecretStorageDto = z.enum(['secret_store', 'provider_cache']);
|
|
|
|
export const zProviderSecretStatusDto = z.enum([
|
|
'valid',
|
|
'expired',
|
|
'unknown'
|
|
]);
|
|
|
|
export const zProviderSecretDto = z.object({
|
|
id: z.string(),
|
|
provider: z.string(),
|
|
providerDisplayName: z.string(),
|
|
name: z.string(),
|
|
storage: zProviderSecretStorageDto,
|
|
expiresAt: z.string().nullish(),
|
|
status: zProviderSecretStatusDto,
|
|
configured: z.boolean(),
|
|
hasSecret: z.boolean(),
|
|
canDelete: z.boolean(),
|
|
canConfigure: z.boolean(),
|
|
configureProvider: z.string().nullish()
|
|
});
|
|
|
|
export const zProviderSecretsListResponse_unstable = z.object({
|
|
secrets: z.array(zProviderSecretDto)
|
|
});
|
|
|
|
/**
|
|
* Delete a locally stored provider credential by id.
|
|
*/
|
|
export const zProviderSecretDeleteRequest_unstable = z.object({
|
|
id: z.string()
|
|
});
|
|
|
|
/**
|
|
* Look up canonical (bundled-registry) model info for a provider/model pair.
|
|
*/
|
|
export const zCanonicalModelInfoRequest_unstable = z.object({
|
|
provider: z.string(),
|
|
model: z.string()
|
|
});
|
|
|
|
export const zCanonicalModelInfoDto = z.object({
|
|
provider: z.string(),
|
|
model: z.string(),
|
|
contextLimit: z.int().gte(0),
|
|
maxOutputTokens: z.int().gte(0).nullish(),
|
|
reasoning: z.boolean(),
|
|
inputTokenCost: z.number().nullish(),
|
|
outputTokenCost: z.number().nullish(),
|
|
cacheReadTokenCost: z.number().nullish(),
|
|
cacheWriteTokenCost: z.number().nullish(),
|
|
currency: z.string()
|
|
});
|
|
|
|
export const zCanonicalModelInfoResponse_unstable = z.object({
|
|
modelInfo: zCanonicalModelInfoDto.nullish()
|
|
});
|
|
|
|
export const zPreferenceKey = z.enum([
|
|
'autoCompactThreshold',
|
|
'gooseThinkingEffort',
|
|
'voiceAutoSubmitPhrases',
|
|
'voiceDictationProvider',
|
|
'voiceDictationPreferredMic'
|
|
]);
|
|
|
|
/**
|
|
* Read allowlisted user preferences. Empty `keys` means all supported preferences.
|
|
*/
|
|
export const zPreferencesReadRequest_unstable = z.object({
|
|
keys: z.array(zPreferenceKey).optional().default([])
|
|
});
|
|
|
|
export const zPreferenceValue = z.object({
|
|
key: zPreferenceKey,
|
|
value: z.unknown().optional().default(null)
|
|
});
|
|
|
|
export const zPreferencesReadResponse_unstable = z.object({
|
|
values: z.array(zPreferenceValue)
|
|
});
|
|
|
|
/**
|
|
* Save allowlisted user preferences.
|
|
*/
|
|
export const zPreferencesSaveRequest_unstable = z.object({
|
|
values: z.array(zPreferenceValue).optional().default([])
|
|
});
|
|
|
|
export const zConfigReadRequest_unstable = z.object({
|
|
key: z.string(),
|
|
isSecret: z.boolean().optional().default(false)
|
|
});
|
|
|
|
export const zConfigReadResponse_unstable = z.object({
|
|
value: z.unknown().optional().default(null)
|
|
});
|
|
|
|
export const zConfigUpsertRequest_unstable = z.object({
|
|
key: z.string(),
|
|
value: z.unknown(),
|
|
isSecret: z.boolean().optional().default(false)
|
|
});
|
|
|
|
export const zConfigRemoveRequest_unstable = z.object({
|
|
key: z.string(),
|
|
isSecret: z.boolean().optional().default(false)
|
|
});
|
|
|
|
export const zConfigReadAllRequest_unstable = z.record(z.string(), z.unknown());
|
|
|
|
export const zConfigReadAllResponse_unstable = z.object({
|
|
config: z.record(z.string(), z.unknown())
|
|
});
|
|
|
|
/**
|
|
* Read Goose default provider and model configuration.
|
|
*/
|
|
export const zDefaultsReadRequest_unstable = z.record(z.string(), z.unknown());
|
|
|
|
export const zDefaultsReadResponse_unstable = z.object({
|
|
providerId: z.string().nullish(),
|
|
modelId: z.string().nullish()
|
|
});
|
|
|
|
/**
|
|
* Save Goose default provider and model configuration.
|
|
*/
|
|
export const zDefaultsSaveRequest_unstable = z.object({
|
|
providerId: z.string(),
|
|
modelId: z.string().nullish()
|
|
});
|
|
|
|
/**
|
|
* Clear Goose default provider and model configuration.
|
|
*/
|
|
export const zDefaultsClearRequest_unstable = z.record(z.string(), z.unknown());
|
|
|
|
/**
|
|
* Sources that onboarding knows how to discover and import.
|
|
*/
|
|
export const zOnboardingImportSourceKind = z.enum(['goose_config', 'claude_desktop']);
|
|
|
|
/**
|
|
* Scan for existing Goose and compatible app data that onboarding can import.
|
|
*/
|
|
export const zOnboardingImportScanRequest_unstable = z.object({
|
|
sources: z.array(zOnboardingImportSourceKind).optional().default([])
|
|
});
|
|
|
|
export const zOnboardingImportCounts = z.object({
|
|
providers: z.int().gte(0),
|
|
extensions: z.int().gte(0),
|
|
sessions: z.int().gte(0),
|
|
skills: z.int().gte(0),
|
|
projects: z.int().gte(0),
|
|
preferences: z.int().gte(0)
|
|
});
|
|
|
|
export const zOnboardingImportCandidate = z.object({
|
|
id: z.string(),
|
|
sourceKind: zOnboardingImportSourceKind,
|
|
displayName: z.string(),
|
|
path: z.string(),
|
|
counts: zOnboardingImportCounts,
|
|
warnings: z.array(z.string()).optional().default([])
|
|
});
|
|
|
|
export const zOnboardingImportScanResponse_unstable = z.object({
|
|
candidates: z.array(zOnboardingImportCandidate)
|
|
});
|
|
|
|
/**
|
|
* Import selected onboarding candidates.
|
|
*/
|
|
export const zOnboardingImportApplyRequest_unstable = z.object({
|
|
candidateIds: z.array(z.string()).optional().default([]),
|
|
enableImportedExtensions: z.boolean().optional().default(false)
|
|
});
|
|
|
|
export const zOnboardingImportApplyResponse_unstable = z.object({
|
|
imported: zOnboardingImportCounts,
|
|
skipped: zOnboardingImportCounts,
|
|
warnings: z.array(z.string()).optional().default([]),
|
|
providerDefaults: zDefaultsReadResponse_unstable.nullish()
|
|
});
|
|
|
|
export const zSessionExportFormat = z.enum(['json', 'markdown']);
|
|
|
|
/**
|
|
* Export a session as a JSON or markdown string.
|
|
*/
|
|
export const zExportSessionRequest_unstable = z.object({
|
|
sessionId: z.string(),
|
|
format: zSessionExportFormat.optional().default('json')
|
|
});
|
|
|
|
/**
|
|
* Export session response — raw JSON of the goose session with `conversation`,
|
|
* or a markdown transcript when `format` is `markdown`.
|
|
*/
|
|
export const zExportSessionResponse_unstable = z.object({
|
|
data: z.string()
|
|
});
|
|
|
|
export const zSessionImportSource = z.enum([
|
|
'auto',
|
|
'json',
|
|
'nostr'
|
|
]);
|
|
|
|
/**
|
|
* Import a session from a JSON string or share link.
|
|
*/
|
|
export const zImportSessionRequest_unstable = z.object({
|
|
input: z.string(),
|
|
source: zSessionImportSource
|
|
});
|
|
|
|
/**
|
|
* Import session response — metadata about the newly created session.
|
|
*/
|
|
export const zImportSessionResponse_unstable = z.object({
|
|
sessionId: z.string(),
|
|
title: z.string().nullish(),
|
|
updatedAt: z.string().nullish(),
|
|
messageCount: z.int().gte(0)
|
|
});
|
|
|
|
export const zShareSessionNostrRequest_unstable = z.object({
|
|
sessionId: z.string(),
|
|
relays: z.array(z.string())
|
|
});
|
|
|
|
export const zShareSessionNostrResponse_unstable = z.object({
|
|
deeplink: z.string(),
|
|
nevent: z.string(),
|
|
eventId: z.string(),
|
|
relays: z.array(z.string())
|
|
});
|
|
|
|
export const zRecipeExtensionDto = z.union([
|
|
z.object({
|
|
name: z.string(),
|
|
description: z.string().nullish(),
|
|
display_name: z.string().nullish(),
|
|
timeout: z.int().gte(0).nullish(),
|
|
bundled: z.boolean().nullish(),
|
|
available_tools: z.array(z.string()).nullish(),
|
|
type: z.literal('builtin')
|
|
}),
|
|
z.object({
|
|
name: z.string(),
|
|
description: z.string().nullish(),
|
|
display_name: z.string().nullish(),
|
|
bundled: z.boolean().nullish(),
|
|
available_tools: z.array(z.string()).nullish(),
|
|
type: z.literal('platform')
|
|
}),
|
|
z.object({
|
|
name: z.string(),
|
|
description: z.string().nullish(),
|
|
cmd: z.string(),
|
|
args: z.array(z.string()).optional(),
|
|
envs: z.record(z.string(), z.string()).optional(),
|
|
env_keys: z.array(z.string()).optional(),
|
|
timeout: z.int().gte(0).nullish(),
|
|
cwd: z.string().nullish(),
|
|
bundled: z.boolean().nullish(),
|
|
available_tools: z.array(z.string()).nullish(),
|
|
type: z.literal('stdio')
|
|
}),
|
|
z.object({
|
|
name: z.string(),
|
|
description: z.string().nullish(),
|
|
uri: z.string(),
|
|
envs: z.record(z.string(), z.string()).optional(),
|
|
env_keys: z.array(z.string()).optional(),
|
|
headers: z.record(z.string(), z.string()).optional(),
|
|
timeout: z.int().gte(0).nullish(),
|
|
socket: z.string().nullish(),
|
|
client_id: z.string().nullish(),
|
|
client_secret_key: z.string().nullish(),
|
|
scopes: z.array(z.string()).optional(),
|
|
bundled: z.boolean().nullish(),
|
|
available_tools: z.array(z.string()).nullish(),
|
|
type: z.literal('streamable_http')
|
|
})
|
|
]);
|
|
|
|
export const zRecipeSettingsDto = z.object({
|
|
goose_provider: z.string().nullish(),
|
|
goose_model: z.string().nullish(),
|
|
temperature: z.number().nullish(),
|
|
max_turns: z.int().gte(0).nullish()
|
|
});
|
|
|
|
export const zRecipeAuthorDto = z.object({
|
|
contact: z.string().nullish(),
|
|
metadata: z.string().nullish()
|
|
});
|
|
|
|
export const zRecipeParameterInputTypeDto = z.enum([
|
|
'string',
|
|
'number',
|
|
'boolean',
|
|
'date',
|
|
'file',
|
|
'select'
|
|
]);
|
|
|
|
export const zRecipeParameterRequirementDto = z.enum([
|
|
'required',
|
|
'optional',
|
|
'user_prompt'
|
|
]);
|
|
|
|
export const zRecipeParameterDto = z.object({
|
|
key: z.string(),
|
|
input_type: zRecipeParameterInputTypeDto,
|
|
requirement: zRecipeParameterRequirementDto,
|
|
description: z.string(),
|
|
default: z.string().nullish(),
|
|
options: z.array(z.string()).nullish()
|
|
});
|
|
|
|
export const zRecipeResponseDto = z.object({
|
|
json_schema: z.unknown().optional()
|
|
});
|
|
|
|
export const zSubRecipeDto = z.object({
|
|
name: z.string(),
|
|
path: z.string(),
|
|
values: z.record(z.string(), z.string()).nullish(),
|
|
sequential_when_repeated: z.boolean().optional().default(false),
|
|
description: z.string().nullish()
|
|
});
|
|
|
|
export const zRecipeSuccessCheckDto = z.object({
|
|
command: z.string(),
|
|
type: z.literal('shell')
|
|
});
|
|
|
|
export const zRecipeRetryConfigDto = z.object({
|
|
max_retries: z.int().gte(0),
|
|
checks: z.array(zRecipeSuccessCheckDto).optional().default([]),
|
|
on_failure: z.string().nullish(),
|
|
timeout_seconds: z.int().gte(0).nullish(),
|
|
on_failure_timeout_seconds: z.int().gte(0).nullish()
|
|
});
|
|
|
|
export const zRecipeDto = z.object({
|
|
version: z.string().optional().default('1.0.0'),
|
|
title: z.string(),
|
|
description: z.string(),
|
|
instructions: z.string().nullish(),
|
|
prompt: z.string().nullish(),
|
|
extensions: z.array(zRecipeExtensionDto).nullish(),
|
|
settings: zRecipeSettingsDto.nullish(),
|
|
activities: z.array(z.string()).nullish(),
|
|
author: zRecipeAuthorDto.nullish(),
|
|
parameters: z.array(zRecipeParameterDto).nullish(),
|
|
response: zRecipeResponseDto.nullish(),
|
|
sub_recipes: z.array(zSubRecipeDto).nullish(),
|
|
retry: zRecipeRetryConfigDto.nullish()
|
|
});
|
|
|
|
export const zEncodeRecipeRequest_unstable = z.object({
|
|
recipe: zRecipeDto
|
|
});
|
|
|
|
export const zEncodeRecipeResponse_unstable = z.object({
|
|
deeplink: z.string()
|
|
});
|
|
|
|
export const zDecodeRecipeRequest_unstable = z.object({
|
|
deeplink: z.string()
|
|
});
|
|
|
|
export const zDecodeRecipeResponse_unstable = z.object({
|
|
recipe: zRecipeDto
|
|
});
|
|
|
|
export const zScanRecipeRequest_unstable = z.object({
|
|
recipe: zRecipeDto
|
|
});
|
|
|
|
export const zScanRecipeResponse_unstable = z.object({
|
|
has_security_warnings: z.boolean()
|
|
});
|
|
|
|
export const zListRecipesRequest_unstable = z.record(z.string(), z.unknown());
|
|
|
|
export const zRecipeListEntryDto = z.object({
|
|
id: z.string(),
|
|
recipe: zRecipeDto,
|
|
file_path: z.string(),
|
|
last_modified: z.string(),
|
|
schedule_cron: z.string().nullish(),
|
|
slash_command: z.string().nullish()
|
|
});
|
|
|
|
export const zListRecipesResponse_unstable = z.object({
|
|
recipes: z.array(zRecipeListEntryDto)
|
|
});
|
|
|
|
export const zDeleteRecipeRequest_unstable = z.object({
|
|
id: z.string()
|
|
});
|
|
|
|
export const zScheduleRecipeRequest_unstable = z.object({
|
|
id: z.string(),
|
|
cron_schedule: z.string().nullish()
|
|
});
|
|
|
|
export const zSetRecipeSlashCommandRequest_unstable = z.object({
|
|
id: z.string(),
|
|
slash_command: z.string().nullish()
|
|
});
|
|
|
|
export const zSaveRecipeRequest_unstable = z.object({
|
|
recipe: zRecipeDto,
|
|
id: z.string().nullish()
|
|
});
|
|
|
|
export const zSaveRecipeResponse_unstable = z.object({
|
|
id: z.string(),
|
|
file_name: z.string(),
|
|
file_path: z.string()
|
|
});
|
|
|
|
export const zParseRecipeRequest_unstable = z.object({
|
|
content: z.string()
|
|
});
|
|
|
|
export const zParseRecipeResponse_unstable = z.object({
|
|
recipe: zRecipeDto
|
|
});
|
|
|
|
export const zRecipeToYamlRequest_unstable = z.object({
|
|
recipe: zRecipeDto
|
|
});
|
|
|
|
export const zRecipeToYamlResponse_unstable = z.object({
|
|
yaml: z.string()
|
|
});
|
|
|
|
export const zListSchedulesRequest_unstable = z.record(z.string(), z.unknown());
|
|
|
|
export const zScheduledJobDto = z.object({
|
|
id: z.string(),
|
|
source: z.string(),
|
|
cron: z.string(),
|
|
lastRun: z.string().nullish(),
|
|
currentlyRunning: z.boolean(),
|
|
paused: z.boolean(),
|
|
currentSessionId: z.string().nullish(),
|
|
jobStartTime: z.string().nullish()
|
|
});
|
|
|
|
export const zListSchedulesResponse_unstable = z.object({
|
|
jobs: z.array(zScheduledJobDto)
|
|
});
|
|
|
|
export const zListScheduleSessionsRequest_unstable = z.object({
|
|
scheduleId: z.string(),
|
|
limit: z.int().gte(0)
|
|
});
|
|
|
|
/**
|
|
* A unique identifier for a conversation session between a client and agent.
|
|
*
|
|
* Sessions maintain their own context, conversation history, and state,
|
|
* allowing multiple independent interactions with the same agent.
|
|
*
|
|
* See protocol docs: [Session ID](https://agentclientprotocol.com/protocol/session-setup#session-id)
|
|
*/
|
|
export const zSessionId = z.string();
|
|
|
|
/**
|
|
* Information about a session returned by session/list
|
|
*/
|
|
export const zSessionInfo = z.object({
|
|
sessionId: zSessionId,
|
|
cwd: z.string(),
|
|
additionalDirectories: z.array(z.string()).optional(),
|
|
title: z.string().nullish(),
|
|
updatedAt: z.string().nullish(),
|
|
_meta: z.record(z.string(), z.unknown()).nullish()
|
|
});
|
|
|
|
export const zListScheduleSessionsResponse_unstable = z.object({
|
|
sessions: z.array(zSessionInfo)
|
|
});
|
|
|
|
export const zCreateScheduleRequest_unstable = z.object({
|
|
id: z.string(),
|
|
recipe: zRecipeDto,
|
|
cron: z.string()
|
|
});
|
|
|
|
export const zCreateScheduleResponse_unstable = z.object({
|
|
job: zScheduledJobDto
|
|
});
|
|
|
|
export const zDeleteScheduleRequest_unstable = z.object({
|
|
scheduleId: z.string()
|
|
});
|
|
|
|
export const zPauseScheduleRequest_unstable = z.object({
|
|
scheduleId: z.string()
|
|
});
|
|
|
|
export const zUnpauseScheduleRequest_unstable = z.object({
|
|
scheduleId: z.string()
|
|
});
|
|
|
|
export const zUpdateScheduleRequest_unstable = z.object({
|
|
scheduleId: z.string(),
|
|
cron: z.string()
|
|
});
|
|
|
|
export const zUpdateScheduleResponse_unstable = z.object({
|
|
job: zScheduledJobDto
|
|
});
|
|
|
|
export const zRunScheduleNowRequest_unstable = z.object({
|
|
scheduleId: z.string()
|
|
});
|
|
|
|
export const zRunScheduleNowStatus = z.enum(['completed', 'cancelled']);
|
|
|
|
export const zRunScheduleNowResponse_unstable = z.object({
|
|
status: zRunScheduleNowStatus,
|
|
sessionId: z.string().nullish()
|
|
});
|
|
|
|
export const zKillRunningJobRequest_unstable = z.object({
|
|
jobId: z.string()
|
|
});
|
|
|
|
export const zKillRunningJobResponse_unstable = z.object({
|
|
message: z.string()
|
|
});
|
|
|
|
export const zInspectRunningJobRequest_unstable = z.object({
|
|
jobId: z.string()
|
|
});
|
|
|
|
export const zInspectRunningJobResponse_unstable = z.object({
|
|
running: z.boolean(),
|
|
sessionId: z.string().nullish(),
|
|
jobStartTime: z.string().nullish(),
|
|
runningDurationSeconds: z.int().nullish()
|
|
});
|
|
|
|
/**
|
|
* Return list-style metadata for a single session without loading the conversation.
|
|
*/
|
|
export const zGetSessionInfoRequest_unstable = z.object({
|
|
sessionId: z.string()
|
|
});
|
|
|
|
export const zGetSessionInfoResponse_unstable = z.object({
|
|
session: zSessionInfo
|
|
});
|
|
|
|
/**
|
|
* Truncate a session conversation from the given message timestamp onward.
|
|
*/
|
|
export const zTruncateSessionConversationRequest_unstable = z.object({
|
|
sessionId: z.string(),
|
|
truncateFrom: z.int()
|
|
});
|
|
|
|
/**
|
|
* Update the project association for a session.
|
|
*/
|
|
export const zUpdateSessionProjectRequest_unstable = z.object({
|
|
sessionId: z.string(),
|
|
projectId: z.string().nullish()
|
|
});
|
|
|
|
/**
|
|
* Rename a session.
|
|
*/
|
|
export const zRenameSessionRequest_unstable = z.object({
|
|
sessionId: z.string(),
|
|
title: z.string()
|
|
});
|
|
|
|
/**
|
|
* Archive a session (soft delete).
|
|
*/
|
|
export const zArchiveSessionRequest_unstable = z.object({
|
|
sessionId: z.string()
|
|
});
|
|
|
|
/**
|
|
* Unarchive a previously archived session.
|
|
*/
|
|
export const zUnarchiveSessionRequest_unstable = z.object({
|
|
sessionId: z.string()
|
|
});
|
|
|
|
/**
|
|
* The type of source entity.
|
|
*/
|
|
export const zSourceType = z.enum([
|
|
'skill',
|
|
'builtinSkill',
|
|
'recipe',
|
|
'subrecipe',
|
|
'agent',
|
|
'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_unstable = z.object({
|
|
type: zSourceType,
|
|
name: z.string(),
|
|
description: z.string(),
|
|
content: z.string(),
|
|
target: zSourceScope,
|
|
properties: z.record(z.string(), z.unknown()).optional()
|
|
});
|
|
|
|
/**
|
|
* A source discovered by Goose. Filesystem sources use an on-disk path;
|
|
* built-in sources use a stable synthetic path. Sources may be either
|
|
* `global` (shared across all projects) or project-specific.
|
|
*/
|
|
export const zSourceEntry = z.object({
|
|
type: zSourceType,
|
|
name: z.string(),
|
|
description: z.string(),
|
|
content: z.string(),
|
|
path: z.string(),
|
|
global: z.boolean(),
|
|
writable: z.boolean().optional().default(false),
|
|
supportingFiles: z.array(z.string()).optional(),
|
|
properties: z.record(z.string(), z.unknown()).optional()
|
|
});
|
|
|
|
export const zCreateSourceResponse_unstable = z.object({
|
|
source: zSourceEntry
|
|
});
|
|
|
|
/**
|
|
* List discovered sources.
|
|
*
|
|
* If `type` is omitted or `skill`, this lists filesystem/plugin skills only.
|
|
* Both global and project-scoped skills are included when `project_dir` is
|
|
* set. If `type` is `builtinSkill`, this lists shipped read-only built-in
|
|
* skills.
|
|
*/
|
|
export const zListSourcesRequest_unstable = z.object({
|
|
type: zSourceType.nullish(),
|
|
projectDir: z.string().nullish(),
|
|
includeProjectSources: z.boolean().optional().default(false)
|
|
});
|
|
|
|
export const zListSourcesResponse_unstable = z.object({
|
|
sources: z.array(zSourceEntry)
|
|
});
|
|
|
|
/**
|
|
* List user-facing agent mention targets for `@` autocomplete.
|
|
*/
|
|
export const zListAgentMentionsRequest_unstable = z.object({
|
|
cwd: z.string().nullish(),
|
|
sessionId: z.string().nullish()
|
|
});
|
|
|
|
/**
|
|
* A user-facing `@` mention target backed by an agent, recipe, or subrecipe source.
|
|
*/
|
|
export const zAgentMention = z.object({
|
|
name: z.string(),
|
|
description: z.string(),
|
|
sourceType: zSourceType,
|
|
sourcePath: z.string().nullish(),
|
|
mention: z.string()
|
|
});
|
|
|
|
export const zListAgentMentionsResponse_unstable = z.object({
|
|
agents: z.array(zAgentMention)
|
|
});
|
|
|
|
/**
|
|
* List slash commands available for `/` autocomplete.
|
|
*/
|
|
export const zListSlashCommandsRequest_unstable = z.object({
|
|
cwd: z.string().nullish(),
|
|
sessionId: z.string().nullish()
|
|
});
|
|
|
|
/**
|
|
* All text that was typed after the command name is provided as input.
|
|
*/
|
|
export const zUnstructuredCommandInput = z.object({
|
|
hint: z.string(),
|
|
_meta: z.record(z.string(), z.unknown()).nullish()
|
|
});
|
|
|
|
/**
|
|
* All text that was typed after the command name is provided as input.
|
|
*/
|
|
export const zAvailableCommandInput = zUnstructuredCommandInput;
|
|
|
|
/**
|
|
* Information about a command.
|
|
*/
|
|
export const zAvailableCommand = z.object({
|
|
name: z.string(),
|
|
description: z.string(),
|
|
input: zAvailableCommandInput.nullish(),
|
|
_meta: z.record(z.string(), z.unknown()).nullish()
|
|
});
|
|
|
|
export const zListSlashCommandsResponse_unstable = z.object({
|
|
availableCommands: z.array(zAvailableCommand)
|
|
});
|
|
|
|
/**
|
|
* Update an existing source's name, description, and content by absolute path.
|
|
*/
|
|
export const zUpdateSourceRequest_unstable = z.object({
|
|
type: zSourceType,
|
|
path: z.string(),
|
|
name: z.string(),
|
|
description: z.string(),
|
|
content: z.string(),
|
|
properties: z.record(z.string(), z.unknown()).nullish()
|
|
});
|
|
|
|
export const zUpdateSourceResponse_unstable = z.object({
|
|
source: zSourceEntry
|
|
});
|
|
|
|
/**
|
|
* Delete a source and its on-disk directory by absolute path.
|
|
*/
|
|
export const zDeleteSourceRequest_unstable = z.object({
|
|
type: zSourceType,
|
|
path: z.string()
|
|
});
|
|
|
|
/**
|
|
* Export a source at an absolute path as a portable JSON payload.
|
|
*/
|
|
export const zExportSourceRequest_unstable = z.object({
|
|
type: zSourceType,
|
|
path: z.string()
|
|
});
|
|
|
|
export const zExportSourceResponse_unstable = z.object({
|
|
json: z.string(),
|
|
filename: z.string()
|
|
});
|
|
|
|
/**
|
|
* 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_unstable = z.object({
|
|
data: z.string(),
|
|
target: zSourceScope
|
|
});
|
|
|
|
export const zImportSourcesResponse_unstable = z.object({
|
|
sources: z.array(zSourceEntry)
|
|
});
|
|
|
|
/**
|
|
* Transcribe audio via a dictation provider.
|
|
*/
|
|
export const zDictationTranscribeRequest_unstable = z.object({
|
|
audio: z.string(),
|
|
mimeType: z.string(),
|
|
provider: z.string()
|
|
});
|
|
|
|
/**
|
|
* Transcription result.
|
|
*/
|
|
export const zDictationTranscribeResponse_unstable = z.object({
|
|
text: z.string()
|
|
});
|
|
|
|
/**
|
|
* Get the configuration status of all dictation providers.
|
|
*/
|
|
export const zDictationConfigRequest_unstable = z.record(z.string(), z.unknown());
|
|
|
|
export const zDictationModelOption = z.object({
|
|
id: z.string(),
|
|
label: z.string(),
|
|
description: z.string()
|
|
});
|
|
|
|
/**
|
|
* Per-provider configuration status.
|
|
*/
|
|
export const zDictationProviderStatusEntry = z.object({
|
|
configured: z.boolean(),
|
|
host: z.string().nullish(),
|
|
description: z.string(),
|
|
usesProviderConfig: z.boolean(),
|
|
settingsPath: z.string().nullish(),
|
|
configKey: z.string().nullish(),
|
|
modelConfigKey: z.string().nullish(),
|
|
defaultModel: z.string().nullish(),
|
|
selectedModel: z.string().nullish(),
|
|
availableModels: z.array(zDictationModelOption).optional().default([])
|
|
});
|
|
|
|
/**
|
|
* Dictation config response — map of provider name to status.
|
|
*/
|
|
export const zDictationConfigResponse_unstable = z.object({
|
|
providers: z.record(z.string(), zDictationProviderStatusEntry)
|
|
});
|
|
|
|
/**
|
|
* List available local Whisper models with their download status.
|
|
*/
|
|
export const zDictationModelsListRequest_unstable = z.record(z.string(), z.unknown());
|
|
|
|
export const zDictationLocalModelStatus = z.object({
|
|
id: z.string(),
|
|
label: z.string(),
|
|
description: z.string(),
|
|
sizeMb: z.int().gte(0),
|
|
downloaded: z.boolean(),
|
|
downloadInProgress: z.boolean(),
|
|
recommended: z.boolean()
|
|
});
|
|
|
|
export const zDictationModelsListResponse_unstable = z.object({
|
|
models: z.array(zDictationLocalModelStatus)
|
|
});
|
|
|
|
/**
|
|
* Kick off a background download of a local Whisper model.
|
|
*/
|
|
export const zDictationModelDownloadRequest_unstable = z.object({
|
|
modelId: z.string()
|
|
});
|
|
|
|
/**
|
|
* Poll the progress of an in-flight download.
|
|
*/
|
|
export const zDictationModelDownloadProgressRequest_unstable = z.object({
|
|
modelId: z.string()
|
|
});
|
|
|
|
export const zDictationDownloadProgress = z.object({
|
|
bytesDownloaded: z.int().gte(0),
|
|
totalBytes: z.int().gte(0),
|
|
progressPercent: z.number(),
|
|
status: z.string(),
|
|
error: z.string().nullish()
|
|
});
|
|
|
|
export const zDictationModelDownloadProgressResponse_unstable = z.object({
|
|
progress: zDictationDownloadProgress.nullish()
|
|
});
|
|
|
|
/**
|
|
* Cancel an in-flight download.
|
|
*/
|
|
export const zDictationModelCancelRequest_unstable = z.object({
|
|
modelId: z.string()
|
|
});
|
|
|
|
/**
|
|
* Delete a downloaded local Whisper model from disk.
|
|
*/
|
|
export const zDictationModelDeleteRequest_unstable = z.object({
|
|
modelId: z.string()
|
|
});
|
|
|
|
export const zLocalInferenceModelsListRequest_unstable = z.record(z.string(), z.unknown());
|
|
|
|
export const zLocalInferenceDownloadState = z.enum([
|
|
'NotDownloaded',
|
|
'Downloading',
|
|
'Downloaded'
|
|
]);
|
|
|
|
export const zLocalInferenceModelDownloadStatusDto = z.object({
|
|
state: zLocalInferenceDownloadState,
|
|
progressPercent: z.number().nullish(),
|
|
bytesDownloaded: z.int().gte(0).nullish(),
|
|
totalBytes: z.int().gte(0).nullish(),
|
|
speedBps: z.int().gte(0).nullish()
|
|
});
|
|
|
|
export const zLocalInferenceSamplingConfig = z.union([
|
|
z.object({
|
|
type: z.literal('Greedy')
|
|
}),
|
|
z.object({
|
|
temperature: z.number(),
|
|
topK: z.int(),
|
|
topP: z.number(),
|
|
minP: z.number(),
|
|
seed: z.int().gte(0).nullish(),
|
|
type: z.literal('Temperature')
|
|
}),
|
|
z.object({
|
|
tau: z.number(),
|
|
eta: z.number(),
|
|
seed: z.int().gte(0).nullish(),
|
|
type: z.literal('MirostatV2')
|
|
})
|
|
]);
|
|
|
|
export const zLocalInferenceToolCallingMode = z.enum([
|
|
'auto',
|
|
'force_native',
|
|
'force_emulated'
|
|
]);
|
|
|
|
export const zLocalInferenceChatTemplate = z.union([
|
|
z.object({
|
|
type: z.literal('embedded')
|
|
}),
|
|
z.object({
|
|
name: z.string(),
|
|
type: z.literal('builtin')
|
|
}),
|
|
z.object({
|
|
template: z.string(),
|
|
type: z.literal('custom_inline')
|
|
})
|
|
]);
|
|
|
|
export const zLocalInferenceModelSettingsDto = z.object({
|
|
backendId: z.string().nullish(),
|
|
contextSize: z.int().gte(0).nullish(),
|
|
maxOutputTokens: z.int().gte(0).nullish(),
|
|
draftModel: z.string().nullish(),
|
|
sampling: zLocalInferenceSamplingConfig.optional().default({
|
|
type: 'Temperature',
|
|
temperature: 0.800000011920929,
|
|
topK: 40,
|
|
topP: 0.949999988079071,
|
|
minP: 0.05000000074505806
|
|
}),
|
|
repeatPenalty: z.number(),
|
|
repeatLastN: z.int(),
|
|
frequencyPenalty: z.number(),
|
|
presencePenalty: z.number(),
|
|
nBatch: z.int().gte(0).nullish(),
|
|
nGpuLayers: z.int().gte(0).nullish(),
|
|
useMlock: z.boolean(),
|
|
flashAttention: z.boolean().nullish(),
|
|
nThreads: z.int().nullish(),
|
|
toolCalling: zLocalInferenceToolCallingMode.optional().default('auto'),
|
|
chatTemplate: zLocalInferenceChatTemplate.optional().default({ type: 'embedded' }),
|
|
enableThinking: z.boolean(),
|
|
visionCapable: z.boolean(),
|
|
imageTokenEstimate: z.int().gte(0),
|
|
mmprojSizeBytes: z.int().gte(0)
|
|
});
|
|
|
|
export const zLocalInferenceModelDto = z.object({
|
|
id: z.string(),
|
|
repoId: z.string(),
|
|
filename: z.string(),
|
|
quantization: z.string(),
|
|
sizeBytes: z.int().gte(0),
|
|
status: zLocalInferenceModelDownloadStatusDto,
|
|
recommended: z.boolean(),
|
|
isLoaded: z.boolean(),
|
|
settings: zLocalInferenceModelSettingsDto,
|
|
visionCapable: z.boolean(),
|
|
mmprojStatus: zLocalInferenceModelDownloadStatusDto.nullish()
|
|
});
|
|
|
|
export const zLocalInferenceModelsListResponse_unstable = z.object({
|
|
models: z.array(zLocalInferenceModelDto)
|
|
});
|
|
|
|
export const zLocalInferenceModelDownloadRequest_unstable = z.object({
|
|
spec: z.string(),
|
|
backendId: z.string().nullish(),
|
|
variantId: z.string().nullish()
|
|
});
|
|
|
|
export const zLocalInferenceModelDownloadResponse_unstable = z.object({
|
|
modelId: z.string()
|
|
});
|
|
|
|
export const zLocalInferenceModelDownloadProgressRequest_unstable = z.object({
|
|
modelId: z.string()
|
|
});
|
|
|
|
export const zLocalInferenceDownloadProgressDto = z.object({
|
|
modelId: z.string(),
|
|
status: z.string(),
|
|
bytesDownloaded: z.int().gte(0),
|
|
totalBytes: z.int().gte(0),
|
|
progressPercent: z.number(),
|
|
speedBps: z.int().gte(0).nullish(),
|
|
etaSeconds: z.int().gte(0).nullish(),
|
|
error: z.string().nullish(),
|
|
taskExited: z.boolean()
|
|
});
|
|
|
|
export const zLocalInferenceModelDownloadProgressResponse_unstable = z.object({
|
|
progress: zLocalInferenceDownloadProgressDto.nullish()
|
|
});
|
|
|
|
export const zLocalInferenceModelDownloadCancelRequest_unstable = z.object({
|
|
modelId: z.string()
|
|
});
|
|
|
|
export const zLocalInferenceModelDeleteRequest_unstable = z.object({
|
|
modelId: z.string()
|
|
});
|
|
|
|
export const zLocalInferenceModelEvictRequest_unstable = z.object({
|
|
modelId: z.string()
|
|
});
|
|
|
|
export const zLocalInferenceModelSettingsReadRequest_unstable = z.object({
|
|
modelId: z.string()
|
|
});
|
|
|
|
export const zLocalInferenceModelSettingsReadResponse_unstable = z.object({
|
|
settings: zLocalInferenceModelSettingsDto
|
|
});
|
|
|
|
export const zLocalInferenceModelSettingsUpdateRequest_unstable = z.object({
|
|
modelId: z.string(),
|
|
settings: zLocalInferenceModelSettingsDto
|
|
});
|
|
|
|
export const zLocalInferenceModelSettingsUpdateResponse_unstable = z.object({
|
|
settings: zLocalInferenceModelSettingsDto
|
|
});
|
|
|
|
export const zLocalInferenceHuggingFaceSearchRequest_unstable = z.object({
|
|
query: z.string(),
|
|
limit: z.int().gte(0).nullish()
|
|
});
|
|
|
|
export const zLocalInferenceHfGgufFileDto = z.object({
|
|
filename: z.string(),
|
|
sizeBytes: z.int().gte(0),
|
|
quantization: z.string(),
|
|
downloadUrl: z.string()
|
|
});
|
|
|
|
export const zLocalInferenceHfModelVariantDto = z.object({
|
|
variantId: z.string(),
|
|
label: z.string(),
|
|
backendId: z.string(),
|
|
format: z.string(),
|
|
modelId: z.string(),
|
|
downloadId: z.string(),
|
|
sizeBytes: z.int().gte(0),
|
|
filename: z.string().nullish(),
|
|
downloadUrl: z.string().nullish(),
|
|
description: z.string(),
|
|
qualityRank: z.int().gte(0).lte(255),
|
|
sharded: z.boolean(),
|
|
supported: z.boolean(),
|
|
unsupportedReason: z.string().nullish()
|
|
});
|
|
|
|
export const zLocalInferenceHfModelInfoDto = z.object({
|
|
repoId: z.string(),
|
|
author: z.string(),
|
|
modelName: z.string(),
|
|
downloads: z.int().gte(0),
|
|
ggufFiles: z.array(zLocalInferenceHfGgufFileDto).optional().default([]),
|
|
variants: z.array(zLocalInferenceHfModelVariantDto).optional().default([])
|
|
});
|
|
|
|
export const zLocalInferenceHuggingFaceSearchResponse_unstable = z.object({
|
|
models: z.array(zLocalInferenceHfModelInfoDto)
|
|
});
|
|
|
|
export const zLocalInferenceHuggingFaceRepoVariantsRequest_unstable = z.object({
|
|
repoId: z.string()
|
|
});
|
|
|
|
export const zLocalInferenceHuggingFaceRepoVariantsResponse_unstable = z.object({
|
|
variants: z.array(zLocalInferenceHfModelVariantDto),
|
|
recommendedIndex: z.int().gte(0).nullish(),
|
|
availableMemoryBytes: z.int().gte(0),
|
|
downloadedQuants: z.array(z.string()),
|
|
downloadedVariants: z.array(z.string())
|
|
});
|
|
|
|
export const zLocalInferenceBuiltinChatTemplatesListRequest_unstable = z.record(z.string(), z.unknown());
|
|
|
|
export const zLocalInferenceBuiltinChatTemplatesListResponse_unstable = z.object({
|
|
templates: z.array(z.string())
|
|
});
|
|
|
|
/**
|
|
* Streaming context-window usage update for a session.
|
|
*/
|
|
export const zSessionUsageUpdate = z.object({
|
|
used: z.int().gte(0),
|
|
contextLimit: z.int().gte(0),
|
|
accumulatedInputTokens: z.int().gte(0),
|
|
accumulatedOutputTokens: z.int().gte(0),
|
|
accumulatedCost: z.number().nullish()
|
|
});
|
|
|
|
export const zStatusMessage = z.union([
|
|
z.object({
|
|
message: z.string(),
|
|
type: z.literal('notice')
|
|
}),
|
|
z.object({
|
|
message: z.string(),
|
|
type: z.literal('progress')
|
|
})
|
|
]);
|
|
|
|
/**
|
|
* Live UI/session status. This is not conversation transcript content, and
|
|
* should not be persisted or replayed as history.
|
|
*/
|
|
export const zStatusMessageUpdate = z.object({
|
|
status: zStatusMessage
|
|
});
|
|
|
|
/**
|
|
* Wire mirror of the conversation `CostSource`.
|
|
*/
|
|
export const zCostSourceData = z.union([
|
|
z.literal('provider_reported'),
|
|
z.literal('estimated')
|
|
]);
|
|
|
|
/**
|
|
* Wire mirror of the conversation `MessageUsage` (this crate cannot depend on
|
|
* goose-provider-types); field names and serde casing MUST stay in parity.
|
|
*/
|
|
export const zMessageUsageData = z.object({
|
|
inputTokens: z.int().nullish(),
|
|
outputTokens: z.int().nullish(),
|
|
totalTokens: z.int().nullish(),
|
|
cacheReadTokens: z.int().nullish(),
|
|
cacheWriteTokens: z.int().nullish(),
|
|
cost: z.number().nullish(),
|
|
costSource: zCostSourceData.nullish(),
|
|
elapsedMs: z.int().gte(0).nullish(),
|
|
timeToFirstTokenMs: z.int().gte(0).nullish(),
|
|
isCompaction: z.boolean().optional().default(false)
|
|
});
|
|
|
|
/**
|
|
* Per-message token usage/cost/timing, keyed by the message id used for
|
|
* chunk matching. Sent live after a turn's messages and on replay.
|
|
*/
|
|
export const zMessageUsageUpdate = z.object({
|
|
messageId: z.string().nullish(),
|
|
usage: zMessageUsageData
|
|
});
|
|
|
|
/**
|
|
* Discriminated union of goose-specific session update payloads.
|
|
* Variant tag matches ACP's convention (`sessionUpdate: "<snake_case>"`).
|
|
*
|
|
* `discriminator.mapping` is what makes TS codegen (`@hey-api/openapi-ts`)
|
|
* emit the correct snake_case tag value even when this enum has a single
|
|
* variant. Add a mapping entry per variant.
|
|
*/
|
|
export const zGooseSessionUpdate = z.discriminatedUnion('sessionUpdate', [
|
|
zSessionUsageUpdate.extend({ sessionUpdate: z.literal('usage_update') }),
|
|
zStatusMessageUpdate.extend({ sessionUpdate: z.literal('status_message') }),
|
|
zMessageUsageUpdate.extend({ sessionUpdate: z.literal('message_usage') })
|
|
]);
|
|
|
|
/**
|
|
* Goose-custom session update notification — a parallel to ACP's
|
|
* `session/update` carrying goose-specific update variants.
|
|
*/
|
|
export const zGooseSessionNotification_unstable = z.object({
|
|
sessionId: z.string(),
|
|
update: zGooseSessionUpdate
|
|
});
|
|
|
|
/**
|
|
* Dedicated provider notification for OAuth device-code flow.
|
|
* Sent during provider authentication when the ACP client supports
|
|
* `goose.customNotifications` — avoids a fake empty session ID.
|
|
*/
|
|
export const zProviderDeviceCodeNotification_unstable = z.object({
|
|
providerId: z.string(),
|
|
userCode: z.string(),
|
|
verificationUri: z.string(),
|
|
expiresIn: z.int().gte(0)
|
|
});
|
|
|
|
export const zRequestRecipeParams_unstable = z.object({
|
|
sessionId: z.string(),
|
|
parameters: z.array(zRecipeParameterDto),
|
|
parameterScopeId: z.string().nullish()
|
|
});
|
|
|
|
export const zRecipeParamsAction = z.enum(['submit', 'cancel']);
|
|
|
|
export const zRecipeParamsResponse_unstable = z.object({
|
|
action: zRecipeParamsAction.optional().default('submit'),
|
|
values: z.record(z.string(), z.string()).optional().default({})
|
|
});
|
|
|
|
export const zExtRequest = z.object({
|
|
id: z.string(),
|
|
method: z.string(),
|
|
params: z.union([
|
|
z.union([
|
|
zAddSessionExtensionRequest_unstable,
|
|
zRemoveSessionExtensionRequest_unstable,
|
|
zGetToolsRequest_unstable,
|
|
zSetToolPermissionsRequest_unstable,
|
|
zGooseToolCallRequest_unstable,
|
|
zReadResourceRequest_unstable,
|
|
zAppsListRequest_unstable,
|
|
zAppsExportRequest_unstable,
|
|
zAppsImportRequest_unstable,
|
|
zAppsDeleteRequest_unstable,
|
|
zUpdateWorkingDirRequest_unstable,
|
|
zSetSessionSystemPromptRequest_unstable,
|
|
zSteerSessionRequest_unstable,
|
|
zDiagnosticsGetRequest_unstable,
|
|
zListPromptsRequest_unstable,
|
|
zGetPromptRequest_unstable,
|
|
zSavePromptRequest_unstable,
|
|
zResetPromptRequest_unstable,
|
|
zGetConfigExtensionsRequest_unstable,
|
|
zAddConfigExtensionRequest_unstable,
|
|
zRemoveConfigExtensionRequest_unstable,
|
|
zSetConfigExtensionEnabledRequest_unstable,
|
|
zGetSessionExtensionsRequest_unstable,
|
|
zListProvidersRequest_unstable,
|
|
zProviderSupportedModelsListRequest_unstable,
|
|
zProviderCatalogListRequest_unstable,
|
|
zProviderSetupCatalogListRequest_unstable,
|
|
zProviderCatalogTemplateRequest_unstable,
|
|
zCustomProviderCreateRequest_unstable,
|
|
zCustomProviderReadRequest_unstable,
|
|
zCustomProviderUpdateRequest_unstable,
|
|
zCustomProviderDeleteRequest_unstable,
|
|
zRefreshProviderInventoryRequest_unstable,
|
|
zProviderReadinessCheckRequest_unstable,
|
|
zProviderConfigReadRequest_unstable,
|
|
zProviderConfigStatusRequest_unstable,
|
|
zProviderConfigSaveRequest_unstable,
|
|
zProviderConfigDeleteRequest_unstable,
|
|
zProviderConfigAuthenticateRequest_unstable,
|
|
zProviderSecretsListRequest_unstable,
|
|
zProviderSecretDeleteRequest_unstable,
|
|
zCanonicalModelInfoRequest_unstable,
|
|
zPreferencesReadRequest_unstable,
|
|
zPreferencesSaveRequest_unstable,
|
|
zConfigReadRequest_unstable,
|
|
zConfigUpsertRequest_unstable,
|
|
zConfigRemoveRequest_unstable,
|
|
zConfigReadAllRequest_unstable,
|
|
zDefaultsReadRequest_unstable,
|
|
zDefaultsSaveRequest_unstable,
|
|
zDefaultsClearRequest_unstable,
|
|
zOnboardingImportScanRequest_unstable,
|
|
zOnboardingImportApplyRequest_unstable,
|
|
zExportSessionRequest_unstable,
|
|
zImportSessionRequest_unstable,
|
|
zShareSessionNostrRequest_unstable,
|
|
zEncodeRecipeRequest_unstable,
|
|
zDecodeRecipeRequest_unstable,
|
|
zScanRecipeRequest_unstable,
|
|
zListRecipesRequest_unstable,
|
|
zDeleteRecipeRequest_unstable,
|
|
zScheduleRecipeRequest_unstable,
|
|
zSetRecipeSlashCommandRequest_unstable,
|
|
zSaveRecipeRequest_unstable,
|
|
zParseRecipeRequest_unstable,
|
|
zRecipeToYamlRequest_unstable,
|
|
zListSchedulesRequest_unstable,
|
|
zListScheduleSessionsRequest_unstable,
|
|
zCreateScheduleRequest_unstable,
|
|
zDeleteScheduleRequest_unstable,
|
|
zPauseScheduleRequest_unstable,
|
|
zUnpauseScheduleRequest_unstable,
|
|
zUpdateScheduleRequest_unstable,
|
|
zRunScheduleNowRequest_unstable,
|
|
zKillRunningJobRequest_unstable,
|
|
zInspectRunningJobRequest_unstable,
|
|
zGetSessionInfoRequest_unstable,
|
|
zTruncateSessionConversationRequest_unstable,
|
|
zUpdateSessionProjectRequest_unstable,
|
|
zRenameSessionRequest_unstable,
|
|
zArchiveSessionRequest_unstable,
|
|
zUnarchiveSessionRequest_unstable,
|
|
zCreateSourceRequest_unstable,
|
|
zListSourcesRequest_unstable,
|
|
zListAgentMentionsRequest_unstable,
|
|
zListSlashCommandsRequest_unstable,
|
|
zUpdateSourceRequest_unstable,
|
|
zDeleteSourceRequest_unstable,
|
|
zExportSourceRequest_unstable,
|
|
zImportSourcesRequest_unstable,
|
|
zDictationTranscribeRequest_unstable,
|
|
zDictationConfigRequest_unstable,
|
|
zDictationModelsListRequest_unstable,
|
|
zDictationModelDownloadRequest_unstable,
|
|
zDictationModelDownloadProgressRequest_unstable,
|
|
zDictationModelCancelRequest_unstable,
|
|
zDictationModelDeleteRequest_unstable,
|
|
zLocalInferenceModelsListRequest_unstable,
|
|
zLocalInferenceModelDownloadRequest_unstable,
|
|
zLocalInferenceModelDownloadProgressRequest_unstable,
|
|
zLocalInferenceModelDownloadCancelRequest_unstable,
|
|
zLocalInferenceModelDeleteRequest_unstable,
|
|
zLocalInferenceModelEvictRequest_unstable,
|
|
zLocalInferenceModelSettingsReadRequest_unstable,
|
|
zLocalInferenceModelSettingsUpdateRequest_unstable,
|
|
zLocalInferenceHuggingFaceSearchRequest_unstable,
|
|
zLocalInferenceHuggingFaceRepoVariantsRequest_unstable,
|
|
zLocalInferenceBuiltinChatTemplatesListRequest_unstable
|
|
]),
|
|
z.record(z.string(), z.unknown())
|
|
]).nullish()
|
|
});
|
|
|
|
export const zExtResponse = z.union([
|
|
z.object({
|
|
id: z.string(),
|
|
result: z.union([
|
|
z.union([
|
|
zEmptyResponse,
|
|
zGetToolsResponse_unstable,
|
|
zSetToolPermissionsResponse_unstable,
|
|
zGooseToolCallResponse_unstable,
|
|
zReadResourceResponse_unstable,
|
|
zAppsListResponse_unstable,
|
|
zAppsExportResponse_unstable,
|
|
zAppsImportResponse_unstable,
|
|
zAppsDeleteResponse_unstable,
|
|
zSteerSessionResponse_unstable,
|
|
zDiagnosticsGetResponse_unstable,
|
|
zListPromptsResponse_unstable,
|
|
zGetPromptResponse_unstable,
|
|
zPromptOperationResponse_unstable,
|
|
zGetConfigExtensionsResponse_unstable,
|
|
zGetSessionExtensionsResponse_unstable,
|
|
zListProvidersResponse_unstable,
|
|
zProviderSupportedModelsListResponse_unstable,
|
|
zProviderCatalogListResponse_unstable,
|
|
zProviderSetupCatalogListResponse_unstable,
|
|
zProviderCatalogTemplateResponse_unstable,
|
|
zCustomProviderCreateResponse_unstable,
|
|
zCustomProviderReadResponse_unstable,
|
|
zCustomProviderUpdateResponse_unstable,
|
|
zCustomProviderDeleteResponse_unstable,
|
|
zRefreshProviderInventoryResponse_unstable,
|
|
zProviderReadinessCheckResponse_unstable,
|
|
zProviderConfigReadResponse_unstable,
|
|
zProviderConfigStatusResponse_unstable,
|
|
zProviderConfigChangeResponse_unstable,
|
|
zProviderSecretsListResponse_unstable,
|
|
zCanonicalModelInfoResponse_unstable,
|
|
zPreferencesReadResponse_unstable,
|
|
zConfigReadResponse_unstable,
|
|
zConfigReadAllResponse_unstable,
|
|
zDefaultsReadResponse_unstable,
|
|
zOnboardingImportScanResponse_unstable,
|
|
zOnboardingImportApplyResponse_unstable,
|
|
zExportSessionResponse_unstable,
|
|
zImportSessionResponse_unstable,
|
|
zShareSessionNostrResponse_unstable,
|
|
zEncodeRecipeResponse_unstable,
|
|
zDecodeRecipeResponse_unstable,
|
|
zScanRecipeResponse_unstable,
|
|
zListRecipesResponse_unstable,
|
|
zSaveRecipeResponse_unstable,
|
|
zParseRecipeResponse_unstable,
|
|
zRecipeToYamlResponse_unstable,
|
|
zListSchedulesResponse_unstable,
|
|
zListScheduleSessionsResponse_unstable,
|
|
zCreateScheduleResponse_unstable,
|
|
zUpdateScheduleResponse_unstable,
|
|
zRunScheduleNowResponse_unstable,
|
|
zKillRunningJobResponse_unstable,
|
|
zInspectRunningJobResponse_unstable,
|
|
zGetSessionInfoResponse_unstable,
|
|
zCreateSourceResponse_unstable,
|
|
zListSourcesResponse_unstable,
|
|
zListAgentMentionsResponse_unstable,
|
|
zListSlashCommandsResponse_unstable,
|
|
zUpdateSourceResponse_unstable,
|
|
zExportSourceResponse_unstable,
|
|
zImportSourcesResponse_unstable,
|
|
zDictationTranscribeResponse_unstable,
|
|
zDictationConfigResponse_unstable,
|
|
zDictationModelsListResponse_unstable,
|
|
zDictationModelDownloadProgressResponse_unstable,
|
|
zLocalInferenceModelsListResponse_unstable,
|
|
zLocalInferenceModelDownloadResponse_unstable,
|
|
zLocalInferenceModelDownloadProgressResponse_unstable,
|
|
zLocalInferenceModelSettingsReadResponse_unstable,
|
|
zLocalInferenceModelSettingsUpdateResponse_unstable,
|
|
zLocalInferenceHuggingFaceSearchResponse_unstable,
|
|
zLocalInferenceHuggingFaceRepoVariantsResponse_unstable,
|
|
zLocalInferenceBuiltinChatTemplatesListResponse_unstable
|
|
]),
|
|
z.unknown()
|
|
]).optional()
|
|
}),
|
|
z.object({
|
|
error: z.object({
|
|
code: z.int(),
|
|
message: z.string(),
|
|
data: z.unknown().optional()
|
|
}),
|
|
id: z.string()
|
|
})
|
|
]);
|
|
|
|
export const zExtNotification = z.object({
|
|
method: z.string(),
|
|
params: z.union([
|
|
z.union([
|
|
zGooseSessionNotification_unstable,
|
|
zProviderDeviceCodeNotification_unstable
|
|
]),
|
|
z.record(z.string(), z.unknown())
|
|
]).nullish()
|
|
});
|
|
|
|
export const zExtAgentRequest = z.object({
|
|
id: z.string(),
|
|
method: z.string(),
|
|
params: z.union([
|
|
zRequestRecipeParams_unstable,
|
|
z.record(z.string(), z.unknown())
|
|
]).nullish()
|
|
});
|
|
|
|
export const zExtAgentResponse = z.union([
|
|
z.object({
|
|
id: z.string(),
|
|
result: z.union([
|
|
zRecipeParamsResponse_unstable,
|
|
z.unknown()
|
|
]).optional()
|
|
}),
|
|
z.object({
|
|
error: z.object({
|
|
code: z.int(),
|
|
message: z.string(),
|
|
data: z.unknown().optional()
|
|
}),
|
|
id: z.string()
|
|
})
|
|
]);
|