import"./paths-B4IRk3wi.js";import"./subsystem-BQ1073Mu.js";import"./utils-D1PlBTFH.js";import{d as e,f as t}from"./agent-scope-DW6ZDCxj.js";import"./openclaw-root-D_0Q6--h.js";import{t as n}from"./command-format-BbDT1tlm.js";import"./boolean-Ch3DfXPy.js";import"./frontmatter-BkZkwkVO.js";import"./workspace-DAohsEeW.js";import{t as r}from"./hooks-status-CNwn6gmu.js";async function i(i,a,o){await o.note([`Hooks let you automate actions when agent commands are issued.`,`Example: Save session context to memory when you issue /new or /reset.`,``,`Learn more: https://docs.openclaw.ai/automation/hooks`].join(`
`),`Hooks`);let s=r(e(i,t(i)),{config:i}).hooks.filter(e=>e.eligible);if(s.length===0)return await o.note(`No eligible hooks found. You can configure hooks later in your config.`,`No Hooks Available`),i;let c=(await o.multiselect({message:`Enable hooks?`,options:[{value:`__skip__`,label:`Skip for now`},...s.map(e=>({value:e.name,label:`${e.emoji??`🔗`} ${e.name}`,hint:e.description}))]})).filter(e=>e!==`__skip__`);if(c.length===0)return i;let l={...i.hooks?.internal?.entries};for(let e of c)l[e]={enabled:!0};let u={...i,hooks:{...i.hooks,internal:{enabled:!0,entries:l}}};return await o.note([`Enabled ${c.length} hook${c.length>1?`s`:``}: ${c.join(`, `)}`,``,`You can manage hooks later with:`,`  ${n(`openclaw hooks list`)}`,`  ${n(`openclaw hooks enable <name>`)}`,`  ${n(`openclaw hooks disable <name>`)}`].join(`
`),`Hooks Configured`),u}export{i as setupInternalHooks};
