Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
38fe861bca | ||
|
|
fa9108e2d1 | ||
|
|
5773e74086 |
+27
-21
@@ -7,42 +7,42 @@ import (
|
||||
|
||||
// 智能体画像(4.7):核心定制机制,全部数据化、可导入导出。
|
||||
type AgentProfile struct {
|
||||
ID string `json:"id"`
|
||||
Owner string `json:"owner,omitempty"` // 租户;空 = 共享(builtin)
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Builtin bool `json:"builtin,omitempty"`
|
||||
Source string `json:"source,omitempty"` // builtin | plugin | user
|
||||
SystemPrompt string `json:"systemPrompt"`
|
||||
ID string `json:"id"`
|
||||
Owner string `json:"owner,omitempty"` // 租户;空 = 共享(builtin)
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Builtin bool `json:"builtin,omitempty"`
|
||||
Source string `json:"source,omitempty"` // builtin | plugin | user
|
||||
SystemPrompt string `json:"systemPrompt"`
|
||||
// PromptModules 引用提示词库模块 ID(有序;空 = 组装默认基座全集)。
|
||||
// SystemPrompt 兼容保留:非空时作为附加段追加在模块组装结果之后。
|
||||
PromptModules []string `json:"promptModules,omitempty"`
|
||||
Model ModelRoute `json:"model"`
|
||||
Tools ToolPolicy `json:"tools"`
|
||||
Context ContextPolicy `json:"context"`
|
||||
HITL HITLPolicy `json:"hitl"`
|
||||
Budget RunBudget `json:"budget"`
|
||||
Model ModelRoute `json:"model"`
|
||||
Tools ToolPolicy `json:"tools"`
|
||||
Context ContextPolicy `json:"context"`
|
||||
HITL HITLPolicy `json:"hitl"`
|
||||
Budget RunBudget `json:"budget"`
|
||||
}
|
||||
|
||||
// ModelRoute 按用途选择模型(4.7 kind 路由):空串回落到 chat 默认。
|
||||
type ModelRoute struct {
|
||||
Chat string `json:"chat,omitempty"`
|
||||
Chat string `json:"chat,omitempty"`
|
||||
Lightweight string `json:"lightweight,omitempty"`
|
||||
Embedding string `json:"embedding,omitempty"`
|
||||
Rerank string `json:"rerank,omitempty"`
|
||||
Embedding string `json:"embedding,omitempty"`
|
||||
Rerank string `json:"rerank,omitempty"`
|
||||
}
|
||||
|
||||
// ToolPolicy 三清单:allow/deny 决定可见工具,confirm 强制执行前 HITL 确认。
|
||||
// 匹配语义:精确名或前缀通配("http.*" 表示 http 前缀);deny 优先于 allow。
|
||||
type ToolPolicy struct {
|
||||
Allow []string `json:"allow"` // ["*"] 全部
|
||||
Allow []string `json:"allow"` // ["*"] 全部
|
||||
Deny []string `json:"deny,omitempty"`
|
||||
Confirm []string `json:"confirm,omitempty"`
|
||||
}
|
||||
|
||||
// ContextPolicy(4.10):ctxasm 的输入;逐版本增加策略项不动组装器接口。
|
||||
type ContextPolicy struct {
|
||||
MaxHistoryMessages int `json:"maxHistoryMessages"` // 0 = 默认 40
|
||||
MaxHistoryMessages int `json:"maxHistoryMessages"` // 0 = 默认 40
|
||||
SummarizeBeyond bool `json:"summarizeBeyond,omitempty"` // 远期;先存标志
|
||||
MemoryBudgetPct int `json:"memoryBudgetPct,omitempty"` // 注入槽份额上限
|
||||
KnowledgeBudgetPct int `json:"knowledgeBudgetPct,omitempty"`
|
||||
@@ -105,19 +105,25 @@ const (
|
||||
type SettingEffect string
|
||||
|
||||
const (
|
||||
EffectHot SettingEffect = "hot" // 立即生效
|
||||
EffectNewRun SettingEffect = "new-run" // 仅影响新 run
|
||||
EffectHot SettingEffect = "hot" // 立即生效
|
||||
EffectNewRun SettingEffect = "new-run" // 仅影响新 run
|
||||
EffectRestart SettingEffect = "restart" // 需重启
|
||||
)
|
||||
|
||||
// SettingScope 声明设置项的写入归属(提案 2026-10-13-rdm-settings-members-duties-perms-increment P2)。
|
||||
// 空串 = 默认:user 与 project 层可写(向后兼容既有 schema)。
|
||||
// 空串保留旧个人配置兼容,不表示共享项目策略或系统管理资格。
|
||||
type SettingScope string
|
||||
|
||||
const (
|
||||
// SettingScopeSystem 受管项:仅系统管理面(admin)可写;user/project 写入被拒,
|
||||
// 生效链忽略这两层的存量覆盖值。
|
||||
SettingScopeSystem SettingScope = "system"
|
||||
// SettingScopeUser is a private account preference, never a shared project policy.
|
||||
SettingScopeUser SettingScope = "user"
|
||||
// SettingScopeProject is shared business configuration under project authority.
|
||||
SettingScopeProject SettingScope = "project"
|
||||
// SettingScopeProjectPersonal is a private preference within one project.
|
||||
SettingScopeProjectPersonal SettingScope = "project-personal"
|
||||
)
|
||||
|
||||
// SettingDesc 描述一个设置项;设置页按此渲染并标注生效时机(schema 驱动)。
|
||||
@@ -131,7 +137,7 @@ type SettingDesc struct {
|
||||
Options []string `json:"options,omitempty"` // enum
|
||||
Effect SettingEffect `json:"effect"`
|
||||
Secret bool `json:"secret,omitempty"`
|
||||
Scope SettingScope `json:"scope,omitempty"` // 空 = user/project 可写;system = 受管
|
||||
Scope SettingScope `json:"scope,omitempty"` // Empty is legacy personal compatibility; explicit scopes own their write surface.
|
||||
}
|
||||
|
||||
// ManagedPaths 返回 schema 中 scope=system 的键路径(点路径形式)。
|
||||
|
||||
+2
-2
@@ -269,8 +269,8 @@ export interface SettingDesc {
|
||||
default?: unknown; options?: string[];
|
||||
effect: 'hot' | 'new-run' | 'restart';
|
||||
secret?: boolean;
|
||||
/** P2 受管:system = 系统受管项,仅系统管理面可写(用户/项目层拒绝)。 */
|
||||
scope?: 'system';
|
||||
/** Setting ownership; an omitted scope retains legacy personal compatibility. */
|
||||
scope?: 'system' | 'user' | 'project' | 'project-personal';
|
||||
}
|
||||
|
||||
// ---- 插件 ----
|
||||
|
||||
Reference in New Issue
Block a user