Explorar o código

chore: generate

opencode-agent[bot] hai 4 meses
pai
achega
17701628bd

+ 14 - 1
packages/opencode/src/cli/cmd/agent.ts

@@ -18,7 +18,20 @@ type AgentMode = "all" | "primary" | "subagent"
 // Permission keys (not raw tool names). Multiple tools can map to a single
 // Permission keys (not raw tool names). Multiple tools can map to a single
 // permission — e.g. write/edit/apply_patch all gate on `edit` — so we configure
 // permission — e.g. write/edit/apply_patch all gate on `edit` — so we configure
 // agents at the permission level to match how the runtime actually enforces it.
 // agents at the permission level to match how the runtime actually enforces it.
-const AVAILABLE_PERMISSIONS = ["bash", "read", "edit", "glob", "grep", "webfetch", "task", "todowrite", "websearch", "codesearch", "lsp", "skill"]
+const AVAILABLE_PERMISSIONS = [
+  "bash",
+  "read",
+  "edit",
+  "glob",
+  "grep",
+  "webfetch",
+  "task",
+  "todowrite",
+  "websearch",
+  "codesearch",
+  "lsp",
+  "skill",
+]
 
 
 const AgentCreateCommand = cmd({
 const AgentCreateCommand = cmd({
   command: "create",
   command: "create",

+ 18 - 18
packages/web/src/content/docs/agents.mdx

@@ -421,24 +421,24 @@ You can configure permissions to manage what actions an agent can take. Each per
 
 
 The available permission keys are:
 The available permission keys are:
 
 
-| Key                  | Tools it gates                                                                |
-| -------------------- | ----------------------------------------------------------------------------- |
-| `read`               | `read`                                                                        |
-| `edit`               | `write`, `edit`, `apply_patch`                                                |
-| `glob`               | `glob`                                                                        |
-| `grep`               | `grep`                                                                        |
-| `list`               | `list`                                                                        |
-| `bash`               | `bash`                                                                        |
-| `task`               | `task`                                                                        |
-| `external_directory` | Any tool that reads or writes files outside the project worktree              |
-| `todowrite`          | `todowrite`, `todoread`                                                       |
-| `webfetch`           | `webfetch`                                                                    |
-| `websearch`          | `websearch`                                                                   |
-| `codesearch`         | `codesearch`                                                                  |
-| `lsp`                | `lsp`                                                                         |
-| `skill`              | `skill`                                                                       |
-| `question`           | `question`                                                                    |
-| `doom_loop`          | Recovery prompts when an agent appears stuck                                  |
+| Key                  | Tools it gates                                                   |
+| -------------------- | ---------------------------------------------------------------- |
+| `read`               | `read`                                                           |
+| `edit`               | `write`, `edit`, `apply_patch`                                   |
+| `glob`               | `glob`                                                           |
+| `grep`               | `grep`                                                           |
+| `list`               | `list`                                                           |
+| `bash`               | `bash`                                                           |
+| `task`               | `task`                                                           |
+| `external_directory` | Any tool that reads or writes files outside the project worktree |
+| `todowrite`          | `todowrite`, `todoread`                                          |
+| `webfetch`           | `webfetch`                                                       |
+| `websearch`          | `websearch`                                                      |
+| `codesearch`         | `codesearch`                                                     |
+| `lsp`                | `lsp`                                                            |
+| `skill`              | `skill`                                                          |
+| `question`           | `question`                                                       |
+| `doom_loop`          | Recovery prompts when an agent appears stuck                     |
 
 
 `read`, `edit`, `glob`, `grep`, `list`, `bash`, `task`, `external_directory`, `lsp`, and `skill` accept either a shorthand action (`"allow" | "ask" | "deny"`) or an object of glob/pattern → action for fine-grained control. The remaining keys accept the shorthand action only.
 `read`, `edit`, `glob`, `grep`, `list`, `bash`, `task`, `external_directory`, `lsp`, and `skill` accept either a shorthand action (`"allow" | "ask" | "deny"`) or an object of glob/pattern → action for fine-grained control. The remaining keys accept the shorthand action only.
 
 

+ 7 - 7
packages/web/src/content/docs/cli.mdx

@@ -97,13 +97,13 @@ This command will guide you through creating a new agent with a custom system pr
 
 
 #### Flags
 #### Flags
 
 
-| Flag             | Description                                                                                                |
-| ---------------- | ---------------------------------------------------------------------------------------------------------- |
-| `--path`         | Directory to write the agent file to (defaults to global or `.opencode/agent` based on the prompt)         |
-| `--description`  | What the agent should do                                                                                   |
-| `--mode`         | Agent mode: `all`, `primary`, or `subagent`                                                                |
-| `--permissions`  | Comma-separated list of permissions to allow (default: all). Available: `bash`, `read`, `edit`, `glob`, `grep`, `webfetch`, `task`, `todowrite`, `websearch`, `codesearch`, `lsp`, `skill`. Anything omitted is denied. Alias: `--tools` |
-| `--model`, `-m`  | Model to use, in `provider/model` format                                                                   |
+| Flag            | Description                                                                                                                                                                                                                              |
+| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `--path`        | Directory to write the agent file to (defaults to global or `.opencode/agent` based on the prompt)                                                                                                                                       |
+| `--description` | What the agent should do                                                                                                                                                                                                                 |
+| `--mode`        | Agent mode: `all`, `primary`, or `subagent`                                                                                                                                                                                              |
+| `--permissions` | Comma-separated list of permissions to allow (default: all). Available: `bash`, `read`, `edit`, `glob`, `grep`, `webfetch`, `task`, `todowrite`, `websearch`, `codesearch`, `lsp`, `skill`. Anything omitted is denied. Alias: `--tools` |
+| `--model`, `-m` | Model to use, in `provider/model` format                                                                                                                                                                                                 |
 
 
 Passing all of `--path`, `--description`, `--mode`, and `--permissions` runs the command non-interactively.
 Passing all of `--path`, `--description`, `--mode`, and `--permissions` runs the command non-interactively.