dsh-qoder-connect 0.1.5 → 0.1.8

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.
@@ -502,11 +502,18 @@ var QoderCatalog = class {
502
502
  useMaximumContextWindow = false;
503
503
  /** Per-model window overrides (model id → tokens); an override wins over the preference. */
504
504
  modelContextWindows = {};
505
+ /** Disabled model IDs (blacklist); disabled models are filtered out from current(). */
506
+ disabledModels = /* @__PURE__ */ new Set();
505
507
  constructor(initial = FALLBACK_QODER_MODELS) {
506
508
  this.models = initial;
507
509
  }
508
- /** Current entries; empty while the variant has no usable credential. */
510
+ /** Current entries; empty while the variant has no usable credential, excluding disabled models. */
509
511
  current() {
512
+ if (!this.visible) return [];
513
+ return this.all().filter((model) => !this.disabledModels.has(model.id));
514
+ }
515
+ /** All configured entries including disabled ones; empty while the variant has no usable credential. */
516
+ all() {
510
517
  if (!this.visible) return [];
511
518
  return this.models.map((model) => {
512
519
  const override = this.modelContextWindows[model.id];
@@ -557,6 +564,20 @@ var QoderCatalog = class {
557
564
  return true;
558
565
  }
559
566
  /**
567
+ * Replace the disabled model IDs wholesale. Returns whether the set
568
+ * changed, so the caller can skip an invalidation over an identical write.
569
+ */
570
+ setDisabledModels(disabledModels) {
571
+ const next = new Set(disabledModels);
572
+ if (next.size === this.disabledModels.size && [...next].every((id) => this.disabledModels.has(id))) return false;
573
+ this.disabledModels = next;
574
+ return true;
575
+ }
576
+ /** Current disabled model IDs. */
577
+ getDisabledModels() {
578
+ return Array.from(this.disabledModels);
579
+ }
580
+ /**
560
581
  * Models to fall back to when the upstream fetch fails; ignores
561
582
  * visibility, because the caller asking for the fallback already knows the
562
583
  * credential state.
@@ -2367,6 +2388,7 @@ var QoderUsageReader = class {
2367
2388
  return {
2368
2389
  userQuota: normalizeQuota(data.userQuota),
2369
2390
  orgResourcePackage: normalizeQuota(data.orgResourcePackage),
2391
+ addOnQuota: normalizeQuota(data.addOnQuota),
2370
2392
  totalUsagePercentage: typeof data.totalUsagePercentage === "number" ? data.totalUsagePercentage : void 0,
2371
2393
  isQuotaExceeded: typeof data.isQuotaExceeded === "boolean" ? data.isQuotaExceeded : false,
2372
2394
  expiresAt: normalizeExpiresAt(data.expiresAt),
@@ -2438,6 +2460,7 @@ var QoderCheckInService = class {
2438
2460
  const data = await openApiJsonRequest(this.fetchImpl, {
2439
2461
  url,
2440
2462
  token,
2463
+ headers: { "cosy-clienttype": "10" },
2441
2464
  signal,
2442
2465
  timeoutMs: this.timeoutMs,
2443
2466
  logger: this.logger,
@@ -2453,7 +2476,10 @@ var QoderCheckInService = class {
2453
2476
  url,
2454
2477
  method: "POST",
2455
2478
  token,
2456
- headers: { origin: openApiUrl },
2479
+ headers: {
2480
+ origin: openApiUrl,
2481
+ "cosy-clienttype": "10"
2482
+ },
2457
2483
  signal,
2458
2484
  timeoutMs: this.timeoutMs,
2459
2485
  logger: this.logger,
@@ -3983,6 +4009,13 @@ var QoderUpstreamClient = class {
3983
4009
  size: org.total,
3984
4010
  ...usage.expiresAt === void 0 ? {} : { packageEndTime: usage.expiresAt }
3985
4011
  });
4012
+ const addOn = usage.addOnQuota;
4013
+ if (addOn !== void 0) accounts.push({
4014
+ packageName: "赠送额度",
4015
+ remain: addOn.remaining,
4016
+ size: addOn.total,
4017
+ ...usage.expiresAt === void 0 ? {} : { packageEndTime: usage.expiresAt }
4018
+ });
3986
4019
  const unlimited = usage.isQuotaExceeded === false && personal !== void 0 && personal.total === 0;
3987
4020
  return {
3988
4021
  total: usage.totalUsagePercentage ?? personal?.percentage ?? 0,
@@ -4233,7 +4266,7 @@ const DEFAULT_MAX_TOKENS = 32768;
4233
4266
  const DEFAULT_CONTEXT_WINDOW = 18e4;
4234
4267
  //#endregion
4235
4268
  //#region src/version.ts
4236
- const QODER_CONNECT_VERSION = "0.1.5";
4269
+ const QODER_CONNECT_VERSION = "0.1.8";
4237
4270
  //#endregion
4238
4271
  //#region src/host-heartbeat.ts
4239
4272
  /**
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "dsh-qoder-connect",
3
3
  "displayName": "DSH Qoder Connect",
4
4
  "description": "将 Qoder(国内版 / 国际版)的模型接入 DeepSeek Harness — bring Qoder (CN & international) models into DeepSeek Harness.",
5
- "version": "0.1.5",
5
+ "version": "0.1.8",
6
6
  "author": "corrinehu",
7
7
  "keywords": [
8
8
  "dsh-plugin",