@dan-ai-studio/dshopencodego 0.1.76 → 0.1.77

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.en.md CHANGED
@@ -113,7 +113,7 @@ Configuration lives in the profile's `cordis.patch.yml`:
113
113
  some-new-model: openai-responses # the only legal values are anthropic-messages / openai-completions / openai-responses
114
114
  pinnedAddresses: # fixed IP: host -> address (only the gateway host counts)
115
115
  opencode.ai: 104.18.32.47 # IPv4 or IPv6; an invalid or absent address uses the system DNS
116
- requestLogEnabled: true # request-log master switch, default on: off reads byte-for-byte as without the log
116
+ requestLogEnabled: false # request-log master switch, default off: on registers the sidebar entry and the conversation tab; off leaves no entry and reads byte-for-byte as without the log
117
117
  requestLogDebug: false # debug detail: pool events and the request user agent; session ids are always whole
118
118
  requestLogMaxEntries: 200 # most entries to keep, 50 to 500; oldest are dropped first
119
119
  retryPolicy: # optional: this route's retry policy, executed by dsh-llm-retry
@@ -139,7 +139,7 @@ The API key comes from the Harness credential store (reference name `OPENCODE_GO
139
139
  - The settings page shows and accepts the value in **seconds** (a number of milliseconds is not readable at a glance) and stores it in milliseconds. Range: 1 to 1800000 milliseconds.
140
140
  - Once a connection has been idle that long, the pool **reclaims it** on its own — no separate mechanism is needed. The actual release comes a couple of seconds later than the setting, which is the client's own small margin beyond the deadline the server states. When the plugin is unloaded, the pool is **closed with it**: the pool belongs to the plugin and should not be left behind on the machine.
141
141
 
142
- **Request log**: per-request records, on by default; turning them off returns the request path to exactly as without the log. The settings page's "Request log" group holds the master switch, the debug switch (pool events and the request user agent, default off), and the retention count (default 200).
142
+ **Request log**: per-request records, off by default; turning them on registers the sidebar entry and the conversation tab, and turning them off removes those entries and returns the request path to exactly as without the log. The settings page's "Request log" group holds the master switch, the debug switch (pool events and the request user agent, default off), and the retention count (default 200).
143
143
 
144
144
  - **Two entries, one page**:
145
145
  - **A sidebar icon → a full page in the main column**: every request across sessions. The log is a process-wide thing, so the sidebar is where it belongs — a fixed, always-visible spot, and the same pattern the Harness's own plugin manager uses.
package/README.md CHANGED
@@ -112,7 +112,7 @@ DSH 桌面端是 Electron 壳 + 完整的 dsh Web 应用,本插件对它同样
112
112
  some-new-model: openai-responses # 合法值只有 anthropic-messages / openai-completions / openai-responses
113
113
  pinnedAddresses: # 固定 IP:域名 → 地址(只对网关域名生效)
114
114
  opencode.ai: 104.18.32.47 # 可写 IPv4 或 IPv6;不合法或未设置时走系统 DNS
115
- requestLogEnabled: true # 请求日志总开关,默认开启:关闭后请求路径与没有该日志逐字节一致
115
+ requestLogEnabled: false # 请求日志总开关,默认关闭:打开后注册侧边栏入口与会话标签页;关闭后无入口,请求路径与没有该日志逐字节一致
116
116
  requestLogDebug: false # 排错详情:连接池事件与请求 UA;会话 id 始终完整记录
117
117
  requestLogMaxEntries: 200 # 最多保留条数,50 ~ 500,超限丢弃最旧的
118
118
  retryPolicy: # 可选:本路由的重试策略(由 dsh-llm-retry 执行)
@@ -138,7 +138,7 @@ API Key 通过 Harness 凭证库提供(引用名 `OPENCODE_GO_API_KEY`),
138
138
  - 设置页里以**秒**显示与填写(毫秒的数字人读不出量级),存储时换算成毫秒。取值 1 ~ 1800000 毫秒。
139
139
  - 空闲满这个时间之后,连接由连接池**自己回收**,不需要额外的清理机制(实际释放时间比设置值多约 2 秒,那是客户端在服务端给的期限之外自留的一点缓冲)。插件被卸载时,连接池也会**一并关掉**——它是插件的,不该留在机器上。
140
140
 
141
- **请求日志**:默认开启的逐请求记录,关掉它请求路径与没有该日志逐字节一致。设置页"请求日志"分组里有总开关、排错详情开关(连接池事件与请求 UA,默认关闭)、保留条数(默认 200)。
141
+ **请求日志**:默认关闭的逐请求记录,打开它才注册侧边栏入口与会话标签页;关掉它入口一并消失,请求路径与没有该日志逐字节一致。设置页"请求日志"分组里有总开关、排错详情开关(连接池事件与请求 UA,默认关闭)、保留条数(默认 200)。
142
142
 
143
143
  - **两个入口,同一个页面**:
144
144
  - **侧边栏图标 → 主区域整页**:跨会话看全部请求。日志是进程级的数据,放在侧边栏最合理——位置固定、常驻可见,和 DSH 自己的插件管理器同一个范式。
package/lib/client.js CHANGED
@@ -513,7 +513,7 @@ var en = {
513
513
  imageBudgetPresetDshopencodego: "This plugin (1.44M px / 400KB / 6MB)",
514
514
  imageBudgetPresetPiAi: "pi-ai catalog (2000\xD72000 / 4.5MB / 20MB)",
515
515
  requestLogTitle: "Request log",
516
- requestLogHint: "Per-request records for troubleshooting. On by default; turning it off returns the request path to exactly as without the log.",
516
+ requestLogHint: "Per-request records for troubleshooting. Off by default; turning it on registers the sidebar entry and the conversation tab, and the request path stays exactly as without the log when off.",
517
517
  requestLogPageHint: "One row per request. Click a column head to sort; the table scrolls and the filters stay put.",
518
518
  requestLogEnabled: "Record requests",
519
519
  requestLogDebug: "Debug detail",
@@ -711,7 +711,7 @@ var zh = {
711
711
  imageBudgetPresetDshopencodego: "\u672C\u63D2\u4EF6\uFF08144\u4E07\u50CF\u7D20 / 400KB / 6MB\uFF09",
712
712
  imageBudgetPresetPiAi: "pi-ai \u76EE\u5F55\uFF082000\xD72000 / 4.5MB / 20MB\uFF09",
713
713
  requestLogTitle: "\u8BF7\u6C42\u65E5\u5FD7",
714
- requestLogHint: "\u6392\u67E5\u7528\u7684\u9010\u8BF7\u6C42\u8BB0\u5F55\u3002\u9ED8\u8BA4\u5F00\u542F\uFF1B\u5173\u95ED\u540E\u8BF7\u6C42\u8DEF\u5F84\u4E0E\u6CA1\u6709\u8BE5\u65E5\u5FD7\u9010\u5B57\u8282\u4E00\u81F4\u3002",
714
+ requestLogHint: "\u6392\u67E5\u7528\u7684\u9010\u8BF7\u6C42\u8BB0\u5F55\u3002\u9ED8\u8BA4\u5173\u95ED\uFF1B\u6253\u5F00\u540E\u6CE8\u518C\u4FA7\u8FB9\u680F\u5165\u53E3\u4E0E\u4F1A\u8BDD\u6807\u7B7E\u9875\uFF0C\u5173\u95ED\u540E\u8BF7\u6C42\u8DEF\u5F84\u4E0E\u6CA1\u6709\u8BE5\u65E5\u5FD7\u9010\u5B57\u8282\u4E00\u81F4\u3002",
715
715
  requestLogPageHint: "\u6BCF\u4E2A\u8BF7\u6C42\u4E00\u884C\u3002\u70B9\u5217\u5934\u53EF\u6392\u5E8F\uFF1B\u8868\u683C\u6EDA\u52A8\uFF0C\u7B5B\u9009\u680F\u56FA\u5B9A\u5728\u4E0A\u65B9\u3002",
716
716
  requestLogEnabled: "\u8BB0\u5F55\u8BF7\u6C42",
717
717
  requestLogDebug: "\u6392\u9519\u8BE6\u60C5",
@@ -1066,7 +1066,7 @@ function settingsOf(value) {
1066
1066
  pinnedAddresses: Object.fromEntries(pinEntries),
1067
1067
  keepAliveTimeoutMs: typeof keepAlive === "number" ? keepAlive : DEFAULT_KEEP_ALIVE_TIMEOUT_MS,
1068
1068
  imageBudgetPreset: isImageBudgetPreset(imageBudgetPreset) ? imageBudgetPreset : "dsh",
1069
- requestLogEnabled: typeof requestLogEnabled === "boolean" ? requestLogEnabled : true,
1069
+ requestLogEnabled: typeof requestLogEnabled === "boolean" ? requestLogEnabled : false,
1070
1070
  requestLogDebug: typeof requestLogDebug === "boolean" ? requestLogDebug : false,
1071
1071
  requestLogMaxEntries: typeof requestLogMaxEntries === "number" ? requestLogMaxEntries : DEFAULT_REQUEST_LOG_MAX_ENTRIES
1072
1072
  };
@@ -1965,7 +1965,7 @@ function Section({ controller, t, getLocale, openRequestLog }) {
1965
1965
  "input",
1966
1966
  {
1967
1967
  type: "checkbox",
1968
- checked: state.settings?.requestLogEnabled ?? true,
1968
+ checked: state.settings?.requestLogEnabled ?? false,
1969
1969
  disabled: !editable || state.saving,
1970
1970
  onChange: (event) => {
1971
1971
  void act(async () => {
@@ -2016,7 +2016,7 @@ function Section({ controller, t, getLocale, openRequestLog }) {
2016
2016
  ),
2017
2017
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: section_default.hint, children: t("requestLogMaxEntriesHint") })
2018
2018
  ] }),
2019
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: section_default.row, children: [
2019
+ state.settings?.requestLogEnabled === true && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: section_default.row, children: [
2020
2020
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: section_default.button, onClick: () => {
2021
2021
  setLogOpenFailed(!(openRequestLog?.() ?? false));
2022
2022
  }, children: t("requestLogOpen") }),
@@ -2962,19 +2962,19 @@ function apply(ctx) {
2962
2962
  scope.effect(() => () => {
2963
2963
  controller.dispose();
2964
2964
  });
2965
+ const isLogEnabled = () => {
2966
+ if (profile === void 0) return true;
2967
+ const value = profile.getSnapshot().value;
2968
+ if (value === null || typeof value !== "object") return false;
2969
+ return value.requestLogEnabled === true;
2970
+ };
2965
2971
  const requestLog = {
2966
2972
  readLog: async () => {
2967
2973
  const result = await scope.remote.opencodeGoRequestLog.readLog();
2968
2974
  if (!result.ok) throw result.error;
2969
2975
  return result.value;
2970
2976
  },
2971
- // Read live: the switch on the settings page can change while the log
2972
- // page sits open, and the page says so rather than pretending.
2973
- enabled: () => {
2974
- const value = profile?.getSnapshot().value;
2975
- if (value === null || typeof value !== "object") return false;
2976
- return value.requestLogEnabled === true;
2977
- },
2977
+ enabled: isLogEnabled,
2978
2978
  // Whether a title click can open its session. The navigation service
2979
2979
  // is a separate composition member; without it titles stay text.
2980
2980
  canOpenSession: () => sessionOpener.current !== void 0,
@@ -2995,15 +2995,34 @@ function apply(ctx) {
2995
2995
  t: (key) => translate(key),
2996
2996
  getLocale: () => scope.locale.getLocale().active
2997
2997
  };
2998
- scope.slots.inject("main", function* () {
2999
- yield scope.slots.register({
3000
- name: "main",
3001
- key: REQUEST_LOG_PANEL,
3002
- locale: NS,
3003
- inject: () => requestLog
3004
- }, RequestLogPage);
3005
- });
3006
- scope.slots.inject("sidebar.panellist", () => scope.slots.register({
2998
+ const gateLogSeat = (slot, register) => {
2999
+ scope.slots.inject(slot, () => {
3000
+ let disposeEntry;
3001
+ const sync = () => {
3002
+ if (isLogEnabled()) {
3003
+ disposeEntry ??= register();
3004
+ } else {
3005
+ disposeEntry?.();
3006
+ disposeEntry = void 0;
3007
+ }
3008
+ };
3009
+ const unsubscribe = profile?.subscribe(sync) ?? (() => {
3010
+ });
3011
+ sync();
3012
+ return () => {
3013
+ unsubscribe();
3014
+ disposeEntry?.();
3015
+ disposeEntry = void 0;
3016
+ };
3017
+ });
3018
+ };
3019
+ gateLogSeat("main", () => scope.slots.register({
3020
+ name: "main",
3021
+ key: REQUEST_LOG_PANEL,
3022
+ locale: NS,
3023
+ inject: () => requestLog
3024
+ }, RequestLogPage));
3025
+ gateLogSeat("sidebar.panellist", () => scope.slots.register({
3007
3026
  name: "sidebar.panellist",
3008
3027
  id: REQUEST_LOG_PANEL,
3009
3028
  // After the Host's own panels, which run from 0.
@@ -3011,7 +3030,7 @@ function apply(ctx) {
3011
3030
  label: () => translate("requestLogTitle"),
3012
3031
  locale: NS
3013
3032
  }, RequestLogPanelIcon));
3014
- scope.slots.inject("conversation.view", () => scope.slots.register({
3033
+ gateLogSeat("conversation.view", () => scope.slots.register({
3015
3034
  name: "conversation.view",
3016
3035
  id: "dshopencodego-request-log",
3017
3036
  // After the Host's own View (the chat itself), which runs at 0.
package/lib/index.js CHANGED
@@ -75876,11 +75876,13 @@ var fields = {
75876
75876
  maxTokens: Schema.union([Schema.const(null), Schema.number().step(1).min(1).max(Number.MAX_SAFE_INTEGER)])
75877
75877
  })])).default({}),
75878
75878
  modelProtocols: Schema.dict(Schema.string()).default({}),
75879
- // On by default: recording costs one call and one boolean per request
75880
- // plus a bounded ring, and buys a per-request trail whenever something
75881
- // looks wrong. Off returns the request path to exactly as without the
75882
- // log, because the recorder is never constructed then.
75883
- requestLogEnabled: Schema.boolean().default(true),
75879
+ // Off by default: the log is a troubleshooting tool, and an unasked
75880
+ // sidebar entry plus a conversation tab is the wrong first impression.
75881
+ // On, recording costs one call and one boolean per request plus a bounded
75882
+ // ring, and buys a per-request trail whenever something looks wrong. Off
75883
+ // returns the request path to exactly as without the log, because the
75884
+ // recorder is never constructed then.
75885
+ requestLogEnabled: Schema.boolean().default(false),
75884
75886
  requestLogDebug: Schema.boolean().default(false),
75885
75887
  requestLogMaxEntries: Schema.number().step(1).min(MIN_REQUEST_LOG_MAX_ENTRIES).max(MAX_REQUEST_LOG_MAX_ENTRIES).default(DEFAULT_REQUEST_LOG_MAX_ENTRIES),
75886
75888
  pinnedAddresses: Schema.dict(Schema.string()).default({}),
@@ -78095,7 +78097,7 @@ function createUpdateChecker(deps) {
78095
78097
  }
78096
78098
 
78097
78099
  // src/update/version.ts
78098
- var PLUGIN_VERSION = true ? "0.1.76" : "0.0.0-dev";
78100
+ var PLUGIN_VERSION = true ? "0.1.77" : "0.0.0-dev";
78099
78101
 
78100
78102
  // src/update/service.ts
78101
78103
  import { TypertRemoteService as TypertRemoteService4 } from "@deepseek-ai/dsh-typert-protocol";
@@ -77,10 +77,10 @@ export interface OpencodeGoConfig {
77
77
  */
78
78
  modelProtocols: Record<string, string>;
79
79
  /**
80
- * Whether the request log records anything at all. On by default: one
81
- * call and one boolean per request, plus a bounded ring. Off returns the
82
- * request path to exactly as without the log — the recorder is never
83
- * constructed.
80
+ * Whether the request log records anything at all. Off by default: one
81
+ * call and one boolean per request, plus a bounded ring, only when on.
82
+ * Off returns the request path to exactly as without the log — the
83
+ * recorder is never constructed, and the log's pages stay unregistered.
84
84
  */
85
85
  requestLogEnabled: boolean;
86
86
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dan-ai-studio/dshopencodego",
3
- "version": "0.1.76",
3
+ "version": "0.1.77",
4
4
  "description": "OpenCode Go provider for DeepSeek Harness: live gateway catalog, per-conversation session header, usage",
5
5
  "type": "module",
6
6
  "license": "MIT",