MCPcopy Index your code
hub / github.com/ChinaSiro/claude-code-sourcemap / wg1

Function wg1

package/cli.js:7733–7733  ·  view source on GitHub ↗
({serverName:q,message:K,requestedSchema:_,permissionMode:z,signal:Y,timeoutMs:$=PO,mode:A,url:O,elicitationId:w})

Source from the content-addressed store, hash-verified

7731`):void 0,userDisplayMessage:A.length>0?A.join(`
7732`):void 0}}async function Ip8(q,K,_=PO){let z={...C$(void 0),hook_event_name:"PostCompact",trigger:q.trigger,compact_summary:q.compactSummary},Y=await ob({hookInput:z,matchQuery:q.trigger,signal:K,timeoutMs:_});if(Y.length===0)return{};let $=[];for(let A of Y)if(A.succeeded)if(A.output.trim())$.push(`PostCompact [${A.command}] completed successfully: ${A.output.trim()}`);else $.push(`PostCompact [${A.command}] completed successfully`);else if(A.output.trim())$.push(`PostCompact [${A.command}] failed: ${A.output.trim()}`);else $.push(`PostCompact [${A.command}] failed`);return{userDisplayMessage:$.length>0?$.join(`
7733`):void 0}}async function J78(q,K){let{getAppState:_,setAppState:z,signal:Y,timeoutMs:$=PO}=K||{},A={...C$(void 0),hook_event_name:"SessionEnd",reason:q},O=await ob({getAppState:_,hookInput:A,matchQuery:q,signal:Y,timeoutMs:$});for(let w of O)if(!w.succeeded&&w.output)process.stderr.write(`SessionEnd hook [${w.command}] failed: ${w.output}
7734`);if(z){let w=N8();pN6(z,w)}}async function*hH6(q,K,_,z,Y,$,A,O=PO,w,j){N(`executePermissionRequestHooks called for tool: ${q}`);let H={...C$(Y,void 0,z),hook_event_name:"PermissionRequest",tool_name:q,tool_input:_,permission_suggestions:$};yield*GR({hookInput:H,toolUseID:K,matchQuery:q,signal:A,timeoutMs:O,toolUseContext:z,requestPrompt:w,toolInputSummary:j})}async function qv6(q,K,_=PO){let z={...C$(void 0),hook_event_name:"ConfigChange",source:q,file_path:K},Y=await ob({hookInput:z,timeoutMs:_,matchQuery:q});if(q==="policy_settings")return Y.map(($)=>({...$,blocked:!1}));return Y}async function LgK(q,K){let _=await ob({hookInput:q,timeoutMs:K});if(_.length>0)sE6();let z=_.flatMap(($)=>$.watchPaths??[]),Y=_.map(($)=>$.systemMessage).filter(($)=>!!$);return{results:_,watchPaths:z,systemMessages:Y}}function Yo1(q,K,_=PO){let z={...C$(void 0),hook_event_name:"CwdChanged",old_cwd:q,new_cwd:K};return LgK(z,_)}function $o1(q,K,_=PO){let z={...C$(void 0),hook_event_name:"FileChanged",file_path:q,event:K};return LgK(z,_)}function Wr6(){let q=bQ()?.InstructionsLoaded;if(q&&q.length>0)return!0;let K=sR()?.InstructionsLoaded;if(K&&K.length>0)return!0;return!1}async function Dr6(q,K,_,z){let{globs:Y,triggerFilePath:$,parentFilePath:A,timeoutMs:O=PO}=z??{},w={...C$(void 0),hook_event_name:"InstructionsLoaded",file_path:q,memory_type:K,load_reason:_,globs:Y,trigger_file_path:$,parent_file_path:A};await ob({hookInput:w,timeoutMs:O,matchQuery:_})}function RgK(q,K){if(q.blocked&&!q.succeeded)return{blockingError:{blockingError:q.output||"Elicitation blocked by hook",command:q.command}};if(!q.output.trim())return{};let _=q.output.trim();if(!_.startsWith("{"))return{};try{let z=lS6().parse(JSON.parse(_));if(rb(z))return{};if(!Cd(z))return{};if(z.decision==="block"||q.blocked)return{blockingError:{blockingError:z.reason||"Elicitation blocked by hook",command:q.command}};let Y=z.hookSpecificOutput;if(!Y||Y.hookEventName!==K)return{};if(!Y.action)return{};let A={response:{action:Y.action,content:Y.content}};if(Y.action==="decline")A.blockingError={blockingError:z.reason||(K==="Elicitation"?"Elicitation denied by hook":"Elicitation result blocked by hook"),command:q.command};return A}catch{return{}}}async function wg1({serverName:q,message:K,requestedSchema:_,permissionMode:z,signal:Y,timeoutMs:$=PO,mode:A,url:O,elicitationId:w}){let j={...C$(z),hook_event_name:"Elicitation",mcp_server_name:q,message:K,mode:A,url:O,elicitation_id:w,requested_schema:_},H=await ob({hookInput:j,matchQuery:q,signal:Y,timeoutMs:$}),J,M;for(let X of H){let P=RgK(X,"Elicitation");if(P.blockingError)M=P.blockingError;if(P.response)J=P.response}return{elicitationResponse:J,blockingError:M}}async function jg1({serverName:q,action:K,content:_,permissionMode:z,signal:Y,timeoutMs:$=PO,mode:A,elicitationId:O}){let w={...C$(z),hook_event_name:"ElicitationResult",mcp_server_name:q,elicitation_id:O,mode:A,action:K,content:_},j=await ob({hookInput:w,matchQuery:q,signal:Y,timeoutMs:$}),H,J;for(let M of j){let X=RgK(M,"ElicitationResult");if(X.blockingError)J=X.blockingError;if(X.response)H=X.response}return{elicitationResultResponse:H,blockingError:J}}async function H_7(q,K,_=5000,z=!1){if(j68())return;if(Qq8()){N("Skipping StatusLine command execution - workspace trust not accepted");return}let Y;if(fb())Y=v1("policySettings")?.statusLine;else Y=Z7()?.statusLine;if(!Y||Y.type!=="command")return;let $=K||AbortSignal.timeout(_);try{let A=g6(q),O=await hQ8(Y,"StatusLine","statusLine",A,$,vy());if(O.aborted)return;if(O.status===0){let w=O.stdout.trim().split(`
7735`).flatMap((j)=>j.trim()||[]).join(`
7736`);if(w){if(z)N(`StatusLine [${Y.command}] completed with status ${O.status}`);return w}}else if(z)N(`StatusLine [${Y.command}] completed with status ${O.status}`,{level:"warn"});return}catch(A){N(`Status hook failed: ${A}`,{level:"error"});return}}async function hq7(q,K,_=5000){if(j68())return[];if(Qq8())return N("Skipping FileSuggestion command execution - workspace trust not accepted"),[];let z;if(fb())z=v1("policySettings")?.fileSuggestion;else z=Z7()?.fileSuggestion;if(!z||z.type!=="command")return[];let Y=K||AbortSignal.timeout(_);try{let $=g6(q),A={type:"command",command:z.command},O=await hQ8(A,"FileSuggestion","FileSuggestion",$,Y,vy());if(O.aborted||O.status!==0)return[];return O.stdout.split(`

Callers 1

ka6Function · 0.85

Calls 3

C$Function · 0.85
obFunction · 0.85
RgKFunction · 0.85

Tested by

no test coverage detected