@agi-fans/oh-my-dsh 0.12.0 → 0.13.0

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 CHANGED
@@ -45,6 +45,7 @@ The full documentation is also published on the [official site](https://omdsh.ag
45
45
  - [User plugins](https://omdsh.agi.fans/docs/plugins/) — install DSH bundles into the omdsh Profile with `omdsh plugin`.
46
46
  - [Architecture](https://omdsh.agi.fans/docs/architecture/) — understand the plugin boundaries and runtime data flow.
47
47
  - [Performance](https://omdsh.agi.fans/docs/performance/) — inspect the benchmarks, methodology, and rendering optimizations.
48
+ - [Report a bug or request a feature](https://github.com/agi-fans/oh-my-dsh/issues/new/choose) — use a guided form to include the version, environment, reproduction steps, and sanitized context.
48
49
 
49
50
  ## Why oh-my-dsh
50
51
 
@@ -1,7 +1,7 @@
1
1
  - id: persona
2
2
  name: '@deepseek-ai/dsh-persona'
3
3
  config:
4
- text: You are a helpful software engineer assistant.
4
+ text: You are a helpful software engineer assistant.{{omdsh_agent_behavior}}
5
5
  complete: true
6
6
  includeRuntimeContext: false
7
7
 
package/config/cordis.yml CHANGED
@@ -15,6 +15,10 @@
15
15
 
16
16
  - id: llm-deepseek
17
17
  name: '@deepseek-ai/dsh-llm-deepseek'
18
+ config:
19
+ # Current built-ins share this fallback. Exact catalog values still win,
20
+ # and omitting models keeps future adapter additions visible.
21
+ maxTokens: 384000
18
22
 
19
23
  - id: session
20
24
  name: '@deepseek-ai/dsh-session'
@@ -257,6 +261,9 @@
257
261
  config:
258
262
  model: !!js process.env.OMDSH_MODEL || 'deepseek-v4-flash'
259
263
 
264
+ - id: agent-behavior
265
+ name: '@agi-fans/oh-my-dsh/agent-behavior'
266
+
260
267
  - id: tui-tool-presentation
261
268
  name: '@agi-fans/dsh-tui/tool-presentation'
262
269
 
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Product-owned Agent behavior settings projected into the Harness system prompt.
3
+ * @module @agi-fans/oh-my-dsh/agent-behavior
4
+ */
5
+ import type { Context } from '@deepseek-ai/cordis';
6
+ import type { Agent } from '@deepseek-ai/dsh-agent';
7
+ import type { AssembleContext } from '@deepseek-ai/dsh-system-prompt';
8
+ import z from '@deepseek-ai/schemastery';
9
+ import type { TuiAgentBehaviorSettings } from '@agi-fans/dsh-tui';
10
+ export declare const name = "omdsh-agent-behavior";
11
+ export declare const inject: string[];
12
+ export declare const AGENT_BEHAVIOR_SETTINGS_NAMESPACE = "omdsh-agent";
13
+ export declare const AGENT_BEHAVIOR_SECTION = "omdsh:agent-behavior";
14
+ export declare const AGENT_BEHAVIOR_ORDER = 30;
15
+ export declare const AGENT_BEHAVIOR_VARIABLE = "omdsh_agent_behavior";
16
+ export declare const AGENT_LANGUAGES: readonly ["auto", "zh-CN", "en"];
17
+ export type AgentLanguage = typeof AGENT_LANGUAGES[number];
18
+ export interface AgentBehaviorSettings extends TuiAgentBehaviorSettings {
19
+ language: AgentLanguage;
20
+ }
21
+ export declare const AgentBehaviorSettingsSchema: z<AgentBehaviorSettings>;
22
+ /** Stable model instruction for one accepted language setting. */
23
+ export declare function agentLanguageFragment(language: AgentLanguage): string;
24
+ /** Freeze live user settings at a turn boundary while keeping direct assemblies useful. */
25
+ export declare class AgentBehaviorPrompt {
26
+ #private;
27
+ snapshot(agent: Agent, turn: number, language: AgentLanguage): void;
28
+ clear(agent: Agent): void;
29
+ fragment(context: AssembleContext, current: AgentLanguage): string;
30
+ variable(context: AssembleContext, current: AgentLanguage): string;
31
+ }
32
+ export declare function apply(ctx: Context): void;
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Product-owned Agent behavior settings projected into the Harness system prompt.
3
+ * @module @agi-fans/oh-my-dsh/agent-behavior
4
+ */
5
+ import { settingsNamespace } from '@deepseek-ai/dsh-settings';
6
+ import z from '@deepseek-ai/schemastery';
7
+ export const name = 'omdsh-agent-behavior';
8
+ export const inject = ['settings', 'systemPrompt'];
9
+ export const AGENT_BEHAVIOR_SETTINGS_NAMESPACE = 'omdsh-agent';
10
+ export const AGENT_BEHAVIOR_SECTION = 'omdsh:agent-behavior';
11
+ export const AGENT_BEHAVIOR_ORDER = 30;
12
+ export const AGENT_BEHAVIOR_VARIABLE = 'omdsh_agent_behavior';
13
+ export const AGENT_LANGUAGES = ['auto', 'zh-CN', 'en'];
14
+ export const AgentBehaviorSettingsSchema = z.object({
15
+ language: z.union([...AGENT_LANGUAGES]).default('auto'),
16
+ });
17
+ const LANGUAGE_FRAGMENTS = {
18
+ 'zh-CN': '主要使用简体中文进行推理和面向用户的沟通,包括回复、提问、计划、待办文字和子 Agent 简报。代码、标识符、命令、Tool 参数、日志、引用、文件内容和惯用技术术语在准确性需要时保留原文或标准写法。项目指令中明确规定语言时,遵循项目指令;若用户明确要求当前任务使用其他语言,以该要求为准。',
19
+ en: 'Use English as the primary language for reasoning and user-facing communication, including replies, questions, plans, todo text, and subagent summaries. Preserve code, identifiers, commands, tool arguments, logs, quotations, file contents, and conventional technical terms in their original or standard form when accuracy requires. Follow explicit language requirements in project instructions; if the user explicitly requests another language for the current task, follow that request.',
20
+ };
21
+ /** Stable model instruction for one accepted language setting. */
22
+ export function agentLanguageFragment(language) {
23
+ return language === 'auto' ? '' : LANGUAGE_FRAGMENTS[language];
24
+ }
25
+ /** Freeze live user settings at a turn boundary while keeping direct assemblies useful. */
26
+ export class AgentBehaviorPrompt {
27
+ #snapshots = new WeakMap();
28
+ snapshot(agent, turn, language) {
29
+ const current = this.#snapshots.get(agent);
30
+ if (current?.turn === turn)
31
+ return;
32
+ this.#snapshots.set(agent, { turn, language });
33
+ }
34
+ clear(agent) {
35
+ this.#snapshots.delete(agent);
36
+ }
37
+ fragment(context, current) {
38
+ const language = context.agent === undefined
39
+ ? current
40
+ : this.#snapshots.get(context.agent)?.language ?? current;
41
+ return agentLanguageFragment(language);
42
+ }
43
+ variable(context, current) {
44
+ const fragment = this.fragment(context, current);
45
+ return fragment === '' ? '' : `\n\n${fragment}`;
46
+ }
47
+ }
48
+ export function apply(ctx) {
49
+ const scope = ctx.settings.register(settingsNamespace(AGENT_BEHAVIOR_SETTINGS_NAMESPACE), AgentBehaviorSettingsSchema, { applies: 'live' });
50
+ const prompt = new AgentBehaviorPrompt();
51
+ ctx.on('agent/pre-step', async (payload, next) => {
52
+ prompt.snapshot(payload.agent, payload.turn, scope.get().language);
53
+ return next();
54
+ });
55
+ ctx.on('agent/status', ({ agent, status }) => {
56
+ if (status === 'idle')
57
+ prompt.clear(agent);
58
+ });
59
+ ctx.on('agent/disposed', ({ agent }) => { prompt.clear(agent); });
60
+ ctx.effect(() => ctx.systemPrompt.section({
61
+ name: AGENT_BEHAVIOR_SECTION,
62
+ order: AGENT_BEHAVIOR_ORDER,
63
+ text: context => prompt.fragment(context, scope.get().language),
64
+ }), 'omdsh Agent behavior prompt section');
65
+ ctx.effect(() => ctx.systemPrompt.variable(AGENT_BEHAVIOR_VARIABLE, context => prompt.variable(context, scope.get().language)), 'omdsh Agent behavior prompt variable');
66
+ ctx.inject(['tui'], (tuiCtx) => {
67
+ const binding = {
68
+ get: () => scope.get(),
69
+ update: next => scope.update({ language: next.language }),
70
+ watch: listener => scope.watch(next => { listener(next); }),
71
+ };
72
+ tuiCtx.effect(() => tuiCtx.tui.bindAgentBehaviorSettings?.(binding) ?? (() => { }), 'bind Agent behavior settings to TUI');
73
+ });
74
+ }
75
+ //# sourceMappingURL=agent-behavior.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agi-fans/oh-my-dsh",
3
3
  "description": "omdsh: a keyboard-first DeepSeek TUI coding agent on the DeepSeek Harness runtime",
4
- "version": "0.12.0",
4
+ "version": "0.13.0",
5
5
  "homepage": "https://omdsh.agi.fans/",
6
6
  "keywords": [
7
7
  "omdsh",
@@ -27,6 +27,13 @@
27
27
  "bin": {
28
28
  "omdsh": "lib/bin.js"
29
29
  },
30
+ "exports": {
31
+ "./agent-behavior": {
32
+ "types": "./lib/agent-behavior.d.ts",
33
+ "default": "./lib/agent-behavior.js"
34
+ },
35
+ "./package.json": "./package.json"
36
+ },
30
37
  "files": [
31
38
  "lib/*.js",
32
39
  "lib/*.d.ts",
@@ -100,9 +107,12 @@
100
107
  "@deepseek-ai/dsh-user-questions": "0.1.1-rc.2",
101
108
  "@deepseek-ai/dsh-subprocess-local": "0.1.1-rc.2",
102
109
  "@deepseek-ai/dsh-settings-file": "0.1.1-rc.2",
110
+ "@deepseek-ai/dsh-settings": "0.1.1-rc.2",
111
+ "@deepseek-ai/dsh-system-prompt": "0.1.1-rc.2",
112
+ "@deepseek-ai/schemastery": "3.18.1",
103
113
  "@deepseek-ai/dsh-credentials-local": "0.1.1-rc.2",
104
114
  "@deepseek-ai/dsh-authorization": "0.1.1-rc.2",
105
- "@agi-fans/dsh-tui": "^0.12.0"
115
+ "@agi-fans/dsh-tui": "^0.13.0"
106
116
  },
107
117
  "peerDependencies": {
108
118
  "@deepseek-ai/cordis": "^4.0.1"