first commit

This commit is contained in:
2026-04-09 21:35:06 +08:00
commit 22fe6e069c
38 changed files with 12631 additions and 0 deletions

28
src/renderer/http/url.js Normal file
View File

@@ -0,0 +1,28 @@
// OpenCode 服务地址由主进程动态分配端口,通过 getBaseUrl() 获取
export function getBaseUrl() {
return window.__opencodeBaseUrl || 'http://127.0.0.1:4096'
}
const url = {
// 健康检查
health: '/global/health',
// 会话
session: {
create: '/session',
detail: (id) => `/session/${id}`,
list: '/session',
delete: (id) => `/session/${id}`,
},
// 消息
message: {
send: (sessionId) => `/session/${sessionId}/message`,
list: (sessionId) => `/session/${sessionId}/message`,
},
// SSE 事件流
event: '/event',
}
export default url