moving
Some checks failed
Installer Smoke / installer-smoke (push) Has been cancelled

This commit is contained in:
Oleg Maslov
2026-09-02 10:10:29 +02:00
commit 0c3e2ead3b
3841 changed files with 970576 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
/**
* Cursor beforeSubmitPrompt hook — captures the user prompt as a temporary
* frame scoped to the current Cursor session. Thin entrypoint over the
* shared handler body.
*
* DEGRADED (spec §5.3): cursor's `beforeSubmitPrompt` is SAVE-ONLY — its
* stdout is only `{ continue, user_message }`, so it cannot inject recalled
* context. hive-mind's UserPromptSubmit only persists, so this is fully
* compatible; the hook emits no stdout and is a pure side-effect on the
* .mind file.
*/
import {
makeUserPromptSubmitHandler,
runHook,
type HookRunOptions,
} from '@waggle/hive-mind-hooks-core';
import { cursorAdapter } from '../adapter.js';
export async function runUserPromptSubmit(opts: Partial<HookRunOptions> = {}): Promise<void> {
return runHook(makeUserPromptSubmitHandler(cursorAdapter), {
name: 'user-prompt-submit',
loggerPrefix: 'cursor-hooks',
...opts,
});
}
const isMain = (() => {
try {
if (typeof process.argv[1] !== 'string') return false;
const url = new URL(`file://${process.argv[1].replace(/\\/g, '/')}`);
return url.href === import.meta.url;
} catch {
return false;
}
})();
if (isMain) {
void runUserPromptSubmit();
}