feat(acp): add opt-in flag for question tool (#13562)
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
This commit is contained in:
@@ -599,6 +599,7 @@ OPENCODE_EXPERIMENTAL_MARKDOWN
|
|||||||
OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX
|
OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX
|
||||||
OPENCODE_EXPERIMENTAL_OXFMT
|
OPENCODE_EXPERIMENTAL_OXFMT
|
||||||
OPENCODE_EXPERIMENTAL_PLAN_MODE
|
OPENCODE_EXPERIMENTAL_PLAN_MODE
|
||||||
|
OPENCODE_ENABLE_QUESTION_TOOL
|
||||||
OPENCODE_FAKE_VCS
|
OPENCODE_FAKE_VCS
|
||||||
OPENCODE_GIT_BASH_PATH
|
OPENCODE_GIT_BASH_PATH
|
||||||
OPENCODE_MODEL
|
OPENCODE_MODEL
|
||||||
|
|||||||
@@ -44,6 +44,16 @@ opencode acp
|
|||||||
opencode acp --cwd /path/to/project
|
opencode acp --cwd /path/to/project
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Question Tool Opt-In
|
||||||
|
|
||||||
|
ACP excludes `QuestionTool` by default.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
OPENCODE_ENABLE_QUESTION_TOOL=1 opencode acp
|
||||||
|
```
|
||||||
|
|
||||||
|
Enable this only for ACP clients that support interactive question prompts.
|
||||||
|
|
||||||
### Programmatic
|
### Programmatic
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ export namespace Flag {
|
|||||||
export declare const OPENCODE_CLIENT: string
|
export declare const OPENCODE_CLIENT: string
|
||||||
export const OPENCODE_SERVER_PASSWORD = process.env["OPENCODE_SERVER_PASSWORD"]
|
export const OPENCODE_SERVER_PASSWORD = process.env["OPENCODE_SERVER_PASSWORD"]
|
||||||
export const OPENCODE_SERVER_USERNAME = process.env["OPENCODE_SERVER_USERNAME"]
|
export const OPENCODE_SERVER_USERNAME = process.env["OPENCODE_SERVER_USERNAME"]
|
||||||
|
export const OPENCODE_ENABLE_QUESTION_TOOL = truthy("OPENCODE_ENABLE_QUESTION_TOOL")
|
||||||
|
|
||||||
// Experimental
|
// Experimental
|
||||||
export const OPENCODE_EXPERIMENTAL = truthy("OPENCODE_EXPERIMENTAL")
|
export const OPENCODE_EXPERIMENTAL = truthy("OPENCODE_EXPERIMENTAL")
|
||||||
|
|||||||
@@ -94,10 +94,11 @@ export namespace ToolRegistry {
|
|||||||
async function all(): Promise<Tool.Info[]> {
|
async function all(): Promise<Tool.Info[]> {
|
||||||
const custom = await state().then((x) => x.custom)
|
const custom = await state().then((x) => x.custom)
|
||||||
const config = await Config.get()
|
const config = await Config.get()
|
||||||
|
const question = ["app", "cli", "desktop"].includes(Flag.OPENCODE_CLIENT) || Flag.OPENCODE_ENABLE_QUESTION_TOOL
|
||||||
|
|
||||||
return [
|
return [
|
||||||
InvalidTool,
|
InvalidTool,
|
||||||
...(["app", "cli", "desktop"].includes(Flag.OPENCODE_CLIENT) ? [QuestionTool] : []),
|
...(question ? [QuestionTool] : []),
|
||||||
BashTool,
|
BashTool,
|
||||||
ReadTool,
|
ReadTool,
|
||||||
GlobTool,
|
GlobTool,
|
||||||
|
|||||||
Reference in New Issue
Block a user