Promote workspace_root from channel-specific (magicform) to agents.defaults so both CLI --workspace/--config-dir and gateway metadata overrides are validated against the same immutable boundary. Paths must be relative subdirectories — absolute paths, .., and empty/dot are rejected. The boundary is snapshotted before overlay merges and cannot be widened by workspace config files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
13 lines
375 B
Go
13 lines
375 B
Go
package magicform
|
|
|
|
import (
|
|
"github.com/sipeed/picoclaw/pkg/bus"
|
|
"github.com/sipeed/picoclaw/pkg/channels"
|
|
"github.com/sipeed/picoclaw/pkg/config"
|
|
)
|
|
|
|
func init() {
|
|
channels.RegisterFactory("magicform", func(cfg *config.Config, b *bus.MessageBus) (channels.Channel, error) {
|
|
return NewMagicFormChannel(cfg.Channels.MagicForm, cfg.Agents.Defaults.WorkspaceRoot, b)
|
|
})
|
|
}
|