@@ -59,10 +59,14 @@ const HOOK_GROUPS: HookGroup[] = [
5959 {
6060 label : 'Agent 轮次' ,
6161 points : [
62- { name : 'agent.turn.start' , description : '一轮对话开始时触发 ' , type : 'observer' } ,
62+ { name : 'agent.turn.start' , description : '每一轮对话开始时触发 ' , type : 'observer' } ,
6363 { name : 'agent.step.before' , description : '每个推理步骤前触发' , type : 'decision' } ,
64- { name : 'agent.turn.stop' , description : '对话轮次停止时触发' , type : 'observer' } ,
65- { name : 'agent.turn.end' , description : '对话轮次结束时触发' , type : 'observer' } ,
64+ {
65+ name : 'agent.turn.stop' ,
66+ description : 'Agent 本轮无工具调用、准备停止时裁决,可返回 continue 续行' ,
67+ type : 'decision' ,
68+ } ,
69+ { name : 'agent.turn.end' , description : '轮次最终结束时通知,不可干预' , type : 'observer' } ,
6670 ] ,
6771 } ,
6872 {
@@ -81,7 +85,6 @@ interface HookForm {
8185 name : string ;
8286 description : string ;
8387 point : string ;
84- type : 'observer' | 'decision' ;
8588 command : string ;
8689 args : string ;
8790 env : string ;
@@ -93,7 +96,6 @@ const EMPTY_FORM: HookForm = {
9396 name : '' ,
9497 description : '' ,
9598 point : ALL_POINTS [ 0 ] ?. name ?? '' ,
96- type : 'observer' ,
9799 command : '' ,
98100 args : '' ,
99101 env : '' ,
@@ -139,7 +141,6 @@ export default function HooksPanel({ global: isGlobal }: { global?: boolean }) {
139141 name : h . name ,
140142 description : h . description ?? '' ,
141143 point : h . point ,
142- type : h . type ,
143144 command : h . command ,
144145 args : ( h . args ?? [ ] ) . join ( ', ' ) ,
145146 env : h . env
@@ -164,7 +165,7 @@ export default function HooksPanel({ global: isGlobal }: { global?: boolean }) {
164165 const hook : Record < string , unknown > = {
165166 name : form . name ,
166167 point : form . point ,
167- type : form . type ,
168+ type : ALL_POINTS . find ( ( p ) => p . name === form . point ) ?. type ?? 'observer' ,
168169 command : form . command ,
169170 enabled : form . enabled ,
170171 } ;
@@ -493,31 +494,6 @@ function FormCard({
493494 ) ) }
494495 </ select >
495496 </ div >
496- < div >
497- < div className = { labelCls } > 类型</ div >
498- < div className = "flex gap-2 pt-1" >
499- < button
500- onClick = { ( ) => setForm ( { ...form , type : 'observer' } ) }
501- className = { `px-3 py-1.5 rounded text-[13px] font-mono transition-colors ${
502- form . type === 'observer'
503- ? 'bg-[var(--btn-primary-bg)] text-[var(--accent-primary)]'
504- : 'bg-[var(--border-card)] text-[var(--text-secondary)] border border-[var(--border-hover)]'
505- } `}
506- >
507- observer
508- </ button >
509- < button
510- onClick = { ( ) => setForm ( { ...form , type : 'decision' } ) }
511- className = { `px-3 py-1.5 rounded text-[13px] font-mono transition-colors ${
512- form . type === 'decision'
513- ? 'bg-[var(--btn-primary-bg)] text-[var(--accent-primary)]'
514- : 'bg-[var(--border-card)] text-[var(--text-secondary)] border border-[var(--border-hover)]'
515- } `}
516- >
517- decision
518- </ button >
519- </ div >
520- </ div >
521497 </ div >
522498 < div >
523499 < div className = { labelCls } > 命令</ div >
0 commit comments