@serviceme/devtools-shared 0.4.11 → 0.4.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.
package/dist/index.d.mts CHANGED
@@ -40,7 +40,7 @@
40
40
  * pre-fill baseUrl / displayName / default model list without
41
41
  * requiring the user to look up endpoint docs.
42
42
  */
43
- type ProviderType = "openai-compatible" | "anthropic-compatible" | "minimax" | "deepseek" | "kimi" | "zhipu" | "stepfun" | "siliconflow" | "openrouter" | "novita" | "agnes" | "medalsoft" | "vscode-builtin";
43
+ type ProviderType = "openai-compatible" | "anthropic-compatible" | "minimax" | "deepseek" | "kimi" | "zhipu" | "stepfun" | "siliconflow" | "openrouter" | "novita" | "agnes" | "medalsoft" | "sensenova" | "vscode-builtin";
44
44
  /**
45
45
  * Curated metadata for named, well-known models. Used as a
46
46
  * **fallback** when a `ProviderModel` entry omits one of the
@@ -770,7 +770,7 @@ interface PresetModelFamilyGroup {
770
770
  entries: readonly PresetModelListing[];
771
771
  }
772
772
  declare function listPresetModelGroups(): readonly PresetModelFamilyGroup[];
773
- declare const BUILTIN_PROVIDER_PRESETS: Readonly<Record<"minimax" | "deepseek" | "kimi" | "zhipu" | "stepfun" | "siliconflow" | "openrouter" | "novita" | "agnes" | "medalsoft", {
773
+ declare const BUILTIN_PROVIDER_PRESETS: Readonly<Record<"minimax" | "deepseek" | "kimi" | "zhipu" | "stepfun" | "siliconflow" | "openrouter" | "novita" | "agnes" | "medalsoft" | "sensenova", {
774
774
  displayName: string;
775
775
  baseUrl: string;
776
776
  models: ProviderModel[];
package/dist/index.d.ts CHANGED
@@ -40,7 +40,7 @@
40
40
  * pre-fill baseUrl / displayName / default model list without
41
41
  * requiring the user to look up endpoint docs.
42
42
  */
43
- type ProviderType = "openai-compatible" | "anthropic-compatible" | "minimax" | "deepseek" | "kimi" | "zhipu" | "stepfun" | "siliconflow" | "openrouter" | "novita" | "agnes" | "medalsoft" | "vscode-builtin";
43
+ type ProviderType = "openai-compatible" | "anthropic-compatible" | "minimax" | "deepseek" | "kimi" | "zhipu" | "stepfun" | "siliconflow" | "openrouter" | "novita" | "agnes" | "medalsoft" | "sensenova" | "vscode-builtin";
44
44
  /**
45
45
  * Curated metadata for named, well-known models. Used as a
46
46
  * **fallback** when a `ProviderModel` entry omits one of the
@@ -770,7 +770,7 @@ interface PresetModelFamilyGroup {
770
770
  entries: readonly PresetModelListing[];
771
771
  }
772
772
  declare function listPresetModelGroups(): readonly PresetModelFamilyGroup[];
773
- declare const BUILTIN_PROVIDER_PRESETS: Readonly<Record<"minimax" | "deepseek" | "kimi" | "zhipu" | "stepfun" | "siliconflow" | "openrouter" | "novita" | "agnes" | "medalsoft", {
773
+ declare const BUILTIN_PROVIDER_PRESETS: Readonly<Record<"minimax" | "deepseek" | "kimi" | "zhipu" | "stepfun" | "siliconflow" | "openrouter" | "novita" | "agnes" | "medalsoft" | "sensenova", {
774
774
  displayName: string;
775
775
  baseUrl: string;
776
776
  models: ProviderModel[];
package/dist/index.js CHANGED
@@ -183,6 +183,13 @@ var PROVIDER_BASE_URL_PRESETS = {
183
183
  { label: "\u5185\u7F51", baseUrl: MEDALSOFT_PRIVATE_GATEWAY_URL },
184
184
  { label: "\u5916\u7F51", baseUrl: "https://nexus.servicemecloud.com/v1" }
185
185
  ],
186
+ // SenseNova (SenseTime) — single OpenAI-compatible token-plan
187
+ // gateway (https://platform.sensenova.cn/docs). Also exposes an
188
+ // Anthropic-compatible endpoint at the bare host
189
+ // `https://token.sensenova.cn` (SDK appends /v1/messages), but the
190
+ // named `sensenova` type routes through OpenAIAdapter, so only the
191
+ // OpenAI-compat `/v1` base is offered here.
192
+ sensenova: [{ label: "\u5B98\u65B9", baseUrl: "https://token.sensenova.cn/v1" }],
186
193
  "vscode-builtin": []
187
194
  };
188
195
  function getProviderBaseUrlPresets(type) {
@@ -227,6 +234,11 @@ var PROVIDER_CACHE_CONTROL_METADATA = {
227
234
  // Flip to `supportsCacheControl: true` once the gateway is verified
228
235
  // to honour stable prompt caching.
229
236
  medalsoft: {},
237
+ // SenseNova (SenseTime) token-plan gateway — the /v1/models payload
238
+ // publishes an `input_cache_read` pricing field (all-zero today), so
239
+ // the upstream is cache-aware in principle, but there is no
240
+ // documented prompt-cache key contract. Off until verified.
241
+ sensenova: {},
230
242
  "vscode-builtin": {}
231
243
  };
232
244
  function isProviderCacheControlAware(type) {
@@ -283,6 +295,29 @@ var PRIMARY_METADATA = {
283
295
  maxInputTokens: 131072,
284
296
  maxOutputTokens: 73728
285
297
  },
298
+ "sensenova-6.8-flash-lite": {
299
+ detail: "SenseNova 6.8 Flash-Lite \u2014 \u8F7B\u91CF\u591A\u6A21\u6001\u667A\u80FD\u4F53\u6A21\u578B\uFF0C\u652F\u6301\u56FE\u50CF\u7406\u89E3 / \u5DE5\u5177\u8C03\u7528\uFF08262K \u4E0A\u4E0B\u6587\uFF0Ctoken-plan \u9650\u9891\uFF09",
300
+ imageInput: true,
301
+ toolCalling: true,
302
+ // Per https://platform.sensenova.cn/docs (fetched 2026-08-25): the
303
+ // /v1/models listing publishes all-zero pricing (token-plan free
304
+ // tier, quota-limited per 5h window rather than per-token billed).
305
+ // Both currency blocks pin 0 so the picker shows a free model
306
+ // instead of an invented rate; when SenseNova publishes per-token
307
+ // pricing, update both blocks here.
308
+ pricingUSD: { input: 0, output: 0, cacheRead: 0 },
309
+ pricingCNY: { input: 0, output: 0, cacheRead: 0 },
310
+ priceCategory: "low",
311
+ // Docs advertise `reasoning_effort` ("low"/"medium"/"high"/"none",
312
+ // default "medium") and list "reasoning" in supported_features —
313
+ // a leveled effort scale, so the picker gets the 3-level dropdown
314
+ // and the OpenAI adapter gates the wire field.
315
+ thinkingSchema: "reasoningEffort",
316
+ supportsReasoningEffort: true,
317
+ // Per /v1/models: context_length 262144, max_output_length 65536.
318
+ maxInputTokens: 262144,
319
+ maxOutputTokens: 65536
320
+ },
286
321
  "deepseek-v4-flash": {
287
322
  detail: "Fast, general-purpose model",
288
323
  imageInput: true,
@@ -1117,7 +1152,11 @@ function currencyForBaseUrl(baseUrl) {
1117
1152
  // MODEL_METADATA pins the PEAK tier for these entries
1118
1153
  // (conservative worst-case; see the deepseek-v4-flash
1119
1154
  // comment).
1120
- hostname === "api.deepseek.com") {
1155
+ hostname === "api.deepseek.com" || // SenseNova (SenseTime) token-plan gateway — CN-domiciled,
1156
+ // quota-billed (all-zero published pricing, so the currency is
1157
+ // cosmetic today, but pinning it keeps a future per-token ¥ table
1158
+ // from silently rendering as USD).
1159
+ hostname === "token.sensenova.cn") {
1121
1160
  return "CNY";
1122
1161
  }
1123
1162
  if (hostname === "api.minimax.io" || hostname === "api.minimaxi.io" || hostname === "api.siliconflow.cn" || hostname === "api.siliconflow.com" || hostname === "api.stepfun.com" || hostname === "openrouter.ai" || hostname === "api.novita.ai" || // Z.ai / Zhipu international. Billed in USD per the
@@ -1205,6 +1244,7 @@ var PRESET_MODEL_FAMILIES = [
1205
1244
  "StepFun",
1206
1245
  "MiniMax",
1207
1246
  "Agnes",
1247
+ "SenseNova",
1208
1248
  "Qwen",
1209
1249
  "SiliconFlow (aggregator)",
1210
1250
  "Novita (aggregator)",
@@ -1219,6 +1259,7 @@ function vendorFamilyForId(id) {
1219
1259
  if (id.startsWith("step-")) return "StepFun";
1220
1260
  if (id.startsWith("MiniMax-")) return "MiniMax";
1221
1261
  if (id.startsWith("agnes-")) return "Agnes";
1262
+ if (id.startsWith("sensenova-")) return "SenseNova";
1222
1263
  if (id.startsWith("Qwen")) return "Qwen";
1223
1264
  if (id.startsWith("openrouter/")) return "OpenRouter (aggregator)";
1224
1265
  return "Other";
@@ -1272,8 +1313,16 @@ var BUILTIN_PROVIDER_PRESETS = {
1272
1313
  // (otherwise the user's added model never shows up in the
1273
1314
  // Copilot Chat picker).
1274
1315
  models: [
1275
- buildPresetModel("MiniMax-M3", "MiniMax-M3", "https://api.minimaxi.com/anthropic"),
1276
- buildPresetModel("MiniMax-M2.7", "MiniMax-M2.7", "https://api.minimaxi.com/anthropic"),
1316
+ buildPresetModel(
1317
+ "MiniMax-M3",
1318
+ "MiniMax-M3",
1319
+ "https://api.minimaxi.com/anthropic"
1320
+ ),
1321
+ buildPresetModel(
1322
+ "MiniMax-M2.7",
1323
+ "MiniMax-M2.7",
1324
+ "https://api.minimaxi.com/anthropic"
1325
+ ),
1277
1326
  buildPresetModel(
1278
1327
  "MiniMax-M2.7-highspeed",
1279
1328
  "MiniMax-M2.7-highspeed",
@@ -1283,7 +1332,11 @@ var BUILTIN_PROVIDER_PRESETS = {
1283
1332
  // predecessor of M2.7. Still in the catalog and often
1284
1333
  // available on MiniMax's promotional $0.30/$1.20 rate, so
1285
1334
  // keep it as a preset for users on the M2.5 plan tier.
1286
- buildPresetModel("MiniMax-M2.5", "MiniMax-M2.5", "https://api.minimaxi.com/anthropic")
1335
+ buildPresetModel(
1336
+ "MiniMax-M2.5",
1337
+ "MiniMax-M2.5",
1338
+ "https://api.minimaxi.com/anthropic"
1339
+ )
1287
1340
  ]
1288
1341
  },
1289
1342
  deepseek: {
@@ -1305,8 +1358,16 @@ var BUILTIN_PROVIDER_PRESETS = {
1305
1358
  // the recommended default — users still on V3 can override
1306
1359
  // these defaults in the ProvidersTab form.
1307
1360
  models: [
1308
- buildPresetModel("deepseek-v4-flash", "DeepSeek V4 Flash", "https://api.deepseek.com/v1"),
1309
- buildPresetModel("deepseek-v4-pro", "DeepSeek V4 Pro", "https://api.deepseek.com/v1")
1361
+ buildPresetModel(
1362
+ "deepseek-v4-flash",
1363
+ "DeepSeek V4 Flash",
1364
+ "https://api.deepseek.com/v1"
1365
+ ),
1366
+ buildPresetModel(
1367
+ "deepseek-v4-pro",
1368
+ "DeepSeek V4 Pro",
1369
+ "https://api.deepseek.com/v1"
1370
+ )
1310
1371
  ]
1311
1372
  },
1312
1373
  agnes: {
@@ -1320,14 +1381,26 @@ var BUILTIN_PROVIDER_PRESETS = {
1320
1381
  // benchmark-listed alpha — followed by the flash tier
1321
1382
  // newest-first.
1322
1383
  models: [
1323
- buildPresetModel("agnes-2.5-pro", "Agnes 2.5 Pro", "https://apihub.agnes-ai.com/v1"),
1384
+ buildPresetModel(
1385
+ "agnes-2.5-pro",
1386
+ "Agnes 2.5 Pro",
1387
+ "https://apihub.agnes-ai.com/v1"
1388
+ ),
1324
1389
  buildPresetModel(
1325
1390
  "agnes-2.5-pro-alpha",
1326
1391
  "Agnes 2.5 Pro Alpha",
1327
1392
  "https://apihub.agnes-ai.com/v1"
1328
1393
  ),
1329
- buildPresetModel("agnes-2.5-flash", "Agnes 2.5 Flash", "https://apihub.agnes-ai.com/v1"),
1330
- buildPresetModel("agnes-2.0-flash", "Agnes 2.0 Flash", "https://apihub.agnes-ai.com/v1")
1394
+ buildPresetModel(
1395
+ "agnes-2.5-flash",
1396
+ "Agnes 2.5 Flash",
1397
+ "https://apihub.agnes-ai.com/v1"
1398
+ ),
1399
+ buildPresetModel(
1400
+ "agnes-2.0-flash",
1401
+ "Agnes 2.0 Flash",
1402
+ "https://apihub.agnes-ai.com/v1"
1403
+ )
1331
1404
  ]
1332
1405
  },
1333
1406
  kimi: {
@@ -1335,7 +1408,11 @@ var BUILTIN_PROVIDER_PRESETS = {
1335
1408
  baseUrl: "https://api.moonshot.cn/v1",
1336
1409
  models: [
1337
1410
  buildPresetModel("kimi-k3", "Kimi K3", "https://api.moonshot.cn/v1"),
1338
- buildPresetModel("kimi-k2.7-code", "Kimi K2.7 Code", "https://api.moonshot.cn/v1"),
1411
+ buildPresetModel(
1412
+ "kimi-k2.7-code",
1413
+ "Kimi K2.7 Code",
1414
+ "https://api.moonshot.cn/v1"
1415
+ ),
1339
1416
  buildPresetModel(
1340
1417
  "kimi-k2.7-code-highspeed",
1341
1418
  "Kimi K2.7 Code HighSpeed",
@@ -1413,23 +1490,67 @@ var BUILTIN_PROVIDER_PRESETS = {
1413
1490
  // `MODEL_METADATA` entries are kept so the id is still
1414
1491
  // resolvable for the curated detail / pricing columns.
1415
1492
  models: [
1416
- buildPresetModel("glm-5.3", "GLM-5.3", "https://open.bigmodel.cn/api/paas/v4"),
1417
- buildPresetModel("glm-5.2", "GLM-5.2", "https://open.bigmodel.cn/api/paas/v4"),
1418
- buildPresetModel("glm-5.1", "GLM-5.1", "https://open.bigmodel.cn/api/paas/v4"),
1419
- buildPresetModel("glm-5", "GLM-5", "https://open.bigmodel.cn/api/paas/v4"),
1420
- buildPresetModel("glm-5-turbo", "GLM-5 Turbo", "https://open.bigmodel.cn/api/paas/v4"),
1421
- buildPresetModel("glm-4.7", "GLM-4.7", "https://open.bigmodel.cn/api/paas/v4"),
1422
- buildPresetModel("glm-4.6", "GLM-4.6", "https://open.bigmodel.cn/api/paas/v4"),
1423
- buildPresetModel("glm-4.5-air", "GLM-4.5 Air", "https://open.bigmodel.cn/api/paas/v4"),
1424
- buildPresetModel("glm-4.5", "GLM-4.5", "https://open.bigmodel.cn/api/paas/v4")
1493
+ buildPresetModel(
1494
+ "glm-5.3",
1495
+ "GLM-5.3",
1496
+ "https://open.bigmodel.cn/api/paas/v4"
1497
+ ),
1498
+ buildPresetModel(
1499
+ "glm-5.2",
1500
+ "GLM-5.2",
1501
+ "https://open.bigmodel.cn/api/paas/v4"
1502
+ ),
1503
+ buildPresetModel(
1504
+ "glm-5.1",
1505
+ "GLM-5.1",
1506
+ "https://open.bigmodel.cn/api/paas/v4"
1507
+ ),
1508
+ buildPresetModel(
1509
+ "glm-5",
1510
+ "GLM-5",
1511
+ "https://open.bigmodel.cn/api/paas/v4"
1512
+ ),
1513
+ buildPresetModel(
1514
+ "glm-5-turbo",
1515
+ "GLM-5 Turbo",
1516
+ "https://open.bigmodel.cn/api/paas/v4"
1517
+ ),
1518
+ buildPresetModel(
1519
+ "glm-4.7",
1520
+ "GLM-4.7",
1521
+ "https://open.bigmodel.cn/api/paas/v4"
1522
+ ),
1523
+ buildPresetModel(
1524
+ "glm-4.6",
1525
+ "GLM-4.6",
1526
+ "https://open.bigmodel.cn/api/paas/v4"
1527
+ ),
1528
+ buildPresetModel(
1529
+ "glm-4.5-air",
1530
+ "GLM-4.5 Air",
1531
+ "https://open.bigmodel.cn/api/paas/v4"
1532
+ ),
1533
+ buildPresetModel(
1534
+ "glm-4.5",
1535
+ "GLM-4.5",
1536
+ "https://open.bigmodel.cn/api/paas/v4"
1537
+ )
1425
1538
  ]
1426
1539
  },
1427
1540
  stepfun: {
1428
1541
  displayName: "StepFun",
1429
1542
  baseUrl: "https://api.stepfun.com/v1",
1430
1543
  models: [
1431
- buildPresetModel("step-3.7-flash", "Step 3.7 Flash", "https://api.stepfun.com/v1"),
1432
- buildPresetModel("step-3.5-flash", "Step 3.5 Flash", "https://api.stepfun.com/v1"),
1544
+ buildPresetModel(
1545
+ "step-3.7-flash",
1546
+ "Step 3.7 Flash",
1547
+ "https://api.stepfun.com/v1"
1548
+ ),
1549
+ buildPresetModel(
1550
+ "step-3.5-flash",
1551
+ "Step 3.5 Flash",
1552
+ "https://api.stepfun.com/v1"
1553
+ ),
1433
1554
  buildPresetModel(
1434
1555
  "step-1o-turbo-vision",
1435
1556
  "Step 1o Turbo Vision",
@@ -1482,7 +1603,11 @@ var BUILTIN_PROVIDER_PRESETS = {
1482
1603
  displayName: "OpenRouter",
1483
1604
  baseUrl: "https://openrouter.ai/api/v1",
1484
1605
  models: [
1485
- buildPresetModel("openrouter/auto", "OpenRouter Auto", "https://openrouter.ai/api/v1")
1606
+ buildPresetModel(
1607
+ "openrouter/auto",
1608
+ "OpenRouter Auto",
1609
+ "https://openrouter.ai/api/v1"
1610
+ )
1486
1611
  ]
1487
1612
  },
1488
1613
  novita: {
@@ -1506,8 +1631,16 @@ var BUILTIN_PROVIDER_PRESETS = {
1506
1631
  "https://api.novita.ai/openai/v1"
1507
1632
  ),
1508
1633
  // GLM-5 系列 (2026-04/06)
1509
- buildPresetModel("zai/glm-5.2", "GLM-5.2 (via Novita)", "https://api.novita.ai/openai/v1"),
1510
- buildPresetModel("zai/glm-5.1", "GLM-5.1 (via Novita)", "https://api.novita.ai/openai/v1"),
1634
+ buildPresetModel(
1635
+ "zai/glm-5.2",
1636
+ "GLM-5.2 (via Novita)",
1637
+ "https://api.novita.ai/openai/v1"
1638
+ ),
1639
+ buildPresetModel(
1640
+ "zai/glm-5.1",
1641
+ "GLM-5.1 (via Novita)",
1642
+ "https://api.novita.ai/openai/v1"
1643
+ ),
1511
1644
  // Kimi K3 (2026-07-16 API, 2026-07-27 开源) — 1M context, 2.8T MoE
1512
1645
  buildPresetModel(
1513
1646
  "moonshotai/kimi-k3",
@@ -1532,6 +1665,64 @@ var BUILTIN_PROVIDER_PRESETS = {
1532
1665
  // token caps) still resolves via `MODEL_METADATA` after the fetch.
1533
1666
  baseUrl: "https://nexus.servicemecloud.com/v1",
1534
1667
  models: []
1668
+ },
1669
+ sensenova: {
1670
+ displayName: "SenseNova",
1671
+ // SenseTime's SenseNova OpenAI-compatible gateway (see
1672
+ // https://platform.sensenova.cn/docs — `POST /v1/chat/completions`,
1673
+ // `Authorization: Bearer`, `GET /v1/models`). Token-plan quota per
1674
+ // model (e.g. 1500 req / 5h for flash-lite) is enforced upstream.
1675
+ //
1676
+ // The starter list mirrors the live `GET /v1/models` response
1677
+ // (fetched 2026-08-25 with a real key). The image-generation
1678
+ // models (sensenova-u1.5-lite / sensenova-u1-fast) live on
1679
+ // /v1/images/* endpoints and are explicitly documented as NOT
1680
+ // usable as chat Model IDs, so they are not curated here.
1681
+ // `sensenova-6.7-flash-lite` is likewise excluded — the docs
1682
+ // state it is a compat alias whose calls auto-redirect to
1683
+ // `sensenova-6.8-flash-lite` (through 2026-08-31).
1684
+ //
1685
+ // The relayed deepseek-v4-flash / glm-5.2 rows reuse their
1686
+ // MODEL_METADATA entries (keyed on the un-qualified id) and then
1687
+ // OVERRIDE the gateway-published specifics below: SenseNova
1688
+ // serves them with a 1M context window and TEXT-ONLY input
1689
+ // (per the live /v1/models payload), which differs from the
1690
+ // vendor-official curated values (655K input / vision on).
1691
+ // The global MODEL_METADATA stays vendor-official; only this
1692
+ // preset carries the gateway-specific caps so other providers
1693
+ // (DeepSeek official / Zhipu) are unaffected.
1694
+ baseUrl: "https://token.sensenova.cn/v1",
1695
+ models: [
1696
+ buildPresetModel(
1697
+ "sensenova-6.8-flash-lite",
1698
+ "SenseNova 6.8 Flash-Lite",
1699
+ "https://token.sensenova.cn/v1"
1700
+ ),
1701
+ {
1702
+ // Live /v1/models: context_length 1048576,
1703
+ // max_output_length 65536, input_modalities ["text"] only.
1704
+ ...buildPresetModel(
1705
+ "deepseek-v4-flash",
1706
+ "DeepSeek V4 Flash (via SenseNova)",
1707
+ "https://token.sensenova.cn/v1"
1708
+ ),
1709
+ maxInputTokens: 1048576,
1710
+ maxOutputTokens: 65536,
1711
+ capabilities: { supportsImageToText: false, supportsToolCalling: true }
1712
+ },
1713
+ {
1714
+ // Live /v1/models: context_length 1048576,
1715
+ // max_output_length 131072, input_modalities ["text"] only.
1716
+ ...buildPresetModel(
1717
+ "glm-5.2",
1718
+ "GLM-5.2 (via SenseNova)",
1719
+ "https://token.sensenova.cn/v1"
1720
+ ),
1721
+ maxInputTokens: 1048576,
1722
+ maxOutputTokens: 131072,
1723
+ capabilities: { supportsImageToText: false, supportsToolCalling: true }
1724
+ }
1725
+ ]
1535
1726
  }
1536
1727
  };
1537
1728
  var PRESET_MODEL_DISPLAY_NAMES = (() => {
@@ -1577,6 +1768,7 @@ function getBuiltinProviderPreset(type) {
1577
1768
  case "openrouter":
1578
1769
  case "novita":
1579
1770
  case "medalsoft":
1771
+ case "sensenova":
1580
1772
  return BUILTIN_PROVIDER_PRESETS[type];
1581
1773
  default:
1582
1774
  return null;
@@ -1619,8 +1811,115 @@ var CERTIFICATE_BUNDLE_FORMATS = [
1619
1811
  }
1620
1812
  ];
1621
1813
 
1814
+ // ../../node_modules/.pnpm/js-sha256@1.0.0/node_modules/js-sha256/src/node.mjs
1815
+ var import_crypto = require("crypto");
1816
+
1817
+ // ../../node_modules/.pnpm/js-sha256@1.0.0/node_modules/js-sha256/src/shared.mjs
1818
+ var INPUT_ERROR = "input is invalid type";
1819
+ var FINALIZE_ERROR = "finalize already called";
1820
+ var ARRAY_BUFFER = typeof ArrayBuffer !== "undefined";
1821
+ var formatMessage = function(message) {
1822
+ var type = typeof message;
1823
+ if (type === "string") {
1824
+ return [message, true];
1825
+ }
1826
+ if (Array.isArray(message)) {
1827
+ return [message, false];
1828
+ }
1829
+ if (ARRAY_BUFFER && message) {
1830
+ if (message.constructor === ArrayBuffer) {
1831
+ return [new Uint8Array(message), false];
1832
+ } else if (ArrayBuffer.isView(message)) {
1833
+ return [message, false];
1834
+ }
1835
+ }
1836
+ throw new Error(INPUT_ERROR);
1837
+ };
1838
+
1839
+ // ../../node_modules/.pnpm/js-sha256@1.0.0/node_modules/js-sha256/src/node.mjs
1840
+ function toNodeInput(message) {
1841
+ const [msg, isString] = formatMessage(message);
1842
+ return isString ? Buffer.from(msg, "utf8") : Buffer.from(msg);
1843
+ }
1844
+ var NodeHasher = class {
1845
+ constructor(hash) {
1846
+ this.hash = hash;
1847
+ this.result = void 0;
1848
+ }
1849
+ update(message) {
1850
+ if (this.result) {
1851
+ throw new Error(FINALIZE_ERROR);
1852
+ }
1853
+ this.hash.update(toNodeInput(message));
1854
+ return this;
1855
+ }
1856
+ finalize() {
1857
+ if (!this.result) {
1858
+ this.result = this.hash.digest();
1859
+ this.hash = void 0;
1860
+ }
1861
+ }
1862
+ hex() {
1863
+ this.finalize();
1864
+ return this.result.toString("hex");
1865
+ }
1866
+ toString() {
1867
+ return this.hex();
1868
+ }
1869
+ array() {
1870
+ this.finalize();
1871
+ return Array.from(this.result);
1872
+ }
1873
+ digest() {
1874
+ return this.array();
1875
+ }
1876
+ arrayBuffer() {
1877
+ return Uint8Array.from(this.array()).buffer;
1878
+ }
1879
+ };
1880
+ function addOutputMethods(method, createHasher) {
1881
+ method.hex = method;
1882
+ method.array = function(...args) {
1883
+ return createHasher(...args.slice(0, -1)).update(args[args.length - 1]).array();
1884
+ };
1885
+ method.digest = method.array;
1886
+ method.arrayBuffer = function(...args) {
1887
+ return createHasher(...args.slice(0, -1)).update(args[args.length - 1]).arrayBuffer();
1888
+ };
1889
+ return method;
1890
+ }
1891
+ function createNodeMethod(algorithm) {
1892
+ const createHasher = () => new NodeHasher((0, import_crypto.createHash)(algorithm));
1893
+ const method = function(message) {
1894
+ return createHasher().update(message).hex();
1895
+ };
1896
+ addOutputMethods(method, createHasher);
1897
+ method.create = createHasher;
1898
+ method.update = function(message) {
1899
+ return method.create().update(message);
1900
+ };
1901
+ return method;
1902
+ }
1903
+ function createNodeHmacMethod(algorithm) {
1904
+ const createHasher = (key) => new NodeHasher((0, import_crypto.createHmac)(algorithm, toNodeInput(key)));
1905
+ const method = function(key, message) {
1906
+ return createHasher(key).update(message).hex();
1907
+ };
1908
+ addOutputMethods(method, createHasher);
1909
+ method.create = createHasher;
1910
+ method.update = function(key, message) {
1911
+ return method.create(key).update(message);
1912
+ };
1913
+ return method;
1914
+ }
1915
+ var sha256 = createNodeMethod("sha256");
1916
+ var sha224 = createNodeMethod("sha224");
1917
+ sha256.sha256 = sha256;
1918
+ sha256.sha224 = sha224;
1919
+ sha256.hmac = createNodeHmacMethod("sha256");
1920
+ sha224.hmac = createNodeHmacMethod("sha224");
1921
+
1622
1922
  // src/device-auth.ts
1623
- var import_js_sha256 = require("js-sha256");
1624
1923
  var DeviceAuthHeaders = {
1625
1924
  deviceId: "x-ms-device-id",
1626
1925
  deviceSecret: "x-ms-device-secret",
@@ -1636,7 +1935,7 @@ function createDeviceRequestSignature(params) {
1636
1935
  params.body,
1637
1936
  params.secret
1638
1937
  ].join("\n");
1639
- return (0, import_js_sha256.sha256)(basis);
1938
+ return sha256(basis);
1640
1939
  }
1641
1940
 
1642
1941
  // src/git-utils.ts
package/dist/index.mjs CHANGED
@@ -104,6 +104,13 @@ var PROVIDER_BASE_URL_PRESETS = {
104
104
  { label: "\u5185\u7F51", baseUrl: MEDALSOFT_PRIVATE_GATEWAY_URL },
105
105
  { label: "\u5916\u7F51", baseUrl: "https://nexus.servicemecloud.com/v1" }
106
106
  ],
107
+ // SenseNova (SenseTime) — single OpenAI-compatible token-plan
108
+ // gateway (https://platform.sensenova.cn/docs). Also exposes an
109
+ // Anthropic-compatible endpoint at the bare host
110
+ // `https://token.sensenova.cn` (SDK appends /v1/messages), but the
111
+ // named `sensenova` type routes through OpenAIAdapter, so only the
112
+ // OpenAI-compat `/v1` base is offered here.
113
+ sensenova: [{ label: "\u5B98\u65B9", baseUrl: "https://token.sensenova.cn/v1" }],
107
114
  "vscode-builtin": []
108
115
  };
109
116
  function getProviderBaseUrlPresets(type) {
@@ -148,6 +155,11 @@ var PROVIDER_CACHE_CONTROL_METADATA = {
148
155
  // Flip to `supportsCacheControl: true` once the gateway is verified
149
156
  // to honour stable prompt caching.
150
157
  medalsoft: {},
158
+ // SenseNova (SenseTime) token-plan gateway — the /v1/models payload
159
+ // publishes an `input_cache_read` pricing field (all-zero today), so
160
+ // the upstream is cache-aware in principle, but there is no
161
+ // documented prompt-cache key contract. Off until verified.
162
+ sensenova: {},
151
163
  "vscode-builtin": {}
152
164
  };
153
165
  function isProviderCacheControlAware(type) {
@@ -204,6 +216,29 @@ var PRIMARY_METADATA = {
204
216
  maxInputTokens: 131072,
205
217
  maxOutputTokens: 73728
206
218
  },
219
+ "sensenova-6.8-flash-lite": {
220
+ detail: "SenseNova 6.8 Flash-Lite \u2014 \u8F7B\u91CF\u591A\u6A21\u6001\u667A\u80FD\u4F53\u6A21\u578B\uFF0C\u652F\u6301\u56FE\u50CF\u7406\u89E3 / \u5DE5\u5177\u8C03\u7528\uFF08262K \u4E0A\u4E0B\u6587\uFF0Ctoken-plan \u9650\u9891\uFF09",
221
+ imageInput: true,
222
+ toolCalling: true,
223
+ // Per https://platform.sensenova.cn/docs (fetched 2026-08-25): the
224
+ // /v1/models listing publishes all-zero pricing (token-plan free
225
+ // tier, quota-limited per 5h window rather than per-token billed).
226
+ // Both currency blocks pin 0 so the picker shows a free model
227
+ // instead of an invented rate; when SenseNova publishes per-token
228
+ // pricing, update both blocks here.
229
+ pricingUSD: { input: 0, output: 0, cacheRead: 0 },
230
+ pricingCNY: { input: 0, output: 0, cacheRead: 0 },
231
+ priceCategory: "low",
232
+ // Docs advertise `reasoning_effort` ("low"/"medium"/"high"/"none",
233
+ // default "medium") and list "reasoning" in supported_features —
234
+ // a leveled effort scale, so the picker gets the 3-level dropdown
235
+ // and the OpenAI adapter gates the wire field.
236
+ thinkingSchema: "reasoningEffort",
237
+ supportsReasoningEffort: true,
238
+ // Per /v1/models: context_length 262144, max_output_length 65536.
239
+ maxInputTokens: 262144,
240
+ maxOutputTokens: 65536
241
+ },
207
242
  "deepseek-v4-flash": {
208
243
  detail: "Fast, general-purpose model",
209
244
  imageInput: true,
@@ -1038,7 +1073,11 @@ function currencyForBaseUrl(baseUrl) {
1038
1073
  // MODEL_METADATA pins the PEAK tier for these entries
1039
1074
  // (conservative worst-case; see the deepseek-v4-flash
1040
1075
  // comment).
1041
- hostname === "api.deepseek.com") {
1076
+ hostname === "api.deepseek.com" || // SenseNova (SenseTime) token-plan gateway — CN-domiciled,
1077
+ // quota-billed (all-zero published pricing, so the currency is
1078
+ // cosmetic today, but pinning it keeps a future per-token ¥ table
1079
+ // from silently rendering as USD).
1080
+ hostname === "token.sensenova.cn") {
1042
1081
  return "CNY";
1043
1082
  }
1044
1083
  if (hostname === "api.minimax.io" || hostname === "api.minimaxi.io" || hostname === "api.siliconflow.cn" || hostname === "api.siliconflow.com" || hostname === "api.stepfun.com" || hostname === "openrouter.ai" || hostname === "api.novita.ai" || // Z.ai / Zhipu international. Billed in USD per the
@@ -1126,6 +1165,7 @@ var PRESET_MODEL_FAMILIES = [
1126
1165
  "StepFun",
1127
1166
  "MiniMax",
1128
1167
  "Agnes",
1168
+ "SenseNova",
1129
1169
  "Qwen",
1130
1170
  "SiliconFlow (aggregator)",
1131
1171
  "Novita (aggregator)",
@@ -1140,6 +1180,7 @@ function vendorFamilyForId(id) {
1140
1180
  if (id.startsWith("step-")) return "StepFun";
1141
1181
  if (id.startsWith("MiniMax-")) return "MiniMax";
1142
1182
  if (id.startsWith("agnes-")) return "Agnes";
1183
+ if (id.startsWith("sensenova-")) return "SenseNova";
1143
1184
  if (id.startsWith("Qwen")) return "Qwen";
1144
1185
  if (id.startsWith("openrouter/")) return "OpenRouter (aggregator)";
1145
1186
  return "Other";
@@ -1193,8 +1234,16 @@ var BUILTIN_PROVIDER_PRESETS = {
1193
1234
  // (otherwise the user's added model never shows up in the
1194
1235
  // Copilot Chat picker).
1195
1236
  models: [
1196
- buildPresetModel("MiniMax-M3", "MiniMax-M3", "https://api.minimaxi.com/anthropic"),
1197
- buildPresetModel("MiniMax-M2.7", "MiniMax-M2.7", "https://api.minimaxi.com/anthropic"),
1237
+ buildPresetModel(
1238
+ "MiniMax-M3",
1239
+ "MiniMax-M3",
1240
+ "https://api.minimaxi.com/anthropic"
1241
+ ),
1242
+ buildPresetModel(
1243
+ "MiniMax-M2.7",
1244
+ "MiniMax-M2.7",
1245
+ "https://api.minimaxi.com/anthropic"
1246
+ ),
1198
1247
  buildPresetModel(
1199
1248
  "MiniMax-M2.7-highspeed",
1200
1249
  "MiniMax-M2.7-highspeed",
@@ -1204,7 +1253,11 @@ var BUILTIN_PROVIDER_PRESETS = {
1204
1253
  // predecessor of M2.7. Still in the catalog and often
1205
1254
  // available on MiniMax's promotional $0.30/$1.20 rate, so
1206
1255
  // keep it as a preset for users on the M2.5 plan tier.
1207
- buildPresetModel("MiniMax-M2.5", "MiniMax-M2.5", "https://api.minimaxi.com/anthropic")
1256
+ buildPresetModel(
1257
+ "MiniMax-M2.5",
1258
+ "MiniMax-M2.5",
1259
+ "https://api.minimaxi.com/anthropic"
1260
+ )
1208
1261
  ]
1209
1262
  },
1210
1263
  deepseek: {
@@ -1226,8 +1279,16 @@ var BUILTIN_PROVIDER_PRESETS = {
1226
1279
  // the recommended default — users still on V3 can override
1227
1280
  // these defaults in the ProvidersTab form.
1228
1281
  models: [
1229
- buildPresetModel("deepseek-v4-flash", "DeepSeek V4 Flash", "https://api.deepseek.com/v1"),
1230
- buildPresetModel("deepseek-v4-pro", "DeepSeek V4 Pro", "https://api.deepseek.com/v1")
1282
+ buildPresetModel(
1283
+ "deepseek-v4-flash",
1284
+ "DeepSeek V4 Flash",
1285
+ "https://api.deepseek.com/v1"
1286
+ ),
1287
+ buildPresetModel(
1288
+ "deepseek-v4-pro",
1289
+ "DeepSeek V4 Pro",
1290
+ "https://api.deepseek.com/v1"
1291
+ )
1231
1292
  ]
1232
1293
  },
1233
1294
  agnes: {
@@ -1241,14 +1302,26 @@ var BUILTIN_PROVIDER_PRESETS = {
1241
1302
  // benchmark-listed alpha — followed by the flash tier
1242
1303
  // newest-first.
1243
1304
  models: [
1244
- buildPresetModel("agnes-2.5-pro", "Agnes 2.5 Pro", "https://apihub.agnes-ai.com/v1"),
1305
+ buildPresetModel(
1306
+ "agnes-2.5-pro",
1307
+ "Agnes 2.5 Pro",
1308
+ "https://apihub.agnes-ai.com/v1"
1309
+ ),
1245
1310
  buildPresetModel(
1246
1311
  "agnes-2.5-pro-alpha",
1247
1312
  "Agnes 2.5 Pro Alpha",
1248
1313
  "https://apihub.agnes-ai.com/v1"
1249
1314
  ),
1250
- buildPresetModel("agnes-2.5-flash", "Agnes 2.5 Flash", "https://apihub.agnes-ai.com/v1"),
1251
- buildPresetModel("agnes-2.0-flash", "Agnes 2.0 Flash", "https://apihub.agnes-ai.com/v1")
1315
+ buildPresetModel(
1316
+ "agnes-2.5-flash",
1317
+ "Agnes 2.5 Flash",
1318
+ "https://apihub.agnes-ai.com/v1"
1319
+ ),
1320
+ buildPresetModel(
1321
+ "agnes-2.0-flash",
1322
+ "Agnes 2.0 Flash",
1323
+ "https://apihub.agnes-ai.com/v1"
1324
+ )
1252
1325
  ]
1253
1326
  },
1254
1327
  kimi: {
@@ -1256,7 +1329,11 @@ var BUILTIN_PROVIDER_PRESETS = {
1256
1329
  baseUrl: "https://api.moonshot.cn/v1",
1257
1330
  models: [
1258
1331
  buildPresetModel("kimi-k3", "Kimi K3", "https://api.moonshot.cn/v1"),
1259
- buildPresetModel("kimi-k2.7-code", "Kimi K2.7 Code", "https://api.moonshot.cn/v1"),
1332
+ buildPresetModel(
1333
+ "kimi-k2.7-code",
1334
+ "Kimi K2.7 Code",
1335
+ "https://api.moonshot.cn/v1"
1336
+ ),
1260
1337
  buildPresetModel(
1261
1338
  "kimi-k2.7-code-highspeed",
1262
1339
  "Kimi K2.7 Code HighSpeed",
@@ -1334,23 +1411,67 @@ var BUILTIN_PROVIDER_PRESETS = {
1334
1411
  // `MODEL_METADATA` entries are kept so the id is still
1335
1412
  // resolvable for the curated detail / pricing columns.
1336
1413
  models: [
1337
- buildPresetModel("glm-5.3", "GLM-5.3", "https://open.bigmodel.cn/api/paas/v4"),
1338
- buildPresetModel("glm-5.2", "GLM-5.2", "https://open.bigmodel.cn/api/paas/v4"),
1339
- buildPresetModel("glm-5.1", "GLM-5.1", "https://open.bigmodel.cn/api/paas/v4"),
1340
- buildPresetModel("glm-5", "GLM-5", "https://open.bigmodel.cn/api/paas/v4"),
1341
- buildPresetModel("glm-5-turbo", "GLM-5 Turbo", "https://open.bigmodel.cn/api/paas/v4"),
1342
- buildPresetModel("glm-4.7", "GLM-4.7", "https://open.bigmodel.cn/api/paas/v4"),
1343
- buildPresetModel("glm-4.6", "GLM-4.6", "https://open.bigmodel.cn/api/paas/v4"),
1344
- buildPresetModel("glm-4.5-air", "GLM-4.5 Air", "https://open.bigmodel.cn/api/paas/v4"),
1345
- buildPresetModel("glm-4.5", "GLM-4.5", "https://open.bigmodel.cn/api/paas/v4")
1414
+ buildPresetModel(
1415
+ "glm-5.3",
1416
+ "GLM-5.3",
1417
+ "https://open.bigmodel.cn/api/paas/v4"
1418
+ ),
1419
+ buildPresetModel(
1420
+ "glm-5.2",
1421
+ "GLM-5.2",
1422
+ "https://open.bigmodel.cn/api/paas/v4"
1423
+ ),
1424
+ buildPresetModel(
1425
+ "glm-5.1",
1426
+ "GLM-5.1",
1427
+ "https://open.bigmodel.cn/api/paas/v4"
1428
+ ),
1429
+ buildPresetModel(
1430
+ "glm-5",
1431
+ "GLM-5",
1432
+ "https://open.bigmodel.cn/api/paas/v4"
1433
+ ),
1434
+ buildPresetModel(
1435
+ "glm-5-turbo",
1436
+ "GLM-5 Turbo",
1437
+ "https://open.bigmodel.cn/api/paas/v4"
1438
+ ),
1439
+ buildPresetModel(
1440
+ "glm-4.7",
1441
+ "GLM-4.7",
1442
+ "https://open.bigmodel.cn/api/paas/v4"
1443
+ ),
1444
+ buildPresetModel(
1445
+ "glm-4.6",
1446
+ "GLM-4.6",
1447
+ "https://open.bigmodel.cn/api/paas/v4"
1448
+ ),
1449
+ buildPresetModel(
1450
+ "glm-4.5-air",
1451
+ "GLM-4.5 Air",
1452
+ "https://open.bigmodel.cn/api/paas/v4"
1453
+ ),
1454
+ buildPresetModel(
1455
+ "glm-4.5",
1456
+ "GLM-4.5",
1457
+ "https://open.bigmodel.cn/api/paas/v4"
1458
+ )
1346
1459
  ]
1347
1460
  },
1348
1461
  stepfun: {
1349
1462
  displayName: "StepFun",
1350
1463
  baseUrl: "https://api.stepfun.com/v1",
1351
1464
  models: [
1352
- buildPresetModel("step-3.7-flash", "Step 3.7 Flash", "https://api.stepfun.com/v1"),
1353
- buildPresetModel("step-3.5-flash", "Step 3.5 Flash", "https://api.stepfun.com/v1"),
1465
+ buildPresetModel(
1466
+ "step-3.7-flash",
1467
+ "Step 3.7 Flash",
1468
+ "https://api.stepfun.com/v1"
1469
+ ),
1470
+ buildPresetModel(
1471
+ "step-3.5-flash",
1472
+ "Step 3.5 Flash",
1473
+ "https://api.stepfun.com/v1"
1474
+ ),
1354
1475
  buildPresetModel(
1355
1476
  "step-1o-turbo-vision",
1356
1477
  "Step 1o Turbo Vision",
@@ -1403,7 +1524,11 @@ var BUILTIN_PROVIDER_PRESETS = {
1403
1524
  displayName: "OpenRouter",
1404
1525
  baseUrl: "https://openrouter.ai/api/v1",
1405
1526
  models: [
1406
- buildPresetModel("openrouter/auto", "OpenRouter Auto", "https://openrouter.ai/api/v1")
1527
+ buildPresetModel(
1528
+ "openrouter/auto",
1529
+ "OpenRouter Auto",
1530
+ "https://openrouter.ai/api/v1"
1531
+ )
1407
1532
  ]
1408
1533
  },
1409
1534
  novita: {
@@ -1427,8 +1552,16 @@ var BUILTIN_PROVIDER_PRESETS = {
1427
1552
  "https://api.novita.ai/openai/v1"
1428
1553
  ),
1429
1554
  // GLM-5 系列 (2026-04/06)
1430
- buildPresetModel("zai/glm-5.2", "GLM-5.2 (via Novita)", "https://api.novita.ai/openai/v1"),
1431
- buildPresetModel("zai/glm-5.1", "GLM-5.1 (via Novita)", "https://api.novita.ai/openai/v1"),
1555
+ buildPresetModel(
1556
+ "zai/glm-5.2",
1557
+ "GLM-5.2 (via Novita)",
1558
+ "https://api.novita.ai/openai/v1"
1559
+ ),
1560
+ buildPresetModel(
1561
+ "zai/glm-5.1",
1562
+ "GLM-5.1 (via Novita)",
1563
+ "https://api.novita.ai/openai/v1"
1564
+ ),
1432
1565
  // Kimi K3 (2026-07-16 API, 2026-07-27 开源) — 1M context, 2.8T MoE
1433
1566
  buildPresetModel(
1434
1567
  "moonshotai/kimi-k3",
@@ -1453,6 +1586,64 @@ var BUILTIN_PROVIDER_PRESETS = {
1453
1586
  // token caps) still resolves via `MODEL_METADATA` after the fetch.
1454
1587
  baseUrl: "https://nexus.servicemecloud.com/v1",
1455
1588
  models: []
1589
+ },
1590
+ sensenova: {
1591
+ displayName: "SenseNova",
1592
+ // SenseTime's SenseNova OpenAI-compatible gateway (see
1593
+ // https://platform.sensenova.cn/docs — `POST /v1/chat/completions`,
1594
+ // `Authorization: Bearer`, `GET /v1/models`). Token-plan quota per
1595
+ // model (e.g. 1500 req / 5h for flash-lite) is enforced upstream.
1596
+ //
1597
+ // The starter list mirrors the live `GET /v1/models` response
1598
+ // (fetched 2026-08-25 with a real key). The image-generation
1599
+ // models (sensenova-u1.5-lite / sensenova-u1-fast) live on
1600
+ // /v1/images/* endpoints and are explicitly documented as NOT
1601
+ // usable as chat Model IDs, so they are not curated here.
1602
+ // `sensenova-6.7-flash-lite` is likewise excluded — the docs
1603
+ // state it is a compat alias whose calls auto-redirect to
1604
+ // `sensenova-6.8-flash-lite` (through 2026-08-31).
1605
+ //
1606
+ // The relayed deepseek-v4-flash / glm-5.2 rows reuse their
1607
+ // MODEL_METADATA entries (keyed on the un-qualified id) and then
1608
+ // OVERRIDE the gateway-published specifics below: SenseNova
1609
+ // serves them with a 1M context window and TEXT-ONLY input
1610
+ // (per the live /v1/models payload), which differs from the
1611
+ // vendor-official curated values (655K input / vision on).
1612
+ // The global MODEL_METADATA stays vendor-official; only this
1613
+ // preset carries the gateway-specific caps so other providers
1614
+ // (DeepSeek official / Zhipu) are unaffected.
1615
+ baseUrl: "https://token.sensenova.cn/v1",
1616
+ models: [
1617
+ buildPresetModel(
1618
+ "sensenova-6.8-flash-lite",
1619
+ "SenseNova 6.8 Flash-Lite",
1620
+ "https://token.sensenova.cn/v1"
1621
+ ),
1622
+ {
1623
+ // Live /v1/models: context_length 1048576,
1624
+ // max_output_length 65536, input_modalities ["text"] only.
1625
+ ...buildPresetModel(
1626
+ "deepseek-v4-flash",
1627
+ "DeepSeek V4 Flash (via SenseNova)",
1628
+ "https://token.sensenova.cn/v1"
1629
+ ),
1630
+ maxInputTokens: 1048576,
1631
+ maxOutputTokens: 65536,
1632
+ capabilities: { supportsImageToText: false, supportsToolCalling: true }
1633
+ },
1634
+ {
1635
+ // Live /v1/models: context_length 1048576,
1636
+ // max_output_length 131072, input_modalities ["text"] only.
1637
+ ...buildPresetModel(
1638
+ "glm-5.2",
1639
+ "GLM-5.2 (via SenseNova)",
1640
+ "https://token.sensenova.cn/v1"
1641
+ ),
1642
+ maxInputTokens: 1048576,
1643
+ maxOutputTokens: 131072,
1644
+ capabilities: { supportsImageToText: false, supportsToolCalling: true }
1645
+ }
1646
+ ]
1456
1647
  }
1457
1648
  };
1458
1649
  var PRESET_MODEL_DISPLAY_NAMES = (() => {
@@ -1498,6 +1689,7 @@ function getBuiltinProviderPreset(type) {
1498
1689
  case "openrouter":
1499
1690
  case "novita":
1500
1691
  case "medalsoft":
1692
+ case "sensenova":
1501
1693
  return BUILTIN_PROVIDER_PRESETS[type];
1502
1694
  default:
1503
1695
  return null;
@@ -1540,8 +1732,115 @@ var CERTIFICATE_BUNDLE_FORMATS = [
1540
1732
  }
1541
1733
  ];
1542
1734
 
1735
+ // ../../node_modules/.pnpm/js-sha256@1.0.0/node_modules/js-sha256/src/node.mjs
1736
+ import { createHash, createHmac } from "crypto";
1737
+
1738
+ // ../../node_modules/.pnpm/js-sha256@1.0.0/node_modules/js-sha256/src/shared.mjs
1739
+ var INPUT_ERROR = "input is invalid type";
1740
+ var FINALIZE_ERROR = "finalize already called";
1741
+ var ARRAY_BUFFER = typeof ArrayBuffer !== "undefined";
1742
+ var formatMessage = function(message) {
1743
+ var type = typeof message;
1744
+ if (type === "string") {
1745
+ return [message, true];
1746
+ }
1747
+ if (Array.isArray(message)) {
1748
+ return [message, false];
1749
+ }
1750
+ if (ARRAY_BUFFER && message) {
1751
+ if (message.constructor === ArrayBuffer) {
1752
+ return [new Uint8Array(message), false];
1753
+ } else if (ArrayBuffer.isView(message)) {
1754
+ return [message, false];
1755
+ }
1756
+ }
1757
+ throw new Error(INPUT_ERROR);
1758
+ };
1759
+
1760
+ // ../../node_modules/.pnpm/js-sha256@1.0.0/node_modules/js-sha256/src/node.mjs
1761
+ function toNodeInput(message) {
1762
+ const [msg, isString] = formatMessage(message);
1763
+ return isString ? Buffer.from(msg, "utf8") : Buffer.from(msg);
1764
+ }
1765
+ var NodeHasher = class {
1766
+ constructor(hash) {
1767
+ this.hash = hash;
1768
+ this.result = void 0;
1769
+ }
1770
+ update(message) {
1771
+ if (this.result) {
1772
+ throw new Error(FINALIZE_ERROR);
1773
+ }
1774
+ this.hash.update(toNodeInput(message));
1775
+ return this;
1776
+ }
1777
+ finalize() {
1778
+ if (!this.result) {
1779
+ this.result = this.hash.digest();
1780
+ this.hash = void 0;
1781
+ }
1782
+ }
1783
+ hex() {
1784
+ this.finalize();
1785
+ return this.result.toString("hex");
1786
+ }
1787
+ toString() {
1788
+ return this.hex();
1789
+ }
1790
+ array() {
1791
+ this.finalize();
1792
+ return Array.from(this.result);
1793
+ }
1794
+ digest() {
1795
+ return this.array();
1796
+ }
1797
+ arrayBuffer() {
1798
+ return Uint8Array.from(this.array()).buffer;
1799
+ }
1800
+ };
1801
+ function addOutputMethods(method, createHasher) {
1802
+ method.hex = method;
1803
+ method.array = function(...args) {
1804
+ return createHasher(...args.slice(0, -1)).update(args[args.length - 1]).array();
1805
+ };
1806
+ method.digest = method.array;
1807
+ method.arrayBuffer = function(...args) {
1808
+ return createHasher(...args.slice(0, -1)).update(args[args.length - 1]).arrayBuffer();
1809
+ };
1810
+ return method;
1811
+ }
1812
+ function createNodeMethod(algorithm) {
1813
+ const createHasher = () => new NodeHasher(createHash(algorithm));
1814
+ const method = function(message) {
1815
+ return createHasher().update(message).hex();
1816
+ };
1817
+ addOutputMethods(method, createHasher);
1818
+ method.create = createHasher;
1819
+ method.update = function(message) {
1820
+ return method.create().update(message);
1821
+ };
1822
+ return method;
1823
+ }
1824
+ function createNodeHmacMethod(algorithm) {
1825
+ const createHasher = (key) => new NodeHasher(createHmac(algorithm, toNodeInput(key)));
1826
+ const method = function(key, message) {
1827
+ return createHasher(key).update(message).hex();
1828
+ };
1829
+ addOutputMethods(method, createHasher);
1830
+ method.create = createHasher;
1831
+ method.update = function(key, message) {
1832
+ return method.create(key).update(message);
1833
+ };
1834
+ return method;
1835
+ }
1836
+ var sha256 = createNodeMethod("sha256");
1837
+ var sha224 = createNodeMethod("sha224");
1838
+ sha256.sha256 = sha256;
1839
+ sha256.sha224 = sha224;
1840
+ sha256.hmac = createNodeHmacMethod("sha256");
1841
+ sha224.hmac = createNodeHmacMethod("sha224");
1842
+
1543
1843
  // src/device-auth.ts
1544
- import { sha256 } from "js-sha256";
1545
1844
  var DeviceAuthHeaders = {
1546
1845
  deviceId: "x-ms-device-id",
1547
1846
  deviceSecret: "x-ms-device-secret",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serviceme/devtools-shared",
3
- "version": "0.4.11",
3
+ "version": "0.4.13",
4
4
  "description": "Shared webview↔extension message contracts and cross-package data models used by SERVICEME.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "repository": {
@@ -46,8 +46,8 @@
46
46
  "lint": "biome check src test",
47
47
  "format": "biome check --write src test",
48
48
  "typecheck": "tsc --noEmit",
49
- "test": "pnpm run build && node --test test/*.test.mjs",
50
- "release:check": "pnpm run test && npm pack --dry-run",
49
+ "test": "pnpm run build && node scripts/check-bundle-deps.mjs && node --test test/*.test.mjs",
50
+ "release:check": "pnpm run test && node scripts/check-bundle-deps.mjs && npm pack --dry-run",
51
51
  "pack": "npm pack",
52
52
  "publish:npm": "pnpm publish --access public --no-git-checks"
53
53
  }