ui-context
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePrimary Query
核心查询
Use this function to capture active UI state:
sql
SELECT get_ui_context_json();Capture once per user question, then reuse that snapshot while answering.
Capture again only when the user asks to refresh/re-check, or when a new UI-referential question starts.
使用此函数捕获活跃UI状态:
sql
SELECT get_ui_context_json();每个用户问题捕获一次,在回答过程中复用该快照。仅当用户要求刷新/重新检查,或新的UI相关问题开始时,才重新捕获。
Trigger Patterns
触发场景
Use this skill for prompts like:
- "what am I looking at?"
- "what is on the screen?"
- "what's selected?"
- "look at what I'm doing"
- references such as "this", "here", "current", "selected", "that", "previous"
当遇到以下类型的提示时使用此技能:
- "我现在看的是什么?"
- "屏幕上显示的是什么?"
- "选中的内容是什么?"
- "看看我正在操作的内容"
- 指代性词汇如"这个"、"这里"、"当前"、"选中的"、"那个"、"之前的"
Capture Policy
捕获规则
- Call before answering UI-referential prompts.
get_ui_context_json() - Extract view info: widget type/title and custom-view state.
- Extract selection info when present: begin/end and preview text lines.
- Extract code anchor info when present: address, function, segment.
- If , explain limits and do not invent code context.
has_address: false
- 在回答UI相关提示前调用。
get_ui_context_json() - 提取视图信息:组件类型/标题和自定义视图状态。
- 若存在选中内容,提取选中范围和预览文本行。
- 若存在代码锚点信息,提取地址、函数、段。
- 若,说明限制条件,不得编造代码上下文。
has_address: false
Temporal Reference Rules
时间参考规则
- /
this/here/current: capture a fresh snapshot for this question.selected - /
that/previous: reuse the most recent snapshot in the same working flow.earlier - If the user says "refresh", capture a new snapshot immediately.
- /
this/here/current:为此问题捕获新的快照。selected - /
that/previous:复用同一工作流中最近的快照。earlier - 若用户说"refresh",立即捕获新快照。
Runtime Availability and Fallback
运行时可用性与降级方案
- is plugin GUI runtime only.
get_ui_context_json() - It is unavailable in idalib/CLI mode.
- When unavailable, state this clearly and continue with non-UI queries (explicit addresses/symbols, or DB-orientation queries).
welcome- 仅在插件GUI运行时可用。
get_ui_context_json() - 在idalib/CLI模式下不可用。
- 当不可用时,明确告知用户,并继续处理非UI查询(如明确地址/符号查询,或数据库导向查询)。
welcomeResponse Template
响应模板
Use this fixed shape after reading UI context:
- : widget/view summary.
What You Are Viewing - : selection range and preview (or "no active selection").
What Is Selected - : address/function/segment if available; otherwise mention non-address view.
Code Context - : runtime constraints or missing fields affecting certainty.
Limits - : one concrete follow-up command/query.
Suggested Next Query
读取UI上下文后,使用以下固定格式:
- :组件/视图摘要。
当前视图 - :选中范围和预览(或"无活跃选中内容")。
选中内容 - :若可用则显示地址/函数/段;否则说明当前视图无地址信息。
代码上下文 - :影响判断的运行时约束或缺失字段。
限制条件 - :一个具体的后续命令/查询。
建议后续查询
Examples
示例
1) "What am I looking at?"
1) "我现在看的是什么?"
sql
SELECT get_ui_context_json();Answer with the template fields above. Include focused widget title/type and current anchor address if present.
sql
SELECT get_ui_context_json();使用上述模板字段回答。包含聚焦组件的标题/类型,以及当前锚点地址(若存在)。
2) "Look at what I'm doing"
2) "看看我正在操作的内容"
sql
SELECT get_ui_context_json();Summarize active view and selection first, then propose the next action tied to that context (for example, decompile current function).
sql
SELECT get_ui_context_json();先总结活跃视图和选中内容,然后结合该上下文提出下一步操作建议(例如反编译当前函数)。
3) "What's selected right now?"
3) "现在选中的内容是什么?"
sql
SELECT get_ui_context_json();Prioritize selection begin/end and preview text. Explicitly state when there is no active selection.
sql
SELECT get_ui_context_json();优先展示选中范围和预览文本。明确说明是否存在活跃选中内容。
4) "Explain this function"
4) "解释这个函数"
- Capture UI context.
- If function/address context exists, pivot to decompiler.
sql
SELECT get_ui_context_json();
SELECT decompile(0x401000);Replace with the captured function/address anchor.
0x401000- 捕获UI上下文。
- 若存在函数/地址上下文,切换至反编译工具。
sql
SELECT get_ui_context_json();
SELECT decompile(0x401000);将替换为捕获到的函数/地址锚点。
0x4010005) Follow-up: "What about that function?"
5) 后续问题:"那个函数怎么样?"
Reuse the most recent snapshot from the same flow (do not auto-refresh unless asked), then continue analysis from that stored anchor.
复用同一工作流中最近的快照(除非用户要求,否则不自动刷新),然后基于存储的锚点继续分析。
6) Non-address view (for example Local Types chooser)
6) 非地址视图(例如本地类型选择器)
sql
SELECT get_ui_context_json();If , report chooser selection details and state there is no code address anchor in this view.
has_address: falsesql
SELECT get_ui_context_json();若,报告选择器的选中详情,并说明此视图中无代码地址锚点。
has_address: false7) Plugin API unavailable (CLI/idalib)
7) 插件API不可用(CLI/idalib)
If cannot run:
get_ui_context_json()- state that UI context is unavailable in this runtime
- ask for explicit symbol/address or continue with non-UI alternatives (for example for DB orientation)
SELECT * FROM welcome
若无法运行:
get_ui_context_json()- 说明此运行时环境下无法获取UI上下文
- 请求用户提供明确的符号/地址,或继续处理非UI替代查询(例如使用获取数据库导向信息)
SELECT * FROM welcome
Guardrails
约束规则
- Do not treat output as UI context.
welcome - Do not fabricate selection/address fields when absent.
- Do not recapture repeatedly in one answer unless user asks for refresh.
- 不得将的输出视为UI上下文。
welcome - 当不存在选中内容/地址字段时,不得编造相关信息。
- 除非用户要求刷新,否则在一次回答中不得重复捕获。