Lines 1-21javascript
2"use strict";var ze=exports&&exports.__createBinding||(Object.create?(function(e,t,n,o){o===void 0&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}):(function(e,t,n,o){o===void 0&&(o=n),e[o]=t[n]})),qe=exports&&exports.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),X=exports&&exports.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||fun ...
3
HighSame File Env Network Execution
A single source file combines environment access, network access, and code or shell execution; review context before blocking.
dist/index.jsView on unpkg · L1 4${b}`:b,s=(b,A)=>{e.client==="cursor"?console.log(JSON.stringify({additional_context:b})):e.client==="codex"?console.log(JSON.stringify({hookSpecificOutput:{hookEventName:"SessionStart",additionalContext:b}})):e.json?console.log(JSON.stringify({...A},null,2)):console.log(JSON.stringify({hookSpecificOutput:{hookEventName:"SessionStart",additionalContext:b}}))},u=await(0,T.getBillingState)().catch(()=>null),m=u!=null&&!u.cloud_sync_allowed,d=m?(0,S.liveFreeProjectId)():null,f=!!((0,C.getGoogleKey)()||(0,C.getAnthropicKey)()||(0,C.getOpenAIKey)())||!!(u&&u.cloud_sync_allowed)?"ok":(0,C.hasSupabas ...
5`);s(c(A),{matched:!1,free_limited:!0});return}if(f!=="ok"){const A=h();s(c(A),{matched:!1,capture_gate:f,message:A});return}const b=(0,W.buildReadyFirstSessionMessage)();s(c(b),{matched:!1,capture_gate:"ok",message:b});
6`);s(c(b),{matched:!0,project_id:o.project_id,locked:!0});return}if(f!=="ok"){if((0,j.recentEvents)(o.project_id,1).length===0){const N=h();s(c(N),{matched:!0,project_id:o.project_id,capture_gate:f,message:N});return}const A=await(0,ee.buildTimelineSummaryWithCloud)(o.project_id),G=[h(),"",
7`);s(c(G),{matched:!0,project_id:o.project_id,capture_gate:f,...A});return}const l=await(0,ee.buildTimelineSummaryWithCloud)(o.project_id),k=["[window-memory] Auto-injected Window Memory catch-up. Open your reply to the user by",'surfacing this \u2014 lead with a line like "[window-memory] Last time you \u2026" (use the summary',"below) so the user can SEE Window Memory is active \u2014 then continue answering normally."].join(" "),R=[],$=(0,j.latestDirection)(o.project_id,1)[0
8`);s(c(x),{matched:!0,project_id:o.project_id,...l})}catch(t){_("[recall]",t.message),process.exit(1)}});function z(e){const t=(0,S.listProjects)(),n=(0,v.normalizePath)(e),o=t.find(u=>u.path&&!u.path.startsWith("(")&&(0,v.normalizePath)(u.path)===n);if(o)return o;const r=mt(e);if(r){const u=t.find(m=>m.git_remote===r);if(u)return u}const c=(0,v.detectProject)(e),s=t.find(u=>u.project_id===c.project_id);return s||null}function ce(e){const t=z(e);if(t)return t;const n=(0,v.detectProject)(e);return(0,S.listProjects)().find(o=>o.project_id===n.project_id)??null}function le(e){const t=[];if(Array. ...
9`)}catch{}}function Ee(e){const t=e.match(/<user_query>\s*([\s\S]*?)\s*<\/user_query>/i);return t?.[1]?t[1].trim():e.replace(/<timestamp>[\s\S]*?<\/timestamp>\s*/
10`).filter(o=>o.trim());for(let o=n.length-1;o>=0;o--)try{const r=JSON.parse(n[o]);if(r.role!=="user"||!r.message?.content)continue;const c=r.message.content;if(typeof c
11`),u=Ee(s);if(u.length>=3)return u}}catch{continue}return""}function dt(){const e=y.join(U.homedir(),".cursor","projects");if(!w.existsSync(e))return null;const
12`),process.exit(2)});function kt(e){const t=e.tool_name??"",n=typeof e.tool_input=="object"&&e.tool_input!==null?e.tool_input:{},o=ue(e),r=(0,D.peekReversalBlock)({sessionIds:_t(e),workspaceRoot:q(e),generationId:e.generation_id,conversationId:e.conversation_id});if(r)return{skip:!1,reminder:r.message,dedupKey:`reversal::${r.eventId}`,deny:!0};const c=(0,ne.readManagedAlert)();if(c&&o&&!pe(o,c.bucket))return Z(o,c.bucket),{skip:!1,reminder:c.line};const s=t==="TodoWrite"||t==="update_plan",u=t==="Agent"||t==="Task",m=t==="Write"||t==="apply_patch",d=t==="Bash"||t==="shell",a=t==="Edit"||t==="M ...
13Paste any known past failures/decisions into the subagent prompt yourself. Do not assume the child inherits parent memory.`,St=`[window-memory] About to draft a TODO list.
14SELF-CHECK FIRST: Call mcp__window-memory__search_events with 2-3 core nouns from the user's request.
15If past work in the same area shows failures, reversals, or rule decisions, reflect them in the TODOs
16so you don't repeat the same wrong path. This is the cheap step that prevents the expensive reversal.`,bt=`[window-memory] Writing a large new file.
17SELF-CHECK FIRST: Call mcp__window-memory__search_events on the file's domain (e.g. "auth", "watcher",
18"i18n", "cloud sync"). Past code may have set conventions, naming patterns, or had specific failures
19worth respecting.`,$t=`[window-memory] About to run an irreversible shell command
20(delete / force-push / publish / drop / truncate).
21SELF-CHECK FIRST: Call mcp__window-memory__search_events on the action verb (e.g. "publish",
Long lines were clipped for display.