@agi-fans/oh-my-dsh 0.11.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
@@ -6,7 +6,7 @@
6
6
 
7
7
  **Into the Unknown**
8
8
 
9
- A focused, keyboard-first DeepSeek coding agent built on the plugin architecture of [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) and inspired by the interaction quality of [oh-my-pi](https://github.com/can1357/oh-my-pi) and the original [Pi](https://github.com/earendil-works/pi) agent harness.
9
+ omdsh is a focused, keyboard-first DeepSeek coding agent built on the plugin architecture of [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) and inspired by the interaction quality of [oh-my-pi](https://github.com/can1357/oh-my-pi) and the original [Pi](https://github.com/earendil-works/pi) agent harness.
10
10
 
11
11
  [![CI](https://github.com/agi-fans/oh-my-dsh/actions/workflows/ci.yml/badge.svg)](https://github.com/agi-fans/oh-my-dsh/actions/workflows/ci.yml) [![npm version](https://img.shields.io/npm/v/%40agi-fans%2Foh-my-dsh?style=flat-square&logo=npm)](https://www.npmjs.com/package/@agi-fans/oh-my-dsh) [![npm downloads](https://img.shields.io/npm/dm/%40agi-fans%2Foh-my-dsh?style=flat-square&logo=npm)](https://www.npmjs.com/package/@agi-fans/oh-my-dsh) [![Node.js ^22.19 or >=24](https://img.shields.io/badge/node-%5E22.19%20%7C%7C%20%3E%3D24-339933?style=flat-square&logo=node.js)](https://nodejs.org/) [![MIT License](https://img.shields.io/npm/l/%40agi-fans%2Foh-my-dsh?style=flat-square)](https://github.com/agi-fans/oh-my-dsh/blob/main/LICENSE)
12
12
 
@@ -30,21 +30,22 @@ Run `/login` once inside omdsh to validate and save your DeepSeek API key, then
30
30
  ## Highlights
31
31
 
32
32
  - **Durable conversations:** search, pin, rename, and resume sessions in `/sessions`; rewind, retry, compact, and export complete transcripts as Markdown or standalone HTML.
33
- - **Four real session controls:** choose a Harness Agent preset (Standard, PTC, Minimal, or Cordis), Workflow (Default or Plan), tool presentation (Native, Code, or Both), and Access (Read only, Workspace write, or Full access).
33
+ - **Three real session controls:** choose a Harness Agent preset (Standard, PTC, Minimal, or Cordis), Workflow (Default or Plan), and Access (Read only, Workspace write, or Full access). Each Agent preset owns its tool exposure; PTC uses the generated TypeScript SDK automatically.
34
34
  - **Rich terminal input:** mention project files and other sessions with `@`, paste clipboard images, reuse persistent prompt history, edit multiline prompts externally, and retrieve queued follow-ups.
35
35
  - **Readable tool activity:** follow streaming calls and live subagent progress, press Down on an empty composer then Enter (or use Alt+A directly) to select a child in the keyboard-driven Agent Hub, steer a continuable child from its transcript, inspect distinct Input and Output sections, expand long results, and keep domain-specific presentation owned by tool plugins.
36
- - **Live operational context:** see Agent, Workflow, Tools, Access, model, reasoning effort, workspace, Git state, context pressure, tokens, TTFT, throughput, cache, timings, turns, and steps without leaving the composer; use `/context` for an inline projection-backed breakdown that remains in the transcript.
36
+ - **Live operational context:** see Agent, Workflow, Access, model, reasoning effort, workspace, Git state, context pressure, tokens, TTFT, throughput, cache, timings, turns, and steps without leaving the composer; use `/context` for an inline projection-backed breakdown that remains in the transcript.
37
37
  - **Responsive by design:** retain settled transcript layout, coalesce scroll updates, emit row-level terminal diffs, and preserve correct display-cell alignment for CJK text and emoji.
38
38
 
39
39
  ## Learn
40
40
 
41
41
  The full documentation is also published on the [official site](https://omdsh.agi.fans/).
42
42
 
43
- - [Tutorials](https://omdsh.agi.fans/docs/tutorials) — complete a first task, add precise context, guide queued work, recover long sessions, customize the environment, and write an installable plugin.
44
- - [Skills and MCP](https://omdsh.agi.fans/docs/skills-and-mcp) — extend a project with reusable instructions and external tools.
45
- - [User plugins](https://omdsh.agi.fans/docs/plugins) — install DSH bundles into the omdsh Profile with `omdsh plugin`.
46
- - [Architecture](https://omdsh.agi.fans/docs/architecture) — understand the plugin boundaries and runtime data flow.
47
- - [Performance](https://omdsh.agi.fans/docs/performance) — inspect the benchmarks, methodology, and rendering optimizations.
43
+ - [Tutorials](https://omdsh.agi.fans/docs/tutorials/) — complete a first task, add precise context, guide queued work, recover long sessions, customize the environment, and write an installable plugin.
44
+ - [Skills and MCP](https://omdsh.agi.fans/docs/skills-and-mcp/) — extend a project with reusable instructions and external tools.
45
+ - [User plugins](https://omdsh.agi.fans/docs/plugins/) — install DSH bundles into the omdsh Profile with `omdsh plugin`.
46
+ - [Architecture](https://omdsh.agi.fans/docs/architecture/) — understand the plugin boundaries and runtime data flow.
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
 
@@ -73,19 +74,19 @@ DeepSeek Harness plugins and services
73
74
  @agi-fans/oh-my-dsh — boot and plugin composition
74
75
  ```
75
76
 
76
- The TUI package is split into a service definition, local terminal Provider, session and interaction adapters, tool-presentation bridge, command contributions, and interactive Runner. This isolates terminal ownership from Harness domain state and exposes plugin seams only where a capability has an independent lifecycle or owner. See the [architecture overview](https://omdsh.agi.fans/docs/architecture) for the current boundaries and data flow.
77
+ The TUI package is split into a service definition, local terminal Provider, session and interaction adapters, tool-presentation bridge, command contributions, and interactive Runner. This isolates terminal ownership from Harness domain state and exposes plugin seams only where a capability has an independent lifecycle or owner. See the [architecture overview](https://omdsh.agi.fans/docs/architecture/) for the current boundaries and data flow.
77
78
 
78
79
  ## Performance
79
80
 
80
81
  Performance is part of the TUI architecture: durable sessions replay in linear time, Harness Projections avoid repeated history scans, settled transcript blocks retain formatted layout, and the terminal writer emits row-level diffs. On the documented Apple M5 Pro environment, restoring 10,000 conversation turns takes a median 2.62 ms, 10,000 tool calls take 22.71 ms, and rendering cached frames over a 5,000-turn surface averages 0.35 ms per frame.
81
82
 
82
- See the reproducible [TUI performance report](https://omdsh.agi.fans/docs/performance) or run `pnpm benchmark:tui` locally.
83
+ See the reproducible [TUI performance report](https://omdsh.agi.fans/docs/performance/) or run `pnpm benchmark:tui` locally.
83
84
 
84
85
  ## Configuration
85
86
 
86
87
  Run `/login` to configure a provider. DeepSeek still opens the official key dashboard, validates the key, and prefers the stored credential over an inherited `DEEPSEEK_API_KEY`. When a mounted provider registers a Harness authorization flow, `/login` lists that flow and its methods and the terminal only renders the notices and prompts the flow asks for. The same command can also activate a catalog API-key provider or add a custom provider with its own id, base URL, protocol, and model ids. `/model` then lists every live route. `/logout` removes an omdsh-managed choice and, for DeepSeek, falls back to the environment when available.
87
88
 
88
- Model settings can also come from `$DSH_HOME/settings.yaml`. Use `/model favorite` and `/model unfavorite` to maintain a small local cycle list, then use `Ctrl+P`/`Alt+P` to move through it and `Ctrl+T` to change reasoning effort. Skills and MCP configuration are documented in [Skills and MCP](https://omdsh.agi.fans/docs/skills-and-mcp).
89
+ Model settings can also come from `$DSH_HOME/settings.yaml`. Use `/model favorite` and `/model unfavorite` to maintain a small local cycle list, then use `Ctrl+P`/`Alt+P` to move through it and `Ctrl+T` to change reasoning effort. Skills and MCP configuration are documented in [Skills and MCP](https://omdsh.agi.fans/docs/skills-and-mcp/).
89
90
 
90
91
  After an upgrade, omdsh can show release notes once at startup. Use `/changelog` for recent entries or `/changelog full` for the complete packaged history. A cached daily npm check reports newer versions without installing anything automatically; both behaviors can be customized in `/settings`. Terminal notifications for completed long turns and human prompts are also configured there and remain off by default.
91
92
 
@@ -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,8 +1,20 @@
1
1
  {
2
2
  "name": "@agi-fans/oh-my-dsh",
3
- "description": "omdsh: TUI coding agent command over the DeepSeek Harness runtime",
4
- "version": "0.11.0",
5
- "homepage": "https://github.com/agi-fans/oh-my-dsh#readme",
3
+ "description": "omdsh: a keyboard-first DeepSeek TUI coding agent on the DeepSeek Harness runtime",
4
+ "version": "0.13.0",
5
+ "homepage": "https://omdsh.agi.fans/",
6
+ "keywords": [
7
+ "omdsh",
8
+ "oh-my-dsh",
9
+ "deepseek",
10
+ "deepseek-harness",
11
+ "dsh",
12
+ "plugin",
13
+ "dsh-plugin",
14
+ "tui",
15
+ "coding-agent",
16
+ "cli"
17
+ ],
6
18
  "repository": {
7
19
  "type": "git",
8
20
  "url": "git+https://github.com/agi-fans/oh-my-dsh.git",
@@ -15,6 +27,13 @@
15
27
  "bin": {
16
28
  "omdsh": "lib/bin.js"
17
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
+ },
18
37
  "files": [
19
38
  "lib/*.js",
20
39
  "lib/*.d.ts",
@@ -88,9 +107,12 @@
88
107
  "@deepseek-ai/dsh-user-questions": "0.1.1-rc.2",
89
108
  "@deepseek-ai/dsh-subprocess-local": "0.1.1-rc.2",
90
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",
91
113
  "@deepseek-ai/dsh-credentials-local": "0.1.1-rc.2",
92
114
  "@deepseek-ai/dsh-authorization": "0.1.1-rc.2",
93
- "@agi-fans/dsh-tui": "^0.11.0"
115
+ "@agi-fans/dsh-tui": "^0.13.0"
94
116
  },
95
117
  "peerDependencies": {
96
118
  "@deepseek-ai/cordis": "^4.0.1"