public class OpenCodeCallbackParser extends Object
OpenCode does not have a native webhook/callback mechanism. This parser attempts to extract JSON blocks from the AI's text response, following the format conventions defined by cloud-agents prompt templates (e.g., the callback_url output format specified in SKILL.md).
The parser tries three strategies in order:
```json ... ``` fenced code blockstask_id, taskId, or titlePromptResult| Constructor and Description |
|---|
OpenCodeCallbackParser() |
| Modifier and Type | Method and Description |
|---|---|
Map<String,Object> |
parseFromPromptResult(PromptResult result)
从 PromptResult 中提取文本内容并解析为 Map。
|
Map<String,Object> |
parseFromText(String text)
从纯文本中尝试提取并解析 JSON。
|
public Map<String,Object> parseFromPromptResult(PromptResult result)
result - OpenCode Prompt 执行结果Copyright © 2026. All rights reserved.