Skip to content

Commit 48492bf

Browse files
author
linyuan.yang
committed
profile
1 parent 1122df3 commit 48492bf

15 files changed

Lines changed: 43 additions & 48 deletions

File tree

packages/admin/src/i18n/en.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ export default {
613613
insight_scope: 'Insight',
614614
insight_disabled: 'Disabled',
615615
insight_agent: 'Per Agent',
616-
insight_session: 'Per Session',
616+
insight_profile: 'Per Profile',
617617
insight_hint: 'When enabled, the agent can accumulate and reuse insights across conversations',
618618
insight_extractor: 'Extraction Model',
619619
insight_extractor_placeholder: 'Select a model',
@@ -624,7 +624,7 @@ export default {
624624
error_insight_extractor: 'An extraction model is required when Insight is enabled',
625625
todo_scope: 'Todo',
626626
todo_disabled: 'Disabled',
627-
todo_session: 'Per Session',
627+
todo_profile: 'Per Profile',
628628
todo_hint: 'When enabled, todos are automatically extracted/updated from the conversation each turn. Only the read-only todo_list tool is exposed to the agent.',
629629
todo_extractor: 'Extraction Model',
630630
todo_extractor_placeholder: 'Select a model',

packages/admin/src/i18n/zh.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ export default {
613613
insight_scope: '经验洞察',
614614
insight_disabled: '不启用',
615615
insight_agent: '按智能体隔离',
616-
insight_session: '按会话隔离',
616+
insight_profile: '按 Profile 隔离',
617617
insight_hint: '启用后智能体可在对话中积累经验并复用',
618618
insight_extractor: '提取模型',
619619
insight_extractor_placeholder: '请选择模型',
@@ -624,7 +624,7 @@ export default {
624624
error_insight_extractor: '启用经验洞察时必须选择提取模型',
625625
todo_scope: '待办事项',
626626
todo_disabled: '不启用',
627-
todo_session: '按会话隔离',
627+
todo_profile: '按 Profile 隔离',
628628
todo_hint: '启用后每轮结束自动从对话中抽取/更新待办事项,仅向智能体暴露只读 todo_list 工具',
629629
todo_extractor: '提取模型',
630630
todo_extractor_placeholder: '请选择模型',

packages/admin/src/layouts/Layout.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ async function init() {
207207
apiFetch('/api/mcp'),
208208
apiFetch('/api/skills'),
209209
apiFetch('/api/about'),
210-
apiFetch('/api/sessions'),
210+
apiFetch('/api/profiles'),
211211
])
212212
Object.assign(store.settings, settingsRes.data)
213213
// Convert sessions array to Record<id, SessionConfig>

packages/admin/src/views/agents/modals/AgentModal.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ defineExpose({ open })
386386
<SSelect v-model="form.insightScope">
387387
<option :value="InsightScope.Disabled">{{ t('agents.insight_disabled') }}</option>
388388
<option :value="InsightScope.Agent">{{ t('agents.insight_agent') }}</option>
389-
<option :value="InsightScope.Session">{{ t('agents.insight_session') }}</option>
389+
<option :value="InsightScope.Profile">{{ t('agents.insight_profile') }}</option>
390390
</SSelect>
391391
</SFormItem>
392392
<SFormItem
@@ -417,7 +417,7 @@ defineExpose({ open })
417417
<SFormItem :label="t('agents.todo_scope')" :hint="t('agents.todo_hint')">
418418
<SSelect v-model="form.todoScope">
419419
<option :value="TodoScope.Disabled">{{ t('agents.todo_disabled') }}</option>
420-
<option :value="TodoScope.Session">{{ t('agents.todo_session') }}</option>
420+
<option :value="TodoScope.Profile">{{ t('agents.todo_profile') }}</option>
421421
</SSelect>
422422
</SFormItem>
423423
<SFormItem

packages/chat-ui/src/WebSocketTransport.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,22 +102,22 @@ export class WebSocketTransport implements IChatTransport {
102102
// ── Sessions ──
103103

104104
async listSessions(): Promise<SessionItem[]> {
105-
const res = await this.api('/api/sessions')
105+
const res = await this.api('/api/profiles')
106106
return res.data ?? res ?? []
107107
}
108108

109109
async createSession(opts: CreateSessionOpts): Promise<{ id: string }> {
110-
const res = await this.api('/api/settings/sessions', 'POST', opts)
110+
const res = await this.api('/api/settings/profiles', 'POST', opts)
111111
return { id: res.id ?? res.data?.id }
112112
}
113113

114114
async deleteSession(profileId: string): Promise<void> {
115-
await this.api(`/api/sessions/${encodeURIComponent(profileId)}/history`, 'DELETE').catch(() => {})
116-
await this.api(`/api/settings/sessions/${encodeURIComponent(profileId)}`, 'DELETE')
115+
await this.api(`/api/profiles/${encodeURIComponent(profileId)}/history`, 'DELETE').catch(() => {})
116+
await this.api(`/api/settings/profiles/${encodeURIComponent(profileId)}`, 'DELETE')
117117
}
118118

119119
async updateSession(profileId: string, patch: Partial<SessionItem>): Promise<void> {
120-
await this.api(`/api/settings/sessions/${encodeURIComponent(profileId)}`, 'PUT', patch)
120+
await this.api(`/api/settings/profiles/${encodeURIComponent(profileId)}`, 'PUT', patch)
121121
}
122122

123123
// ── Messages ──
@@ -132,12 +132,12 @@ export class WebSocketTransport implements IChatTransport {
132132
}
133133

134134
async getHistory(profileId: string): Promise<StoredMessage[]> {
135-
const res = await this.api(`/api/sessions/${encodeURIComponent(profileId)}/history`)
135+
const res = await this.api(`/api/profiles/${encodeURIComponent(profileId)}/history`)
136136
return res.data ?? res ?? []
137137
}
138138

139139
async clearHistory(profileId: string): Promise<void> {
140-
await this.api(`/api/sessions/${encodeURIComponent(profileId)}/history`, 'DELETE')
140+
await this.api(`/api/profiles/${encodeURIComponent(profileId)}/history`, 'DELETE')
141141
}
142142

143143
// ── Usage ──
@@ -232,11 +232,11 @@ export class WebSocketTransport implements IChatTransport {
232232
// ── Thinks ──
233233

234234
getThinksUrlPrefix(profileId: string): string | null {
235-
return `${this._baseUrl}/api/sessions/${encodeURIComponent(profileId)}/thinks`
235+
return `${this._baseUrl}/api/profiles/${encodeURIComponent(profileId)}/thinks`
236236
}
237237

238238
getTasksUrlPrefix(profileId: string): string | null {
239-
return `${this._baseUrl}/api/sessions/${encodeURIComponent(profileId)}/tasks`
239+
return `${this._baseUrl}/api/profiles/${encodeURIComponent(profileId)}/tasks`
240240
}
241241

242242
async fetchThinks(url: string): Promise<any> {

packages/cli/src/api/sbotClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export class SbotClient {
177177
/** Fetch sessions filtered by workPath */
178178
async fetchSessions(workPath: string): Promise<SessionItem[]> {
179179
const res = await this.http.get<{ data: SessionItem[] }>(
180-
'/api/sessions', { params: { workPath } },
180+
'/api/profiles', { params: { workPath } },
181181
);
182182
return res.data.data;
183183
}
@@ -191,7 +191,7 @@ export class SbotClient {
191191
workPath,
192192
name: workPath.replace(/[/\\]+$/, '').split(/[/\\]/).pop() || workPath,
193193
};
194-
const res = await this.http.post<{ data: { id: string } }>('/api/settings/sessions', body);
194+
const res = await this.http.post<{ data: { id: string } }>('/api/settings/profiles', body);
195195
return res.data.data.id;
196196
}
197197

packages/sbot.commons/src/settings.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export interface EmbeddingConfig {
7878
export enum InsightScope {
7979
Disabled = "disabled",
8080
Agent = "agent",
81-
Session = "session",
81+
Profile = "profile",
8282
}
8383

8484
export interface InsightConfig {
@@ -89,7 +89,7 @@ export interface InsightConfig {
8989

9090
export enum TodoScope {
9191
Disabled = "disabled",
92-
Session = "session",
92+
Profile = "profile",
9393
}
9494

9595
export interface TodoConfig {

packages/sbot/src/Agent/AgentRunner.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ export class AgentRunner {
206206
const insightConfig = agentEntry.insight;
207207
if (!insightConfig || insightConfig.scope === InsightScope.Disabled) return;
208208

209-
const insightDir = insightConfig.scope === InsightScope.Session
210-
? config.getSessionInsightsPath(threadId)
209+
const insightDir = insightConfig.scope === InsightScope.Profile
210+
? config.getProfileInsightsPath(threadId)
211211
: config.getAgentInsightsPath(agentName);
212212

213213
const extractorModel = await config.getModelService(insightConfig.extractor, true);
@@ -233,7 +233,7 @@ export class AgentRunner {
233233
const todoConfig = agentEntry.todo;
234234
if (!todoConfig || todoConfig.scope === TodoScope.Disabled) return;
235235

236-
const filePath = config.getSessionTodoPath(threadId);
236+
const filePath = config.getProfileTodoPath(threadId);
237237

238238
const extractorModel = await config.getModelService(todoConfig.extractor, true);
239239
container.registerWithArgs(ITodoExtractor, TodoExtractor, {

packages/sbot/src/Core/Config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -518,11 +518,11 @@ class Config {
518518
getAgentInsightsPath(agentName: string) {
519519
return this.getConfigPath(`agents/${agentName}/insights`, true)
520520
}
521-
getSessionInsightsPath(sessionId: string) {
522-
return this.getConfigPath(`sessions/${sessionId}/insights`, true)
521+
getProfileInsightsPath(profileId: string) {
522+
return this.getConfigPath(`profiles/${profileId}/insights`, true)
523523
}
524-
getSessionTodoPath(sessionId: string) {
525-
return this.getConfigPath(`sessions/${sessionId}/todos.json`)
524+
getProfileTodoPath(profileId: string) {
525+
return this.getConfigPath(`profiles/${profileId}/todos.json`)
526526
}
527527
getAgentMcpServers(agentName: string): MCPServers {
528528
const mcpConfigPath = this.getConfigPath(`agents/${agentName}/mcp.json`);

packages/sbot/src/Server/routes/data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export class DataRoutes {
9090
this.registerSaverThreadRoutes(app, '/api/channel-sessions/:id', async req =>
9191
await this.resolveSessionSaver(await this.getSessionRowByPk(req.params.id as string))
9292
);
93-
this.registerSaverThreadRoutes(app, '/api/sessions/:profileId', async req =>
93+
this.registerSaverThreadRoutes(app, '/api/profiles/:profileId', async req =>
9494
await this.resolveSessionSaver(await this.getWebSessionRowByProfileId(req.params.profileId as string))
9595
);
9696

0 commit comments

Comments
 (0)