oc-tweaks 0.4.0 → 0.4.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 CHANGED
@@ -89,13 +89,15 @@ Customize the appearance of the WPF notification window.
89
89
 
90
90
  ### `compaction`
91
91
 
92
- This plugin ensures that when OpenCode compacts a session's context, the resulting summary is generated in your preferred language (e.g., Chinese) instead of defaulting to English.
92
+ This plugin ensures that when OpenCode compacts a session's context, the resulting summary is generated in your preferred language and writing style.
93
93
 
94
94
  **Configuration Options:**
95
95
 
96
96
  | Property | Type | Default | Description |
97
97
  |---|---|---|---|
98
98
  | `enabled` | boolean | `true` | Enable or disable the plugin. |
99
+ | `language` | string | session language | Target language for the compaction summary (e.g., `"繁体中文"`, `"French"`). Defaults to the language the user used most in the session. |
100
+ | `style` | string | `"concise and well-organized"` | Writing style for the compaction summary (e.g., `"毛泽东语言风格"`, `"academic"`). |
99
101
 
100
102
  ### `autoMemory`
101
103
 
@@ -163,7 +165,9 @@ Here is an example of a `~/.config/opencode/oc-tweaks.json` file with all option
163
165
  }
164
166
  },
165
167
  "compaction": {
166
- "enabled": true
168
+ "enabled": true,
169
+ "language": "繁体中文",
170
+ "style": "毛泽东语言风格"
167
171
  },
168
172
  "autoMemory": {
169
173
  "enabled": true
@@ -275,13 +279,15 @@ bunx oc-tweaks init
275
279
 
276
280
  ### `compaction`
277
281
 
278
- 此插件确保当 OpenCode 压缩会话上下文时,生成的摘要使用你的首选语言(例如中文),而不是默认为英文。
282
+ 此插件确保当 OpenCode 压缩会话上下文时,生成的摘要使用你的首选语言和写作风格。
279
283
 
280
284
  **配置选项:**
281
285
 
282
286
  | 属性 | 类型 | 默认值 | 描述 |
283
287
  |---|---|---|---|
284
288
  | `enabled` | boolean | `true` | 启用或禁用此插件。 |
289
+ | `language` | string | 会话语言 | 压缩摘要的目标语言(如 `"繁体中文"`、`"French"`)。默认使用会话中用户最常使用的语言。 |
290
+ | `style` | string | `"concise and well-organized"` | 压缩摘要的写作风格(如 `"毛泽东语言风格"`、`"academic"`)。 |
285
291
 
286
292
  ### `autoMemory`
287
293
 
@@ -349,7 +355,9 @@ bunx oc-tweaks init
349
355
  }
350
356
  },
351
357
  "compaction": {
352
- "enabled": true
358
+ "enabled": true,
359
+ "language": "繁体中文",
360
+ "style": "毛泽东语言风格"
353
361
  },
354
362
  "autoMemory": {
355
363
  "enabled": true
package/dist/index.js CHANGED
@@ -321,11 +321,12 @@ ${VIOLATION_WARNING}`;
321
321
  };
322
322
  };
323
323
  // src/plugins/compaction.ts
324
- function buildLanguagePrompt(language) {
324
+ function buildCompactionPrompt(language, style) {
325
325
  const lang = language || "the language the user used most in this session";
326
- return `## Language Preference
326
+ const writingStyle = style || "concise and well-organized";
327
+ return `## Language & Style Preference
327
328
 
328
- Write the compaction summary in ${lang}. Keep technical terms (filenames, commands, code) in their original form.`;
329
+ Write the compaction summary in ${lang}, using a ${writingStyle} writing style. Keep technical terms (filenames, commands, code) in their original form.`;
329
330
  }
330
331
  var compactionPlugin = async () => {
331
332
  return {
@@ -333,7 +334,7 @@ var compactionPlugin = async () => {
333
334
  const config = await loadOcTweaksConfig();
334
335
  if (!config || config.compaction?.enabled !== true)
335
336
  return;
336
- output.context.push(buildLanguagePrompt(config.compaction?.language));
337
+ output.context.push(buildCompactionPrompt(config.compaction?.language, config.compaction?.style));
337
338
  })
338
339
  };
339
340
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oc-tweaks",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./dist/index.js"