@morlay/dsh-session-mode 0.0.14 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -7
- package/dist/client.cjs +4576 -3901
- package/dist/client.d.cts +41 -43
- package/dist/client.d.mts +41 -43
- package/dist/client.mjs +952 -1233
- package/dist/index.cjs +748 -70
- package/dist/index.d.mts +26 -55
- package/dist/index.mjs +742 -65
- package/dist/mode-config-CiQfAy4G.mjs +99 -0
- package/dist/mode-config-DOQ1VjcM.cjs +225 -0
- package/dist/rows-BT6Fpq-E.cjs +99 -0
- package/dist/rows-DnHpp-Ak.mjs +82 -0
- package/dist/rows.cjs +3 -86
- package/dist/rows.d.mts +31 -1
- package/dist/rows.mjs +1 -86
- package/dist/shared-R2j0SuWy.d.mts +118 -0
- package/package.json +70 -56
- package/src/client/SessionModePanel.tsx +803 -0
- package/src/client/api.ts +125 -1
- package/src/client/hints.ts +41 -0
- package/src/client/index.ts +71 -55
- package/src/client/locales.ts +80 -0
- package/src/index.ts +581 -20
- package/src/mode-config.ts +104 -0
- package/src/mode-sources.ts +4 -4
- package/src/mode-store.ts +53 -0
- package/src/modes.ts +23 -28
- package/src/per-agent.ts +53 -0
- package/src/ptc-describe.ts +97 -0
- package/src/ptc-sdk.ts +90 -0
- package/src/rows.ts +4 -8
- package/src/scope.ts +369 -71
- package/src/session-mode-store.ts +20 -0
- package/src/shared.ts +128 -3
- package/src/system-remainder.ts +39 -0
- package/src/tool-groups.ts +19 -0
- package/dist/shared-DO1nZbJ0.cjs +0 -64
- package/dist/shared-vjlwxiMt.mjs +0 -4
- package/src/client/BundleConfigPage.tsx +0 -631
- package/src/client/bundle-config.ts +0 -701
package/src/client/api.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
SESSION_MODE_PATH,
|
|
6
|
+
type SessionModeActiveState,
|
|
6
7
|
type SessionModeRoster,
|
|
7
8
|
type SessionModeSelectResult,
|
|
8
9
|
} from "../shared.ts";
|
|
@@ -13,7 +14,7 @@ export async function fetchRoster(): Promise<SessionModeRoster> {
|
|
|
13
14
|
method: "GET",
|
|
14
15
|
headers: { accept: "application/json" },
|
|
15
16
|
});
|
|
16
|
-
if (!response.ok) throw
|
|
17
|
+
if (!response.ok) throw await failure(response);
|
|
17
18
|
return (await response.json()) as SessionModeRoster;
|
|
18
19
|
}
|
|
19
20
|
|
|
@@ -33,3 +34,126 @@ export async function selectMode(sessionId: string, mode: string): Promise<strin
|
|
|
33
34
|
}
|
|
34
35
|
return value?.mode ?? mode;
|
|
35
36
|
}
|
|
37
|
+
|
|
38
|
+
// 读某个会话**当下生效**的那一份(工具是运行期可见集,MCP 组加载后会变),侧边栏面板用。
|
|
39
|
+
|
|
40
|
+
// 错误响应体里的 `error` 是 host 给的可读原因:原样抛出来,别让页面只剩一个 HTTP 状态码。
|
|
41
|
+
async function failure(response: Response): Promise<Error> {
|
|
42
|
+
const value = (await response.json().catch(() => undefined)) as { error?: unknown } | undefined;
|
|
43
|
+
return new Error(
|
|
44
|
+
typeof value?.error === "string" ? value.error : `HTTP ${String(response.status)}`,
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export async function fetchActive(sessionId: string): Promise<SessionModeActiveState> {
|
|
49
|
+
const response = await fetch(`${SESSION_MODE_PATH}?sessionId=${encodeURIComponent(sessionId)}`, {
|
|
50
|
+
method: "GET",
|
|
51
|
+
headers: { accept: "application/json" },
|
|
52
|
+
});
|
|
53
|
+
if (!response.ok) throw await failure(response);
|
|
54
|
+
return (await response.json()) as SessionModeActiveState;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// 面板的写面:改这个会话的三个注入开关;返回新的生效态。
|
|
58
|
+
export async function updateSwitches(
|
|
59
|
+
sessionId: string,
|
|
60
|
+
switches: Partial<Record<"instructions" | "skills" | "runtimeContext", boolean | null>>,
|
|
61
|
+
): Promise<SessionModeActiveState> {
|
|
62
|
+
const response = await fetch(SESSION_MODE_PATH, {
|
|
63
|
+
method: "POST",
|
|
64
|
+
headers: { accept: "application/json", "content-type": "application/json" },
|
|
65
|
+
body: JSON.stringify({ sessionId, switches }),
|
|
66
|
+
});
|
|
67
|
+
if (!response.ok) throw await failure(response);
|
|
68
|
+
return (await response.json()) as SessionModeActiveState;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// 把当前会话的开关覆盖写回这个模式的配置(对之后的新会话生效)。
|
|
72
|
+
export async function saveSwitchesAsDefault(sessionId: string): Promise<SessionModeActiveState> {
|
|
73
|
+
const response = await fetch(SESSION_MODE_PATH, {
|
|
74
|
+
method: "POST",
|
|
75
|
+
headers: { accept: "application/json", "content-type": "application/json" },
|
|
76
|
+
body: JSON.stringify({ sessionId, saveAsDefault: true }),
|
|
77
|
+
});
|
|
78
|
+
if (!response.ok) throw await failure(response);
|
|
79
|
+
return (await response.json()) as SessionModeActiveState;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// 会话级的字段覆盖(`null` = 回到模式默认)。
|
|
83
|
+
export async function updateModePatch(
|
|
84
|
+
sessionId: string,
|
|
85
|
+
patch: Record<string, unknown>,
|
|
86
|
+
): Promise<SessionModeActiveState> {
|
|
87
|
+
const response = await fetch(SESSION_MODE_PATH, {
|
|
88
|
+
method: "POST",
|
|
89
|
+
headers: { accept: "application/json", "content-type": "application/json" },
|
|
90
|
+
body: JSON.stringify({ sessionId, modePatch: patch }),
|
|
91
|
+
});
|
|
92
|
+
if (!response.ok) throw await failure(response);
|
|
93
|
+
return (await response.json()) as SessionModeActiveState;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// 以当前会话的生效配置另存为一个新模式。
|
|
97
|
+
export async function saveAsNewMode(sessionId: string, code: string, name: string): Promise<void> {
|
|
98
|
+
const response = await fetch(SESSION_MODE_PATH, {
|
|
99
|
+
method: "POST",
|
|
100
|
+
headers: { accept: "application/json", "content-type": "application/json" },
|
|
101
|
+
body: JSON.stringify({ sessionId, saveAsNewMode: { code, name } }),
|
|
102
|
+
});
|
|
103
|
+
if (!response.ok) throw await failure(response);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// 删除一个"另存为"出来的模式(内置模式由 host 拒绝)。
|
|
107
|
+
export async function deleteMode(sessionId: string): Promise<SessionModeActiveState> {
|
|
108
|
+
const response = await fetch(SESSION_MODE_PATH, {
|
|
109
|
+
method: "POST",
|
|
110
|
+
headers: { accept: "application/json", "content-type": "application/json" },
|
|
111
|
+
body: JSON.stringify({ sessionId, deleteMode: true }),
|
|
112
|
+
});
|
|
113
|
+
if (!response.ok) throw await failure(response);
|
|
114
|
+
return (await response.json()) as SessionModeActiveState;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// 会话级逐条目三态(`null` = 回到模式默认)。
|
|
118
|
+
export async function updateItemState(
|
|
119
|
+
sessionId: string,
|
|
120
|
+
kind: "tools" | "skills" | "policies",
|
|
121
|
+
id: string,
|
|
122
|
+
value: "allow" | "deny" | null,
|
|
123
|
+
): Promise<SessionModeActiveState> {
|
|
124
|
+
const response = await fetch(SESSION_MODE_PATH, {
|
|
125
|
+
method: "POST",
|
|
126
|
+
headers: { accept: "application/json", "content-type": "application/json" },
|
|
127
|
+
body: JSON.stringify({ sessionId, itemState: { kind, id, value } }),
|
|
128
|
+
});
|
|
129
|
+
if (!response.ok) throw await failure(response);
|
|
130
|
+
return (await response.json()) as SessionModeActiveState;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// 一次性应用整份会话覆盖(面板的"应用到会话")。
|
|
134
|
+
export async function applySessionConfig(
|
|
135
|
+
sessionId: string,
|
|
136
|
+
config: import("../mode-config.ts").ModeConfig,
|
|
137
|
+
): Promise<SessionModeActiveState> {
|
|
138
|
+
const response = await fetch(SESSION_MODE_PATH, {
|
|
139
|
+
method: "POST",
|
|
140
|
+
headers: { accept: "application/json", "content-type": "application/json" },
|
|
141
|
+
body: JSON.stringify({ sessionId, applyConfig: { config } }),
|
|
142
|
+
});
|
|
143
|
+
if (!response.ok) throw await failure(response);
|
|
144
|
+
return (await response.json()) as SessionModeActiveState;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// 把草稿写回配置("保存为默认"):传的是完整 `ModeConfig`。
|
|
148
|
+
export async function saveConfigDraft(
|
|
149
|
+
sessionId: string,
|
|
150
|
+
config: import("../mode-config.ts").ModeConfig,
|
|
151
|
+
): Promise<SessionModeActiveState> {
|
|
152
|
+
const response = await fetch(SESSION_MODE_PATH, {
|
|
153
|
+
method: "POST",
|
|
154
|
+
headers: { accept: "application/json", "content-type": "application/json" },
|
|
155
|
+
body: JSON.stringify({ sessionId, saveConfig: { config } }),
|
|
156
|
+
});
|
|
157
|
+
if (!response.ok) throw await failure(response);
|
|
158
|
+
return (await response.json()) as SessionModeActiveState;
|
|
159
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// 行配置页与提示面共用的命名空间/解包:从 `bundle-config.ts` 抽出来,配置页移除后仍要给提示面用。
|
|
2
|
+
|
|
3
|
+
export const SESSION_MODE_NS = "session-mode";
|
|
4
|
+
|
|
5
|
+
// cordis 会把服务值包成追踪代理(`Symbol.for("cordis.original")` 指回原始实例)。代理上的方法调用以代理为
|
|
6
|
+
// `this`,而服务实现用的是 JS 私有字段——先解包成原实例再调。
|
|
7
|
+
export function unwrapService<T>(value: T | undefined): T | undefined {
|
|
8
|
+
if (value === undefined) return undefined;
|
|
9
|
+
const original = (value as { [key: symbol]: unknown })[Symbol.for("cordis.original")];
|
|
10
|
+
return (original ?? value) as T;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface HintsLike {
|
|
14
|
+
textFor(ns: string, path: readonly string[]): { label?: string; hint?: string };
|
|
15
|
+
selectFor(ns: string, path: readonly string[]): unknown;
|
|
16
|
+
sourceFor(name: string): unknown;
|
|
17
|
+
subscribe(listener: () => void): () => void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface HintsService extends HintsLike {
|
|
21
|
+
describe(
|
|
22
|
+
ns: string,
|
|
23
|
+
path: readonly string[],
|
|
24
|
+
read: () => { label?: string; hint?: string },
|
|
25
|
+
): () => void;
|
|
26
|
+
select(
|
|
27
|
+
ns: string,
|
|
28
|
+
path: readonly string[],
|
|
29
|
+
spec: { options: () => readonly unknown[] },
|
|
30
|
+
): () => void;
|
|
31
|
+
source(
|
|
32
|
+
name: string,
|
|
33
|
+
read: {
|
|
34
|
+
options: (
|
|
35
|
+
read: (path: readonly string[]) => unknown,
|
|
36
|
+
) => readonly { value: string; label?: string }[];
|
|
37
|
+
dependsOn?: readonly (readonly string[])[];
|
|
38
|
+
},
|
|
39
|
+
): () => void;
|
|
40
|
+
refresh(): void;
|
|
41
|
+
}
|
package/src/client/index.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
// client 半:会话里那一个面(模式 chip,槽位 `conversation.input.left`,list + session scope
|
|
2
|
-
//
|
|
3
|
-
// 装本行的 bundle 那一页(`plugins.bundle.config`,key = bundle 包名,见 `./BundleConfigPage.tsx`)。
|
|
1
|
+
// client 半:会话里那一个面(模式 chip,槽位 `conversation.input.left`,list + session scope)。bundle 配置页
|
|
2
|
+
// 不再注册——模式与它的生效面(工具 / 技能 / policy / 系统提示词)改在侧边栏面板里按会话展示。
|
|
4
3
|
|
|
5
4
|
import type { Context } from "@deepseek-ai/cordis";
|
|
6
5
|
// Type-only:`ctx.remote` 的合并面(选模型的候选来自 LLM 目录)。
|
|
@@ -11,38 +10,35 @@ import type {} from "@deepseek-ai/dsh-client-ui-slots";
|
|
|
11
10
|
import type {} from "@deepseek-ai/dsh-client-ui-conversation/client";
|
|
12
11
|
// Type-only:`plugins.bundle.config` 的槽位声明(bundle 详情页的配置座位)。
|
|
13
12
|
import type {} from "@deepseek-ai/dsh-client-ui-plugin-manager/client";
|
|
13
|
+
// Type-only:右栏 tab 的类型注册面(`ctx.sidebarRightTabs`)与座位声明。
|
|
14
|
+
import type {} from "@deepseek-ai/dsh-client-ui-sidebar-right/client";
|
|
14
15
|
import {
|
|
15
16
|
CATALOG_NS,
|
|
16
17
|
SESSION_MODE_CATALOG_REMOTE,
|
|
17
18
|
type SessionModeCatalogRemote,
|
|
18
19
|
} from "../catalog-remote.ts";
|
|
19
20
|
import { POLICY_NAMES } from "../shared.ts";
|
|
20
|
-
import {
|
|
21
|
-
BUNDLE_CONFIG_KEY,
|
|
22
|
-
createBundleConfigFace,
|
|
23
|
-
SESSION_MODE_NS,
|
|
24
|
-
unwrapService,
|
|
25
|
-
type HintsLike,
|
|
26
|
-
type HintsService,
|
|
27
|
-
} from "./bundle-config.ts";
|
|
28
|
-
import { BundleConfigPage } from "./BundleConfigPage.tsx";
|
|
29
|
-
import { BUNDLE_NS, bundleEn, bundleZh, type BundleLocaleKey } from "./bundle-locales.ts";
|
|
21
|
+
import { SESSION_MODE_NS, unwrapService, type HintsService } from "./hints.ts";
|
|
30
22
|
import { loadLlmProviders, remoteNamespace, type ProviderModels } from "./llm-directory.ts";
|
|
23
|
+
import { SessionModePanel } from "./SessionModePanel.tsx";
|
|
31
24
|
import { SessionModeSeat } from "./SessionModeSeat.tsx";
|
|
32
25
|
import { en, zh, type SessionModeLocaleKey } from "./locales.ts";
|
|
33
26
|
|
|
34
27
|
declare module "@deepseek-ai/dsh-client-ui-slots" {
|
|
35
28
|
interface LocaleNamespaceMap {
|
|
36
|
-
//
|
|
29
|
+
// 会话里那个面(模式 chip)的文案。
|
|
37
30
|
"session-mode": SessionModeLocaleKey;
|
|
38
|
-
// bundle
|
|
39
|
-
"session-mode-bundle": BundleLocaleKey;
|
|
31
|
+
// bundle 配置页的字典:页面已不再注册,类型面留着给保留的文件。
|
|
32
|
+
"session-mode-bundle": import("./bundle-locales.ts").BundleLocaleKey;
|
|
40
33
|
}
|
|
41
34
|
}
|
|
42
35
|
|
|
43
36
|
// 浏览器半插件的字典命名空间。
|
|
44
37
|
const NS = "session-mode";
|
|
45
38
|
|
|
39
|
+
// 右栏 tab 类型的 id(也是正文座位的 key):包名是天然的唯一值。
|
|
40
|
+
const PANEL_ID = "@morlay/dsh-session-mode";
|
|
41
|
+
|
|
46
42
|
// 这一行里需要中文文案的字段(都在 `modes.<模式>.defaultModel` 里,所以按模板路径注册一次)。
|
|
47
43
|
const FIELDS = ["provider", "model", "reasoningEffort"] as const;
|
|
48
44
|
|
|
@@ -63,7 +59,6 @@ interface PresetRosterReader {
|
|
|
63
59
|
|
|
64
60
|
export type { SessionModeSeatProps } from "./SessionModeSeat.tsx";
|
|
65
61
|
export type { SessionModeLocaleKey } from "./locales.ts";
|
|
66
|
-
export type { BundleConfigPageProps } from "./BundleConfigPage.tsx";
|
|
67
62
|
|
|
68
63
|
// 需要的服务:槽位与字典(会话列表经槽位的标准 props 到达组件,不必自己 inject);bundle 那页另要配置表单与
|
|
69
64
|
// schema 服务,见下面那段注册自己的 `ctx.inject`。
|
|
@@ -253,51 +248,72 @@ export function apply(ctx: Context): void {
|
|
|
253
248
|
}, "session-mode: composer chip");
|
|
254
249
|
});
|
|
255
250
|
|
|
256
|
-
//
|
|
257
|
-
// `
|
|
258
|
-
|
|
259
|
-
// 提示面一到(或它的候选变了)就刷一次,模型那两个字段不会静默退回手输。
|
|
260
|
-
let refreshPage: (() => void) | undefined;
|
|
261
|
-
// 提示面按**属性访问**取(`ctx.get(name)` 给的是追踪代理,调带 JS 私有字段的方法会抛),存下来给下面那一页用。
|
|
262
|
-
let hints: HintsLike | undefined;
|
|
263
|
-
ctx.inject(["schemaFormHints"], (scope) =>
|
|
251
|
+
// 右栏面板(`sidebar.right.pane.tab`):只展示这个会话**选中的模式**与它当下生效的那一份。注册是两段式——
|
|
252
|
+
// 类型进 `sidebarRightTabs`,正文进 keyed 座位(key = 类型 id)——与上游各 tab 类型走同一条路。
|
|
253
|
+
ctx.inject(["sidebarRightTabs", "slots", "locale"], (scope) =>
|
|
264
254
|
scope.effect(() => {
|
|
265
|
-
|
|
266
|
-
const
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
255
|
+
const panelT = scope.locale.bind(NS);
|
|
256
|
+
const offType = scope.sidebarRightTabs.register({
|
|
257
|
+
id: PANEL_ID,
|
|
258
|
+
kind: PANEL_ID,
|
|
259
|
+
priority: "extension",
|
|
260
|
+
title: () => panelT("panel"),
|
|
261
|
+
// 右栏 guide 页上的一条入口:没有它,用户只能等自动打开才看得到这一页。
|
|
262
|
+
guide: [
|
|
263
|
+
{
|
|
264
|
+
id: PANEL_ID,
|
|
265
|
+
order: 20,
|
|
266
|
+
title: () => panelT("panel"),
|
|
267
|
+
description: () => panelT("panelDescription"),
|
|
268
|
+
},
|
|
269
|
+
],
|
|
270
270
|
});
|
|
271
|
+
const body = scope.slots.inject("sidebar.right.pane.tab", () =>
|
|
272
|
+
scope.slots.register(
|
|
273
|
+
{ name: "sidebar.right.pane.tab", key: PANEL_ID, locale: NS },
|
|
274
|
+
SessionModePanel,
|
|
275
|
+
),
|
|
276
|
+
);
|
|
271
277
|
return () => {
|
|
272
|
-
|
|
273
|
-
|
|
278
|
+
body();
|
|
279
|
+
offType();
|
|
274
280
|
};
|
|
275
|
-
}, "session-mode:
|
|
281
|
+
}, "session-mode: sidebar panel"),
|
|
276
282
|
);
|
|
277
283
|
|
|
278
|
-
|
|
284
|
+
// 和新建对话联动:当前会话一变(新建或切换)就把面板带到右栏。右栏没挂载(窄屏/未装那一行)时不动;
|
|
285
|
+
// 同一 pane 内按 kind 单页,重复调用只是把已有那一页选中。
|
|
286
|
+
ctx.inject(["sidebarRight", "uiSession"], (scope) =>
|
|
279
287
|
scope.effect(() => {
|
|
280
|
-
const
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
const
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
288
|
+
const current = scope.uiSession.adapter.current;
|
|
289
|
+
// `mounted` 是右栏当前显示的会话:首帧与切换过程中它还没指向新会话,这时 `openTab` 会以
|
|
290
|
+
// "no session surface is mounted" 抛错。所以两路都订阅——会话换了自己不写,等右栏挂到这个会话
|
|
291
|
+
// 再打开(同一 pane 内按 kind 单页,重复调用只是选中)。
|
|
292
|
+
const mounted = scope.sidebarRight.mounted;
|
|
293
|
+
let queued = false;
|
|
294
|
+
const sync = (): void => {
|
|
295
|
+
if (queued) return;
|
|
296
|
+
queued = true;
|
|
297
|
+
// 推迟到本轮订阅回调结束之后:`publishMain` 期间 surface 还在切换,同步写会抛。
|
|
298
|
+
queueMicrotask(() => {
|
|
299
|
+
queued = false;
|
|
300
|
+
const key = current.getSnapshot().key;
|
|
301
|
+
if (typeof key !== "string" || key.length === 0) return;
|
|
302
|
+
if (mounted.getSnapshot() !== key) return;
|
|
303
|
+
try {
|
|
304
|
+
scope.sidebarRight.openTab(PANEL_ID);
|
|
305
|
+
} catch {
|
|
306
|
+
// 挂载与卸载之间仍可能撞上:下一次订阅回调会再试,这里不当作错误。
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
};
|
|
310
|
+
const offCurrent = current.subscribe(sync);
|
|
311
|
+
const offMounted = mounted.subscribe(sync);
|
|
312
|
+
sync();
|
|
295
313
|
return () => {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
refreshPage = undefined;
|
|
299
|
-
dispose();
|
|
314
|
+
offCurrent();
|
|
315
|
+
offMounted();
|
|
300
316
|
};
|
|
301
|
-
}, "session-mode:
|
|
302
|
-
|
|
317
|
+
}, "session-mode: panel follows the session"),
|
|
318
|
+
);
|
|
303
319
|
}
|
package/src/client/locales.ts
CHANGED
|
@@ -12,6 +12,45 @@ export const zh = {
|
|
|
12
12
|
modelHint: "模型 id。",
|
|
13
13
|
reasoningEffort: "思考档位",
|
|
14
14
|
reasoningEffortHint: "默认就跟服务商自己的默认。",
|
|
15
|
+
panel: "会话模式",
|
|
16
|
+
panelDescription: "当前会话的模式与生效面:工具、技能、政策与注入开关。",
|
|
17
|
+
panelNoSession: "当前没有会话",
|
|
18
|
+
persona: "系统提示词",
|
|
19
|
+
tools: "工具",
|
|
20
|
+
skills: "技能",
|
|
21
|
+
policies: "政策规则",
|
|
22
|
+
switches: "注入面",
|
|
23
|
+
instructions: "工作区指令",
|
|
24
|
+
skillsCatalog: "技能目录",
|
|
25
|
+
runtimeContext: "动态快照",
|
|
26
|
+
empty: "(无)",
|
|
27
|
+
loading: "读取中…",
|
|
28
|
+
saveDefault: "保存为默认",
|
|
29
|
+
reset: "重置",
|
|
30
|
+
apply: "应用到会话",
|
|
31
|
+
applied: "已应用到会话",
|
|
32
|
+
fromSession: "会话覆盖",
|
|
33
|
+
fromMode: "模式默认",
|
|
34
|
+
saveAs: "另存为",
|
|
35
|
+
delete: "删除",
|
|
36
|
+
deleteConfirm: "删除这个模式?它会从配置里移除,使用它的会话回到默认模式。",
|
|
37
|
+
cancel: "取消",
|
|
38
|
+
confirm: "确定",
|
|
39
|
+
nameLabel: "显示名(可选)",
|
|
40
|
+
codeLabel: "模式 code(必填)",
|
|
41
|
+
codePlaceholder: "例如 my-mode",
|
|
42
|
+
namePlaceholder: "新模式名",
|
|
43
|
+
addValue: "添加一项",
|
|
44
|
+
general: "通用配置",
|
|
45
|
+
stateDefault: "默认",
|
|
46
|
+
stateMixed: "混合",
|
|
47
|
+
stateOn: "开",
|
|
48
|
+
stateOff: "关",
|
|
49
|
+
stateAllow: "允许",
|
|
50
|
+
stateDeny: "禁止",
|
|
51
|
+
savedNewMode: "已另存为新模式,对新会话生效",
|
|
52
|
+
saved: "已保存,对新会话生效",
|
|
53
|
+
saveFailed: "保存失败",
|
|
15
54
|
};
|
|
16
55
|
|
|
17
56
|
export const en: Record<keyof typeof zh, string> = {
|
|
@@ -25,6 +64,47 @@ export const en: Record<keyof typeof zh, string> = {
|
|
|
25
64
|
modelHint: "Model id.",
|
|
26
65
|
reasoningEffort: "Reasoning effort",
|
|
27
66
|
reasoningEffortHint: "Default keeps the provider's own default.",
|
|
67
|
+
panel: "Session mode",
|
|
68
|
+
panelDescription:
|
|
69
|
+
"The mode this session runs and what it currently exposes: tools, skills, policies and injections.",
|
|
70
|
+
panelNoSession: "No session",
|
|
71
|
+
persona: "System prompt",
|
|
72
|
+
tools: "Tools",
|
|
73
|
+
skills: "Skills",
|
|
74
|
+
policies: "Policies",
|
|
75
|
+
switches: "Injections",
|
|
76
|
+
instructions: "Workspace instructions",
|
|
77
|
+
skillsCatalog: "Skill catalog",
|
|
78
|
+
runtimeContext: "Runtime context",
|
|
79
|
+
empty: "(none)",
|
|
80
|
+
loading: "Loading…",
|
|
81
|
+
saveDefault: "Save as default",
|
|
82
|
+
reset: "Reset",
|
|
83
|
+
apply: "Apply to session",
|
|
84
|
+
applied: "Applied to session",
|
|
85
|
+
fromSession: "session override",
|
|
86
|
+
fromMode: "mode default",
|
|
87
|
+
saveAs: "Save as",
|
|
88
|
+
delete: "Delete",
|
|
89
|
+
deleteConfirm:
|
|
90
|
+
"Delete this mode? It is removed from the configuration and sessions using it fall back to the default.",
|
|
91
|
+
cancel: "Cancel",
|
|
92
|
+
confirm: "Confirm",
|
|
93
|
+
nameLabel: "Display name (optional)",
|
|
94
|
+
codeLabel: "Mode code (required)",
|
|
95
|
+
codePlaceholder: "e.g. my-mode",
|
|
96
|
+
namePlaceholder: "New mode name",
|
|
97
|
+
addValue: "Add an entry",
|
|
98
|
+
general: "General",
|
|
99
|
+
stateDefault: "Default",
|
|
100
|
+
stateMixed: "Mixed",
|
|
101
|
+
stateOn: "On",
|
|
102
|
+
stateOff: "Off",
|
|
103
|
+
stateAllow: "Allow",
|
|
104
|
+
stateDeny: "Deny",
|
|
105
|
+
savedNewMode: "Saved as a new mode; applies to new sessions",
|
|
106
|
+
saved: "Saved; applies to new sessions",
|
|
107
|
+
saveFailed: "Save failed",
|
|
28
108
|
};
|
|
29
109
|
|
|
30
110
|
export type SessionModeLocaleKey = keyof typeof zh;
|