diff options
| author | Adam <[email protected]> | 2026-02-10 13:59:14 -0600 |
|---|---|---|
| committer | opencode <[email protected]> | 2026-02-10 20:22:30 +0000 |
| commit | fd5531316f858b77274e26975796aec41ba5128c (patch) | |
| tree | 6337bc388da712e35b24e3bf6bdf903b21cecfa4 /packages/web/src/content/docs/pt-br/plugins.mdx | |
| parent | fbc41475b403a23f004f63289b264c224b9d6b2f (diff) | |
| download | opencode-fd5531316f858b77274e26975796aec41ba5128c.tar.gz opencode-fd5531316f858b77274e26975796aec41ba5128c.zip | |
fix(docs): locale translations
Diffstat (limited to 'packages/web/src/content/docs/pt-br/plugins.mdx')
| -rw-r--r-- | packages/web/src/content/docs/pt-br/plugins.mdx | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/packages/web/src/content/docs/pt-br/plugins.mdx b/packages/web/src/content/docs/pt-br/plugins.mdx index 99b9af819..eed62df67 100644 --- a/packages/web/src/content/docs/pt-br/plugins.mdx +++ b/packages/web/src/content/docs/pt-br/plugins.mdx @@ -104,10 +104,10 @@ export const MyPlugin = async (ctx) => { ```js title=".opencode/plugins/example.js" export const MyPlugin = async ({ project, client, $, directory, worktree }) => { - console.log("Plugin inicializado!") + console.log("Plugin initialized!") return { - // Implementações de hooks vão aqui + // Hook implementations go here } } ``` @@ -117,7 +117,7 @@ A função do plugin recebe: - `project`: As informações do projeto atual. - `directory`: O diretório de trabalho atual. - `worktree`: O caminho do worktree do git. -- `client`: Um cliente SDK do opencode para interagir com a IA. +- `client`: Um cliente SDK do opencode para interagir com a AI. - `$`: A [API shell](https://bun.com/docs/runtime/shell) do Bun para executar comandos. --- @@ -131,7 +131,7 @@ import type { Plugin } from "@opencode-ai/plugin" export const MyPlugin: Plugin = async ({ project, client, $, directory, worktree }) => { return { - // Implementações de hooks seguras em tipo + // Type-safe hook implementations } } ``` @@ -222,7 +222,7 @@ Envie notificações quando certos eventos ocorrerem: export const NotificationPlugin = async ({ project, client, $, directory, worktree }) => { return { event: async ({ event }) => { - // Enviar notificação ao concluir a sessão + // Send notification on session completion if (event.type === "session.idle") { await $`osascript -e 'display notification "Session completed!" with title "opencode"'` } @@ -248,7 +248,7 @@ export const EnvProtection = async ({ project, client, $, directory, worktree }) return { "tool.execute.before": async (input, output) => { if (input.tool === "read" && output.args.filePath.includes(".env")) { - throw new Error("Não leia arquivos .env") + throw new Error("Do not read .env files") } }, } @@ -259,13 +259,13 @@ export const EnvProtection = async ({ project, client, $, directory, worktree }) ### Injetar variáveis de ambiente -Injete variáveis de ambiente em todas as execuções de shell (ferramentas de IA e terminais de usuário): +Injete variáveis de ambiente em todas as execuções de shell (ferramentas de AI e terminais de usuário): ```javascript title=".opencode/plugins/inject-env.js" export const InjectEnvPlugin = async () => { return { "shell.env": async (input, output) => { - output.env.MY_API_KEY = "secreto" + output.env.MY_API_KEY = "secret" output.env.PROJECT_ROOT = input.cwd }, } @@ -285,7 +285,7 @@ export const CustomToolsPlugin: Plugin = async (ctx) => { return { tool: { mytool: tool({ - description: "Esta é uma ferramenta personalizada", + description: "This is a custom tool", args: { foo: tool.schema.string(), }, @@ -319,7 +319,7 @@ export const MyPlugin = async ({ client }) => { body: { service: "my-plugin", level: "info", - message: "Plugin inicializado", + message: "Plugin initialized", extra: { foo: "bar" }, }, }) @@ -340,14 +340,14 @@ import type { Plugin } from "@opencode-ai/plugin" export const CompactionPlugin: Plugin = async (ctx) => { return { "experimental.session.compacting": async (input, output) => { - // Injetar contexto adicional no prompt de compactação + // Inject additional context into the compaction prompt output.context.push(` -## Contexto Personalizado +## Custom Context -Inclua qualquer estado que deve persistir entre as compactações: -- Status da tarefa atual -- Decisões importantes tomadas -- Arquivos sendo trabalhados ativamente +Include any state that should persist across compaction: +- Current task status +- Important decisions made +- Files being actively worked on `) }, } @@ -364,17 +364,17 @@ import type { Plugin } from "@opencode-ai/plugin" export const CustomCompactionPlugin: Plugin = async (ctx) => { return { "experimental.session.compacting": async (input, output) => { - // Substituir todo o prompt de compactação + // Replace the entire compaction prompt output.prompt = ` -Você está gerando um prompt de continuação para uma sessão de enxame multi-agente. +You are generating a continuation prompt for a multi-agent swarm session. -Resuma: -1. A tarefa atual e seu status -2. Quais arquivos estão sendo modificados e por quem -3. Quaisquer bloqueios ou dependências entre agentes -4. Os próximos passos para concluir o trabalho +Summarize: +1. The current task and its status +2. Which files are being modified and by whom +3. Any blockers or dependencies between agents +4. The next steps to complete the work -Formate como um prompt estruturado que um novo agente pode usar para retomar o trabalho. +Format as a structured prompt that a new agent can use to resume work. ` }, } |
