@chatcode/cco-llm-chatcode-config 0.1.1 → 0.1.2

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
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
9
9
 
10
10
  ## Summary
11
11
 
12
- This plugin publishes user-defined, CodingPlan, and optional MAAS model catalogs in the selector order **Built-in models → Yuanjing → Custom models**, provides shared ChatCode account access, and reports committed ChatCode CLI Session activity to ChatCode. User-defined models live in the `llm-chatcode-config` settings section and appear in the conversation model selector. Runtime model credentials stay in the Host process, while the account grant stays in ChatCode CLI credential storage and never reaches Web or TUI clients. Reporting is enabled by default and can be disabled with `reporting.enabled: false`.
12
+ This plugin publishes CodingPlan and optional Yuanjing model catalogs, provides shared ChatCode account access, and reports committed ChatCode CLI Session activity to ChatCode. Legacy user-defined routes remain runtime-compatible but are not exposed through Web or CLI configuration. Runtime model credentials stay in the Host process, while the account grant stays in ChatCode CLI credential storage and never reaches Web or TUI clients. Reporting is enabled by default and can be disabled with `reporting.enabled: false`.
13
13
 
14
14
  ## Table of Contents
15
15
 
@@ -62,9 +62,9 @@ The `llm-chatcode-config` section in `$CHATCODE_CLI_HOME/settings.yaml` is the r
62
62
  chatCodeSession: true
63
63
  ```
64
64
 
65
- MAAS has a different response shape from CodingPlan: the catalog returns model IDs, and the plugin resolves each ID through its private runtime endpoint. `codingPlanEndpoint` and `catalogTimeoutMs` override the CodingPlan address and catalog timeout.
65
+ Yuanjing (internally identified by the legacy MAAS setting) has a different response shape from CodingPlan: the catalog returns model IDs, and the plugin resolves each ID through its private runtime endpoint. `codingPlanEndpoint` and `catalogTimeoutMs` override the CodingPlan address and catalog timeout.
66
66
 
67
- The package also ships a browser client bundle. Its **Model configuration** card contains only the MAAS switch; it does not edit the `customModels` array or display CodingPlan and MAAS rows. The browser decodes only `enableMaas` from the redacted settings view and never needs custom-model API keys. Edit imported user-defined models in `$CHATCODE_CLI_HOME/settings.yaml`; valid file updates refresh the **自定义模型** conversation-selector group without restarting the Host.
67
+ The package also ships a browser client bundle. Its **Model configuration** card contains only the user-facing **Yuanjing** switch; it does not expose or edit the `customModels` array, and it does not display CodingPlan and managed-model rows. The browser decodes only the legacy internal `enableMaas` field from the redacted settings view and never needs custom-model API keys.
68
68
 
69
69
  -----
70
70
 
@@ -106,10 +106,10 @@ The model receives the normal ChatCode CLI system prompt, messages, and tools th
106
106
 
107
107
  <a id="known-limitations-and-deferred-work"></a>
108
108
 
109
- - Managed catalog reads are activation snapshots; remount or restart after changing a central catalog. The MAAS switch refreshes its selector group immediately.
109
+ - Managed catalog reads are activation snapshots; remount or restart after changing a central catalog. The Yuanjing switch refreshes its selector group immediately.
110
110
  - Imported models declare text input. Non-DeepSeek routes do not expose selectable reasoning effort.
111
111
  - One invalid entry, including a duplicate model ID, suppresses the complete imported catalog; the bundle does not publish a partially valid source.
112
- - The public plugin client extension point adds this package's managed-model configuration card to the native Models page. The card controls MAAS only; user-defined model entries require a settings-file edit, while CodingPlan and MAAS groups remain read-only.
112
+ - The public plugin client extension point adds this package's managed-model configuration card to the native Models page. The card controls Yuanjing only; user-defined model configuration is not exposed, while CodingPlan and Yuanjing groups remain read-only.
113
113
  - The package tracks the copied pi-ai adapter source and the native DeepSeek adapter peer; upgrade either through an explicit compatibility test, and refresh `vendor/` when pi-ai changes.
114
114
  - Conversation synchronization has no durable outbox, and ChatCode message requests are not retried when the server may have committed them.
115
115
 
package/README.zh.md CHANGED
@@ -10,7 +10,7 @@ kind: "package-bundle"
10
10
  ## 概述
11
11
 
12
12
 
13
- 此插件发布用户自定义模型、CodingPlan 与可选 MAAS 模型目录,提供共用 ChatCode 账号访问,并向 ChatCode 上报已提交的 ChatCode CLI Session 活动。用户自定义模型保存在 `llm-chatcode-config` 设置段,并出现在会话模型选择器中。运行时模型凭据只保存在 Host 进程中,账号 grant 保存在 ChatCode CLI 凭据存储中且不会进入 Web 或 TUI 客户端。上报默认开启,可通过 `reporting.enabled: false` 关闭。
13
+ 此插件发布 CodingPlan 与可选元景模型目录,提供共用 ChatCode 账号访问,并向 ChatCode 上报已提交的 ChatCode CLI Session 活动。历史版本写入的用户自定义路由仅保留运行时兼容,不再通过 Web CLI 暴露配置入口。运行时模型凭据只保存在 Host 进程中,账号 grant 保存在 ChatCode CLI 凭据存储中且不会进入 Web 或 TUI 客户端。上报默认开启,可通过 `reporting.enabled: false` 关闭。
14
14
 
15
15
  启动时还会读取 Coding Plan 运行时模型接口,并在会话模型选择器中按 `内置模型`、(启用后)`元景`、`自定义模型` 的顺序发布三个独立分组。接口返回的 API Key 只保存在进程内的请求鉴权对象中;模型列表、日志和错误信息不会包含该值。
16
16
 
@@ -71,9 +71,9 @@ MAAS 默认关闭。开启后,插件先读取 `https://chatcode.chinaunicom.cn
71
71
  maasEndpoint: https://chatcode.chinaunicom.cn/cvp/wanma/api/v1/cli/maas-models
72
72
  ```
73
73
 
74
- MAAS 目录接口与 Coding Plan 接口的返回结构不同:目录接口返回模型 ID,插件会再按 ID 获取私有运行配置。可用 `codingPlanEndpoint` 和 `catalogTimeoutMs` 覆盖 Coding Plan 地址和读取超时。
74
+ 元景(内部仍沿用旧 MAAS 配置标识)目录接口与 Coding Plan 接口的返回结构不同:目录接口返回模型 ID,插件会再按 ID 获取私有运行配置。可用 `codingPlanEndpoint` 和 `catalogTimeoutMs` 覆盖 Coding Plan 地址和读取超时。
75
75
 
76
- 本包同时发布浏览器 client bundle,在原生“模型”设置页增加“模型配置”卡片,仅保留 MAAS 开关,不展示 CodingPlan MAAS 模型列表。浏览器只从脱敏设置视图中解析 `enableMaas`,无需获取自定义模型的 API key。MAAS 开关会持久化到插件 settings 命名空间,并刷新会话模型选择器中的对应分组。自定义模型的增删改查保留在原生模型页;CodingPlan 和 MAAS 模型列表仅在会话模型选择器中展示。
76
+ 本包同时发布浏览器 client bundle,在原生“模型”设置页增加“模型配置”卡片,仅保留“元景”开关,不展示 CodingPlan 或元景模型列表,也不暴露或编辑 `customModels`。浏览器只从脱敏设置视图中解析内部兼容字段 `enableMaas`,无需获取自定义模型的 API key。
77
77
 
78
78
  -----
79
79
 
@@ -115,10 +115,10 @@ DeepSeek 路由使用条目中的协议、基础 URL 和 API key。其 OpenAI
115
115
 
116
116
  <a id="known-limitations-and-deferred-work"></a>
117
117
 
118
- - 中央目录读取为激活快照;更新中央目录后需要重新挂载或重启 profile。MAAS 开关会立即刷新会话选择分组。
118
+ - 中央目录读取为激活快照;更新中央目录后需要重新挂载或重启 profile。元景开关会立即刷新会话选择分组。
119
119
  - 导入模型声明文本输入。非 DeepSeek 路由不公开可选推理强度。
120
120
  - 任一条目非法(包括模型 ID 重复)都会抑制完整导入目录;bundle 不会发布部分有效的来源。
121
- - 公共插件 client 扩展点允许本包向原生“模型”页面追加托管模型配置卡片。该卡片只控制 MAAS;用户自定义模型需要编辑设置文件,CodingPlan 与 MAAS 分组保持只读。
121
+ - 公共插件 client 扩展点允许本包向原生“模型”页面追加托管模型配置卡片。该卡片只控制元景;用户自定义模型配置不再暴露,CodingPlan 与元景分组保持只读。
122
122
  - 包会同时跟踪复制的 pi-ai 适配器源码和原生 DeepSeek 适配器 peer;升级任一实现都必须执行显式兼容性测试,pi-ai 变化时还需刷新 `vendor/`。
123
123
  - 会话同步没有持久化 outbox;当服务端可能已经提交时,ChatCode 消息请求不会重试。
124
124
 
package/lib/client.js CHANGED
@@ -12,7 +12,7 @@ window.__ModuleLoader__.load({
12
12
  max-width: 720px;
13
13
  flex-direction: column;
14
14
  gap: 20px;
15
- margin-top: 20px;
15
+ margin-top: 0;
16
16
  color: var(--dsw-alias-label-primary);
17
17
  }
18
18
 
@@ -373,27 +373,29 @@ window.__ModuleLoader__.load({
373
373
  }
374
374
  //#endregion
375
375
  //#region src/client/index.ts
376
- /** Browser extension rendering the MAAS availability switch in the native Models page. */
376
+ /** Browser extension replacing the Models settings section with the Yuanjing switch. */
377
377
  const React = require("react");
378
378
  const SETTINGS_NAMESPACE = "llm-chatcode-config";
379
379
  const LOG_PREFIX = "[dsh-llm-chatcode-config]";
380
380
  const en = {
381
+ nav: "Models",
381
382
  title: "Model configuration",
382
- description: "Custom models are managed by the native Models page. CodingPlan and MAAS models remain available in the conversation model selector.",
383
+ description: "CodingPlan and Yuanjing models remain available in the conversation model selector.",
383
384
  maas: "Yuanjing",
384
- maasDescription: "Enable MAAS models for the conversation model selector.",
385
- maasToggle: "Enable MAAS models",
386
- maasUpdating: "Updating MAAS setting…",
387
- maasUnavailable: "MAAS setting is unavailable."
385
+ maasDescription: "Show Yuanjing models in the conversation model selector.",
386
+ maasToggle: "Yuanjing",
387
+ maasUpdating: "Updating Yuanjing…",
388
+ maasUnavailable: "Yuanjing setting is unavailable."
388
389
  };
389
390
  const zh = {
391
+ nav: "模型",
390
392
  title: "模型配置",
391
- description: "自定义模型由原生模型页面管理;CodingPlan 与 MAAS 模型继续在对话模型选择中提供。",
393
+ description: "CodingPlan 与元景模型会在对话模型选择中提供。",
392
394
  maas: "元景",
393
- maasDescription: "开启后,MAAS 模型会出现在对话模型选择中。",
394
- maasToggle: "启用 MAAS 模型",
395
- maasUpdating: "正在更新 MAAS 设置…",
396
- maasUnavailable: "MAAS 设置不可用。"
395
+ maasDescription: "开启后,元景模型会出现在对话模型选择中。",
396
+ maasToggle: "元景",
397
+ maasUpdating: "正在更新元景…",
398
+ maasUnavailable: "元景设置不可用。"
397
399
  };
398
400
  function installStyles() {
399
401
  const documentRef = globalThis.document;
@@ -465,11 +467,14 @@ window.__ModuleLoader__.load({
465
467
  return scope.subscribe(report);
466
468
  }, "chatcode-models: settings diagnostics");
467
469
  const t = ctx.locale.bind("settings.chatcodeModels");
468
- ctx.slots.inject("settings.models.footer", () => {
469
- console.info(`${LOG_PREFIX} registering settings.models.footer card`);
470
+ ctx.slots.inject("settings.section", () => {
471
+ console.info(`${LOG_PREFIX} replacing settings.section models entry`);
470
472
  return ctx.slots.register({
471
- name: "settings.models.footer",
472
- id: "chatcode-models",
473
+ name: "settings.section",
474
+ id: "models",
475
+ order: 10,
476
+ priority: -100,
477
+ label: () => t("nav"),
473
478
  locale: "settings.chatcodeModels",
474
479
  inject: () => ({
475
480
  scope,
package/lib/index.js CHANGED
@@ -441,7 +441,6 @@ async function validatePackage(config, packageName, options) {
441
441
  const url = validateUrl(config.cvpChatCodeApiUrl);
442
442
  url.searchParams.set("packageName", packageName);
443
443
  url.searchParams.set("versionNum", versionNum);
444
- console.log(`[version-check] 开始校验 ${packageName}@${versionNum}`);
445
444
  const request = options.request ?? fetch;
446
445
  let response;
447
446
  try {
@@ -1398,7 +1397,7 @@ function buildProvider(spec) {
1398
1397
  //#endregion
1399
1398
  //#region vendor/dsh-llm-pi-ai/src/config.ts
1400
1399
  /** Default maximum idle interval while an adapter stream read is outstanding. */
1401
- const DEFAULT_STREAM_IDLE_TIMEOUT_MS = 3e5;
1400
+ const DEFAULT_STREAM_IDLE_TIMEOUT_MS = 6e5;
1402
1401
  /**
1403
1402
  * Default request-level bound on base64-encoded image payload. Every image in
1404
1403
  * history is re-encoded into every request body, so an unbounded conversation
@@ -1559,7 +1558,7 @@ function resolveProfiles(providers) {
1559
1558
  if (provider.length === 0) throw new Error("llm-pi-ai: provider names must be non-empty");
1560
1559
  if (source.baseURL !== void 0 && source.baseURL.length === 0) throw new Error(`llm-pi-ai: provider "${provider}" has an empty baseURL`);
1561
1560
  if (source.displayName !== void 0 && source.displayName.length === 0) throw new Error(`llm-pi-ai: provider "${provider}" has an empty displayName`);
1562
- const streamIdleTimeoutMs = source.streamIdleTimeoutMs ?? 3e5;
1561
+ const streamIdleTimeoutMs = source.streamIdleTimeoutMs ?? 6e5;
1563
1562
  if (!Number.isFinite(streamIdleTimeoutMs) || streamIdleTimeoutMs <= 0 || streamIdleTimeoutMs > MAX_TIMER_DELAY_MS) throw new Error(`llm-pi-ai: provider "${provider}" streamIdleTimeoutMs must be a positive finite number no greater than ${MAX_TIMER_DELAY_MS}`);
1564
1563
  const maxRequestImageBytes = source.maxRequestImageBytes ?? 20971520;
1565
1564
  if (!Number.isInteger(maxRequestImageBytes) || maxRequestImageBytes <= 0) throw new Error(`llm-pi-ai: provider "${provider}" maxRequestImageBytes must be a positive integer`);