照测试会话那条链路补一份 prototype:
- 消息与路由:session/start-prototype、session/resume-prototype、
issue/update-prototype-profile-path,都进只读门禁
- 会话:handleStartPrototypeSession / handleResumePrototypeSession,
终端名 issue-N-原型;cwd 有 worktree 用 worktree、没有退主仓库根
(原 resolveTestSessionCwd 改名 resolveWorktreeOrRootCwd 两种会话共用)
- 不要求有 PR,任何阶段都能起;前置工单锁仍然拦
- 提示词:新增 prompts/prototype.md,设置里可改,占位符 {issueNumber}
- profile:工单级 prototypeProfilePath > 设置里的原型默认 profile >
内置默认,与其它会话互不回退
- 状态字段 prototypeSessionId / prototypeProfilePath / prototypeTabOpen
贯通 gitea、youtrack、本机 state 与移交包
- 详情面板加「原型会话id」「原型配置文件」两行,设置面板加对应两项
Claude-Session: https://claude.ai/code/session_01Kgmb1LvrPmFX3NoUDB4zZC
47 lines
1.6 KiB
TypeScript
47 lines
1.6 KiB
TypeScript
/**
|
|
* 同事工单的写操作门禁:看板范围切到「团队全部」后,别人的卡也在板上,
|
|
* 前端会把按钮藏掉,但 webview 消息仍可能因为竞态(卡刚被重新指派、
|
|
* 快照过期)送到扩展侧,所以这里做最终拦截——归属不是我就直接丢掉。
|
|
*
|
|
* 只拦「会改工单状态或在本机替别人跑会话」的消息。看 PR 改动、勾已查看、
|
|
* 生成文件摘要属于审查动作,落地在本机,照常放行。
|
|
*/
|
|
|
|
/** 必须是工单归属人才能执行的消息类型。 */
|
|
export const OWNER_ONLY_MESSAGE_TYPES: ReadonlySet<string> = new Set([
|
|
// 会话:在本机替别人开/恢复/关闭会话没有意义,worktree 也不在本机
|
|
'session/resume',
|
|
'session/focus',
|
|
'session/resume-review',
|
|
'session/resume-test',
|
|
'session/resume-prototype',
|
|
'session/start-review',
|
|
'session/start-test',
|
|
'session/start-prototype',
|
|
'session/close-tab',
|
|
'brainstorm/continue',
|
|
'issue/implement',
|
|
// 工单状态:写回 Gitea
|
|
'column/change',
|
|
'issue/delete',
|
|
'issue/close',
|
|
'issue/generate-pr-diff-summary',
|
|
'issue/update-auto-review',
|
|
'issue/update-profile-path',
|
|
'issue/update-brainstorm-profile-path',
|
|
'issue/clear-brainstorm-session',
|
|
'issue/update-test-profile-path',
|
|
'issue/update-prototype-profile-path',
|
|
'dependency/set',
|
|
'dependency/clear',
|
|
'handoff/users',
|
|
'handoff/start',
|
|
// 分支与 worktree
|
|
'git/merge-preview',
|
|
'worktree/delete',
|
|
])
|
|
|
|
export function isOwnerOnlyMessage(type: string): boolean {
|
|
return OWNER_ONLY_MESSAGE_TYPES.has(type)
|
|
}
|