Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/loonghao/auroraviewWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/loonghao/auroraview/07-event-system)<a href="https://agentmods.dev/rules/loonghao/auroraview/07-event-system"><img src="https://agentmods.dev/badge/rules/loonghao/auroraview/07-event-system/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/loonghao/auroraview/07-event-system"><img src="https://agentmods.dev/badge/rules/loonghao/auroraview/07-event-system.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00787 | $0.00787 |
| Opus 5.5 | $0.00315 | $0.00315 |
| Sonnet 5.5 | $0.00157 | $0.00157 |
| Haiku 4.5 | $0.00079 | $0.00079 |
Grade A, and why
07-event-system scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 77 lines — stays where its author put it; the contents beside it link to each section on GitHub.
事件分发机制(Python → JavaScript)
关键设计决策(2025-01):统一使用 window.auroraview.trigger() 进行事件分发
-
Rust 层实现:
- 所有
WebViewMessage::EmitEvent处理统一使用window.auroraview.trigger(event, data) - 替代原有的
window.dispatchEvent(new CustomEvent(...)) - 涉及文件:
src/webview/backend/native.rssrc/webview/event_loop.rs(两处)src/webview/webview_inner.rssrc/webview/backend/mod.rssrc/webview/backend/custom.rs
- 所有
-
标准模式:
(function() { if (window.auroraview && window.auroraview.trigger) { window.auroraview.trigger('event_name', data); } else { console.error('[AuroraView] Event bridge not ready, cannot emit event: event_name'); } })(); -
前端接收:
- 使用
window.auroraview.on(event, handler)订阅事件 - 与 Rust 层的
trigger()完全匹配 - 形成完整的事件流:
Python emit()→Rust trigger()→JS on()
- 使用
-
架构优势:
- API 一致性:统一使用 AuroraView 事件系统,不混用浏览器原生 API
- 错误处理:事件桥接未就绪时有明确错误提示
- 可维护性:所有事件分发逻辑集中在
window.auroraview命名空间
最小端到端示例(当前实现)
注意:当前实现中,
auroraview.call()在桥接层还是 fire-and-forget,Promise 会立即 resolve 为undefined; 最推荐的模式是:前端通过auroraview.api.*触发 Python 逻辑,Python 再通过emit向前端推事件。
-
前端(JS):
// 等待 bridge 就绪 window.addEventListener('auroraviewready', () => { // 订阅来自 Python 的 echo 结果 auroraview.on('echo_result', (payload) => { console.log('[AuroraView] echo_result from Python:', payload); }); // 通过 api 调用 Python 方法(fire-and-forget) auroraview.api.echo({ message: 'hello from JS' }); }); -
Python(概念示例,基于 AuroraView 基类):
from auroraview import AuroraView class MyTool(AuroraView): def __init__(self, **kwargs): super().__init__(api=self, **kwargs) # JS 侧调用:auroraview.api.echo({ message: "..." }) def echo(self, message: str) -> None: # 当前实现:通过事件把结果推回前端 self.emit("echo_result", {"message": message})
后续在 call 的 request/response 协议补全后,可以把 echo 设计为真正返回值的函数,
前端直接使用 await auroraview.api.echo("hello") 获取结果。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3mo ago First seen · 77 lines · 787 tokens per session scan A 3344b1d483db
07-event-system is a cursor rule published in the GitHub repository loonghao/auroraview (47 stars, last pushed 2mo ago), licensed MIT. It adds 787 tokens to every session, about $0.0031 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
07-event-system compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| 07-event-systemloonghao/auroraview | Cursor rule | 47 | 2mo ago | MIT | A | 787 | Cursor |
| ponytailDietrichGebert/ponytail | Cursor rule | 204k | 11d ago | MIT | A | 604 | Cursor |
| angular-20angular/angular | Cursor rule | 102k | today | MIT | A | 0 | Cursor |
| dev-standardapache/superset | Cursor rule | 76k | today | Apache-2.0 | A | 1,147 | Cursor |
| prefer-assertions-over-defensive-checksprisma/orm | Cursor rule | 48k | today | Apache-2.0 | A | 0 | Cursor |
| prefer-direct-imports-over-module-mocksprisma/orm | Cursor rule | 48k | today | Apache-2.0 | A | 0 | Cursor |
| shared-plane-packagesprisma/orm | Cursor rule | 48k | today | Apache-2.0 | A | 0 | Cursor |