From 794b04a0b1f4c58378ef3738dade297c13690b77 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Wed, 2 Sep 2026 21:56:40 +0000 Subject: [PATCH] docs: generate ACP reference documentation from release schemas (#11770) --- .github/workflows/ci.yml | 4 +- .../workflows/deploy-docs-and-extensions.yml | 19 ++ .github/workflows/pr-website-preview.yml | 6 + .gitignore | 1 + Justfile | 14 +- crates/goose-sdk-types/src/custom_requests.rs | 48 ++- .../src/custom_requests/recipe.rs | 11 + .../src/custom_requests/schedule.rs | 10 + crates/goose/acp-schema.json | 69 ++++- documentation/scripts/generate-acp-docs.js | 293 ++++++++++++++++++ .../scripts/generate-acp-docs.test.js | 53 ++++ .../scripts/generate-released-acp-docs.sh | 23 ++ ui/sdk/src/generated/types.gen.ts | 155 ++++++++- ui/sdk/src/generated/zod.gen.ts | 155 ++++++++- 14 files changed, 803 insertions(+), 58 deletions(-) create mode 100644 documentation/scripts/generate-acp-docs.js create mode 100644 documentation/scripts/generate-acp-docs.test.js create mode 100755 documentation/scripts/generate-released-acp-docs.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 55a170fbf..80d431e58 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -275,10 +275,10 @@ jobs: cd ui/desktop && pnpm install --frozen-lockfile cd ../sdk && pnpm install --frozen-lockfile - - name: Check ACP Schema is Up-to-Date + - name: Check ACP Artifacts are Up-to-Date run: | source ./bin/activate-hermit - just check-acp-schema + just check-acp-artifacts - name: Check ACP Client SDK run: | diff --git a/.github/workflows/deploy-docs-and-extensions.yml b/.github/workflows/deploy-docs-and-extensions.yml index 2bc06bdc3..ee2cb36f6 100644 --- a/.github/workflows/deploy-docs-and-extensions.yml +++ b/.github/workflows/deploy-docs-and-extensions.yml @@ -1,11 +1,19 @@ name: Deploy Documentation on: + workflow_dispatch: push: branches: - main paths: - 'documentation/**' + workflow_run: + workflows: + - Release + types: + - completed + branches-ignore: + - 'release/**' concurrency: group: pages @@ -13,6 +21,9 @@ concurrency: jobs: deploy: + if: | + github.event_name != 'workflow_run' || + github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest permissions: contents: read @@ -25,12 +36,20 @@ jobs: steps: - name: Checkout the branch uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + ref: main + fetch-depth: 0 - name: Setup Node.js uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 20 + - name: Generate released ACP reference + env: + GH_TOKEN: ${{ github.token }} + run: ./documentation/scripts/generate-released-acp-docs.sh + - name: Cache Node.js modules (documentation) uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: diff --git a/.github/workflows/pr-website-preview.yml b/.github/workflows/pr-website-preview.yml index cb8cf6c99..cc57409df 100644 --- a/.github/workflows/pr-website-preview.yml +++ b/.github/workflows/pr-website-preview.yml @@ -8,6 +8,8 @@ on: - synchronize paths: - 'documentation/**' + - 'crates/goose/acp-schema.json' + - 'crates/goose/acp-meta.json' concurrency: group: docs-preview-${{ github.event.pull_request.number }} @@ -35,6 +37,9 @@ jobs: cache: npm cache-dependency-path: documentation/package-lock.json + - name: Generate ACP reference + run: node documentation/scripts/generate-acp-docs.js + - name: Install dependencies and build docs working-directory: ./documentation env: @@ -44,6 +49,7 @@ jobs: TARGET_PATH: / run: | npm ci + npm test npm run build - name: Verify docs map was generated diff --git a/.gitignore b/.gitignore index c25c7a8dc..25a0a377f 100644 --- a/.gitignore +++ b/.gitignore @@ -49,6 +49,7 @@ debug_*.txt # Generated files .docusaurus .cache-loader +/documentation/docs/reference/goose-acp-reference.md # Benchmark paths benchmark-* diff --git a/Justfile b/Justfile index d459c2a0e..16443a968 100644 --- a/Justfile +++ b/Justfile @@ -151,11 +151,11 @@ run-server: @echo "Running external ACP backend..." GOOSE_SERVER__SECRET_KEY="${GOOSE_SERVER__SECRET_KEY:-test}" cargo run -p goose-cli --bin goose -- serve --platform desktop --enable-scheduler --host 127.0.0.1 --port 3000 -# Check if generated ACP schema and TypeScript types are up-to-date -check-acp-schema: generate-acp-types +# Check if checked-in ACP artifacts are up-to-date and the docs can be rendered +check-acp-artifacts: generate-acp-types generate-acp-docs #!/usr/bin/env bash set -e - echo "🔍 Checking ACP schema and generated types are up-to-date..." + echo "🔍 Checking generated ACP artifacts are up-to-date..." if ! git diff --exit-code crates/goose/acp-schema.json crates/goose/acp-meta.json ui/sdk/src/generated/; then echo "" echo "❌ ACP generated files are out of date!" @@ -163,7 +163,7 @@ check-acp-schema: generate-acp-types echo "Run 'just generate-acp-types' locally, then commit the changes." exit 1 fi - echo "✅ ACP schema and generated types are up-to-date" + echo "✅ Generated ACP artifacts are up-to-date" # Generate ACP JSON schema from Rust types generate-acp-schema: @@ -177,6 +177,12 @@ generate-acp-types: generate-acp-schema cd ui/sdk && npx tsx generate-schema.ts @echo "ACP TypeScript types generated in ui/sdk/src/generated/" +# Generate ACP documentation from the existing JSON schema and metadata +generate-acp-docs: + @echo "Generating ACP documentation..." + node documentation/scripts/generate-acp-docs.js + @echo "ACP documentation generated for the docs build." + # Build SDK TypeScript package (schema + types + compile) build-sdk: generate-acp-types @echo "Compiling ACP TypeScript..." diff --git a/crates/goose-sdk-types/src/custom_requests.rs b/crates/goose-sdk-types/src/custom_requests.rs index 9aa2a1067..2edfa01b9 100644 --- a/crates/goose-sdk-types/src/custom_requests.rs +++ b/crates/goose-sdk-types/src/custom_requests.rs @@ -118,6 +118,7 @@ pub struct GooseToolCallResponse { pub meta: Option, } +/// List available goose apps, optionally scoped to a session. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request(method = "_goose/unstable/apps/list", response = AppsListResponse)] #[serde(rename_all = "camelCase")] @@ -132,6 +133,7 @@ pub struct AppsListResponse { pub apps: Vec, } +/// Export a goose app as HTML. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request(method = "_goose/unstable/apps/export", response = AppsExportResponse)] #[serde(rename_all = "camelCase")] @@ -144,6 +146,7 @@ pub struct AppsExportResponse { pub html: String, } +/// Import a goose app from HTML. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request(method = "_goose/unstable/apps/import", response = AppsImportResponse)] #[serde(rename_all = "camelCase")] @@ -157,6 +160,7 @@ pub struct AppsImportResponse { pub message: String, } +/// Delete a goose app by name. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request(method = "_goose/unstable/apps/delete", response = AppsDeleteResponse)] #[serde(rename_all = "camelCase")] @@ -192,7 +196,7 @@ pub enum SessionSystemPromptMode { /// Set, append, or clear system prompt text for a session. /// -/// `mode: "set"` replaces Goose's base system prompt. `mode: "append"` adds an +/// `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. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] @@ -234,6 +238,7 @@ pub struct SteerSessionResponse { pub message_id: String, } +/// Get a diagnostic report for a session. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/diagnostics/get", @@ -271,7 +276,7 @@ pub struct PromptTemplateEntry { pub is_customized: bool, } -/// List all available Goose prompt templates. +/// List all available goose prompt templates. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request(method = "_goose/unstable/config/prompts/list", response = ListPromptsResponse)] #[serde(rename_all = "camelCase")] @@ -283,7 +288,7 @@ pub struct ListPromptsResponse { pub prompts: Vec, } -/// Read a Goose prompt template. +/// Read a goose prompt template. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request(method = "_goose/unstable/config/prompts/get", response = GetPromptResponse)] #[serde(rename_all = "camelCase")] @@ -300,7 +305,7 @@ pub struct GetPromptResponse { pub is_customized: bool, } -/// Save a custom Goose prompt template. +/// Save a custom goose prompt template. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request(method = "_goose/unstable/config/prompts/save", response = PromptOperationResponse)] #[serde(rename_all = "camelCase")] @@ -309,7 +314,7 @@ pub struct SavePromptRequest { pub content: String, } -/// Reset a Goose prompt template to its default content. +/// Reset a goose prompt template to its default content. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request(method = "_goose/unstable/config/prompts/reset", response = PromptOperationResponse)] #[serde(rename_all = "camelCase")] @@ -461,6 +466,7 @@ pub struct SetConfigExtensionEnabledRequest { pub enabled: bool, } +/// List extensions enabled for an active session. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request(method = "_goose/unstable/session/extensions/list", response = GetSessionExtensionsResponse)] #[serde(rename_all = "camelCase")] @@ -491,6 +497,7 @@ pub struct PreferencesSaveRequest { pub values: Vec, } +/// Read one goose configuration value. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request(method = "_goose/unstable/config/read", response = ConfigReadResponse)] #[serde(rename_all = "camelCase")] @@ -507,6 +514,7 @@ pub struct ConfigReadResponse { pub value: serde_json::Value, } +/// Create or replace one goose configuration value. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request(method = "_goose/unstable/config/upsert", response = EmptyResponse)] #[serde(rename_all = "camelCase")] @@ -517,6 +525,7 @@ pub struct ConfigUpsertRequest { pub is_secret: bool, } +/// Remove one goose configuration value. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request(method = "_goose/unstable/config/remove", response = EmptyResponse)] #[serde(rename_all = "camelCase")] @@ -526,6 +535,7 @@ pub struct ConfigRemoveRequest { pub is_secret: bool, } +/// Read all non-secret goose configuration values. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request(method = "_goose/unstable/config/read-all", response = ConfigReadAllResponse)] #[serde(rename_all = "camelCase")] @@ -562,7 +572,7 @@ pub struct PreferencesReadResponse { pub values: Vec, } -/// Read Goose default provider and model configuration. +/// Read goose default provider and model configuration. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request(method = "_goose/unstable/defaults/read", response = DefaultsReadResponse)] #[serde(rename_all = "camelCase")] @@ -575,7 +585,7 @@ pub struct DefaultsReadResponse { pub model_id: Option, } -/// Save Goose default provider and model configuration. +/// Save goose default provider and model configuration. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request(method = "_goose/unstable/defaults/save", response = DefaultsReadResponse)] #[serde(rename_all = "camelCase")] @@ -585,7 +595,7 @@ pub struct DefaultsSaveRequest { pub model_id: Option, } -/// Clear Goose default provider and model configuration. +/// Clear goose default provider and model configuration. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request(method = "_goose/unstable/defaults/clear", response = DefaultsReadResponse)] #[serde(rename_all = "camelCase")] @@ -623,7 +633,7 @@ pub struct OnboardingImportCandidate { pub warnings: Vec, } -/// Scan for existing Goose and compatible app data that onboarding can import. +/// Scan for existing goose and compatible app data that onboarding can import. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/onboarding/import/scan", @@ -773,6 +783,7 @@ pub enum SessionImportSource { Nostr, } +/// Share a session through Nostr and return its share links. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/session/share/nostr", @@ -956,7 +967,7 @@ pub struct ProviderSecretDto { pub configure_provider: Option, } -/// List provider credentials stored locally by Goose. +/// List provider credentials stored locally by goose. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/providers/secrets/list", @@ -1232,7 +1243,7 @@ pub struct CustomProviderUpsertDto { pub preserves_thinking: Option, } -/// Create a custom provider backed by Goose's declarative provider store. +/// Create a custom provider backed by goose's declarative provider store. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/providers/custom/create", @@ -1271,7 +1282,7 @@ pub struct CustomProviderReadResponse { pub status: ProviderConfigStatusDto, } -/// Update a custom provider backed by Goose's declarative provider store. +/// Update a custom provider backed by goose's declarative provider store. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/providers/custom/update", @@ -1292,7 +1303,7 @@ pub struct CustomProviderUpdateResponse { pub refresh: RefreshProviderInventoryResponse, } -/// Delete a custom provider from Goose's declarative provider store. +/// Delete a custom provider from goose's declarative provider store. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/providers/custom/delete", @@ -1987,6 +1998,7 @@ pub struct LocalInferenceHfModelInfoDto { pub variants: Vec, } +/// List locally available inference models. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/local-inference/models/list", @@ -2001,6 +2013,7 @@ pub struct LocalInferenceModelsListResponse { pub models: Vec, } +/// Download a model for local inference. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/local-inference/models/download", @@ -2021,6 +2034,7 @@ pub struct LocalInferenceModelDownloadResponse { pub model_id: String, } +/// Get the progress of a local model download. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/local-inference/models/download/progress", @@ -2038,6 +2052,7 @@ pub struct LocalInferenceModelDownloadProgressResponse { pub progress: Option, } +/// Cancel a local model download. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/local-inference/models/download/cancel", @@ -2048,6 +2063,7 @@ pub struct LocalInferenceModelDownloadCancelRequest { pub model_id: String, } +/// Delete a downloaded local inference model. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/local-inference/models/delete", @@ -2058,6 +2074,7 @@ pub struct LocalInferenceModelDeleteRequest { pub model_id: String, } +/// Evict a local inference model from memory. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/local-inference/models/evict", @@ -2068,6 +2085,7 @@ pub struct LocalInferenceModelEvictRequest { pub model_id: String, } +/// Read the sampling settings for a local inference model. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/local-inference/models/settings/read", @@ -2084,6 +2102,7 @@ pub struct LocalInferenceModelSettingsReadResponse { pub settings: LocalInferenceModelSettingsDto, } +/// Update the sampling settings for a local inference model. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/local-inference/models/settings/update", @@ -2101,6 +2120,7 @@ pub struct LocalInferenceModelSettingsUpdateResponse { pub settings: LocalInferenceModelSettingsDto, } +/// Search Hugging Face for local inference models. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/local-inference/huggingface/search", @@ -2119,6 +2139,7 @@ pub struct LocalInferenceHuggingFaceSearchResponse { pub models: Vec, } +/// List downloadable variants of a Hugging Face model repository. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/local-inference/huggingface/repo/variants", @@ -2140,6 +2161,7 @@ pub struct LocalInferenceHuggingFaceRepoVariantsResponse { pub downloaded_variants: Vec, } +/// List built-in chat templates for local inference. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/local-inference/chat-templates/builtin/list", diff --git a/crates/goose-sdk-types/src/custom_requests/recipe.rs b/crates/goose-sdk-types/src/custom_requests/recipe.rs index 10b9a0e3d..5aac58313 100644 --- a/crates/goose-sdk-types/src/custom_requests/recipe.rs +++ b/crates/goose-sdk-types/src/custom_requests/recipe.rs @@ -265,6 +265,7 @@ pub struct RecipeListEntryDto { pub slash_command: Option, } +/// Ask the client to provide values for a recipe's parameters. #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "camelCase")] pub struct RequestRecipeParams { @@ -291,6 +292,7 @@ pub struct RecipeParamsResponse { pub values: HashMap, } +/// Encode a recipe as a goose deep link. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/recipes/encode", @@ -305,6 +307,7 @@ pub struct EncodeRecipeResponse { pub deeplink: String, } +/// Decode a goose deep link into a recipe. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/recipes/decode", @@ -319,6 +322,7 @@ pub struct DecodeRecipeResponse { pub recipe: RecipeDto, } +/// Scan a recipe for security warnings. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request(method = "_goose/unstable/recipes/scan", response = ScanRecipeResponse)] pub struct ScanRecipeRequest { @@ -330,6 +334,7 @@ pub struct ScanRecipeResponse { pub has_security_warnings: bool, } +/// Save a recipe to the local recipe library. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request(method = "_goose/unstable/recipes/save", response = SaveRecipeResponse)] pub struct SaveRecipeRequest { @@ -345,6 +350,7 @@ pub struct SaveRecipeResponse { pub file_path: String, } +/// Parse serialized recipe content. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request(method = "_goose/unstable/recipes/parse", response = ParseRecipeResponse)] pub struct ParseRecipeRequest { @@ -356,12 +362,14 @@ pub struct ParseRecipeResponse { pub recipe: RecipeDto, } +/// Delete a recipe from the local recipe library. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request(method = "_goose/unstable/recipes/delete", response = EmptyResponse)] pub struct DeleteRecipeRequest { pub id: String, } +/// List recipes in the local recipe library. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request(method = "_goose/unstable/recipes/list", response = ListRecipesResponse)] pub struct ListRecipesRequest {} @@ -371,6 +379,7 @@ pub struct ListRecipesResponse { pub recipes: Vec, } +/// Set or clear a recipe's cron schedule. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request(method = "_goose/unstable/recipes/schedule", response = EmptyResponse)] pub struct ScheduleRecipeRequest { @@ -379,6 +388,7 @@ pub struct ScheduleRecipeRequest { pub cron_schedule: Option, } +/// Set or clear a recipe's slash command. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/recipes/slash-command", @@ -390,6 +400,7 @@ pub struct SetRecipeSlashCommandRequest { pub slash_command: Option, } +/// Serialize a recipe as YAML. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/recipes/to-yaml", diff --git a/crates/goose-sdk-types/src/custom_requests/schedule.rs b/crates/goose-sdk-types/src/custom_requests/schedule.rs index 37457a7bf..2431551a2 100644 --- a/crates/goose-sdk-types/src/custom_requests/schedule.rs +++ b/crates/goose-sdk-types/src/custom_requests/schedule.rs @@ -21,6 +21,7 @@ pub struct ScheduledJobDto { pub job_start_time: Option, } +/// List scheduled recipe jobs. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/schedules/list", @@ -33,6 +34,7 @@ pub struct ListSchedulesResponse { pub jobs: Vec, } +/// Create a scheduled recipe job. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/schedules/create", @@ -49,6 +51,7 @@ pub struct CreateScheduleResponse { pub job: ScheduledJobDto, } +/// Delete a scheduled recipe job. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request(method = "_goose/unstable/schedules/delete", response = EmptyResponse)] #[serde(rename_all = "camelCase")] @@ -56,6 +59,7 @@ pub struct DeleteScheduleRequest { pub schedule_id: String, } +/// Update the cron expression for a scheduled recipe job. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/schedules/update", @@ -72,6 +76,7 @@ pub struct UpdateScheduleResponse { pub job: ScheduledJobDto, } +/// Run a scheduled recipe job immediately. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/schedules/run-now", @@ -98,6 +103,7 @@ pub enum RunScheduleNowStatus { Cancelled, } +/// List recent sessions created by a scheduled recipe job. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/schedules/sessions/list", @@ -114,6 +120,7 @@ pub struct ListScheduleSessionsResponse { pub sessions: Vec, } +/// Pause a scheduled recipe job. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request(method = "_goose/unstable/schedules/pause", response = EmptyResponse)] #[serde(rename_all = "camelCase")] @@ -121,6 +128,7 @@ pub struct PauseScheduleRequest { pub schedule_id: String, } +/// Resume a paused scheduled recipe job. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/schedules/unpause", @@ -131,6 +139,7 @@ pub struct UnpauseScheduleRequest { pub schedule_id: String, } +/// Stop a currently running scheduled job. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/schedules/running-job/kill", @@ -146,6 +155,7 @@ pub struct KillRunningJobResponse { pub message: String, } +/// Inspect the current state of a running scheduled job. #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)] #[request( method = "_goose/unstable/schedules/running-job/inspect", diff --git a/crates/goose/acp-schema.json b/crates/goose/acp-schema.json index a342a69bd..3adeac0a8 100644 --- a/crates/goose/acp-schema.json +++ b/crates/goose/acp-schema.json @@ -641,6 +641,7 @@ ] } }, + "description": "List available goose apps, optionally scoped to a session.", "x-side": "agent", "x-method": "_goose/unstable/apps/list" }, @@ -666,6 +667,7 @@ "required": [ "name" ], + "description": "Export a goose app as HTML.", "x-side": "agent", "x-method": "_goose/unstable/apps/export" }, @@ -692,6 +694,7 @@ "required": [ "html" ], + "description": "Import a goose app from HTML.", "x-side": "agent", "x-method": "_goose/unstable/apps/import" }, @@ -722,6 +725,7 @@ "required": [ "name" ], + "description": "Delete a goose app by name.", "x-side": "agent", "x-method": "_goose/unstable/apps/delete" }, @@ -784,7 +788,7 @@ "sessionId", "text" ], - "description": "Set, append, or clear system prompt text for a session.\n\n`mode: \"set\"` replaces Goose's base system prompt. `mode: \"append\"` adds an\ninstruction under \"Additional Instructions\". Reusing a key replaces the\nprevious value for that mode/key; sending empty text clears it.", + "description": "Set, append, or clear system prompt text for a session.\n\n`mode: \"set\"` replaces goose's base system prompt. `mode: \"append\"` adds an\ninstruction under \"Additional Instructions\". Reusing a key replaces the\nprevious value for that mode/key; sending empty text clears it.", "x-side": "agent", "x-method": "_goose/unstable/session/system-prompt/set" }, @@ -1305,6 +1309,7 @@ "required": [ "sessionId" ], + "description": "Get a diagnostic report for a session.", "x-side": "agent", "x-method": "_goose/unstable/diagnostics/get" }, @@ -1328,7 +1333,7 @@ }, "ListPromptsRequest_unstable": { "type": "object", - "description": "List all available Goose prompt templates.", + "description": "List all available goose prompt templates.", "x-side": "agent", "x-method": "_goose/unstable/config/prompts/list" }, @@ -1388,7 +1393,7 @@ "required": [ "name" ], - "description": "Read a Goose prompt template.", + "description": "Read a goose prompt template.", "x-side": "agent", "x-method": "_goose/unstable/config/prompts/get" }, @@ -1431,7 +1436,7 @@ "name", "content" ], - "description": "Save a custom Goose prompt template.", + "description": "Save a custom goose prompt template.", "x-side": "agent", "x-method": "_goose/unstable/config/prompts/save" }, @@ -1457,7 +1462,7 @@ "required": [ "name" ], - "description": "Reset a Goose prompt template to its default content.", + "description": "Reset a goose prompt template to its default content.", "x-side": "agent", "x-method": "_goose/unstable/config/prompts/reset" }, @@ -1572,6 +1577,7 @@ "required": [ "sessionId" ], + "description": "List extensions enabled for an active session.", "x-side": "agent", "x-method": "_goose/unstable/session/extensions/list" }, @@ -2302,7 +2308,7 @@ "apiUrl", "requiresAuth" ], - "description": "Create a custom provider backed by Goose's declarative provider store.", + "description": "Create a custom provider backed by goose's declarative provider store.", "x-side": "agent", "x-method": "_goose/unstable/providers/custom/create" }, @@ -2570,7 +2576,7 @@ "apiUrl", "requiresAuth" ], - "description": "Update a custom provider backed by Goose's declarative provider store.", + "description": "Update a custom provider backed by goose's declarative provider store.", "x-side": "agent", "x-method": "_goose/unstable/providers/custom/update" }, @@ -2605,7 +2611,7 @@ "required": [ "providerId" ], - "description": "Delete a custom provider from Goose's declarative provider store.", + "description": "Delete a custom provider from goose's declarative provider store.", "x-side": "agent", "x-method": "_goose/unstable/providers/custom/delete" }, @@ -2852,7 +2858,7 @@ }, "ProviderSecretsListRequest_unstable": { "type": "object", - "description": "List provider credentials stored locally by Goose.", + "description": "List provider credentials stored locally by goose.", "x-side": "agent", "x-method": "_goose/unstable/providers/secrets/list" }, @@ -3142,6 +3148,7 @@ "required": [ "key" ], + "description": "Read one goose configuration value.", "x-side": "agent", "x-method": "_goose/unstable/config/read" }, @@ -3171,6 +3178,7 @@ "key", "value" ], + "description": "Create or replace one goose configuration value.", "x-side": "agent", "x-method": "_goose/unstable/config/upsert" }, @@ -3188,11 +3196,13 @@ "required": [ "key" ], + "description": "Remove one goose configuration value.", "x-side": "agent", "x-method": "_goose/unstable/config/remove" }, "ConfigReadAllRequest_unstable": { "type": "object", + "description": "Read all non-secret goose configuration values.", "x-side": "agent", "x-method": "_goose/unstable/config/read-all" }, @@ -3212,7 +3222,7 @@ }, "DefaultsReadRequest_unstable": { "type": "object", - "description": "Read Goose default provider and model configuration.", + "description": "Read goose default provider and model configuration.", "x-side": "agent", "x-method": "_goose/unstable/defaults/read" }, @@ -3250,13 +3260,13 @@ "required": [ "providerId" ], - "description": "Save Goose default provider and model configuration.", + "description": "Save goose default provider and model configuration.", "x-side": "agent", "x-method": "_goose/unstable/defaults/save" }, "DefaultsClearRequest_unstable": { "type": "object", - "description": "Clear Goose default provider and model configuration.", + "description": "Clear goose default provider and model configuration.", "x-side": "agent", "x-method": "_goose/unstable/defaults/clear" }, @@ -3272,7 +3282,7 @@ "default": [] } }, - "description": "Scan for existing Goose and compatible app data that onboarding can import.", + "description": "Scan for existing goose and compatible app data that onboarding can import.", "x-side": "agent", "x-method": "_goose/unstable/onboarding/import/scan" }, @@ -3537,6 +3547,7 @@ "sessionId", "relays" ], + "description": "Share a session through Nostr and return its share links.", "x-side": "agent", "x-method": "_goose/unstable/session/share/nostr" }, @@ -3578,6 +3589,7 @@ "required": [ "recipe" ], + "description": "Encode a recipe as a goose deep link.", "x-side": "agent", "x-method": "_goose/unstable/recipes/encode" }, @@ -4181,6 +4193,7 @@ "required": [ "deeplink" ], + "description": "Decode a goose deep link into a recipe.", "x-side": "agent", "x-method": "_goose/unstable/recipes/decode" }, @@ -4207,6 +4220,7 @@ "required": [ "recipe" ], + "description": "Scan a recipe for security warnings.", "x-side": "agent", "x-method": "_goose/unstable/recipes/scan" }, @@ -4225,6 +4239,7 @@ }, "ListRecipesRequest_unstable": { "type": "object", + "description": "List recipes in the local recipe library.", "x-side": "agent", "x-method": "_goose/unstable/recipes/list" }, @@ -4289,6 +4304,7 @@ "required": [ "id" ], + "description": "Delete a recipe from the local recipe library.", "x-side": "agent", "x-method": "_goose/unstable/recipes/delete" }, @@ -4308,6 +4324,7 @@ "required": [ "id" ], + "description": "Set or clear a recipe's cron schedule.", "x-side": "agent", "x-method": "_goose/unstable/recipes/schedule" }, @@ -4327,6 +4344,7 @@ "required": [ "id" ], + "description": "Set or clear a recipe's slash command.", "x-side": "agent", "x-method": "_goose/unstable/recipes/slash-command" }, @@ -4346,6 +4364,7 @@ "required": [ "recipe" ], + "description": "Save a recipe to the local recipe library.", "x-side": "agent", "x-method": "_goose/unstable/recipes/save" }, @@ -4380,6 +4399,7 @@ "required": [ "content" ], + "description": "Parse serialized recipe content.", "x-side": "agent", "x-method": "_goose/unstable/recipes/parse" }, @@ -4406,6 +4426,7 @@ "required": [ "recipe" ], + "description": "Serialize a recipe as YAML.", "x-side": "agent", "x-method": "_goose/unstable/recipes/to-yaml" }, @@ -4424,6 +4445,7 @@ }, "ListSchedulesRequest_unstable": { "type": "object", + "description": "List scheduled recipe jobs.", "x-side": "agent", "x-method": "_goose/unstable/schedules/list" }, @@ -4503,6 +4525,7 @@ "scheduleId", "limit" ], + "description": "List recent sessions created by a scheduled recipe job.", "x-side": "agent", "x-method": "_goose/unstable/schedules/sessions/list" }, @@ -4596,6 +4619,7 @@ "recipe", "cron" ], + "description": "Create a scheduled recipe job.", "x-side": "agent", "x-method": "_goose/unstable/schedules/create" }, @@ -4622,6 +4646,7 @@ "required": [ "scheduleId" ], + "description": "Delete a scheduled recipe job.", "x-side": "agent", "x-method": "_goose/unstable/schedules/delete" }, @@ -4635,6 +4660,7 @@ "required": [ "scheduleId" ], + "description": "Pause a scheduled recipe job.", "x-side": "agent", "x-method": "_goose/unstable/schedules/pause" }, @@ -4648,6 +4674,7 @@ "required": [ "scheduleId" ], + "description": "Resume a paused scheduled recipe job.", "x-side": "agent", "x-method": "_goose/unstable/schedules/unpause" }, @@ -4665,6 +4692,7 @@ "scheduleId", "cron" ], + "description": "Update the cron expression for a scheduled recipe job.", "x-side": "agent", "x-method": "_goose/unstable/schedules/update" }, @@ -4691,6 +4719,7 @@ "required": [ "scheduleId" ], + "description": "Run a scheduled recipe job immediately.", "x-side": "agent", "x-method": "_goose/unstable/schedules/run-now" }, @@ -4730,6 +4759,7 @@ "required": [ "jobId" ], + "description": "Stop a currently running scheduled job.", "x-side": "agent", "x-method": "_goose/unstable/schedules/running-job/kill" }, @@ -4756,6 +4786,7 @@ "required": [ "jobId" ], + "description": "Inspect the current state of a running scheduled job.", "x-side": "agent", "x-method": "_goose/unstable/schedules/running-job/inspect" }, @@ -5727,6 +5758,7 @@ }, "LocalInferenceModelsListRequest_unstable": { "type": "object", + "description": "List locally available inference models.", "x-side": "agent", "x-method": "_goose/unstable/local-inference/models/list" }, @@ -6132,6 +6164,7 @@ "required": [ "spec" ], + "description": "Download a model for local inference.", "x-side": "agent", "x-method": "_goose/unstable/local-inference/models/download" }, @@ -6158,6 +6191,7 @@ "required": [ "modelId" ], + "description": "Get the progress of a local model download.", "x-side": "agent", "x-method": "_goose/unstable/local-inference/models/download/progress" }, @@ -6242,6 +6276,7 @@ "required": [ "modelId" ], + "description": "Cancel a local model download.", "x-side": "agent", "x-method": "_goose/unstable/local-inference/models/download/cancel" }, @@ -6255,6 +6290,7 @@ "required": [ "modelId" ], + "description": "Delete a downloaded local inference model.", "x-side": "agent", "x-method": "_goose/unstable/local-inference/models/delete" }, @@ -6268,6 +6304,7 @@ "required": [ "modelId" ], + "description": "Evict a local inference model from memory.", "x-side": "agent", "x-method": "_goose/unstable/local-inference/models/evict" }, @@ -6281,6 +6318,7 @@ "required": [ "modelId" ], + "description": "Read the sampling settings for a local inference model.", "x-side": "agent", "x-method": "_goose/unstable/local-inference/models/settings/read" }, @@ -6311,6 +6349,7 @@ "modelId", "settings" ], + "description": "Update the sampling settings for a local inference model.", "x-side": "agent", "x-method": "_goose/unstable/local-inference/models/settings/update" }, @@ -6344,6 +6383,7 @@ "required": [ "query" ], + "description": "Search Hugging Face for local inference models.", "x-side": "agent", "x-method": "_goose/unstable/local-inference/huggingface/search" }, @@ -6507,6 +6547,7 @@ "required": [ "repoId" ], + "description": "List downloadable variants of a Hugging Face model repository.", "x-side": "agent", "x-method": "_goose/unstable/local-inference/huggingface/repo/variants" }, @@ -6554,6 +6595,7 @@ }, "LocalInferenceBuiltinChatTemplatesListRequest_unstable": { "type": "object", + "description": "List built-in chat templates for local inference.", "x-side": "agent", "x-method": "_goose/unstable/local-inference/chat-templates/builtin/list" }, @@ -6882,6 +6924,7 @@ "sessionId", "parameters" ], + "description": "Ask the client to provide values for a recipe's parameters.", "x-side": "client", "x-method": "_goose/unstable/session/recipe/request-params" }, diff --git a/documentation/scripts/generate-acp-docs.js b/documentation/scripts/generate-acp-docs.js new file mode 100644 index 000000000..21912cc9a --- /dev/null +++ b/documentation/scripts/generate-acp-docs.js @@ -0,0 +1,293 @@ +const fs = require('fs'); +const path = require('path'); + +const ROOT = path.join(__dirname, '..', '..'); +const SCHEMA_FILE = path.join(ROOT, 'crates', 'goose', 'acp-schema.json'); +const META_FILE = path.join(ROOT, 'crates', 'goose', 'acp-meta.json'); +const OUTPUT_FILE = path.join( + ROOT, + 'documentation', + 'docs', + 'reference', + 'goose-acp-reference.md' +); +const UNSUPPORTED_KEYWORDS = [ + 'contains', + 'dependentSchemas', + 'else', + 'if', + 'not', + 'patternProperties', + 'prefixItems', + 'propertyNames', + 'then', + 'unevaluatedProperties', +]; + +function escapeCode(value) { + return String(value) + .replaceAll('&', '&') + .replaceAll('<', '<') + .replaceAll('>', '>') + .replaceAll('{', '{') + .replaceAll('}', '}') + .replaceAll('`', '`'); +} + +function code(value) { + return `${escapeCode(value)}`; +} + +function methodCode(value) { + return `${escapeCode(value).replaceAll('/', '/')}`; +} + +function schemaCode(value) { + const escaped = escapeCode(value) + .replace(/([a-z0-9])([A-Z])/g, '$1$2') + .replaceAll('_', '_'); + return `${escaped}`; +} + +function text(value, fallback = '') { + const result = String(value ?? '').trim(); + return result + ? result.replaceAll('|', '\\|').replaceAll('\r\n', '\n').replaceAll('\n', '
') + : fallback; +} + +function literal(value) { + return code(JSON.stringify(value)); +} + +function refName(reference) { + const prefix = '#/$defs/'; + if (typeof reference !== 'string' || !reference.startsWith(prefix)) { + throw new Error(`Unsupported schema reference: ${JSON.stringify(reference)}`); + } + return reference.slice(prefix.length); +} + +function schemaId(name) { + return `schema-${name.toLowerCase()}`; +} + +function schemaLink(name) { + return `[${schemaCode(name)}](#${schemaId(name)})`; +} + +function schemaType(schema, inlineObject = false) { + if (schema === true) return code('unknown'); + if (schema === false) return code('never'); + if (!schema || Array.isArray(schema) || typeof schema !== 'object') { + throw new Error(`Unsupported schema: ${JSON.stringify(schema)}`); + } + + const unsupported = UNSUPPORTED_KEYWORDS.find((keyword) => keyword in schema); + if (unsupported) throw new Error(`Unsupported schema keyword: ${unsupported}`); + + if (schema.$ref) { + const structuralSiblings = Object.fromEntries( + Object.entries(schema).filter( + ([key]) => + ![ + '$ref', + 'default', + 'description', + 'format', + 'maximum', + 'minimum', + 'pattern', + 'title', + ].includes(key) && !key.startsWith('x-') + ) + ); + const reference = schemaLink(refName(schema.$ref)); + return Object.keys(structuralSiblings).length === 0 + ? reference + : `${reference} & ${schemaType(structuralSiblings, true)}`; + } + if (Object.hasOwn(schema, 'const')) return literal(schema.const); + if (schema.enum) return schema.enum.map(literal).join(' \\| '); + + for (const keyword of ['anyOf', 'oneOf', 'allOf']) { + if (schema[keyword]) { + if (!Array.isArray(schema[keyword]) || schema[keyword].length === 0) { + throw new Error(`Invalid ${keyword} schema`); + } + const separator = keyword === 'allOf' ? ' & ' : ' \\| '; + return schema[keyword].map((part) => schemaType(part, true)).join(separator); + } + } + + if (Array.isArray(schema.type)) { + return schema.type + .map((type) => schemaType({...schema, type}, inlineObject)) + .join(' \\| '); + } + + if (schema.type === 'array') { + if (!Object.hasOwn(schema, 'items')) throw new Error('Array schema is missing items'); + return `Array<${schemaType(schema.items, true)}>`; + } + + if ( + schema.type === 'object' || + (!schema.type && (schema.properties || Object.hasOwn(schema, 'additionalProperties'))) + ) { + if (schema.properties && inlineObject) { + const required = new Set(schema.required ?? []); + const fields = Object.entries(schema.properties).map( + ([name, property]) => + `${code(name)}${required.has(name) ? '' : '?'}: ${schemaType(property, true)}` + ); + return `{ ${fields.join('; ')} }`; + } + if (Object.hasOwn(schema, 'additionalProperties') && !schema.properties) { + return `Record<${code('string')}, ${schemaType(schema.additionalProperties, true)}>`; + } + return code('object'); + } + + if (typeof schema.type === 'string') return code(schema.type); + if ( + Object.keys(schema).every( + (key) => + key === 'default' || key === 'description' || key === 'title' || key.startsWith('x-') + ) + ) { + return code('unknown'); + } + throw new Error(`Unsupported schema shape: ${JSON.stringify(schema)}`); +} + +function constraints(schema) { + const values = []; + if (Object.hasOwn(schema, 'default')) values.push(`Default: ${literal(schema.default)}`); + if (schema.format !== undefined) values.push(`Format: ${code(schema.format)}`); + if (schema.minimum !== undefined) values.push(`Minimum: ${code(schema.minimum)}`); + if (schema.maximum !== undefined) values.push(`Maximum: ${code(schema.maximum)}`); + if (schema.pattern !== undefined) values.push(`Pattern: ${code(schema.pattern)}`); + return values.join('
'); +} + +function renderProperties(schema) { + const properties = Object.entries(schema.properties ?? {}); + if (properties.length === 0) return ''; + + const required = new Set(schema.required ?? []); + const rows = properties.map(([name, property]) => + `| ${code(name)} | ${schemaType(property)} | ${required.has(name) ? 'Yes' : 'No'} | ${text(property.description, '—')} | ${constraints(property) || '—'} |` + ); + return [ + '| Field | Type | Required | Description | Constraints |', + '|---|---|:---:|---|---|', + ...rows, + '', + ].join('\n'); +} + +function renderMethods(entries, schemas, notification = false) { + if (entries.length === 0) return '_None._\n'; + + const rows = [...entries] + .sort((left, right) => left.method.localeCompare(right.method)) + .map((entry) => { + const inputType = notification ? entry.paramsType : entry.requestType; + const inputSchema = schemas.$defs[inputType]; + if (!inputSchema) { + throw new Error(`${entry.method} references missing type ${inputType}`); + } + if (!notification && !schemas.$defs[entry.responseType]) { + throw new Error(`${entry.method} references missing type ${entry.responseType}`); + } + const links = notification + ? `**Parameters:** ${schemaLink(inputType)}` + : `**Request:** ${schemaLink(inputType)}
**Response:** ${schemaLink(entry.responseType)}`; + const description = text(inputSchema.description); + const method = description + ? `${methodCode(entry.method)}
${description}` + : methodCode(entry.method); + return `| ${method} | ${links} |`; + }); + + return ['| Method | Schemas |', '|---|---|', ...rows, ''].join('\n'); +} + +function renderSchema(name, schema) { + const lines = [`### ${code(name)} {#${schemaId(name)}}`, '']; + if (schema.description) lines.push(text(schema.description), ''); + lines.push(`**Type:** ${schemaType(schema)}`, ''); + + const schemaConstraints = constraints(schema); + if (schemaConstraints) lines.push(`**Constraints:** ${schemaConstraints}`, ''); + + const properties = renderProperties(schema); + if (properties) lines.push(properties); + return lines.join('\n'); +} + +function renderDocumentation(schemas, meta, gooseVersion = 'Preview') { + if (!schemas.$defs || typeof schemas.$defs !== 'object') { + throw new Error('Schema document is missing $defs'); + } + + const definitions = Object.entries(schemas.$defs) + .filter(([, schema]) => !schema['x-docs-ignore']) + .sort(([left], [right]) => left.localeCompare(right)); + + const output = [ + '---', + 'title: goose ACP Reference', + 'sidebar_label: goose ACP Reference', + '---', + '', + '# goose ACP Reference', + '', + 'This reference documents goose-specific Agent Client Protocol methods. Standard ACP methods are documented by the [Agent Client Protocol specification](https://agentclientprotocol.com/).', + '', + `**goose version:** ${code(gooseVersion)}`, + '', + '> This file is generated from `crates/goose/acp-schema.json` and `crates/goose/acp-meta.json`. Do not edit it manually.', + '', + '## Client-to-agent requests', + '', + renderMethods(meta.methods ?? [], schemas), + '## Agent-to-client requests', + '', + renderMethods(meta.agentRequests ?? [], schemas), + '## Agent-to-client notifications', + '', + renderMethods(meta.notifications ?? [], schemas, true), + '## Schemas', + '', + ...definitions.map(([name, schema]) => renderSchema(name, schema)), + ]; + return `${output.join('\n').trimEnd()}\n`; +} + +function main() { + const args = process.argv.slice(2); + if (args.length !== 0 && args.length !== 3 && args.length !== 4) { + throw new Error( + 'Usage: generate-acp-docs.js [schema-file meta-file output-file [goose-version]]' + ); + } + + const [ + schemaFile = SCHEMA_FILE, + metaFile = META_FILE, + outputFile = OUTPUT_FILE, + gooseVersion = 'Preview', + ] = args; + const schemas = JSON.parse(fs.readFileSync(schemaFile, 'utf8')); + const meta = JSON.parse(fs.readFileSync(metaFile, 'utf8')); + const output = renderDocumentation(schemas, meta, gooseVersion); + fs.mkdirSync(path.dirname(outputFile), {recursive: true}); + fs.writeFileSync(outputFile, output); + console.log(`[generate-acp-docs] Generated: ${outputFile}`); +} + +if (require.main === module) main(); + +module.exports = {renderDocumentation, schemaType}; diff --git a/documentation/scripts/generate-acp-docs.test.js b/documentation/scripts/generate-acp-docs.test.js new file mode 100644 index 000000000..48a0c7b26 --- /dev/null +++ b/documentation/scripts/generate-acp-docs.test.js @@ -0,0 +1,53 @@ +const assert = require('node:assert/strict'); +const test = require('node:test'); + +const {renderDocumentation, schemaType} = require('./generate-acp-docs'); + +const schema = { + $defs: { + Request: { + type: 'object', + description: 'Run the example.', + properties: { + target: {$ref: '#/$defs/Target'}, + tags: {type: ['array', 'null'], items: {type: 'string'}}, + values: {type: 'object', additionalProperties: {type: 'integer'}}, + mode: {enum: ['fast', 'safe'], default: 'safe'}, + count: {type: 'integer', minimum: 1, maximum: 10}, + label: {type: 'string', format: 'slug', pattern: '^[a-z]+$'}, + }, + required: ['target'], + }, + Response: {type: 'object'}, + Target: { + oneOf: [ + {$ref: '#/$defs/Response', type: 'object', properties: {kind: {const: 'object'}}}, + {type: 'string'}, + ], + }, + }, +}; +const meta = { + methods: [{method: '_goose/example', requestType: 'Request', responseType: 'Response'}], + agentRequests: [], + notifications: [], +}; + +test('renders representative schema forms deterministically', () => { + const output = renderDocumentation(schema, meta, 'v1.2.3'); + + assert.equal(output, renderDocumentation(schema, meta, 'v1.2.3')); + assert.match(output, /\*\*goose version:\*\* v1\.2\.3<\/code>/); + assert.match(output, /\[Target<\/code>\]\(#schema-target\)/); + assert.match(output, /### Target<\/code> \{#schema-target\}/); + assert.match(output, /\[Response<\/code>\]\(#schema-response\) & .*kind<\/code>/); + assert.match(output, /Array<string<\/code>> \\| null<\/code>/); + assert.match(output, /Record<string<\/code>, integer<\/code>>/); + assert.match(output, /Default: "safe"<\/code>/); + assert.match(output, /Minimum: 1<\/code>
Maximum: 10<\/code>/); + assert.match(output, /Format: slug<\/code>
Pattern: \^\[a-z\]\+\$<\/code>/); +}); + +test('rejects unsupported schema shapes', () => { + assert.throws(() => schemaType({not: {type: 'string'}}), /Unsupported schema keyword: not/); +}); diff --git a/documentation/scripts/generate-released-acp-docs.sh b/documentation/scripts/generate-released-acp-docs.sh new file mode 100755 index 000000000..1f64ef043 --- /dev/null +++ b/documentation/scripts/generate-released-acp-docs.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +set -euo pipefail + +cd "$(dirname "${BASH_SOURCE[0]}")/../.." + +acp_ref=$(gh api 'repos/{owner}/{repo}/releases/latest' --jq '.tag_name') +echo "Using goose release $acp_ref for ACP documentation." + +if ! git rev-parse --verify --quiet "refs/tags/$acp_ref" >/dev/null; then + echo "Release tag $acp_ref is not available locally. Run 'git fetch --tags'." >&2 + exit 1 +fi + +temp_dir=$(mktemp -d) +trap 'rm -rf "$temp_dir"' EXIT + +schema="$temp_dir/acp-schema.json" +meta="$temp_dir/acp-meta.json" + +git show "$acp_ref:crates/goose/acp-schema.json" > "$schema" +git show "$acp_ref:crates/goose/acp-meta.json" > "$meta" +node documentation/scripts/generate-acp-docs.js "$schema" "$meta" \ + documentation/docs/reference/goose-acp-reference.md "$acp_ref" diff --git a/ui/sdk/src/generated/types.gen.ts b/ui/sdk/src/generated/types.gen.ts index 8c80970de..673a84c46 100644 --- a/ui/sdk/src/generated/types.gen.ts +++ b/ui/sdk/src/generated/types.gen.ts @@ -311,6 +311,9 @@ export type ReadResourceResponse_unstable = { result?: unknown; }; +/** + * List available goose apps, optionally scoped to a session. + */ export type AppsListRequest_unstable = { sessionId?: string | null; }; @@ -319,6 +322,9 @@ export type AppsListResponse_unstable = { apps?: Array; }; +/** + * Export a goose app as HTML. + */ export type AppsExportRequest_unstable = { name: string; }; @@ -327,6 +333,9 @@ export type AppsExportResponse_unstable = { html: string; }; +/** + * Import a goose app from HTML. + */ export type AppsImportRequest_unstable = { html: string; }; @@ -336,6 +345,9 @@ export type AppsImportResponse_unstable = { message: string; }; +/** + * Delete a goose app by name. + */ export type AppsDeleteRequest_unstable = { name: string; }; @@ -356,7 +368,7 @@ export type UpdateWorkingDirRequest_unstable = { /** * Set, append, or clear system prompt text for a session. * - * `mode: "set"` replaces Goose's base system prompt. `mode: "append"` adds an + * `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. */ @@ -665,6 +677,9 @@ export type SteerSessionResponse_unstable = { messageId: string; }; +/** + * Get a diagnostic report for a session. + */ export type DiagnosticsGetRequest_unstable = { sessionId: string; level?: DiagnosticsReportLevel; @@ -677,7 +692,7 @@ export type DiagnosticsGetResponse_unstable = { }; /** - * List all available Goose prompt templates. + * List all available goose prompt templates. */ export type ListPromptsRequest_unstable = { [key: string]: unknown; @@ -699,7 +714,7 @@ export type PromptTemplateEntry = { }; /** - * Read a Goose prompt template. + * Read a goose prompt template. */ export type GetPromptRequest_unstable = { name: string; @@ -713,7 +728,7 @@ export type GetPromptResponse_unstable = { }; /** - * Save a custom Goose prompt template. + * Save a custom goose prompt template. */ export type SavePromptRequest_unstable = { name: string; @@ -725,7 +740,7 @@ export type PromptOperationResponse_unstable = { }; /** - * Reset a Goose prompt template to its default content. + * Reset a goose prompt template to its default content. */ export type ResetPromptRequest_unstable = { name: string; @@ -775,6 +790,9 @@ export type SetConfigExtensionEnabledRequest_unstable = { enabled: boolean; }; +/** + * List extensions enabled for an active session. + */ export type GetSessionExtensionsRequest_unstable = { sessionId: string; }; @@ -1050,7 +1068,7 @@ export type ProviderTemplateCapabilitiesDto = { }; /** - * Create a custom provider backed by Goose's declarative provider store. + * Create a custom provider backed by goose's declarative provider store. */ export type CustomProviderCreateRequest_unstable = { engine: string; @@ -1132,7 +1150,7 @@ export type CustomProviderConfigDto = { }; /** - * Update a custom provider backed by Goose's declarative provider store. + * Update a custom provider backed by goose's declarative provider store. */ export type CustomProviderUpdateRequest_unstable = { providerId: string; @@ -1158,7 +1176,7 @@ export type CustomProviderUpdateResponse_unstable = { }; /** - * Delete a custom provider from Goose's declarative provider store. + * Delete a custom provider from goose's declarative provider store. */ export type CustomProviderDeleteRequest_unstable = { providerId: string; @@ -1255,7 +1273,7 @@ export type ProviderConfigAuthenticateRequest_unstable = { }; /** - * List provider credentials stored locally by Goose. + * List provider credentials stored locally by goose. */ export type ProviderSecretsListRequest_unstable = { [key: string]: unknown; @@ -1341,6 +1359,9 @@ export type PreferencesSaveRequest_unstable = { values?: Array; }; +/** + * Read one goose configuration value. + */ export type ConfigReadRequest_unstable = { key: string; isSecret?: boolean; @@ -1350,17 +1371,26 @@ export type ConfigReadResponse_unstable = { value?: unknown; }; +/** + * Create or replace one goose configuration value. + */ export type ConfigUpsertRequest_unstable = { key: string; value: unknown; isSecret?: boolean; }; +/** + * Remove one goose configuration value. + */ export type ConfigRemoveRequest_unstable = { key: string; isSecret?: boolean; }; +/** + * Read all non-secret goose configuration values. + */ export type ConfigReadAllRequest_unstable = { [key: string]: unknown; }; @@ -1372,7 +1402,7 @@ export type ConfigReadAllResponse_unstable = { }; /** - * Read Goose default provider and model configuration. + * Read goose default provider and model configuration. */ export type DefaultsReadRequest_unstable = { [key: string]: unknown; @@ -1384,7 +1414,7 @@ export type DefaultsReadResponse_unstable = { }; /** - * Save Goose default provider and model configuration. + * Save goose default provider and model configuration. */ export type DefaultsSaveRequest_unstable = { providerId: string; @@ -1392,14 +1422,14 @@ export type DefaultsSaveRequest_unstable = { }; /** - * Clear Goose default provider and model configuration. + * Clear goose default provider and model configuration. */ export type DefaultsClearRequest_unstable = { [key: string]: unknown; }; /** - * Scan for existing Goose and compatible app data that onboarding can import. + * Scan for existing goose and compatible app data that onboarding can import. */ export type OnboardingImportScanRequest_unstable = { /** @@ -1488,6 +1518,9 @@ export type ImportSessionResponse_unstable = { messageCount: number; }; +/** + * Share a session through Nostr and return its share links. + */ export type ShareSessionNostrRequest_unstable = { sessionId: string; relays: Array; @@ -1500,6 +1533,9 @@ export type ShareSessionNostrResponse_unstable = { relays: Array; }; +/** + * Encode a recipe as a goose deep link. + */ export type EncodeRecipeRequest_unstable = { recipe: RecipeDto; }; @@ -1647,6 +1683,9 @@ export type EncodeRecipeResponse_unstable = { deeplink: string; }; +/** + * Decode a goose deep link into a recipe. + */ export type DecodeRecipeRequest_unstable = { deeplink: string; }; @@ -1655,6 +1694,9 @@ export type DecodeRecipeResponse_unstable = { recipe: RecipeDto; }; +/** + * Scan a recipe for security warnings. + */ export type ScanRecipeRequest_unstable = { recipe: RecipeDto; }; @@ -1663,6 +1705,9 @@ export type ScanRecipeResponse_unstable = { has_security_warnings: boolean; }; +/** + * List recipes in the local recipe library. + */ export type ListRecipesRequest_unstable = { [key: string]: unknown; }; @@ -1680,20 +1725,32 @@ export type RecipeListEntryDto = { slash_command?: string | null; }; +/** + * Delete a recipe from the local recipe library. + */ export type DeleteRecipeRequest_unstable = { id: string; }; +/** + * Set or clear a recipe's cron schedule. + */ export type ScheduleRecipeRequest_unstable = { id: string; cron_schedule?: string | null; }; +/** + * Set or clear a recipe's slash command. + */ export type SetRecipeSlashCommandRequest_unstable = { id: string; slash_command?: string | null; }; +/** + * Save a recipe to the local recipe library. + */ export type SaveRecipeRequest_unstable = { recipe: RecipeDto; id?: string | null; @@ -1705,6 +1762,9 @@ export type SaveRecipeResponse_unstable = { file_path: string; }; +/** + * Parse serialized recipe content. + */ export type ParseRecipeRequest_unstable = { content: string; }; @@ -1713,6 +1773,9 @@ export type ParseRecipeResponse_unstable = { recipe: RecipeDto; }; +/** + * Serialize a recipe as YAML. + */ export type RecipeToYamlRequest_unstable = { recipe: RecipeDto; }; @@ -1721,6 +1784,9 @@ export type RecipeToYamlResponse_unstable = { yaml: string; }; +/** + * List scheduled recipe jobs. + */ export type ListSchedulesRequest_unstable = { [key: string]: unknown; }; @@ -1740,6 +1806,9 @@ export type ScheduledJobDto = { jobStartTime?: string | null; }; +/** + * List recent sessions created by a scheduled recipe job. + */ export type ListScheduleSessionsRequest_unstable = { scheduleId: string; limit: number; @@ -1799,6 +1868,9 @@ export type SessionInfo = { */ export type SessionId = string; +/** + * Create a scheduled recipe job. + */ export type CreateScheduleRequest_unstable = { id: string; recipe: RecipeDto; @@ -1809,18 +1881,30 @@ export type CreateScheduleResponse_unstable = { job: ScheduledJobDto; }; +/** + * Delete a scheduled recipe job. + */ export type DeleteScheduleRequest_unstable = { scheduleId: string; }; +/** + * Pause a scheduled recipe job. + */ export type PauseScheduleRequest_unstable = { scheduleId: string; }; +/** + * Resume a paused scheduled recipe job. + */ export type UnpauseScheduleRequest_unstable = { scheduleId: string; }; +/** + * Update the cron expression for a scheduled recipe job. + */ export type UpdateScheduleRequest_unstable = { scheduleId: string; cron: string; @@ -1830,6 +1914,9 @@ export type UpdateScheduleResponse_unstable = { job: ScheduledJobDto; }; +/** + * Run a scheduled recipe job immediately. + */ export type RunScheduleNowRequest_unstable = { scheduleId: string; }; @@ -1841,6 +1928,9 @@ export type RunScheduleNowResponse_unstable = { export type RunScheduleNowStatus = 'completed' | 'cancelled'; +/** + * Stop a currently running scheduled job. + */ export type KillRunningJobRequest_unstable = { jobId: string; }; @@ -1849,6 +1939,9 @@ export type KillRunningJobResponse_unstable = { message: string; }; +/** + * Inspect the current state of a running scheduled job. + */ export type InspectRunningJobRequest_unstable = { jobId: string; }; @@ -2289,6 +2382,9 @@ export type DictationModelDeleteRequest_unstable = { modelId: string; }; +/** + * List locally available inference models. + */ export type LocalInferenceModelsListRequest_unstable = { [key: string]: unknown; }; @@ -2372,6 +2468,9 @@ export type LocalInferenceChatTemplate = { type: 'custom_inline'; }; +/** + * Download a model for local inference. + */ export type LocalInferenceModelDownloadRequest_unstable = { spec: string; backendId?: string | null; @@ -2382,6 +2481,9 @@ export type LocalInferenceModelDownloadResponse_unstable = { modelId: string; }; +/** + * Get the progress of a local model download. + */ export type LocalInferenceModelDownloadProgressRequest_unstable = { modelId: string; }; @@ -2402,18 +2504,30 @@ export type LocalInferenceDownloadProgressDto = { taskExited: boolean; }; +/** + * Cancel a local model download. + */ export type LocalInferenceModelDownloadCancelRequest_unstable = { modelId: string; }; +/** + * Delete a downloaded local inference model. + */ export type LocalInferenceModelDeleteRequest_unstable = { modelId: string; }; +/** + * Evict a local inference model from memory. + */ export type LocalInferenceModelEvictRequest_unstable = { modelId: string; }; +/** + * Read the sampling settings for a local inference model. + */ export type LocalInferenceModelSettingsReadRequest_unstable = { modelId: string; }; @@ -2422,6 +2536,9 @@ export type LocalInferenceModelSettingsReadResponse_unstable = { settings: LocalInferenceModelSettingsDto; }; +/** + * Update the sampling settings for a local inference model. + */ export type LocalInferenceModelSettingsUpdateRequest_unstable = { modelId: string; settings: LocalInferenceModelSettingsDto; @@ -2431,6 +2548,9 @@ export type LocalInferenceModelSettingsUpdateResponse_unstable = { settings: LocalInferenceModelSettingsDto; }; +/** + * Search Hugging Face for local inference models. + */ export type LocalInferenceHuggingFaceSearchRequest_unstable = { query: string; limit?: number | null; @@ -2473,6 +2593,9 @@ export type LocalInferenceHfModelVariantDto = { unsupportedReason?: string | null; }; +/** + * List downloadable variants of a Hugging Face model repository. + */ export type LocalInferenceHuggingFaceRepoVariantsRequest_unstable = { repoId: string; }; @@ -2485,6 +2608,9 @@ export type LocalInferenceHuggingFaceRepoVariantsResponse_unstable = { downloadedVariants: Array; }; +/** + * List built-in chat templates for local inference. + */ export type LocalInferenceBuiltinChatTemplatesListRequest_unstable = { [key: string]: unknown; }; @@ -2594,6 +2720,9 @@ export type ProviderDeviceCodeNotification_unstable = { expiresIn: number; }; +/** + * Ask the client to provide values for a recipe's parameters. + */ export type RequestRecipeParams_unstable = { sessionId: string; parameters: Array; diff --git a/ui/sdk/src/generated/zod.gen.ts b/ui/sdk/src/generated/zod.gen.ts index 48e5efcab..e2a81e918 100644 --- a/ui/sdk/src/generated/zod.gen.ts +++ b/ui/sdk/src/generated/zod.gen.ts @@ -209,6 +209,9 @@ export const zReadResourceResponse_unstable = z.object({ result: z.unknown().optional().default(null) }); +/** + * List available goose apps, optionally scoped to a session. + */ export const zAppsListRequest_unstable = z.object({ sessionId: z.string().nullish() }); @@ -217,6 +220,9 @@ export const zAppsListResponse_unstable = z.object({ apps: z.array(z.unknown()).optional().default([]) }); +/** + * Export a goose app as HTML. + */ export const zAppsExportRequest_unstable = z.object({ name: z.string() }); @@ -225,6 +231,9 @@ export const zAppsExportResponse_unstable = z.object({ html: z.string() }); +/** + * Import a goose app from HTML. + */ export const zAppsImportRequest_unstable = z.object({ html: z.string() }); @@ -234,6 +243,9 @@ export const zAppsImportResponse_unstable = z.object({ message: z.string() }); +/** + * Delete a goose app by name. + */ export const zAppsDeleteRequest_unstable = z.object({ name: z.string() }); @@ -262,7 +274,7 @@ export const zSessionSystemPromptMode = z.union([ /** * Set, append, or clear system prompt text for a session. * - * `mode: "set"` replaces Goose's base system prompt. `mode: "append"` adds an + * `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. */ @@ -412,6 +424,9 @@ export const zSteerSessionResponse_unstable = z.object({ export const zDiagnosticsReportLevel = z.enum(['summary', 'full']); +/** + * Get a diagnostic report for a session. + */ export const zDiagnosticsGetRequest_unstable = z.object({ sessionId: z.string(), level: zDiagnosticsReportLevel.optional().default('summary') @@ -422,7 +437,7 @@ export const zDiagnosticsGetResponse_unstable = z.object({ }); /** - * List all available Goose prompt templates. + * List all available goose prompt templates. */ export const zListPromptsRequest_unstable = z.record(z.string(), z.unknown()); @@ -442,7 +457,7 @@ export const zListPromptsResponse_unstable = z.object({ }); /** - * Read a Goose prompt template. + * Read a goose prompt template. */ export const zGetPromptRequest_unstable = z.object({ name: z.string() @@ -456,7 +471,7 @@ export const zGetPromptResponse_unstable = z.object({ }); /** - * Save a custom Goose prompt template. + * Save a custom goose prompt template. */ export const zSavePromptRequest_unstable = z.object({ name: z.string(), @@ -468,7 +483,7 @@ export const zPromptOperationResponse_unstable = z.object({ }); /** - * Reset a Goose prompt template to its default content. + * Reset a goose prompt template to its default content. */ export const zResetPromptRequest_unstable = z.object({ name: z.string() @@ -516,6 +531,9 @@ export const zSetConfigExtensionEnabledRequest_unstable = z.object({ enabled: z.boolean() }); +/** + * List extensions enabled for an active session. + */ export const zGetSessionExtensionsRequest_unstable = z.object({ sessionId: z.string() }); @@ -715,7 +733,7 @@ export const zProviderCatalogTemplateResponse_unstable = z.object({ }); /** - * Create a custom provider backed by Goose's declarative provider store. + * Create a custom provider backed by goose's declarative provider store. */ export const zCustomProviderCreateRequest_unstable = z.object({ engine: z.string(), @@ -792,7 +810,7 @@ export const zCustomProviderReadResponse_unstable = z.object({ }); /** - * Update a custom provider backed by Goose's declarative provider store. + * Update a custom provider backed by goose's declarative provider store. */ export const zCustomProviderUpdateRequest_unstable = z.object({ providerId: z.string(), @@ -816,7 +834,7 @@ export const zCustomProviderUpdateResponse_unstable = z.object({ }); /** - * Delete a custom provider from Goose's declarative provider store. + * Delete a custom provider from goose's declarative provider store. */ export const zCustomProviderDeleteRequest_unstable = z.object({ providerId: z.string() @@ -910,7 +928,7 @@ export const zProviderConfigAuthenticateRequest_unstable = z.object({ }); /** - * List provider credentials stored locally by Goose. + * List provider credentials stored locally by goose. */ export const zProviderSecretsListRequest_unstable = z.record(z.string(), z.unknown()); @@ -1004,6 +1022,9 @@ export const zPreferencesSaveRequest_unstable = z.object({ values: z.array(zPreferenceValue).optional().default([]) }); +/** + * Read one goose configuration value. + */ export const zConfigReadRequest_unstable = z.object({ key: z.string(), isSecret: z.boolean().optional().default(false) @@ -1013,17 +1034,26 @@ export const zConfigReadResponse_unstable = z.object({ value: z.unknown().optional().default(null) }); +/** + * Create or replace one goose configuration value. + */ export const zConfigUpsertRequest_unstable = z.object({ key: z.string(), value: z.unknown(), isSecret: z.boolean().optional().default(false) }); +/** + * Remove one goose configuration value. + */ export const zConfigRemoveRequest_unstable = z.object({ key: z.string(), isSecret: z.boolean().optional().default(false) }); +/** + * Read all non-secret goose configuration values. + */ export const zConfigReadAllRequest_unstable = z.record(z.string(), z.unknown()); export const zConfigReadAllResponse_unstable = z.object({ @@ -1031,7 +1061,7 @@ export const zConfigReadAllResponse_unstable = z.object({ }); /** - * Read Goose default provider and model configuration. + * Read goose default provider and model configuration. */ export const zDefaultsReadRequest_unstable = z.record(z.string(), z.unknown()); @@ -1041,7 +1071,7 @@ export const zDefaultsReadResponse_unstable = z.object({ }); /** - * Save Goose default provider and model configuration. + * Save goose default provider and model configuration. */ export const zDefaultsSaveRequest_unstable = z.object({ providerId: z.string(), @@ -1049,7 +1079,7 @@ export const zDefaultsSaveRequest_unstable = z.object({ }); /** - * Clear Goose default provider and model configuration. + * Clear goose default provider and model configuration. */ export const zDefaultsClearRequest_unstable = z.record(z.string(), z.unknown()); @@ -1059,7 +1089,7 @@ export const zDefaultsClearRequest_unstable = z.record(z.string(), z.unknown()); export const zOnboardingImportSourceKind = z.enum(['goose_config', 'claude_desktop']); /** - * Scan for existing Goose and compatible app data that onboarding can import. + * Scan for existing goose and compatible app data that onboarding can import. */ export const zOnboardingImportScanRequest_unstable = z.object({ sources: z.array(zOnboardingImportSourceKind).optional().default([]) @@ -1144,6 +1174,9 @@ export const zImportSessionResponse_unstable = z.object({ messageCount: z.int().gte(0) }); +/** + * Share a session through Nostr and return its share links. + */ export const zShareSessionNostrRequest_unstable = z.object({ sessionId: z.string(), relays: z.array(z.string()) @@ -1282,6 +1315,9 @@ export const zRecipeDto = z.object({ retry: zRecipeRetryConfigDto.nullish() }); +/** + * Encode a recipe as a goose deep link. + */ export const zEncodeRecipeRequest_unstable = z.object({ recipe: zRecipeDto }); @@ -1290,6 +1326,9 @@ export const zEncodeRecipeResponse_unstable = z.object({ deeplink: z.string() }); +/** + * Decode a goose deep link into a recipe. + */ export const zDecodeRecipeRequest_unstable = z.object({ deeplink: z.string() }); @@ -1298,6 +1337,9 @@ export const zDecodeRecipeResponse_unstable = z.object({ recipe: zRecipeDto }); +/** + * Scan a recipe for security warnings. + */ export const zScanRecipeRequest_unstable = z.object({ recipe: zRecipeDto }); @@ -1306,6 +1348,9 @@ export const zScanRecipeResponse_unstable = z.object({ has_security_warnings: z.boolean() }); +/** + * List recipes in the local recipe library. + */ export const zListRecipesRequest_unstable = z.record(z.string(), z.unknown()); export const zRecipeListEntryDto = z.object({ @@ -1321,20 +1366,32 @@ export const zListRecipesResponse_unstable = z.object({ recipes: z.array(zRecipeListEntryDto) }); +/** + * Delete a recipe from the local recipe library. + */ export const zDeleteRecipeRequest_unstable = z.object({ id: z.string() }); +/** + * Set or clear a recipe's cron schedule. + */ export const zScheduleRecipeRequest_unstable = z.object({ id: z.string(), cron_schedule: z.string().nullish() }); +/** + * Set or clear a recipe's slash command. + */ export const zSetRecipeSlashCommandRequest_unstable = z.object({ id: z.string(), slash_command: z.string().nullish() }); +/** + * Save a recipe to the local recipe library. + */ export const zSaveRecipeRequest_unstable = z.object({ recipe: zRecipeDto, id: z.string().nullish() @@ -1346,6 +1403,9 @@ export const zSaveRecipeResponse_unstable = z.object({ file_path: z.string() }); +/** + * Parse serialized recipe content. + */ export const zParseRecipeRequest_unstable = z.object({ content: z.string() }); @@ -1354,6 +1414,9 @@ export const zParseRecipeResponse_unstable = z.object({ recipe: zRecipeDto }); +/** + * Serialize a recipe as YAML. + */ export const zRecipeToYamlRequest_unstable = z.object({ recipe: zRecipeDto }); @@ -1362,6 +1425,9 @@ export const zRecipeToYamlResponse_unstable = z.object({ yaml: z.string() }); +/** + * List scheduled recipe jobs. + */ export const zListSchedulesRequest_unstable = z.record(z.string(), z.unknown()); export const zScheduledJobDto = z.object({ @@ -1379,6 +1445,9 @@ export const zListSchedulesResponse_unstable = z.object({ jobs: z.array(zScheduledJobDto) }); +/** + * List recent sessions created by a scheduled recipe job. + */ export const zListScheduleSessionsRequest_unstable = z.object({ scheduleId: z.string(), limit: z.int().gte(0) @@ -1410,6 +1479,9 @@ export const zListScheduleSessionsResponse_unstable = z.object({ sessions: z.array(zSessionInfo) }); +/** + * Create a scheduled recipe job. + */ export const zCreateScheduleRequest_unstable = z.object({ id: z.string(), recipe: zRecipeDto, @@ -1420,18 +1492,30 @@ export const zCreateScheduleResponse_unstable = z.object({ job: zScheduledJobDto }); +/** + * Delete a scheduled recipe job. + */ export const zDeleteScheduleRequest_unstable = z.object({ scheduleId: z.string() }); +/** + * Pause a scheduled recipe job. + */ export const zPauseScheduleRequest_unstable = z.object({ scheduleId: z.string() }); +/** + * Resume a paused scheduled recipe job. + */ export const zUnpauseScheduleRequest_unstable = z.object({ scheduleId: z.string() }); +/** + * Update the cron expression for a scheduled recipe job. + */ export const zUpdateScheduleRequest_unstable = z.object({ scheduleId: z.string(), cron: z.string() @@ -1441,6 +1525,9 @@ export const zUpdateScheduleResponse_unstable = z.object({ job: zScheduledJobDto }); +/** + * Run a scheduled recipe job immediately. + */ export const zRunScheduleNowRequest_unstable = z.object({ scheduleId: z.string() }); @@ -1452,6 +1539,9 @@ export const zRunScheduleNowResponse_unstable = z.object({ sessionId: z.string().nullish() }); +/** + * Stop a currently running scheduled job. + */ export const zKillRunningJobRequest_unstable = z.object({ jobId: z.string() }); @@ -1460,6 +1550,9 @@ export const zKillRunningJobResponse_unstable = z.object({ message: z.string() }); +/** + * Inspect the current state of a running scheduled job. + */ export const zInspectRunningJobRequest_unstable = z.object({ jobId: z.string() }); @@ -1818,6 +1911,9 @@ export const zDictationModelDeleteRequest_unstable = z.object({ modelId: z.string() }); +/** + * List locally available inference models. + */ export const zLocalInferenceModelsListRequest_unstable = z.record(z.string(), z.unknown()); export const zLocalInferenceDownloadState = z.enum([ @@ -1921,6 +2017,9 @@ export const zLocalInferenceModelsListResponse_unstable = z.object({ models: z.array(zLocalInferenceModelDto) }); +/** + * Download a model for local inference. + */ export const zLocalInferenceModelDownloadRequest_unstable = z.object({ spec: z.string(), backendId: z.string().nullish(), @@ -1931,6 +2030,9 @@ export const zLocalInferenceModelDownloadResponse_unstable = z.object({ modelId: z.string() }); +/** + * Get the progress of a local model download. + */ export const zLocalInferenceModelDownloadProgressRequest_unstable = z.object({ modelId: z.string() }); @@ -1951,18 +2053,30 @@ export const zLocalInferenceModelDownloadProgressResponse_unstable = z.object({ progress: zLocalInferenceDownloadProgressDto.nullish() }); +/** + * Cancel a local model download. + */ export const zLocalInferenceModelDownloadCancelRequest_unstable = z.object({ modelId: z.string() }); +/** + * Delete a downloaded local inference model. + */ export const zLocalInferenceModelDeleteRequest_unstable = z.object({ modelId: z.string() }); +/** + * Evict a local inference model from memory. + */ export const zLocalInferenceModelEvictRequest_unstable = z.object({ modelId: z.string() }); +/** + * Read the sampling settings for a local inference model. + */ export const zLocalInferenceModelSettingsReadRequest_unstable = z.object({ modelId: z.string() }); @@ -1971,6 +2085,9 @@ export const zLocalInferenceModelSettingsReadResponse_unstable = z.object({ settings: zLocalInferenceModelSettingsDto }); +/** + * Update the sampling settings for a local inference model. + */ export const zLocalInferenceModelSettingsUpdateRequest_unstable = z.object({ modelId: z.string(), settings: zLocalInferenceModelSettingsDto @@ -1980,6 +2097,9 @@ export const zLocalInferenceModelSettingsUpdateResponse_unstable = z.object({ settings: zLocalInferenceModelSettingsDto }); +/** + * Search Hugging Face for local inference models. + */ export const zLocalInferenceHuggingFaceSearchRequest_unstable = z.object({ query: z.string(), limit: z.int().gte(0).nullish() @@ -2022,6 +2142,9 @@ export const zLocalInferenceHuggingFaceSearchResponse_unstable = z.object({ models: z.array(zLocalInferenceHfModelInfoDto) }); +/** + * List downloadable variants of a Hugging Face model repository. + */ export const zLocalInferenceHuggingFaceRepoVariantsRequest_unstable = z.object({ repoId: z.string() }); @@ -2034,6 +2157,9 @@ export const zLocalInferenceHuggingFaceRepoVariantsResponse_unstable = z.object( downloadedVariants: z.array(z.string()) }); +/** + * List built-in chat templates for local inference. + */ export const zLocalInferenceBuiltinChatTemplatesListRequest_unstable = z.record(z.string(), z.unknown()); export const zLocalInferenceBuiltinChatTemplatesListResponse_unstable = z.object({ @@ -2139,6 +2265,9 @@ export const zProviderDeviceCodeNotification_unstable = z.object({ expiresIn: z.int().gte(0) }); +/** + * Ask the client to provide values for a recipe's parameters. + */ export const zRequestRecipeParams_unstable = z.object({ sessionId: z.string(), parameters: z.array(zRecipeParameterDto),