diff --git a/code-review-bot/README.md b/code-review-bot/README.md index 3802ffa..e7dd090 100644 --- a/code-review-bot/README.md +++ b/code-review-bot/README.md @@ -68,17 +68,15 @@ cp .env.example .env.local ## 2. Import Tilde State -Replace `https://YOUR_DEPLOYMENT.example/api/code-review` in -[`tilde-state.yaml`](./tilde-state.yaml) with the endpoint you intend to use. -For local development, use the public URL from your Tilde development tunnel. +Set `CODEX_REVIEW_CHATKIT_ENDPOINT_URL` when importing +[`tilde.state.yaml`](./tilde.state.yaml) to the complete endpoint you intend to use. -Import from Mission Control, or with the Tilde CLI: +[![Deploy with Tilde](https://api.trytilde.ai/deploy-button.svg)](https://api.trytilde.ai/deploy?repository-url=https%3A%2F%2Fgithub.com%2Ftrytilde%2Fexamples&state-path=code-review-bot%2Ftilde.state.yaml) -```bash -tilde auth login -tilde auth set-team -tilde state import tilde-state.yaml .tilde/imports/code-review-output.yaml -``` +For local development, use the public URL from your Tilde development tunnel. + +Use the deploy button above, or import the file from Mission Control and provide +the variable when prompted. The state creates: @@ -211,7 +209,7 @@ found. - [`lib/tilde.ts`](./lib/tilde.ts): the single configured Harness SDK client. - [Tilde Harness SDK](https://github.com/trytilde/harness-sdk): ChatKit, MCP, reverse-proxy, and typed provider-context integration. -- [`tilde-state.yaml`](./tilde-state.yaml): portable Tilde resources. +- [`tilde.state.yaml`](./tilde.state.yaml): portable Tilde resources. ## Limitations diff --git a/code-review-bot/tilde-state.yaml b/code-review-bot/tilde.state.yaml similarity index 81% rename from code-review-bot/tilde-state.yaml rename to code-review-bot/tilde.state.yaml index eecda1f..174e59f 100644 --- a/code-review-bot/tilde-state.yaml +++ b/code-review-bot/tilde.state.yaml @@ -1,17 +1,28 @@ metadata: name: code-review-bot description: GitHub pull request reviewer with Tilde MCP and a Modal sandbox. +variables: + CODEX_REVIEW_CHATKIT_ENDPOINT_URL: + type: string + description: ex. https://acme.com/api/agent. The planned URL to your Tilde agent. resources: chatkit/agent/code-review: configuration: local_running_endpoint: false - local_runtime_path: /api/code-review provider: chatkit.http-vercel-ai-sdk streaming: true timeout_ms: 300000 displayName: Code Review enabled: true - endpointUrl: https://YOUR_DEPLOYMENT.example/api/code-review + endpointUrl: ${CODEX_REVIEW_CHATKIT_ENDPOINT_URL} + chatkit/provider/trytilde: + refs: + default_agent: chatkit/agent/code-review + defaultAgentInboxId: code-review + desiredEnabled: true + displayName: GitHub + providerConfiguration: {} + providerId: chatkit.channel.github credential/setup_item/github: credentialSourceTypeId: server_token_exchange desiredEnabled: true @@ -23,6 +34,7 @@ resources: ownerType: tool_group_instance provider_display_name: GitHub provider_icon_key: github + provider_provisioner_id: provider_provisioner.github source: state_import ownerId: github ownerType: state_import_credential @@ -62,6 +74,39 @@ resources: status: brokering_initiated toolGroupSourceTypeId: modal_sandbox userCredentialId: null + reverse_proxy/profile/github-rest: + refs: + resource_server_credential: credential/setup_item/github + baseUrl: https://api.github.com + customHeaders: {} + desiredEnabled: true + displayName: GitHub REST + ownerId: null + providerId: github + resourceServerCredentialId: null + userCredentialId: null + reverse_proxy/profile/github-git-https: + refs: + resource_server_credential: credential/setup_item/github + baseUrl: https://github.com + customHeaders: {} + desiredEnabled: true + displayName: GitHub Git HTTPS + ownerId: null + providerId: github_git_https + resourceServerCredentialId: null + userCredentialId: null + reverse_proxy/profile/modal-sandbox-api: + refs: + resource_server_credential: credential/setup_item/modal-sandbox + baseUrl: https://api.modal.com + customHeaders: {} + desiredEnabled: true + displayName: Modal + ownerId: null + providerId: modal_sandbox + resourceServerCredentialId: null + userCredentialId: null mcp/server/code-review: refs: tool_provider_github: mcp/tool_provider/github diff --git a/sentry-remediation-bot/README.md b/sentry-remediation-bot/README.md index 48f4223..3f593a4 100644 --- a/sentry-remediation-bot/README.md +++ b/sentry-remediation-bot/README.md @@ -15,10 +15,14 @@ Sentry note. It does not resolve the issue before deployment. ## Setup +[![Deploy with Tilde](https://api.trytilde.ai/deploy-button.svg)](https://api.trytilde.ai/deploy?repository-url=https%3A%2F%2Fgithub.com%2Ftrytilde%2Fexamples&state-path=sentry-remediation-bot%2Ftilde.state.yaml) + 1. Run `pnpm install` and copy `.env.example` to `.env.local`. -2. Replace the deployment URL and `REPLACE_WITH_SENTRY_APP_CLIENT_SECRET` in - `tilde-state.yaml` before importing it. Never commit the real secret. -3. Import state with `tilde state import tilde-state.yaml .tilde/imports/sentry-remediation-output.yaml`. +2. Set `SENTRY_REMEDIATION_CHATKIT_ENDPOINT_URL` during import and replace + `REPLACE_WITH_SENTRY_APP_CLIENT_SECRET` in `tilde.state.yaml`. Never commit + the real secret. +3. Use the deploy button above, or import `tilde.state.yaml` from Mission Control + and provide the variable when prompted. 4. Complete the pending Sentry, GitHub, and Modal credentials in Mission Control. The Sentry API token needs `org:read`, `project:read`, `event:read`, and `event:write`. diff --git a/sentry-remediation-bot/tilde-state.yaml b/sentry-remediation-bot/tilde.state.yaml similarity index 83% rename from sentry-remediation-bot/tilde-state.yaml rename to sentry-remediation-bot/tilde.state.yaml index e279d29..5214b10 100644 --- a/sentry-remediation-bot/tilde-state.yaml +++ b/sentry-remediation-bot/tilde.state.yaml @@ -1,20 +1,23 @@ metadata: name: sentry-remediation-bot description: Sentry issue signals routed to a GitHub and Modal remediation agent. +variables: + SENTRY_REMEDIATION_CHATKIT_ENDPOINT_URL: + type: string + description: ex. https://acme.com/api/agent. The planned URL to your Tilde agent. resources: chatkit/agent/sentry-remediation: configuration: local_running_endpoint: false - local_runtime_path: /api/sentry-remediation provider: chatkit.http-vercel-ai-sdk streaming: true timeout_ms: 300000 displayName: Sentry Remediation enabled: true - endpointUrl: https://YOUR_DEPLOYMENT.example/api/sentry-remediation + endpointUrl: ${SENTRY_REMEDIATION_CHATKIT_ENDPOINT_URL} credential/setup_item/github: - credentialSourceTypeId: server_token_exchange + credentialSourceTypeId: api_key desiredEnabled: true displayName: GitHub metadata: @@ -28,7 +31,7 @@ resources: status: pending mcp/tool_provider/github: refs: { resource_server_credential: credential/setup_item/github } - credentialSourceTypeId: server_token_exchange + credentialSourceTypeId: api_key displayName: GitHub resourceServerCredentialId: null status: brokering_initiated @@ -46,6 +49,17 @@ resources: resourceServerCredentialId: null userCredentialId: null + reverse_proxy/profile/github-rest: + refs: { resource_server_credential: credential/setup_item/github } + providerId: github + baseUrl: https://api.github.com + customHeaders: {} + desiredEnabled: true + displayName: GitHub REST + ownerId: null + resourceServerCredentialId: null + userCredentialId: null + credential/setup_item/modal-sandbox: credentialSourceTypeId: modal_custom_json_schema desiredEnabled: true @@ -68,6 +82,17 @@ resources: toolGroupSourceTypeId: modal_sandbox userCredentialId: null + reverse_proxy/profile/modal-sandbox-api: + refs: { resource_server_credential: credential/setup_item/modal-sandbox } + providerId: modal_sandbox + baseUrl: https://api.modal.com + customHeaders: {} + desiredEnabled: true + displayName: Modal + ownerId: null + resourceServerCredentialId: null + userCredentialId: null + credential/setup_item/sentry: credentialSourceTypeId: api_key desiredEnabled: true @@ -91,8 +116,27 @@ resources: toolGroupSourceTypeId: sentry userCredentialId: null + reverse_proxy/profile/sentry-rest: + refs: { resource_server_credential: credential/setup_item/sentry } + providerId: sentry + baseUrl: https://sentry.io/api/0 + customHeaders: {} + desiredEnabled: true + displayName: Sentry REST + ownerId: null + resourceServerCredentialId: null + userCredentialId: null + + mcp/tool_provider/tilde-human-approval: + credentialSourceTypeId: no_auth + displayName: Tilde Human Approval + resourceServerCredentialId: null + status: active + toolGroupSourceTypeId: tilde_human_approval + userCredentialId: null + signals/provider_instance/spi_6a4815cc-449d-4a10-bf1c-a30717442071: - providerType: sentry + signalProviderSourceTypeId: sentry credentialSourceTypeId: no_auth displayName: Sentry Issues desiredEnabled: true @@ -124,6 +168,7 @@ resources: tool_provider_github: mcp/tool_provider/github tool_provider_modal_sandbox: mcp/tool_provider/modal-sandbox tool_provider_sentry: mcp/tool_provider/sentry + tool_provider_tilde_human_approval: mcp/tool_provider/tilde-human-approval displayName: Sentry Remediation isDynamicToolDiscovery: false functions: @@ -145,6 +190,7 @@ resources: - { configuredParams: {}, enabled: true, toolDescription: Read a full Sentry event and stacktrace., toolGroupInstanceId: sentry, toolGroupSourceTypeId: sentry, toolName: sentry_get_event_stacktrace, toolSourceTypeId: sentry_get_event_stacktrace } - { configuredParams: {}, enabled: true, toolDescription: Assign or update a Sentry issue., toolGroupInstanceId: sentry, toolGroupSourceTypeId: sentry, toolName: sentry_update_issue, toolSourceTypeId: sentry_update_issue } - { configuredParams: {}, enabled: true, toolDescription: Add a visible note to a Sentry issue., toolGroupInstanceId: sentry, toolGroupSourceTypeId: sentry, toolName: sentry_add_issue_note, toolSourceTypeId: sentry_add_issue_note } + - { configuredParams: {}, enabled: true, toolDescription: Wait for human assistance when remediation needs approval or credentials., toolGroupInstanceId: tilde-human-approval, toolGroupSourceTypeId: tilde_human_approval, toolName: wait_for_human_assistance_to_complete, toolSourceTypeId: wait_for_human_assistance_to_complete } - { configuredParams: {}, enabled: true, toolDescription: Search GitHub issues and pull requests for related work., toolGroupInstanceId: github, toolGroupSourceTypeId: github, toolName: github_search_issues, toolSourceTypeId: github_search_issues } - { configuredParams: {}, enabled: true, toolDescription: Read a matching GitHub issue or pull request., toolGroupInstanceId: github, toolGroupSourceTypeId: github, toolName: github_get_issue, toolSourceTypeId: github_get_issue } - { configuredParams: {}, enabled: true, toolDescription: List open pull requests to avoid duplicates., toolGroupInstanceId: github, toolGroupSourceTypeId: github, toolName: github_list_pull_requests, toolSourceTypeId: github_list_pull_requests }