Skip to content

Cursor plugin specification and official plugins

TypeScript

Remove --trial flag from continual-learning hook

ericzakariasson1966e5222399
diff --git a/continual-learning/hooks/continual-learning-stop.ts b/continual-learning/hooks/continual-learning-stop.ts
index 0bfcc817..4555ddd4 100644
--- a/continual-learning/hooks/continual-learning-stop.ts
+++ b/continual-learning/hooks/continual-learning-stop.ts
@@ -143,7 +143,7 @@ async function parseHookInput<T>(): Promise<T> {
return JSON.parse(text) as T;
}
-async function main(args: string[]): Promise<number> {
+async function main(): Promise<number> {
try {
const input = await parseHookInput<StopHookInput>();
const state = loadState();
@@ -159,9 +159,9 @@ async function main(args: string[]): Promise<number> {
const turnsSinceLastRun = state.turnsSinceLastRun + turnIncrement;
const now = Date.now();
- const trialEnabled =
- args.includes("--trial") ||
- parseBoolean(readEnvValue("CONTINUAL_LEARNING_TRIAL_MODE", "CONTINUOUS_LEARNING_TRIAL_MODE"));
+ const trialEnabled = parseBoolean(
+ readEnvValue("CONTINUAL_LEARNING_TRIAL_MODE", "CONTINUOUS_LEARNING_TRIAL_MODE")
+ );
if (trialEnabled && countedTurn && state.trialStartedAtMs === null) {
state.trialStartedAtMs = now;
}
@@ -243,5 +243,5 @@ async function main(args: string[]): Promise<number> {
}
}
-const exitCode = await main(process.argv.slice(2));
+const exitCode = await main();
process.exit(exitCode);
diff --git a/continual-learning/hooks/hooks.json b/continual-learning/hooks/hooks.json
index 690c86c1..6be2b9c9 100644
--- a/continual-learning/hooks/hooks.json
+++ b/continual-learning/hooks/hooks.json
@@ -3,7 +3,7 @@
"hooks": {
"stop": [
{
- "command": "bun run ./hooks/continual-learning-stop.ts --trial"
+ "command": "bun run ./hooks/continual-learning-stop.ts"
}
]
}