@songtonyli/dsh-cli 0.1.16 → 0.1.17

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
@@ -26,7 +26,7 @@ workspace and no build step. Native packages that ship one build per platform
26
26
  ripgrep, the PTY backend's addons, sharp, koffi, and the Landlock launcher — are
27
27
  ordinary optional dependencies, so npm resolves the right one for your machine.
28
28
 
29
- Requires Node `^22.19.0 || >=24.0.0`. Version 0.1.16; `dsh --version`
29
+ Requires Node `^22.19.0 || >=24.0.0`. Version 0.1.17; `dsh --version`
30
30
  also reports the harness build the package was assembled from.
31
31
 
32
32
  ## License
package/bin/dsh.mjs CHANGED
@@ -18,7 +18,7 @@ const argv = process.argv.slice(2)
18
18
  // version this package publishes. Reporting only one of the two would make an
19
19
  // ordinary `npm install @songtonyli/dsh-cli@x` look like it installed something else.
20
20
  if (argv.length === 1 && (argv[0] === '--version' || argv[0] === '-V')) {
21
- console.log('@songtonyli/dsh-cli 0.1.16 (deepseek-harness 0.1.6-alpha.2)')
21
+ console.log('@songtonyli/dsh-cli 0.1.17 (deepseek-harness 0.1.6-alpha.2)')
22
22
  process.exit(0)
23
23
  }
24
24
 
@@ -160,7 +160,7 @@ window.__ModuleLoader__.load({
160
160
  const SCROLLBAR_LINGER_MS = 2e3;
161
161
  /** Format complete-build metadata for the local brand badge. */
162
162
  function localBuildVersion() {
163
- return `0.1.6-alpha.2-5fbfcf3` + ({}.DSH_CLIENT_GIT_DIRTY === "true" ? "-dirty" : "");
163
+ return `0.1.6-alpha.2-f8474fd` + ({}.DSH_CLIENT_GIT_DIRTY === "true" ? "-dirty" : "");
164
164
  }
165
165
  /** Each panel row subscribes only to its own selection state. */
166
166
  function PanelRow({ id, label, wide, usePanelInfo, selectPanel, renderSlot }) {
@@ -2,5 +2,5 @@
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write packages/llm/llm-cursor/README.md
5
- README.md: d46f17251ec89d70165627179d6a41aad2949854
6
- README.zh.md: 2ffacf2c23f090f0c4209b24d8232aa301af8df5
5
+ README.md: ed90bf879f0f0a6e709b6008f0cd16f78e565a48
6
+ README.zh.md: c18c787d2ff6b51945b08213b6738a82fdf28ca3
@@ -82,7 +82,7 @@ Attribution headers required by `LlmAdapter` go on every HTTP/2 request, with Cu
82
82
 
83
83
  #### What the model sees
84
84
 
85
- One rebuilt Cursor `AgentRunRequest`: the system prompt as a root blob, completed turns (user text plus assistant text, thinking, and MCP tool calls with results), the current user action, requested model id, and MCP tool definitions with `providerIdentifier: dsh`. Images are not sent as Cursor selected images. Native Cursor workspace tools are not offered.
85
+ One rebuilt Cursor `AgentRunRequest`: the system prompt as a root blob, completed turns (user text plus assistant text, thinking, and MCP tool calls with results), the current user action, requested model id, and MCP tool definitions with `providerIdentifier: dsh`. Consecutive user-role messages with no assistant between them — the human prompt plus runtime-context snapshots, skill catalogs, and other injected user messages — join in order into that turn's user text, because a Run has one `userMessageAction`. Images are not sent as Cursor selected images. Native Cursor workspace tools are not offered.
86
86
 
87
87
  #### Token effect
88
88
 
@@ -82,7 +82,7 @@ DSH 的每一步模型调用是一次新的 HTTP/2 Connect `Run`,由 harness
82
82
 
83
83
  #### 模型看见什么
84
84
 
85
- 一次重建的 Cursor `AgentRunRequest`:作为根 blob 的系统提示、已完成的轮次(用户文本加上助手文本、thinking,以及带结果的 MCP 工具调用)、当前用户动作、请求的模型 id,以及 `providerIdentifier: dsh` 的 MCP 工具定义。图片不会作为 Cursor 选中图片发送。不提供原生 Cursor 工作区工具。
85
+ 一次重建的 Cursor `AgentRunRequest`:作为根 blob 的系统提示、已完成的轮次(用户文本加上助手文本、thinking,以及带结果的 MCP 工具调用)、当前用户动作、请求的模型 id,以及 `providerIdentifier: dsh` 的 MCP 工具定义。中间没有助手回复的连续 user 角色消息——人类提示加上运行时上下文快照、技能目录和其他注入的用户消息——按顺序拼进该轮的用户文本,因为一次 Run 只有一个 `userMessageAction`。图片不会作为 Cursor 选中图片发送。不提供原生 Cursor 工作区工具。
86
86
 
87
87
  #### Token 影响
88
88
 
@@ -969,6 +969,22 @@ function textOf(message) {
969
969
  return "";
970
970
  }).join("");
971
971
  }
972
+ function joinUserTexts(left, right) {
973
+ if (left.length === 0) return right;
974
+ if (right.length === 0) return left;
975
+ return `${left}\n\n${right}`;
976
+ }
977
+ function appendUserTurn(turns, text) {
978
+ const last = turns[turns.length - 1];
979
+ if (last !== void 0 && last.steps.length === 0) {
980
+ last.userText = joinUserTexts(last.userText, text);
981
+ return;
982
+ }
983
+ turns.push({
984
+ userText: text,
985
+ steps: []
986
+ });
987
+ }
972
988
  function parseArguments(raw) {
973
989
  try {
974
990
  const parsed = JSON.parse(raw);
@@ -1056,6 +1072,11 @@ function createUserMessage(text, selectedContextBlob) {
1056
1072
  }
1057
1073
  /**
1058
1074
  * Split harness messages into completed Cursor turns plus the current user text.
1075
+ *
1076
+ * Consecutive user-role messages with no assistant steps between them join in
1077
+ * order into one Cursor user text. A Run has a single `userMessageAction`, so
1078
+ * runtime-context snapshots and skill catalogs that follow the human prompt
1079
+ * ride that action instead of replacing it.
1059
1080
  * @param options - assembled model request.
1060
1081
  * @returns conversation turns and the new user action text.
1061
1082
  */
@@ -1087,10 +1108,7 @@ function conversationFromOptions(options) {
1087
1108
  continue;
1088
1109
  }
1089
1110
  if (message.role === "user") {
1090
- turns.push({
1091
- userText: textOf(message),
1092
- steps: []
1093
- });
1111
+ appendUserTurn(turns, textOf(message));
1094
1112
  continue;
1095
1113
  }
1096
1114
  if (turns.length === 0) turns.push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@songtonyli/dsh-cli",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "The dsh terminal agent: an interactive TUI over the DeepSeek Harness, with its whole Node runtime bundled in one install.",
5
5
  "license": "MIT",
6
6
  "type": "module",