Documentation
¶
Overview ¶
Package plan 提供 Plan Mode(计划模式)软引导 + 审批退出。
对齐上游:packages/core/plan-mode
设计要点:
- plan:policy 是一个 Prompt Section(order 500),仅在 plan mode 开启时注入 system prompt;
- 进入 plan mode 写入 plan/mode(on) 事件;下一轮请求时 plan:policy section 注入成功;
- exit_plan_mode 工具触发 UserQuestion 审批(走 M14 UQ 接缝);
- 审批通过 → 移除 plan:policy section(下轮请求不出现)+ 写 plan/mode(off);
- 审批拒绝 → plan:policy section 仍保留(继续计划模式)。
Index ¶
Constants ¶
View Source
const PlanPolicySectionName = "plan_policy"
PlanPolicySectionName 是 plan:policy section 的名字。
Variables ¶
This section is empty.
Functions ¶
func Enter ¶
func Enter(sl *session.SessionLog, sys *sysprompt.Assembler) error
Enter 进入 plan mode:写 plan/mode(on) 事件,并注入 plan:policy section。
Types ¶
type ExitPlanModeResult ¶
type ExitPlanModeResult struct {
// Approved 审批是否通过。
Approved bool
// Exited 是否实际退出(通过才退出)。
Exited bool
}
ExitPlanModeResult 是 exit_plan_mode 审批的结果。
type ExitPlanModeTool ¶
type ExitPlanModeTool struct {
// contains filtered or unexported fields
}
ExitPlanModeTool 是 exit_plan_mode 工具:UserQuestion 审批通过才移除 plan:policy。
func NewExitPlanModeTool ¶
func NewExitPlanModeTool(sl *session.SessionLog, sys *sysprompt.Assembler) *ExitPlanModeTool
NewExitPlanModeTool 创建 exit_plan_mode 工具。
func (*ExitPlanModeTool) Description ¶
func (t *ExitPlanModeTool) Description() string
Description 返回工具描述。
Click to show internal directories.
Click to hide internal directories.