deepccc 0.1.12 → 0.1.13

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.
Files changed (2) hide show
  1. package/dist/index.js +22 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -96,6 +96,24 @@ function buildRuntimeWorkspacePrompt(cwd) {
96
96
  "File tools run locally through DeepCCC. Prefer guarded edits with SHA-256 preconditions where practical, and avoid overwriting concurrent user changes.",
97
97
  ].join("\n");
98
98
  }
99
+ /**
100
+ * Windows 专属命令行指引(仅 win32 注入):cmd.exe 的引号语义与 bash 不同,
101
+ * 模型按 bash 习惯写命令时会被 cmd 拆坏(引号保留为字面量、单引号不生效、
102
+ * 多行/嵌套引号脚本崩坏)。这段提示放在固定规则区(项目指令之前)。
103
+ */
104
+ function buildPlatformCommandPrompt() {
105
+ if (process.platform !== "win32")
106
+ return "";
107
+ return [
108
+ "## Windows Command-Line Notes",
109
+ "You are running on Windows. run_command executes through cmd.exe, not bash. cmd quoting differs from bash and breaks common habits:",
110
+ "- Double quotes are NOT stripped: `echo \"hello world\"` prints `\"hello world\"` (quotes included), and `\"a b\" \"c\"` passes the literal arguments `\"a b\"` and `\"c\"` (quotes included) to the program.",
111
+ "- Single quotes are NOT quoting characters in cmd.exe: `'a b'` is parsed as two arguments (`'a` and `b'`).",
112
+ "- Multi-line or quote-heavy inline scripts (python -c \"...\\n...\", ssh host \"bash -c '...'\") frequently break under cmd quoting; write the script to a temporary file and execute that file instead.",
113
+ "- PowerShell-only syntax (Get-Item, 2>$null, Select-Object) is unavailable; the shell is cmd.exe unless you explicitly invoke powershell.",
114
+ "- To pass an argument containing spaces, use double quotes and expect the quotes to reach the program literally; when the target accepts file input, prefer writing the value to a file.",
115
+ ].join("\n");
116
+ }
99
117
  function normalizeMaxSteps(value) {
100
118
  if (value === undefined)
101
119
  return undefined;
@@ -157,6 +175,10 @@ export class ChatSession {
157
175
  */
158
176
  buildSystemPrompt(skills) {
159
177
  const systemContent = [SYSTEM_PROMPT];
178
+ const platformPrompt = buildPlatformCommandPrompt();
179
+ if (platformPrompt) {
180
+ systemContent.push("", platformPrompt);
181
+ }
160
182
  const projectInstructions = readProjectInstructionFiles(this.cwd);
161
183
  if (projectInstructions) {
162
184
  systemContent.push("", projectInstructions);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepccc",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "A lightweight DeepSeek-optimized coding agent with OpenAI-compatible model support.",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [