dsh-nerd-mode 0.2.0 → 0.2.1
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 +1 -1
- package/README.zh.md +1 -1
- package/client.js +7 -7
- package/cordis.patch.yml +2 -2
- package/lib/fold.js +1 -1
- package/lib/index.js +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ From a local folder or tarball:
|
|
|
35
35
|
dsh plugin --profile <profile> add C:\path\to\dsh-nerd-mode
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
Restart dsh. Every mode gains the `/nerd-mode` command and a `Nerd
|
|
38
|
+
Restart dsh. Every mode gains the `/nerd-mode` command and a `Nerd Mode` pill in the composer bar. The mode picker gains no new entry: the plugin mounts at profile level, not as a preset.
|
|
39
39
|
|
|
40
40
|
## Usage
|
|
41
41
|
|
package/README.zh.md
CHANGED
|
@@ -35,7 +35,7 @@ dsh plugin --profile <profile> add github:bocchii-the-code/dsh-nerd-mode
|
|
|
35
35
|
dsh plugin --profile <profile> add C:\path\to\dsh-nerd-mode
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
重启 dsh。每个模式都会多出 `/nerd-mode` 命令,输入框工具栏多一个 `Nerd
|
|
38
|
+
重启 dsh。每个模式都会多出 `/nerd-mode` 命令,输入框工具栏多一个 `Nerd Mode` 胶囊。模式选择器不会多出新条目:插件挂在 profile 层,不是预设。
|
|
39
39
|
|
|
40
40
|
## 使用方法
|
|
41
41
|
|
package/client.js
CHANGED
|
@@ -5,7 +5,7 @@ window.__ModuleLoader__.load({
|
|
|
5
5
|
const { Toast } = require('@deepseek-ai/dsh-client-ui-primitives');
|
|
6
6
|
|
|
7
7
|
const SLOT = 'conversation.input.left';
|
|
8
|
-
const LABEL = 'Nerd
|
|
8
|
+
const LABEL = 'Nerd Mode';
|
|
9
9
|
|
|
10
10
|
// 16px book, same footprint as the Full Throttle bolt.
|
|
11
11
|
const BOOK = React.createElement(
|
|
@@ -51,14 +51,14 @@ window.__ModuleLoader__.load({
|
|
|
51
51
|
// reach the command executor and write nothing to the session log.
|
|
52
52
|
function failureText(result) {
|
|
53
53
|
if (!result?.ok) {
|
|
54
|
-
return `Nerd
|
|
54
|
+
return `Nerd Mode did not switch: ${result?.error?.message ?? 'the host rejected the command'}`;
|
|
55
55
|
}
|
|
56
56
|
if (result.value == null) {
|
|
57
|
-
return 'Nerd
|
|
57
|
+
return 'Nerd Mode did not switch: /nerd-mode is not available in this build.';
|
|
58
58
|
}
|
|
59
59
|
const outcome = result.value.result;
|
|
60
60
|
if (outcome?.kind === 'error') {
|
|
61
|
-
return `Nerd
|
|
61
|
+
return `Nerd Mode did not switch: ${outcome.text ?? 'the command failed'}`;
|
|
62
62
|
}
|
|
63
63
|
return null;
|
|
64
64
|
}
|
|
@@ -88,7 +88,7 @@ window.__ModuleLoader__.load({
|
|
|
88
88
|
setToast({ id: Date.now(), text });
|
|
89
89
|
}
|
|
90
90
|
} catch (error) {
|
|
91
|
-
const text = `Nerd
|
|
91
|
+
const text = `Nerd Mode did not switch: ${error?.message ?? 'the host rejected the command'}`;
|
|
92
92
|
setFailure(text);
|
|
93
93
|
setToast({ id: Date.now(), text });
|
|
94
94
|
} finally {
|
|
@@ -107,7 +107,7 @@ window.__ModuleLoader__.load({
|
|
|
107
107
|
'aria-checked': active,
|
|
108
108
|
'aria-label': LABEL,
|
|
109
109
|
'data-state': active ? 'on' : 'off',
|
|
110
|
-
title: failure ?? (active ? 'Nerd
|
|
110
|
+
title: failure ?? (active ? 'Nerd Mode is on' : 'Nerd Mode is off'),
|
|
111
111
|
disabled: busy,
|
|
112
112
|
onMouseDown: (event) => event.preventDefault(),
|
|
113
113
|
onClick,
|
|
@@ -142,7 +142,7 @@ window.__ModuleLoader__.load({
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
return {
|
|
145
|
-
inject: ['slots', 'remote.commands'],
|
|
145
|
+
inject: ['slots', 'remote', 'remote.commands'],
|
|
146
146
|
apply(ctx) {
|
|
147
147
|
ctx.slots.inject(SLOT, () =>
|
|
148
148
|
ctx.slots.register({
|
package/cordis.patch.yml
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Nerd
|
|
1
|
+
# Nerd Mode is a profile-level plugin, not a preset. See docs/adr/0008.
|
|
2
2
|
- insert:
|
|
3
3
|
- id: dsh-nerd-mode
|
|
4
4
|
name: dsh-nerd-mode
|
|
5
5
|
config:
|
|
6
6
|
section: |
|
|
7
|
-
Nerd
|
|
7
|
+
Nerd Mode is on for this conversation. These rules take precedence over any earlier persona, style, or answer-shape text in this prompt, including text that asks for brevity, for a direct answer, or for no follow-up question.
|
|
8
8
|
|
|
9
9
|
A learning-shaped request gets the guided shape. Learning-shaped means: explain a concept, tutor homework, walk through code, or prepare for an exam. Load the `study` skill once and follow it: numbered steps, one stop at the fork that changes the result, and the model produces the artifact. Write no file. Read no `study/` file. Do not grade, score, or log.
|
|
10
10
|
|
package/lib/fold.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The Nerd
|
|
2
|
+
* The Nerd Mode state machine, kept free of host imports so it can be tested
|
|
3
3
|
* with plain node. State folds the session log: `command/run` records the
|
|
4
4
|
* request, `command/done` commits it. Nothing else is written, because an
|
|
5
5
|
* unknown stored event type stops a session from reopening.
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Nerd
|
|
2
|
+
* Nerd Mode: a per-session switch. While it is on, one prompt section joins
|
|
3
3
|
* every request and the `study` skill becomes the default answer shape. State
|
|
4
4
|
* folds from the session log, so it survives compaction, resume, and fork. The
|
|
5
5
|
* tool set never changes.
|
|
@@ -71,21 +71,21 @@ export function apply(ctx, config) {
|
|
|
71
71
|
ctx.inject(['commands'], (commandCtx) => {
|
|
72
72
|
commandCtx.commands.register({
|
|
73
73
|
name: COMMAND,
|
|
74
|
-
description: 'Turn Nerd
|
|
74
|
+
description: 'Turn Nerd Mode on or off for this conversation',
|
|
75
75
|
input: { hint: '[on|off]' },
|
|
76
76
|
handler: ({ agent, rawInput }) => {
|
|
77
77
|
const arg = rawInput.trim().toLowerCase()
|
|
78
78
|
const active = ctx.sessionProjections.stateOf(agent.session, KEY).active
|
|
79
79
|
|
|
80
80
|
if (arg === 'off') {
|
|
81
|
-
return { kind: 'success', text: active ? 'Nerd
|
|
81
|
+
return { kind: 'success', text: active ? 'Nerd Mode off.' : 'Nerd Mode is already off.' }
|
|
82
82
|
}
|
|
83
83
|
if (arg !== '' && arg !== 'on') {
|
|
84
84
|
return { kind: 'error', text: `Unknown argument "${arg}". Use /nerd-mode on or /nerd-mode off.` }
|
|
85
85
|
}
|
|
86
86
|
return {
|
|
87
87
|
kind: 'success',
|
|
88
|
-
text: active ? 'Nerd
|
|
88
|
+
text: active ? 'Nerd Mode is already on.' : 'Nerd Mode on. /study guides a concept or a task.',
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
91
|
})
|