@morlay/dsh-session-mode 0.0.15 → 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/dist/rows.mjs CHANGED
@@ -1,86 +1 @@
1
- // src/mode-sources.ts
2
- const CODING_PERSONA = { prefix: [
3
- "你是一个经验丰富的编程专家,YAGNI 是你的编程哲学,PDCA 是你的行为规范。",
4
- "全程 MUST 用中文(专有名词除外),包括但不限于思考,回答,工具描述,subagent 提示词;思考 NEVER 陷入重复循环,一旦循环立即退出;思考 SHOULD 聚焦需求理解与方案设计,不预演具体代码实现,正确性由验证环节确认。",
5
- "单轮次内 MUST 完成明确的任务,任务未完成 NEVER 停下,除非有明确分歧点需要停下询问用户来做决断"
6
- ].join("\n") };
7
- const CHAT_PERSONA = { prefix: "你是一个助手。全程用中文(专有名词除外),包括但不限于思考,回答,工具描述;思考不要陷入重复循环,一旦循环立即退出。" };
8
- const NOOP_MODE_ID = "noop";
9
- const DEFAULT_MODE = "coding";
10
- const MODE_SOURCES = [
11
- {
12
- id: "coding",
13
- name: "编码模式",
14
- description: "功能完整的编码 Agent:文件、Shell、检索、联网等工具常驻,其余用法说明按需加载。",
15
- persona: CODING_PERSONA,
16
- role: ["main", "subagent"],
17
- denyTools: ["load_workspace_dependencies", "plugin_manager"],
18
- denySkills: [
19
- "office-docx",
20
- "office-pptx",
21
- "office-xlsx"
22
- ],
23
- denyPolicies: ["fs/edit-intent", "fs/write-intent"]
24
- },
25
- {
26
- id: "chat",
27
- name: "对话模式",
28
- description: "只做对话:提问与联网(搜索、抓取)三件工具,不注入系统提示词、工作区指令与技能目录。",
29
- persona: CHAT_PERSONA,
30
- role: ["main"],
31
- allowTools: [
32
- "ask_user_question",
33
- "web_search",
34
- "web_fetch"
35
- ],
36
- instructions: false,
37
- runtimeContext: false
38
- },
39
- {
40
- id: NOOP_MODE_ID,
41
- name: "原样模式",
42
- description: "与上游一致:不加人格提示词、不收窄工具与技能、policy 规则全开、官方注入面照旧。",
43
- role: ["main", "subagent"]
44
- }
45
- ];
46
- // src/rows.ts
47
- function list(values) {
48
- return values === void 0 || values.length === 0 ? void 0 : [...values];
49
- }
50
- function modeConfig(source) {
51
- const presetsOnly = list(source.presetsOnly);
52
- const allowTools = list(source.allowTools);
53
- const denyTools = list(source.denyTools);
54
- const allowSkills = list(source.allowSkills);
55
- const denySkills = list(source.denySkills);
56
- const allowPolicies = list(source.allowPolicies);
57
- const denyPolicies = list(source.denyPolicies);
58
- return {
59
- ...presetsOnly === void 0 ? {} : { presetsOnly },
60
- name: source.name,
61
- description: source.description,
62
- ...source.role === void 0 ? {} : { role: [...source.role] },
63
- ...source.persona === void 0 ? {} : { persona: { ...source.persona } },
64
- ...allowTools === void 0 ? {} : { allowTools },
65
- ...denyTools === void 0 ? {} : { denyTools },
66
- ...allowSkills === void 0 ? {} : { allowSkills },
67
- ...denySkills === void 0 ? {} : { denySkills },
68
- ...allowPolicies === void 0 ? {} : { allowPolicies },
69
- ...denyPolicies === void 0 ? {} : { denyPolicies },
70
- ...source.instructions === void 0 ? {} : { instructions: source.instructions },
71
- ...source.skills === void 0 ? {} : { skills: source.skills },
72
- ...source.runtimeContext === void 0 ? {} : { runtimeContext: source.runtimeContext },
73
- ...source.defaultModel === void 0 ? {} : { defaultModel: { ...source.defaultModel } }
74
- };
75
- }
76
- function sessionModeRows() {
77
- return [{ insert: [{
78
- id: "session-mode",
79
- name: "@morlay/dsh-session-mode",
80
- config: {
81
- default: DEFAULT_MODE,
82
- modes: Object.fromEntries(MODE_SOURCES.map((source) => [source.id, modeConfig(source)]))
83
- }
84
- }] }];
85
- }
86
- export { sessionModeRows };
1
+ export { t as modeConfig, n as sessionModeRows } from "./rows-DnHpp-Ak.mjs";
@@ -0,0 +1,118 @@
1
+ import { Volatile } from "@deepseek-ai/cordis";
2
+ import z from "@deepseek-ai/schemastery";
3
+ interface SessionModePersona {
4
+ readonly prefix: string;
5
+ readonly suffix: string;
6
+ }
7
+ type SessionModeRole = "main" | "subagent";
8
+ interface SessionModeModel {
9
+ readonly provider: string;
10
+ readonly model: string;
11
+ readonly reasoningEffort?: string;
12
+ }
13
+ type SessionModeModels = Readonly<Record<string, SessionModeModel>>;
14
+ interface SessionMode {
15
+ readonly presetsOnly?: readonly string[];
16
+ readonly name: string;
17
+ readonly description: string;
18
+ readonly role: SessionModeRole[];
19
+ readonly persona: SessionModePersona;
20
+ readonly allowTools: string[];
21
+ readonly denyTools: string[];
22
+ readonly allowSkills: string[];
23
+ readonly denySkills: string[];
24
+ readonly allowPolicies: string[];
25
+ readonly denyPolicies: string[];
26
+ readonly instructions: boolean;
27
+ readonly skills?: boolean;
28
+ readonly dropSections?: string[];
29
+ readonly runtimeContext: boolean;
30
+ readonly defaultModel?: SessionModeModel;
31
+ readonly preset?: string;
32
+ }
33
+ interface Config {
34
+ readonly default: string;
35
+ readonly modes: Record<string, SessionMode>;
36
+ readonly models?: SessionModeModels;
37
+ }
38
+ interface ResolvedConfig {
39
+ readonly modes?: Record<string, SessionMode>;
40
+ readonly default: Volatile<string>;
41
+ readonly models: SessionModeModels;
42
+ }
43
+ declare const Config: z<Config, ResolvedConfig>;
44
+ interface ModeConfig {
45
+ readonly presetsOnly: string[];
46
+ readonly name: string;
47
+ readonly description: string;
48
+ readonly role: SessionMode["role"];
49
+ readonly persona: {
50
+ readonly prefix: string;
51
+ readonly suffix: string;
52
+ };
53
+ readonly allowTools: string[];
54
+ readonly denyTools: string[];
55
+ readonly allowSkills: string[];
56
+ readonly denySkills: string[];
57
+ readonly allowPolicies: string[];
58
+ readonly denyPolicies: string[];
59
+ readonly instructions: boolean;
60
+ readonly skills: boolean;
61
+ readonly dropSections?: string[];
62
+ readonly runtimeContext: boolean;
63
+ }
64
+ declare const SESSION_MODE_PATH = "/session-mode";
65
+ declare const POLICY_NAMES: readonly ["fs/write-intent", "fs/edit-intent", "fs/delete-intent"];
66
+ type PolicyName = (typeof POLICY_NAMES)[number];
67
+ interface SessionModeRow {
68
+ readonly id: string;
69
+ readonly name: string;
70
+ readonly description?: string;
71
+ }
72
+ interface SessionModeRoster {
73
+ readonly default: string;
74
+ readonly modes: readonly SessionModeRow[];
75
+ }
76
+ type SessionModeSwitchKey = "instructions" | "skills" | "runtimeContext";
77
+ interface SessionModeEditable {
78
+ readonly persona: {
79
+ readonly prefix: string;
80
+ readonly suffix: string;
81
+ };
82
+ readonly allowTools: readonly string[];
83
+ readonly denyTools: readonly string[];
84
+ readonly allowSkills: readonly string[];
85
+ readonly denySkills: readonly string[];
86
+ readonly allowPolicies: readonly string[];
87
+ readonly denyPolicies: readonly string[];
88
+ readonly instructions: boolean;
89
+ readonly skills: boolean;
90
+ readonly runtimeContext: boolean;
91
+ }
92
+ type SessionModeTriState = "allow" | "deny";
93
+ interface SessionModeDirectoryEntry {
94
+ readonly id: string;
95
+ readonly description: string;
96
+ readonly group?: string;
97
+ readonly groupLabel?: string;
98
+ readonly fallback?: SessionModeTriState | "default";
99
+ readonly override?: SessionModeTriState | null;
100
+ }
101
+ interface SessionModeDirectory {
102
+ readonly tools: readonly SessionModeDirectoryEntry[];
103
+ readonly skills: readonly SessionModeDirectoryEntry[];
104
+ readonly policies: readonly SessionModeDirectoryEntry[];
105
+ }
106
+ interface SessionModeActiveState {
107
+ readonly mode: {
108
+ readonly id: string;
109
+ readonly name: string;
110
+ readonly description: string;
111
+ };
112
+ readonly config: ModeConfig;
113
+ readonly session: ModeConfig | undefined;
114
+ readonly overriddenFields?: readonly string[];
115
+ readonly catalog: SessionModeDirectory;
116
+ readonly deletable: boolean;
117
+ }
118
+ export { SessionModeEditable as a, SessionModeSwitchKey as c, ResolvedConfig as d, SessionMode as f, SessionModeRole as h, SessionModeActiveState as i, ModeConfig as l, SessionModePersona as m, PolicyName as n, SessionModeRoster as o, SessionModeModel as p, SESSION_MODE_PATH as r, SessionModeRow as s, POLICY_NAMES as t, Config as u };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@morlay/dsh-session-mode",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "description": "Session modes for dsh: coding / chat as data — a mode is a persona plus its tool lists, its upstream policy lists, its instruction / skill-catalog / runtime-context switches and an optional default model. The host applies the current mode to each session, and the chip in the composer sits beside the official agent-preset entry, which stays.",
5
5
  "keywords": [
6
6
  "dsh",
@@ -43,7 +43,11 @@
43
43
  "./locale/*.json": "./locale/*.json"
44
44
  },
45
45
  "dependencies": {
46
- "@morlay/dsh-client-ui-primitives": "0.0.15",
46
+ "@deepseek-ai/dsh-storage-domain": "^0.2.2-rc.1",
47
+ "@deepseek-ai/dsh-tool-executor-ptc": "^0.2.2-rc.1",
48
+ "@morlay/dsh-client-ui-primitives": "0.0.16",
49
+ "@morlay/dsh-tool-guidance": "^0.0.13",
50
+ "smol-toml": "^1.9.0",
47
51
  "zod": "4.4.3"
48
52
  },
49
53
  "devDependencies": {
@@ -63,19 +67,24 @@
63
67
  "@deepseek-ai/dsh-client-ui-primitives": "^0.2.2-rc.1",
64
68
  "@deepseek-ai/dsh-client-ui-renderer": "^0.2.2-rc.1",
65
69
  "@deepseek-ai/dsh-client-ui-settings": "^0.2.2-rc.1",
70
+ "@deepseek-ai/dsh-client-ui-sidebar-right": "^0.2.2-rc.1",
66
71
  "@deepseek-ai/dsh-client-ui-slots": "^0.2.2-rc.1",
67
72
  "@deepseek-ai/dsh-fs": "^0.2.2-rc.1",
68
73
  "@deepseek-ai/dsh-fs-local": "^0.2.2-rc.1",
69
74
  "@deepseek-ai/dsh-fs-observation-policy": "^0.2.2-rc.1",
75
+ "@deepseek-ai/dsh-home-paths": "^0.2.2-rc.1",
70
76
  "@deepseek-ai/dsh-llm": "^0.2.2-rc.1",
71
77
  "@deepseek-ai/dsh-session": "^0.2.2-rc.1",
72
78
  "@deepseek-ai/dsh-session-projection": "^0.2.2-rc.1",
73
79
  "@deepseek-ai/dsh-settings": "^0.2.2-rc.1",
74
80
  "@deepseek-ai/dsh-skill": "^0.2.2-rc.1",
81
+ "@deepseek-ai/dsh-storage-domain": "^0.2.2-rc.1",
75
82
  "@deepseek-ai/dsh-system-prompt": "^0.2.2-rc.1",
83
+ "@deepseek-ai/dsh-tool-executor-ptc": "^0.2.2-rc.1",
76
84
  "@deepseek-ai/dsh-tools": "^0.2.2-rc.1",
77
85
  "@deepseek-ai/dsh-typert-protocol": "^0.2.2-rc.1",
78
86
  "@deepseek-ai/dsh-working-directory": "^0.2.2-rc.1",
87
+ "@morlay/dsh-tool-guidance": "^0.0.13",
79
88
  "@testing-library/react": "^16.3.0",
80
89
  "@types/js-yaml": "^4.0.9",
81
90
  "@types/react": "~18.3.1",
@@ -95,18 +104,23 @@
95
104
  "@deepseek-ai/dsh-client-ui-plugin-manager": "^0.2.2-rc.1",
96
105
  "@deepseek-ai/dsh-client-ui-primitives": "^0.2.2-rc.1",
97
106
  "@deepseek-ai/dsh-client-ui-settings": "^0.2.2-rc.1",
107
+ "@deepseek-ai/dsh-client-ui-sidebar-right": "^0.2.2-rc.1",
98
108
  "@deepseek-ai/dsh-client-ui-slots": "^0.2.2-rc.1",
99
109
  "@deepseek-ai/dsh-fs": "^0.2.2-rc.1",
110
+ "@deepseek-ai/dsh-home-paths": "^0.2.2-rc.1",
100
111
  "@deepseek-ai/dsh-llm": "^0.2.2-rc.1",
101
112
  "@deepseek-ai/dsh-session": "^0.2.2-rc.1",
102
113
  "@deepseek-ai/dsh-session-projection": "^0.2.2-rc.1",
103
114
  "@deepseek-ai/dsh-skill": "^0.2.2-rc.1",
115
+ "@deepseek-ai/dsh-storage-domain": "^0.2.2-rc.1",
104
116
  "@deepseek-ai/dsh-system-prompt": "^0.2.2-rc.1",
117
+ "@deepseek-ai/dsh-tool-executor-ptc": "^0.2.2-rc.1",
105
118
  "@deepseek-ai/dsh-tool-skill": "^0.2.2-rc.1",
106
119
  "@deepseek-ai/dsh-tools": "^0.2.2-rc.1",
107
120
  "@deepseek-ai/dsh-typert-protocol": "^0.2.2-rc.1",
108
121
  "@deepseek-ai/schemastery": "^3.19.0",
109
- "@morlay/dsh-context-assembler": "0.0.12",
122
+ "@morlay/dsh-context-assembler": "0.0.13",
123
+ "@morlay/dsh-tool-guidance": "^0.0.13",
110
124
  "react": "^18.2.0"
111
125
  },
112
126
  "engines": {