yumoqing a243a16941 feat(secret): 敏感信息库前端接入——AgentIO钥匙图标+选择窗数据源(2026-09-17)
- agent_config.py: GENERAL_TOOLS += 6 个 ToolDefinition(category=secret,
  required 显式声明防 native FC 把可选参数标必填逼 LLM 编值)。
- wwwroot/api/secret_options.dspy: AgentIO 选择窗数据源。身份取自 get_user()/
  get_userorgid(),**不接受前端传 user_id/org_id**(否则改参数即可枚举他人凭据名称);
  双保险剔除 encrypted_value/fingerprint;未登录返 success:false(区分没登录与没数据)。
  RBAC 已被 rp.json 的 /pipeline_core/**(logined) 覆盖,无需额外注册。
- 3 个 .ui 的 AgentIO options 注入 secret_dataurl/secret_format/secret_title/
  secret_tip(共4处,含 agent/index.ui 动态建 tab 的 script 字符串)。
  未传 secret_dataurl 时钥匙图标不渲染 → 其他宿主应用零影响。

bricks 侧配套(UiText.insertAtCursor / AgentInput 弹窗 / AgentIO 透传)在 bricks 仓库。
2026-09-17 15:45:17 +08:00

70 lines
4.1 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"widgettype": "VBox",
"options": {"width": "100%", "height": "100%", "padding": "0"},
"subwidgets": [
{
"widgettype": "HBox",
"options": {"width": "100%", "alignItems": "center", "padding": "16px 24px 8px 24px", "cheight": 6, "gap": "12px"},
"subwidgets": [
{"widgettype": "Title2", "options": {"text": "智能助手"}},
{"widgettype": "Text", "options": {"text": "通用 AI 对话能力", "cfontsize": 0.9, "color": "#94a3b8"}},
{"widgettype": "Filler"},
{
"widgettype": "Button",
"id": "new_session_btn",
"options": {"label": " 新建会话", "css": "small"},
"binds": [{
"wid": "self",
"event": "click",
"actiontype": "script",
"target": "self",
"script": "var tp=bricks.getWidgetById('session_tabs',bricks.app);if(!tp)return;var sid='s'+Date.now()+'_'+Math.floor(Math.random()*100000);var n=tp.opts.items.length+1;tp.open_tab({name:'session_'+sid,label:'会话 '+n,removable:true,content:{widgettype:'VBox',options:{css:'filler',width:'100%',height:'100%'},subwidgets:[{widgettype:'urlwidget',options:{url:'/pipeline_core/api/agent_menus.dspy?session_id='+sid+'&pipeline_id=sdlc_general',method:'GET'}},{widgettype:'AgentIO',options:{css:'filler',margin:'0 24px 24px 24px',url:'/pipeline_core/api/agent_chat.dspy?session_id='+sid+'&pipeline_id=sdlc_general',model_dataurl:'/pipeline_core/api/agent_model_options.dspy?session_id='+sid+'&pipeline_id=sdlc_general',model_cwidth:14,placeholder:'输入你的需求...',secret_dataurl:'/pipeline_core/api/secret_options.dspy',secret_format:'@@sec:{name}@@',secret_title:'选择敏感信息',secret_tip:'插入敏感信息'}}]}});"
}]
}
]
},
{
"widgettype": "TabPanel",
"id": "session_tabs",
"options": {
"css": "filler",
"width": "100%",
"height": "100%",
"tab_pos": "top",
"items": [
{
"name": "session_default",
"label": "会话 1",
"removable": false,
"content": {
"widgettype": "VBox",
"options": {"css": "filler", "width": "100%", "height": "100%"},
"subwidgets": [
{
"widgettype": "urlwidget",
"options": {"url": "{{entire_url('/pipeline_core/api/agent_menus.dspy')}}?session_id=default_sdlc_general&pipeline_id=sdlc_general", "method": "GET"}
},
{
"widgettype": "AgentIO",
"options": {
"css": "filler",
"margin": "0 24px 24px 24px",
"url": "/pipeline_core/api/agent_chat.dspy?session_id=default_sdlc_general&pipeline_id=sdlc_general",
"model_dataurl": "/pipeline_core/api/agent_model_options.dspy?session_id=default_sdlc_general&pipeline_id=sdlc_general",
"model_cwidth": 14,
"placeholder": "输入你的需求...",
"secret_dataurl": "/pipeline_core/api/secret_options.dspy",
"secret_format": "@@sec:{name}@@",
"secret_title": "选择敏感信息",
"secret_tip": "插入敏感信息"
}
}
]
}
}
]
}
}
]
}