Skip to content

Commit 2b80000

Browse files
authored
feat: add bot hooks (#651)
* feat: add bot hooks * fix: address bot hook review feedback
1 parent f71cf9f commit 2b80000

39 files changed

Lines changed: 4263 additions & 79 deletions

apps/web/src/i18n/locales/en.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,6 +1242,40 @@
12421242
},
12431243
"unsavedChanges": "Unsaved changes"
12441244
},
1245+
"hooks": {
1246+
"title": "Hooks",
1247+
"subtitle": "Run workspace actions around tool calls, approvals, turns, memory, channels, and runtime events.",
1248+
"reload": "Reload",
1249+
"save": "Save",
1250+
"statusSection": "Status",
1251+
"filePath": "Config file",
1252+
"present": "Present",
1253+
"missing": "Missing",
1254+
"missingDescription": "No hooks file exists yet; the editor is showing a starter template.",
1255+
"enabledDescription": "Hooks are enabled for matching events.",
1256+
"disabledDescription": "The hooks file exists but is disabled.",
1257+
"invalidDescription": "The JSON file is not valid yet.",
1258+
"rules": "Rules",
1259+
"rulesDescription": "Enabled rules over total rules.",
1260+
"actions": "Actions",
1261+
"actionsDescription": "Commands and tool calls configured by matching hooks.",
1262+
"eventsSection": "Events",
1263+
"editorSection": "Config",
1264+
"jsonConfig": "hooks.json",
1265+
"editorHint": "JSON is valid.",
1266+
"template": "Template",
1267+
"testSection": "Test",
1268+
"testEvent": "Event",
1269+
"testEventDescription": "Run the saved hooks file against a synthetic payload.",
1270+
"selectEvent": "Select event",
1271+
"testReady": "Payload is valid JSON.",
1272+
"runTest": "Run test",
1273+
"loadFailed": "Failed to load hooks",
1274+
"saveSuccess": "Hooks saved",
1275+
"saveFailed": "Failed to save hooks",
1276+
"testSuccess": "Hook test completed",
1277+
"testFailed": "Hook test failed"
1278+
},
12451279
"title": "Bots",
12461280
"searchPlaceholder": "Search bots…",
12471281
"createBot": "New Bot",
@@ -1497,6 +1531,7 @@
14971531
"general": "General",
14981532
"desktop": "Desktop",
14991533
"toolApproval": "Tool Approval",
1534+
"hooks": "Hooks",
15001535
"acp": "Agents",
15011536
"network": "Network",
15021537
"memory": "Memory",

apps/web/src/i18n/locales/ja.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,6 +1242,40 @@
12421242
},
12431243
"unsavedChanges": "未保存の変更"
12441244
},
1245+
"hooks": {
1246+
"title": "Hooks",
1247+
"subtitle": "Tool呼び出し、承認、ターン、Memory、Channel、Runtimeイベントの前後でWorkspaceアクションを実行します。",
1248+
"reload": "再読み込み",
1249+
"save": "保存",
1250+
"statusSection": "状態",
1251+
"filePath": "設定ファイル",
1252+
"present": "あり",
1253+
"missing": "未作成",
1254+
"missingDescription": "hooksファイルはまだありません。エディタには開始用テンプレートが表示されています。",
1255+
"enabledDescription": "一致したイベントでHooksが実行されます。",
1256+
"disabledDescription": "hooksファイルはありますが、現在は無効です。",
1257+
"invalidDescription": "JSONファイルがまだ有効ではありません。",
1258+
"rules": "ルール",
1259+
"rulesDescription": "有効なルール数 / すべてのルール数。",
1260+
"actions": "アクション",
1261+
"actionsDescription": "一致したHooksで実行されるコマンドとTool呼び出し。",
1262+
"eventsSection": "イベント",
1263+
"editorSection": "設定",
1264+
"jsonConfig": "hooks.json",
1265+
"editorHint": "JSONは有効です。",
1266+
"template": "テンプレート",
1267+
"testSection": "テスト",
1268+
"testEvent": "イベント",
1269+
"testEventDescription": "保存済みのhooksファイルを合成payloadで一度実行します。",
1270+
"selectEvent": "イベントを選択",
1271+
"testReady": "Payloadは有効なJSONです。",
1272+
"runTest": "テスト実行",
1273+
"loadFailed": "Hooksの読み込みに失敗しました",
1274+
"saveSuccess": "Hooksを保存しました",
1275+
"saveFailed": "Hooksの保存に失敗しました",
1276+
"testSuccess": "Hookテストが完了しました",
1277+
"testFailed": "Hookテストに失敗しました"
1278+
},
12451279
"title": "Bot",
12461280
"searchPlaceholder": "Botを検索…",
12471281
"createBot": "新しいBot",
@@ -1497,6 +1531,7 @@
14971531
"general": "一般的な",
14981532
"desktop": "Desktop",
14991533
"toolApproval": "Toolの承認",
1534+
"hooks": "Hooks",
15001535
"acp": "エージェント",
15011536
"network": "ネットワーク",
15021537
"memory": "メモリ",

apps/web/src/i18n/locales/zh.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,6 +1242,40 @@
12421242
},
12431243
"unsavedChanges": "有未保存的更改"
12441244
},
1245+
"hooks": {
1246+
"title": "Hooks",
1247+
"subtitle": "围绕工具调用、审批、回合、记忆、频道和运行时事件执行工作区动作。",
1248+
"reload": "重新加载",
1249+
"save": "保存",
1250+
"statusSection": "状态",
1251+
"filePath": "配置文件",
1252+
"present": "已存在",
1253+
"missing": "未创建",
1254+
"missingDescription": "还没有 hooks 文件,编辑器正在显示起始模板。",
1255+
"enabledDescription": "Hooks 会在匹配事件时运行。",
1256+
"disabledDescription": "hooks 文件已存在,但当前关闭。",
1257+
"invalidDescription": "JSON 文件暂时无效。",
1258+
"rules": "规则",
1259+
"rulesDescription": "启用规则数 / 全部规则数。",
1260+
"actions": "动作",
1261+
"actionsDescription": "匹配 hooks 后会运行的命令和工具调用。",
1262+
"eventsSection": "事件",
1263+
"editorSection": "配置",
1264+
"jsonConfig": "hooks.json",
1265+
"editorHint": "JSON 有效。",
1266+
"template": "模板",
1267+
"testSection": "测试",
1268+
"testEvent": "事件",
1269+
"testEventDescription": "使用已保存的 hooks 文件执行一次模拟 payload。",
1270+
"selectEvent": "选择事件",
1271+
"testReady": "Payload 是有效 JSON。",
1272+
"runTest": "运行测试",
1273+
"loadFailed": "加载 hooks 失败",
1274+
"saveSuccess": "Hooks 已保存",
1275+
"saveFailed": "保存 hooks 失败",
1276+
"testSuccess": "Hook 测试完成",
1277+
"testFailed": "Hook 测试失败"
1278+
},
12451279
"title": "Bots",
12461280
"searchPlaceholder": "搜索 Bot…",
12471281
"createBot": "新建 Bot",
@@ -1497,6 +1531,7 @@
14971531
"general": "通用",
14981532
"desktop": "桌面",
14991533
"toolApproval": "工具审核",
1534+
"hooks": "Hooks",
15001535
"acp": "ACP Agent",
15011536
"network": "网络",
15021537
"memory": "记忆",

0 commit comments

Comments
 (0)