✨ feat(vscode): 会话交接改走阿里云 OSS 收件箱、换 xz 压缩,另加从 env 文件配置移交存储的 URI
- 会话包传到 OSS 上收件人的收件箱 spx-handoff/<owner>/<repo>/session/<收件人>/<sid>!<发送人>!<会话名>.tar.xz,对象私有;owner/repo/收件人转小写 - 待接收列表就是列自己的收件箱;同一会话再交给同一人先删旧包;接收后删包,包已被别处收走时提示并刷新 - 打包换成 xz 1 级,和工单移交共用 packHandoff / unpackHandoff,删掉 gzip 版 - 删掉邮箱工单整套(mailboxIssue、MAILBOX_*、isMailboxIssue 及看板 / webhook 里的过滤、附件名编解码)和不再用的 Gitea 附件、标签、建工单接口 - session-handoff/accept 与待接收项改用 OSS 对象 key 标识 - 没配移交存储时发送、接收、刷新都提示去配,刷新回空列表 - 进度提示照工单移交:同一条提示依次显示打包、上传、下载多少 MB、解包、装会话 - 新增 URI configure-handoff-store?envFile=<绝对路径>:读 OSS_ENDPOINT / OSS_BUCKET_NAME / OSS_ACCESS_KEY / OSS_SECRET_KEY 保存,和命令共用 saveHandoffStore;URI 入口按 path 统一分发,未知 path 报错
This commit is contained in:
1 parent
81fe14f6dc
commit
fcee4143d4
26 files changed
+542
-515
No files matched your search
@@ -91,7 +91,7 @@ export interface BottomTabsProps {
|
||||
onImportNamedSession: (sessionId: string, name: string) => void
|
||||
pendingHandoffs: SessionHandoffPendingItem[]
|
||||
onSessionHandoff: (sessionId: string) => void
|
||||
onAcceptSessionHandoff: (attachmentId: number) => void
|
||||
onAcceptSessionHandoff: (key: string) => void
|
||||
}
|
||||
|
||||
export function BottomTabs(props: BottomTabsProps) {
|
||||
|
||||
@@ -29,7 +29,7 @@ interface ManagedSessionsPanelProps {
|
||||
onImport: (sessionId: string, name: string) => void
|
||||
pendingHandoffs: SessionHandoffPendingItem[]
|
||||
onHandoff: (sessionId: string) => void
|
||||
onAcceptHandoff: (attachmentId: number) => void
|
||||
onAcceptHandoff: (key: string) => void
|
||||
}
|
||||
|
||||
function basename(p?: string): string {
|
||||
@@ -254,7 +254,7 @@ export function ManagedSessionsPanel({
|
||||
<div className="mb-1 text-[10px] text-[var(--vscode-descriptionForeground)]">待接收</div>
|
||||
<ul className="flex flex-col gap-1">
|
||||
{pendingHandoffs.map(p => (
|
||||
<li key={p.attachmentId} className="flex items-center gap-2">
|
||||
<li key={p.key} className="flex items-center gap-2">
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="truncate text-xs">{p.name || p.sid.slice(0, 8)}</div>
|
||||
<div className="truncate text-[10px] text-[var(--vscode-descriptionForeground)]">
|
||||
@@ -265,7 +265,7 @@ export function ManagedSessionsPanel({
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => onAcceptHandoff(p.attachmentId)}
|
||||
onClick={() => onAcceptHandoff(p.key)}
|
||||
className="shrink-0 rounded bg-[var(--vscode-button-background)] px-2 py-1 text-xs text-[var(--vscode-button-foreground)] hover:bg-[var(--vscode-button-hoverBackground)]"
|
||||
>
|
||||
接收
|
||||
|
||||
@@ -34,7 +34,7 @@ export interface UseManagedSessionsResult {
|
||||
sessionHandoffUsers: string[] | null
|
||||
startSessionHandoff: (sessionId: string) => void
|
||||
submitSessionHandoff: (sessionId: string, to: string) => void
|
||||
acceptSessionHandoff: (attachmentId: number) => void
|
||||
acceptSessionHandoff: (key: string) => void
|
||||
refreshSessionHandoffs: () => void
|
||||
}
|
||||
|
||||
@@ -102,8 +102,8 @@ export function useManagedSessions(): UseManagedSessionsResult {
|
||||
postMessage({ type: 'session-handoff/start', sessionId, to })
|
||||
}, [])
|
||||
|
||||
const acceptSessionHandoff = useCallback((attachmentId: number): void => {
|
||||
postMessage({ type: 'session-handoff/accept', attachmentId })
|
||||
const acceptSessionHandoff = useCallback((key: string): void => {
|
||||
postMessage({ type: 'session-handoff/accept', key })
|
||||
}, [])
|
||||
|
||||
const refreshSessionHandoffs = useCallback((): void => {
|
||||
|
||||
@@ -52,11 +52,11 @@ export interface IssueChatComment {
|
||||
systemText?: string
|
||||
}
|
||||
|
||||
/** 我收件箱里一份待接收的会话包,`key` 是它在移交存储上的对象 key。 */
|
||||
export interface SessionHandoffPendingItem {
|
||||
attachmentId: number
|
||||
key: string
|
||||
sid: string
|
||||
from: string
|
||||
to: string
|
||||
name: string
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ export type WebviewToExtension
|
||||
| { type: 'handoff/request-reject', issueNumber: number }
|
||||
| { type: 'session-handoff/users' }
|
||||
| { type: 'session-handoff/start', sessionId: string, to: string }
|
||||
| { type: 'session-handoff/accept', attachmentId: number }
|
||||
| { type: 'session-handoff/accept', key: string }
|
||||
| { type: 'session-handoff/refresh' }
|
||||
| { type: 'dependency/set', issueNumber: number, prerequisiteNumber: number }
|
||||
| { type: 'dependency/clear', issueNumber: number, prerequisiteNumber: number }
|
||||
|
||||
Reference in new issue
Block a user