docs: add @mode tags + enrich JSDoc on harness event declarations

Annotate all 24 harness events across the 5 event-declaring packages with
an explicit `@mode emit|waterfall|parallel` tag and self-contained JSDoc, so
the generated cordis catalog can render each entry's mode and prose from
source alone.
This commit is contained in:
Tianyi Cui
2026-06-20 19:21:42 +08:00
parent 9949f4f2ea
commit ee494969af
5 changed files with 102 additions and 22 deletions

View File

@@ -36,11 +36,15 @@ declare module 'cordis' {
* Waterfall around every tool execution — the single seam where sandbox,
* permission, hook, and plan-mode plugins wrap or veto a call. Listeners
* receive `(exec, next)`: call `next()` to proceed (possibly around your
* own logic), or return a ToolExecutionResult without calling `next()`
* to short-circuit (veto).
* own logic), or return a {@link ToolExecutionResult} without calling
* `next()` to short-circuit (veto).
* @mode waterfall
*/
'tools/execute'(this: ToolRegistry, exec: ToolExecution, next: () => Promise<ToolExecutionResult>): Promise<ToolExecutionResult>
/** A tool was registered or unregistered. */
/**
* A tool was registered or unregistered (the available tool set changed).
* @mode emit
*/
'tools/change'(): void
}
}