十年匠心定制 · 商业建站与技术教学双线并行 咨询热线:400-886-1026 service@lmnt.cn
ARTICLE DETAIL

资讯详情

深耕网站建设与运营推广的一线实战洞察。

Hello Researcher Agent

Hello Researcher Agent Hello Researcher Agent【免费下载链接】AionUi免费、本地、开源的 24/7 全天候 Cowork 应用以及适用于 Gemini CLI、Claude Code、Codex、OpenCode、Qwen Code、Goose CLI、Auggie 等的 OpenClaw | 喜欢就点star吧项目地址: https://gitcode.com/iOfficeAI/AionUiYou are a research assistant from the Hello World extension.CapabilitiesInformation analysis and summarizationComparative researchData-driven insightsGuidelinesProvide clear, well-structured summariesCite sources when availablePresent multiple perspectives on topics### 1. 身份声明Identity You are a research assistant from the Hello World extension. 是文件的第一条有效指令用于在对话开始时确立角色的身份与归属。注意它同时声明了来自哪个扩展——在 [hello-assistant-context.md](https://link.gitcode.com/i/41caf1193747dfabc3517ab6ad19438b) 中也采用了同样的写法confirm that you are the Hello World Assistant from the Hello World Theme Extension这说明 AionUI 示例约定**上下文文件应以明确、可复述的身份声明开头**方便用户在对话中识别正在与之协作的扩展角色。 ### 2. 能力清单Capabilities 三条能力分别对应研究型 Agent 的典型工作流 - **Information analysis and summarization**信息分析与总结对应信息获取后的结构化输出 - **Comparative research**比较研究对应多方案、多来源的横向对比 - **Data-driven insights**数据驱动的洞察对应基于数据的结论推导。 与同目录的 [hello-coder-context.md](https://link.gitcode.com/i/28d666da5b64d8c71cd58c935dcff446)编码 Agent对比可以看出设计模式的一致性能力清单用动词短语 领域名词的格式描述该 Agent 擅长的任务类型不涉及具体实现细节。 ### 3. 行为准则Guidelines - Provide clear, well-structured summaries提供清晰、结构良好的总结 - Cite sources when available有来源时注明出处 - Present multiple perspectives on topics就主题呈现多个视角 准则部分约束的是输出风格而非任务内容这正是一份高质量 context 文件的关键**身份声明回答我是谁能力清单回答我擅长什么准则回答我应该怎么表现**。三者叠加即可在系统提示层面塑造稳定的角色行为无需依赖任何代码逻辑。 ## 三、contextFile 如何被系统消费agents.json 贡献清单 上下文文件本身只是 Markdown 文本真正让它生效的是扩展清单中的 contributes.agents 声明。Hello World Extension 的 [contributes/agents.json](https://link.gitcode.com/i/5c806db3661260c1135099df2301dddf) 完整注册了两个 Agent json [ { id: hello-coder, name: Hello Coder, description: A coding agent that helps with code generation and review, presetAgentType: hello-stdio-agent, contextFile: agents/hello-coder-context.md, models: [demo-model], enabledSkills: [hello-quick-summary], prompts: [You are a coding agent. Help users write clean, efficient code.] }, { id: hello-researcher, name: Hello Researcher, description: A research agent similar to leis/openfang style agents, presetAgentType: hello-http-agent, contextFile: agents/hello-researcher-context.md, models: [http-model], prompts: [You are a research assistant. Help users analyze and summarize information.] } ]各字段的含义与作用如下字段取值Researcher 示例作用idhello-researcherAgent 唯一标识加载后会被加前缀e2e 测试中实际断言的是ext-hello-researchernameHello Researcher面向用户的展示名称descriptionA research agent similar to leis/openfang style agents一句话描述用于列表展示与模型选型参考presetAgentTypehello-http-agent绑定到contributes/acp-adapters.json中声明的 ACP 适配器 ID决定该 Agent 运行的执行引擎contextFileagents/hello-researcher-context.md指向上下文文件的相对路径相对扩展根目录即本文讨论的文件models[http-model]允许使用的模型 ID 白名单来自对应 ACP 适配器声明的模型enabledSkillsResearcher 未启用默认启用的技能 ID 列表参见下方 Skills 一节prompts[You are a research assistant. ...]额外的系统提示词与 contextFile 内容共同组成注入给模型的系统指令注意两点实现细节contextFile与prompts是并存的上下文文件提供结构化、可维护的长文本角色设定、准则prompts数组提供短促的补充指令。二者共同进入对话的系统提示这与 assistantTypes.ts 中prompts: string[]与context?: string并存的模型完全对应。上下文文件与 Assistant 的 context 字段同源在 assistantTypes.ts 的Assistant接口中context与context_i18n定义了助手级上下文支持多语言扩展 Agent 的 contextFile 是这一机制的声明式变体。四、presetAgentType上下文文件背后的执行引擎hello-researcher的presetAgentType是hello-http-agent它引用的正是 contributes/acp-adapters.json 中声明的 HTTP 传输 ACP 适配器{ id: hello-http-agent, name: Hello HTTP Agent, description: A demo ACP adapter using HTTP transport, connectionType: http, endpoint: http://localhost:8080/acp, supportsStreaming: false, icon: assets/sunset-glow-cover.svg, models: [http-model], apiKeyFields: [ { key: HELLO_API_KEY, label: API Key, type: password, required: true } ] }而hello-coder绑定的是 stdio 传输的hello-stdio-agent通过cliCommand/acpArgs启动本地 CLI并带healthCheck.versionCommand做健康探测。这说明Researcher 与 Coder 的差异不仅体现在 context 内容上还体现在底层传输方式上HTTP 适配器面向远程 ACP 服务配置endpoint与 API Key 字段stdio 适配器面向本地 CLI 进程。这种上下文文件决定行为、适配器决定运行方式的解耦从 detectedAgent.ts 的 kind 设计可见一斑acp类型的 DetectedAgent 携带cli_path、acpArgs、isExtension、extensionName、custom_agent_id等字段detectedAgent.ts其中custom_agent_id的注释明确写出其形态为ext:name:adapterId——这正是扩展 Agent 在系统中的最终身份标识。五、与 Assistants、Skills 的关系Agent 不是孤岛1. 技能SkillsenabledSkills字段把 Agent 与技能绑定。Hello World Extension 在 contributes/skills.json 中声明了两个技能hello-quick-summary生成带要点列表的项目摘要规则定义在 skills/quick-summary.mdhello-issue-breakdown把用户问题拆解为可复现步骤规则定义在 skills/issue-breakdown.md。hello-coder通过enabledSkills: [hello-quick-summary]默认启用摘要技能而hello-researcher未启用任何技能——一个研究型 Agent 可以不绑定技能把全部行为约束收敛在 context 文件与 prompts 中。这为扩展作者提供了灵活度技能是可选增强context 文件才是角色塑造的主干。2. 助手Assistants扩展还可以通过 contributes/assistants.json 贡献预设助手其结构与 Agent 类似同样有presetAgentType与contextFile但定位不同助手Assistant是面向对话使用者的完整预设而 Agent 更贴近执行引擎模板。在 assistantTypes.ts 中AssistantAgentSource枚举包含internal | builtin | extension | custom扩展贡献的助手即属于extension来源。六、扩展清单、权限与生命周期让 Researcher Agent 真正跑起来Hello Researcher 所在的 Hello World Extension 由根清单 aion-extension.json 组织其中与 Agent 运行相关的关键声明包括permissions: { storage: true, network: false, shell: false, filesystem: extension-only, events: true }, lifecycle: { onActivate: scripts/activate.js, onDeactivate: scripts/deactivate.js }权限声明network: false、shell: false表示该扩展默认不发起网络请求、不执行 Shell 命令仅开放storage与events。e2e 测试 ext-permissions.e2e.ts 通过extensions.get-permissions桥接接口逐项断言了hello-world的权限摘要与风险等级shell被标记为dangerous且granted: false未声明权限的扩展则回退到仅events的默认安全摘要同文件 L41-L53。生命周期钩子scripts/activate.js 导出一个onActivate(context)函数接收extensionName、extensionDir、version等上下文在扩展启用时打点记录对应的deactivate.js负责停用清理。七、e2e 验证Researcher Agent 如何被确认真实加载仓库的 e2e 测试是理解扩展 Agent 机制的最直接证据。ext-capabilities.e2e.ts 断言扩展快照中agents的 ID 列表包含ext-hello-coder与ext-hello-researcherconst agentIds snapshot.agents.map((item) item.id); expect(agentIds).toEqual(expect.arrayContaining([ext-hello-coder, ext-hello-researcher]));【免费下载链接】AionUi免费、本地、开源的 24/7 全天候 Cowork 应用以及适用于 Gemini CLI、Claude Code、Codex、OpenCode、Qwen Code、Goose CLI、Auggie 等的 OpenClaw | 喜欢就点star吧项目地址: https://gitcode.com/iOfficeAI/AionUi创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
返回列表