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/05-frontend-api)<a href="https://agentmods.dev/rules/loonghao/auroraview/05-frontend-api"><img src="https://agentmods.dev/badge/rules/loonghao/auroraview/05-frontend-api/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/05-frontend-api"><img src="https://agentmods.dev/badge/rules/loonghao/auroraview/05-frontend-api.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.00717 | $0.00717 |
| Opus 5.5 | $0.00287 | $0.00287 |
| Sonnet 5.5 | $0.00143 | $0.00143 |
| Haiku 4.5 | $0.00072 | $0.00072 |
Grade A, and why
05-frontend-api 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 1mo 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.
What it actually says
前端命名空间(window.auroraview)
- 全局唯一入口:
window.auroraview - 核心能力:
auroraview.call(method: string, params?: any): Promise<any>method为字符串命名空间,如:"api.export_scene"、"tool.apply"params支持:对象(当作 kwargs)、数组(当作位置参数)、单值(单一位置参数)- 正常返回:Promise resolve 为 Python 返回的 JSON 兼容值
- 异常:Promise reject,错误对象包含
name/message/ 可选code/data
auroraview.on(event: string, handler: (payload: any) => void): () => void- 订阅后端推送事件,返回取消订阅函数
auroraview.off(event: string, handler: (payload: any) => void): void
- pywebview 风格语法糖:
auroraview.api- 通过 JS Proxy 映射:
auroraview.api.foo(...args)→auroraview.call("api.foo", args) - 主要服务于 PyWebView 用户迁移场景
- 通过 JS Proxy 映射:
- 预留字段:
auroraview.platform?: string(如"standalone"、"maya2025-pyside6")auroraview.token?: string(CSRF/session token,对齐 pywebview)
- Ready 事件:
- 注入完成后触发
window级事件"auroraviewready" - 前端可在该事件中安全使用
auroraview.call/on/api
- 注入完成后触发
auroraview.call 请求/响应协议(目标结构)
-
JS → 后端(Rust/Python)消息:
type: "call"id: string唯一ID(例如自增序号 + 时间戳),用于在回包中对应 Promisemethod: string方法名(如"api.echo"、"tool.apply")params: any参数(对象/数组/单值,遵循上文的调用规则)
-
后端 → JS 回包消息:
type: "call_result"id: string必须与请求中id完全一致ok: bool调用是否成功- 成功时:
result: any为返回值(JSON 兼容类型) - 失败时:
error: { name: string; message: string; code?: string | int; data?: any }
-
JS 侧 Promise 语义:
- 发起调用时,JS 为
id建立一个 pending Promise - 收到
call_result:ok == true→resolve(result)ok == false→reject(error)
- 如果超时或底层报错,可在 JS 层构造
error并reject
- 发起调用时,JS 为
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.
- 1mo ago First seen · 48 lines · 717 tokens per session scan A 1a2d24a7093b
05-frontend-api is a cursor rule published in the GitHub repository loonghao/auroraview (47 stars, last pushed 18d ago), licensed MIT. It adds 717 tokens to every session, about $0.0029 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.
Other cursor rules, from other repositories
api-property-optionality-hygiene
Fix ApiProperty/ApiPropertyOptional optionality mismatches in DTO files; use for scheduled batch fixes or DTO edits.
python
Python best practices and patterns for modern software development with Flask and SQLite.
cursor
You are working on the checkout service. Preserve transaction integrity and auditability.
django
Definitive guidelines for writing maintainable, performant, and secure Django applications, emphasizing modern best practices, clear code organization, and efficient patterns.
shared-libraries
Shared libraries - condition framework, inventory containers, file-backed DB, itinerary, references.
selectools-providers
Rules for working with LLM provider adapters in selectools.