mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:10:44 +00:00
fix(docs): validate strict channel json fences
This commit is contained in:
@@ -258,15 +258,17 @@ In group `120363403215116621@g.us` with agents `["alfred", "baerbel"]`:
|
||||
{
|
||||
"agents": {
|
||||
"reviewer": {
|
||||
"tools": { "allow": ["read", "exec"] } // Read-only
|
||||
"tools": { "allow": ["read", "exec"] }
|
||||
},
|
||||
"fixer": {
|
||||
"tools": { "allow": ["read", "write", "edit", "exec"] } // Read-write
|
||||
"tools": { "allow": ["read", "write", "edit", "exec"] }
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`reviewer` is read-only. `fixer` can read and write.
|
||||
|
||||
</Accordion>
|
||||
<Accordion title="4. Monitor performance">
|
||||
With many agents, consider:
|
||||
|
||||
@@ -251,7 +251,19 @@ For **HTTP Request URLs mode**, replace `settings` with the HTTP variant and add
|
||||
"event_subscriptions": {
|
||||
"request_url": "https://gateway-host.example.com/slack/events",
|
||||
"bot_events": [
|
||||
/* same as Socket Mode */
|
||||
"app_home_opened",
|
||||
"app_mention",
|
||||
"channel_rename",
|
||||
"member_joined_channel",
|
||||
"member_left_channel",
|
||||
"message.channels",
|
||||
"message.groups",
|
||||
"message.im",
|
||||
"message.mpim",
|
||||
"pin_added",
|
||||
"pin_removed",
|
||||
"reaction_added",
|
||||
"reaction_removed"
|
||||
]
|
||||
},
|
||||
"interactivity": {
|
||||
@@ -420,11 +432,12 @@ The default manifest enables the Slack App Home **Home** tab and subscribes to `
|
||||
"description": "Show the short help summary",
|
||||
"url": "https://gateway-host.example.com/slack/events"
|
||||
}
|
||||
// ...repeat for every command with the same `url` value
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Repeat that `url` value on every command in the list.
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
|
||||
@@ -22,10 +22,17 @@ describe("channel docs config examples", () => {
|
||||
for (const match of blocks) {
|
||||
const code = match[1] ?? "";
|
||||
const location = `${fileName}:${lineNumberAt(markdown, match.index ?? 0)}`;
|
||||
const isStrictJson = match[0].startsWith("```json\n");
|
||||
try {
|
||||
JSON5.parse(code);
|
||||
if (isStrictJson) {
|
||||
JSON.parse(code);
|
||||
} else {
|
||||
JSON5.parse(code);
|
||||
}
|
||||
} catch (error) {
|
||||
failures.push(`${location} JSON5 parse failed: ${String(error)}`);
|
||||
failures.push(
|
||||
`${location} ${isStrictJson ? "JSON" : "JSON5"} parse failed: ${String(error)}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user