d48cda4081
CI / Test (ubuntu-latest, Node 18.x, bun) (push) Failing after 15m1s
CI / Test (ubuntu-latest, Node 18.x, npm) (push) Failing after 15m1s
CI / Test (ubuntu-latest, Node 18.x, pnpm) (push) Failing after 15m1s
CI / Test (ubuntu-latest, Node 18.x, yarn) (push) Failing after 15m1s
CI / Test (ubuntu-latest, Node 20.x, bun) (push) Failing after 17m13s
CI / Test (ubuntu-latest, Node 20.x, npm) (push) Failing after 18m42s
CI / Test (ubuntu-latest, Node 20.x, pnpm) (push) Failing after 15m0s
CI / Test (ubuntu-latest, Node 20.x, yarn) (push) Failing after 49m44s
CI / Test (ubuntu-latest, Node 22.x, bun) (push) Failing after 51m55s
CI / Test (ubuntu-latest, Node 22.x, pnpm) (push) Failing after 21m57s
CI / Test (ubuntu-latest, Node 22.x, npm) (push) Failing after 37m39s
CI / Test (ubuntu-latest, Node 22.x, yarn) (push) Failing after 34m7s
CI / Validate Components (push) Failing after 37m15s
CI / Python Tests (push) Failing after 10m1s
CI / Security Scan (push) Failing after 10m1s
CI / Lint (push) Failing after 17m12s
CI / Coverage (push) Failing after 20m19s
CI / Test (macos-latest, Node 18.x, bun) (push) Has been cancelled
CI / Test (macos-latest, Node 18.x, npm) (push) Has been cancelled
CI / Test (macos-latest, Node 18.x, pnpm) (push) Has been cancelled
CI / Test (macos-latest, Node 18.x, yarn) (push) Has been cancelled
CI / Test (windows-latest, Node 18.x, npm) (push) Has been cancelled
CI / Test (windows-latest, Node 18.x, pnpm) (push) Has been cancelled
CI / Test (windows-latest, Node 18.x, yarn) (push) Has been cancelled
CI / Test (macos-latest, Node 20.x, bun) (push) Has been cancelled
CI / Test (macos-latest, Node 20.x, npm) (push) Has been cancelled
CI / Test (macos-latest, Node 20.x, pnpm) (push) Has been cancelled
CI / Test (macos-latest, Node 20.x, yarn) (push) Has been cancelled
CI / Test (windows-latest, Node 20.x, npm) (push) Has been cancelled
CI / Test (windows-latest, Node 20.x, pnpm) (push) Has been cancelled
CI / Test (windows-latest, Node 20.x, yarn) (push) Has been cancelled
CI / Test (macos-latest, Node 22.x, bun) (push) Has been cancelled
CI / Test (macos-latest, Node 22.x, npm) (push) Has been cancelled
CI / Test (macos-latest, Node 22.x, pnpm) (push) Has been cancelled
CI / Test (macos-latest, Node 22.x, yarn) (push) Has been cancelled
CI / Test (windows-latest, Node 22.x, npm) (push) Has been cancelled
CI / Test (windows-latest, Node 22.x, pnpm) (push) Has been cancelled
CI / Test (windows-latest, Node 22.x, yarn) (push) Has been cancelled
51 lines
1.7 KiB
JavaScript
51 lines
1.7 KiB
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* Cursor sessionStart hook — inject ECC_AGENT_DATA_HOME for the composer session.
|
|
*
|
|
* Cursor passes session-scoped env from sessionStart output to all later hooks.
|
|
* @see https://cursor.com/docs/hooks
|
|
*/
|
|
|
|
const {
|
|
getCursorSessionEnvPayload,
|
|
resolveAgentDataHome,
|
|
AGENT_DATA_HOME_ENV,
|
|
} = require('../lib/agent-data-home');
|
|
const { readStdinJson, log } = require('../lib/utils');
|
|
|
|
function main() {
|
|
readStdinJson()
|
|
.then(() => {
|
|
const envPayload = getCursorSessionEnvPayload({ preferCursorDefault: true });
|
|
const agentDataHome = envPayload[AGENT_DATA_HOME_ENV];
|
|
const payload = {
|
|
env: envPayload,
|
|
additional_context: [
|
|
'ECC memory persistence uses a dedicated agent data root for this Cursor session.',
|
|
`${AGENT_DATA_HOME_ENV}=${agentDataHome}`,
|
|
'Session summaries, learned skills, aliases, and metrics live under that directory.',
|
|
'Override via shell env, project .cursor/ecc-agent-data.json, or ECC docs (issue #2065).',
|
|
].join('\n'),
|
|
};
|
|
|
|
process.stdout.write(`${JSON.stringify(payload)}\n`);
|
|
log(`[cursor-session-env] Set ${AGENT_DATA_HOME_ENV}=${agentDataHome}`);
|
|
process.exit(0);
|
|
})
|
|
.catch(error => {
|
|
const fallbackHome = resolveAgentDataHome({ preferCursorDefault: true });
|
|
const payload = {
|
|
env: { [AGENT_DATA_HOME_ENV]: fallbackHome },
|
|
};
|
|
process.stdout.write(`${JSON.stringify(payload)}\n`);
|
|
log(`[cursor-session-env] Fallback ${AGENT_DATA_HOME_ENV}=${fallbackHome} (${error.message})`);
|
|
process.exit(0);
|
|
});
|
|
}
|
|
|
|
if (require.main === module) {
|
|
main();
|
|
}
|
|
|
|
module.exports = { main };
|