Merge branch 'feat/ownergate-owner-lane-gate-plus-conversat' into dev
This commit is contained in:
commit
20051f0168
14 files changed
+1049
-30
No files matched your search
@@ -108,6 +108,12 @@ func (a *app) wireChannels() error {
|
||||
// 入站附件的目录口径与文档摄取层(wire_runtime.go 的 docResolver)同源,
|
||||
// 两处必须指向同一棵目录树,否则附件会落在一个地方、抽取去另一个地方找。
|
||||
docDataDir := resolveDataDir(a.cfg)
|
||||
// owner 车道结构化旋钮(design/18 §11「乙 = C」)的落盘面:主人在群里说「少说点」
|
||||
// 这类诉求被写成 $DATA_DIR/config/owner_lane.json(可读可改,面板后续照此写入)。
|
||||
// 它只承载「说不说 / 多频繁」,不承载任何身份/权限信息。
|
||||
ownerLane := runtimeconfig.NewOwnerLaneStore(
|
||||
runtimeconfig.DefaultOwnerLanePath(docDataDir),
|
||||
logger.WithSource(a.log, "services/channelbridge/ownerlane"))
|
||||
bridge, berr := channelbridge.New(channelbridge.Options{
|
||||
Log: logger.WithSource(a.log, "services/channelbridge"),
|
||||
Loop: a.loop,
|
||||
@@ -145,6 +151,23 @@ func (a *app) wireChannels() error {
|
||||
PersonaPrompt: a.defaultInstructions(),
|
||||
Engage: channelbridge.DefaultEngageConfig(),
|
||||
// EngageFor 留空(P2a);按群覆盖随 P2c 到来。
|
||||
// OwnerLaneFor / OwnerLaneSet 是 owner 车道结构化旋钮(design/18 §11「乙 = C」)
|
||||
// 的读取/落盘接缝:读接口按 (platform, groupID) 返回该群生效策略(缺省 = 不对她说
|
||||
// 就不开口),写接口把「少说点」这类结构化诉求落进 owner_lane.json,也是面板后续
|
||||
// 写入的那一份。它只影响说不说/多频繁,绝不触碰权限与 actor 元数据。
|
||||
OwnerLaneFor: func(platform, groupID string) *channelbridge.OwnerLanePolicy {
|
||||
p := ownerLane.PolicyFor(platform, groupID)
|
||||
return &channelbridge.OwnerLanePolicy{
|
||||
ReplyToUnaddressed: p.ReplyToUnaddressed,
|
||||
MinReplyGapSec: p.MinReplyGapSec,
|
||||
}
|
||||
},
|
||||
OwnerLaneSet: func(platform, groupID string, p channelbridge.OwnerLanePolicy) error {
|
||||
return ownerLane.Set(platform, groupID, runtimeconfig.OwnerLanePolicy{
|
||||
ReplyToUnaddressed: p.ReplyToUnaddressed,
|
||||
MinReplyGapSec: p.MinReplyGapSec,
|
||||
})
|
||||
},
|
||||
// Factory 让面板保存时热替换某平台的适配器而无需重启(design/04 §3.1)。
|
||||
Factory: factory,
|
||||
// Channels 让热重载把新适配器写回能力注册表:管理面板(渠道卡片、账号在线
|
||||
|
||||
Reference in new issue
Block a user