@x-all-in-one/coding-helper 0.3.2 → 0.3.3

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.
@@ -16,6 +16,8 @@ const OH_MY_OPENCODE_AGENTS = [
16
16
  'document-writer',
17
17
  'multimodal-looker',
18
18
  ];
19
+ // Unified output token limit for all models
20
+ const OUTPUT_TOKEN_LIMIT = 32000;
19
21
  // Default configuration
20
22
  export const OPENCODE_DEFAULT_CONFIG = {
21
23
  BASE_URL: 'https://code-api.x-aio.com/v1',
@@ -24,10 +26,10 @@ export const OPENCODE_DEFAULT_CONFIG = {
24
26
  DEFAULT_SMALL_MODEL: 'Qwen3-Coder-30B-A3B-Instruct',
25
27
  // Default limits (hardcoded for v1, will be fetched from API in future)
26
28
  DEFAULT_CONTEXT: 128000,
27
- DEFAULT_OUTPUT: 64000,
29
+ DEFAULT_OUTPUT: OUTPUT_TOKEN_LIMIT,
28
30
  // Vision model limits
29
31
  VISION_CONTEXT: 64000,
30
- VISION_OUTPUT: 32000,
32
+ VISION_OUTPUT: OUTPUT_TOKEN_LIMIT,
31
33
  };
32
34
  /**
33
35
  * OpenCode 工具实现
@@ -118,11 +120,11 @@ export class OpenCodeTool extends BaseTool {
118
120
  if (info.name && info.name !== info.id) {
119
121
  entry.name = info.name;
120
122
  }
121
- // Set limits (use API values if available, otherwise use defaults)
123
+ // Set limits (context from API, output always use unified limit)
122
124
  if (isVision) {
123
125
  entry.limit = {
124
126
  context: info.context_length || OPENCODE_DEFAULT_CONFIG.VISION_CONTEXT,
125
- output: info.max_output_tokens || OPENCODE_DEFAULT_CONFIG.VISION_OUTPUT,
127
+ output: OUTPUT_TOKEN_LIMIT,
126
128
  };
127
129
  // Add modalities for vision models
128
130
  entry.modalities = {
@@ -133,7 +135,7 @@ export class OpenCodeTool extends BaseTool {
133
135
  else {
134
136
  entry.limit = {
135
137
  context: info.context_length || OPENCODE_DEFAULT_CONFIG.DEFAULT_CONTEXT,
136
- output: info.max_output_tokens || OPENCODE_DEFAULT_CONFIG.DEFAULT_OUTPUT,
138
+ output: OUTPUT_TOKEN_LIMIT,
137
139
  };
138
140
  }
139
141
  models[info.id] = entry;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@x-all-in-one/coding-helper",
3
3
  "type": "module",
4
- "version": "0.3.2",
4
+ "version": "0.3.3",
5
5
  "description": "X All In One Coding Helper",
6
6
  "author": "X.AIO",
7
7
  "homepage": "https://docs.x-aio.com/zh/docs",