@aliou/pi-neuralwatt 0.11.4 → 0.12.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.
@@ -199,6 +199,13 @@ export default async function (pi: ExtensionAPI) {
199
199
  return { message: overflowMessage };
200
200
  });
201
201
 
202
+ // Inject the active Pi session id as a conversation id on every Neuralwatt
203
+ // request so the gateway can correlate requests within a session.
204
+ pi.on("before_provider_headers", (event, ctx) => {
205
+ if (ctx.model?.provider !== "neuralwatt") return;
206
+ event.headers["X-NW-Conversation-ID"] = ctx.sessionManager.getSessionId();
207
+ });
208
+
202
209
  pi.on("after_provider_response", (event, ctx) => {
203
210
  if (ctx.model?.provider !== "neuralwatt") return;
204
211
 
@@ -56,10 +56,26 @@ const DEEPSEEK_V4_FLASH: NeuralwattModelFamily = {
56
56
  },
57
57
  };
58
58
 
59
- // Google, served from NVIDIA's NVFP4 checkpoint.
59
+ // Google, served from NVIDIA's NVFP4 checkpoint. Gemma 4's chat template
60
+ // takes a boolean rather than an effort level, so it has a single reasoning
61
+ // depth (`max`) plus thinking-off; every non-`none` value resolves to `max`.
62
+ // It does not reason by default (`default_enabled: false`), but the model
63
+ // can produce reasoning traces when asked. See
64
+ // https://portal.neuralwatt.com/docs/api/chat-completions#reasoning-effort
65
+ const GEMMA_4_THINKING: ThinkingLevelMap = {
66
+ off: "none",
67
+ minimal: null,
68
+ low: null,
69
+ medium: null,
70
+ high: null,
71
+ xhigh: null,
72
+ max: "max",
73
+ };
74
+
60
75
  const GEMMA_4: NeuralwattModelFamily = {
61
76
  cost: { input: 0.144, output: 0.42, cacheRead: 0.0144 },
62
77
  vision: true,
78
+ thinkingLevelMap: GEMMA_4_THINKING,
63
79
  };
64
80
 
65
81
  // ZhipuAI.
@@ -132,7 +148,7 @@ const FAMILIES: [NeuralwattModelFamily, NeuralwattVariantSpec[]][] = [
132
148
  name: "Gemma 4 31B",
133
149
  contextWindow: 262128,
134
150
  maxOutputTokens: 16384,
135
- reasoning: false,
151
+ reasoning: true,
136
152
  },
137
153
  ],
138
154
  ],
@@ -147,11 +163,14 @@ const FAMILIES: [NeuralwattModelFamily, NeuralwattVariantSpec[]][] = [
147
163
  reasoning: true,
148
164
  },
149
165
  {
166
+ // GLM-5.2 Fast pins thinking off by default, but keeps the parent's
167
+ // full reasoning contract (`high`/`max`/`none`): sending
168
+ // `reasoning_effort` re-enables thinking for that request.
150
169
  id: "glm-5.2-fast",
151
- name: "GLM-5.2 Fast",
170
+ name: "GLM-5.2 (fast)",
152
171
  contextWindow: 1048560,
153
172
  maxOutputTokens: null,
154
- reasoning: false,
173
+ reasoning: true,
155
174
  },
156
175
  {
157
176
  id: "glm-5.2-flex",
@@ -169,11 +188,13 @@ const FAMILIES: [NeuralwattModelFamily, NeuralwattVariantSpec[]][] = [
169
188
  reasoning: true,
170
189
  },
171
190
  {
191
+ // Short/fast: pins thinking off but keeps the parent reasoning
192
+ // contract, like glm-5.2-fast.
172
193
  id: "glm-5.2-short-fast",
173
- name: "GLM-5.2 Short Fast",
194
+ name: "GLM-5.2 (short, fast)",
174
195
  contextWindow: 199984,
175
196
  maxOutputTokens: 32000,
176
- reasoning: false,
197
+ reasoning: true,
177
198
  },
178
199
  {
179
200
  id: "glm-5.2-short-flex",
@@ -184,11 +205,13 @@ const FAMILIES: [NeuralwattModelFamily, NeuralwattVariantSpec[]][] = [
184
205
  costMultiplier: FLEX_COST_MULTIPLIER,
185
206
  },
186
207
  {
208
+ // Short/fast/flex: pins thinking off but keeps the parent reasoning
209
+ // contract, like glm-5.2-fast.
187
210
  id: "glm-5.2-short-fast-flex",
188
211
  name: "GLM-5.2 (short, fast, flex)",
189
212
  contextWindow: 199984,
190
213
  maxOutputTokens: 32000,
191
- reasoning: false,
214
+ reasoning: true,
192
215
  costMultiplier: FLEX_COST_MULTIPLIER,
193
216
  },
194
217
  ],
@@ -210,6 +233,14 @@ const FAMILIES: [NeuralwattModelFamily, NeuralwattVariantSpec[]][] = [
210
233
  maxOutputTokens: null,
211
234
  reasoning: false,
212
235
  },
236
+ {
237
+ id: "kimi-k3-flex",
238
+ name: "Kimi K3 (flex)",
239
+ contextWindow: 1048560,
240
+ maxOutputTokens: null,
241
+ reasoning: true,
242
+ costMultiplier: FLEX_COST_MULTIPLIER,
243
+ },
213
244
  ],
214
245
  ],
215
246
  [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aliou/pi-neuralwatt",
3
- "version": "0.11.4",
3
+ "version": "0.12.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "private": false,
@@ -34,7 +34,7 @@
34
34
  "!extensions/**/*.test.ts"
35
35
  ],
36
36
  "dependencies": {
37
- "@aliou/pi-utils-settings": "^0.18.0",
37
+ "@aliou/pi-utils-settings": "^0.19.1",
38
38
  "@aliou/pi-utils-ui": "^0.5.0"
39
39
  },
40
40
  "peerDependencies": {
@@ -67,8 +67,8 @@
67
67
  "format": "biome check --write",
68
68
  "test": "vitest run",
69
69
  "test:watch": "vitest",
70
- "gen:schema": "ts-json-schema-generator --path src/config/types.ts --type NeuralwattConfig --no-type-check -o schema.json",
71
- "check:schema": "ts-json-schema-generator --path src/config/types.ts --type NeuralwattConfig --no-type-check -o /tmp/schema-check.json && diff -q schema.json /tmp/schema-check.json",
70
+ "gen:schema": "pi-settings-schema -p src/config/types.ts -t NeuralwattConfig -o schema.json --version 0.12.0",
71
+ "check:schema": "pi-settings-schema -p src/config/types.ts -t NeuralwattConfig -o schema.json --version 0.12.0 --check",
72
72
  "check:lockfile": "pnpm install --frozen-lockfile --ignore-scripts",
73
73
  "prepare": "[ -d .git ] && husky || true",
74
74
  "changeset": "changeset",
package/schema.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
- "$ref": "#/definitions/NeuralwattConfig",
3
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$ref": "#/definitions/NeuralwattConfig",
4
4
  "definitions": {
5
5
  "NeuralwattConfig": {
6
- "additionalProperties": false,
6
+ "type": "object",
7
7
  "properties": {
8
8
  "$schema": {
9
- "description": "$schema URL for editor autocomplete.",
10
9
  "type": "string"
11
10
  },
12
11
  "provider": {
@@ -24,57 +23,70 @@
24
23
  "subBarIntegration": {
25
24
  "$ref": "#/definitions/NeuralwattSubBarIntegrationConfig",
26
25
  "description": "Sub-bar/status-bar integration feature."
26
+ },
27
+ "version": {
28
+ "anyOf": [
29
+ {
30
+ "type": "integer",
31
+ "minimum": 0
32
+ },
33
+ {
34
+ "type": "string",
35
+ "pattern": "^\\d{1,15}(\\.\\d{1,15})?(\\.\\d{1,15})?$"
36
+ }
37
+ ],
38
+ "description": "Config schema version, stamped by migrations. Current version: 0.12.0."
27
39
  }
28
40
  },
29
- "type": "object"
41
+ "additionalProperties": false
30
42
  },
31
43
  "NeuralwattProviderConfig": {
32
- "additionalProperties": false,
44
+ "type": "object",
33
45
  "properties": {
46
+ "includeLegacyModelIds": {
47
+ "type": "boolean",
48
+ "description": "Include legacy Neuralwatt model IDs in the model picker."
49
+ },
34
50
  "includeAliasedModelIds": {
35
- "description": "Include alternate creator-scoped Neuralwatt model IDs in the model picker.",
36
- "type": "boolean"
51
+ "type": "boolean",
52
+ "description": "Include alternate creator-scoped Neuralwatt model IDs in the model picker."
37
53
  },
38
54
  "includeEarlyAccessModels": {
39
- "description": "Include early-access Neuralwatt models discovered via the authenticated API.",
40
- "type": "boolean"
41
- },
42
- "includeLegacyModelIds": {
43
- "description": "Include legacy Neuralwatt model IDs in the model picker.",
44
- "type": "boolean"
55
+ "type": "boolean",
56
+ "description": "Include early-access Neuralwatt models discovered via the authenticated API."
45
57
  }
46
58
  },
47
- "type": "object"
59
+ "additionalProperties": false
48
60
  },
49
61
  "NeuralwattQuotaCommandConfig": {
50
- "additionalProperties": false,
62
+ "type": "object",
51
63
  "properties": {
52
64
  "enabled": {
53
- "description": "Show the quota command (/neuralwatt:quota).",
54
- "type": "boolean"
65
+ "type": "boolean",
66
+ "description": "Show the quota command (/neuralwatt:quota)."
55
67
  }
56
68
  },
57
- "type": "object"
69
+ "additionalProperties": false
58
70
  },
59
71
  "NeuralwattQuotaWarningsConfig": {
60
- "additionalProperties": false,
72
+ "type": "object",
61
73
  "properties": {
62
74
  "enabled": {
63
- "description": "Show quota warnings when credits or energy are low.",
64
- "type": "boolean"
75
+ "type": "boolean",
76
+ "description": "Show quota warnings when credits or energy are low."
65
77
  }
66
78
  },
67
- "type": "object"
79
+ "additionalProperties": false
68
80
  },
69
81
  "NeuralwattSubBarIntegrationConfig": {
70
- "additionalProperties": false,
82
+ "type": "object",
71
83
  "properties": {
72
84
  "enabled": {
73
- "description": "Show usage in the sub-bar / status bar.",
74
- "type": "boolean"
85
+ "type": "boolean",
86
+ "description": "Show usage in the sub-bar / status bar."
75
87
  }
76
88
  },
77
- "type": "object"
89
+ "additionalProperties": false
78
90
  }
79
91
  }
80
- }
92
+ }
@@ -29,6 +29,7 @@ function isPreviousConfigWithoutLegacyDefault(
29
29
  export const disableLegacyModelIdsByDefaultMigration: Migration<NeuralwattConfig> =
30
30
  {
31
31
  name: "disable-legacy-model-ids-by-default",
32
+ version: "0.8.0",
32
33
  shouldRun: isPreviousConfigWithoutLegacyDefault,
33
34
  message:
34
35
  "[neuralwatt] legacy model IDs (ids including the provider and the quantization) are disabled by default. You can enable them with /neuralwatt:settings.",
@@ -80,6 +80,7 @@ export async function backupConfig(filePath: string): Promise<void> {
80
80
 
81
81
  export const flatToNestedConfigMigration: Migration<NeuralwattConfig> = {
82
82
  name: "flat-to-nested-config",
83
+ version: "0.8.1",
83
84
  shouldRun: isPreviousConfig,
84
85
  message: FLAT_CONFIG_MIGRATION_MESSAGE,
85
86
  run: async (config, filePath) => {
@@ -25,6 +25,7 @@ function previousProvider(
25
25
  */
26
26
  export const renameHiddenToEarlyAccessMigration: Migration<NeuralwattConfig> = {
27
27
  name: "rename-hidden-models-to-early-access",
28
+ version: "0.10.6",
28
29
  shouldRun: (config) =>
29
30
  previousProvider(config)?.includeHiddenModels !== undefined,
30
31
  message:
@@ -25,6 +25,7 @@ function previousProvider(
25
25
  export const enableAliasesForLegacyUsersMigration: Migration<NeuralwattConfig> =
26
26
  {
27
27
  name: "enable-alias-model-ids-for-legacy-users",
28
+ version: "0.11.0",
28
29
  shouldRun: (config) => {
29
30
  const provider = previousProvider(config);
30
31
  return (