@goodandready/dsh-usage-guard 0.1.4 → 0.1.5
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 +18 -0
- package/README.ru.md +18 -0
- package/README.zh.md +18 -0
- package/lib/client.js +3 -26
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -112,6 +112,24 @@ Logs informative diagnostic warnings naming the exact session, turn, step, raw p
|
|
|
112
112
|
|
|
113
113
|
---
|
|
114
114
|
|
|
115
|
+
## 🚀 Changed in v0.1.5
|
|
116
|
+
|
|
117
|
+
* **Strict `settings.plugin.item` Registration (#3)**:
|
|
118
|
+
Completely removed the deprecated fallback registration into `settings.section`. In compliance with DSH Plugin Authoring guidelines, settings are rendered exclusively in the "Settings → Plugins" tab (`settings.plugin.item`) with key `dsh-usage-guard` without cluttering the global sidebar.
|
|
119
|
+
* **Refined Client Architecture**:
|
|
120
|
+
Cleaned up the browser bundle to register strictly one slot entry with zero runtime fallback delays.
|
|
121
|
+
|
|
122
|
+
## 🚀 Changed in v0.1.4
|
|
123
|
+
|
|
124
|
+
* **Style Isolation with `data-dsh-plugin`**:
|
|
125
|
+
Dynamic `<style>` element is explicitly tagged with `data-dsh-plugin="dsh-usage-guard"`, preventing style purging during neighbor plugin reloads or HMR.
|
|
126
|
+
* **Direct Slot Registration**:
|
|
127
|
+
Replaced broken invocation pattern with standard `ctx.slots.register('settings.plugin.item', ...)`.
|
|
128
|
+
* **Canonical Localization Standard**:
|
|
129
|
+
Streamlined client registration to strictly register the canonical English locale dictionary, delegating localized user interfaces to DSH translation plugins.
|
|
130
|
+
* **Safe Configuration Loading & English Diagnostics**:
|
|
131
|
+
Protected `Config()` initialization with `try...catch` and migrated diagnostic log messages to English.
|
|
132
|
+
|
|
115
133
|
## 🚀 Changed in v0.1.3
|
|
116
134
|
|
|
117
135
|
* **Fractional Token Protection (Floats & Decimals)**:
|
package/README.ru.md
CHANGED
|
@@ -112,6 +112,24 @@ graph LR
|
|
|
112
112
|
|
|
113
113
|
---
|
|
114
114
|
|
|
115
|
+
## 🚀 Изменения в версии v0.1.5 (Changed in v0.1.5)
|
|
116
|
+
|
|
117
|
+
* **Строгая регистрация в `settings.plugin.item` (#3)**:
|
|
118
|
+
Полностью удалена устаревшая ветка регистрации в боковом меню `settings.section`. По канону DSH Plugin Authoring карточка настроек размещается исключительно во вкладке «Настройки → Плагины» (`settings.plugin.item`) с ключом `dsh-usage-guard`, не занимая ограниченный ресурс бокового списка.
|
|
119
|
+
* **Очистка клиентской архитектуры**:
|
|
120
|
+
Регистрация интерфейса упрощена до единственного прямого вызова без задержек и fallback-таймеров.
|
|
121
|
+
|
|
122
|
+
## 🚀 Изменения в версии v0.1.4 (Changed in v0.1.4)
|
|
123
|
+
|
|
124
|
+
* **Изоляция стилей через `data-dsh-plugin`**:
|
|
125
|
+
Динамический тег `<style>` помечен атрибутом `data-dsh-plugin="dsh-usage-guard"`, предотвращая сброс стилей карточки при HMR или обновлении соседних плагинов.
|
|
126
|
+
* **Прямая регистрация слота**:
|
|
127
|
+
Заменён некорректный вызов `ctx.slots.inject()` на прямой `ctx.slots.register('settings.plugin.item', ...)`.
|
|
128
|
+
* **Канонический стандарт локализации**:
|
|
129
|
+
Клиентский модуль регистрирует только канонический словарь `en`, передавая управление переводами системному translation-плагину.
|
|
130
|
+
* **Безопасная инициализация и англоязычные логи**:
|
|
131
|
+
Вызов `Config()` защищён блоком `try...catch`, а системные предупреждения в консоли переведены на английский язык.
|
|
132
|
+
|
|
115
133
|
## 🚀 Изменения в версии v0.1.3 (Changed in v0.1.3)
|
|
116
134
|
|
|
117
135
|
* **Защита от дробных токенов (Floats & Decimals)**:
|
package/README.zh.md
CHANGED
|
@@ -85,6 +85,24 @@ graph LR
|
|
|
85
85
|
|
|
86
86
|
---
|
|
87
87
|
|
|
88
|
+
## 🚀 v0.1.5 版本更新说明 (Changed in v0.1.5)
|
|
89
|
+
|
|
90
|
+
* **规范设置卡片插槽注册 (#3)**:
|
|
91
|
+
彻底移除废弃的顶层侧边栏 `settings.section` 回退逻辑。严格遵循 DSH Plugin Authoring 规范,卡片仅注册至“设置 → 插件”标签页(`settings.plugin.item`),键名与命名空间一致为 `dsh-usage-guard`,不再占用全局侧边栏资源。
|
|
92
|
+
* **精简前端注册流**:
|
|
93
|
+
客户端模块仅保留标准单一插槽注册,无任何额外回退延时。
|
|
94
|
+
|
|
95
|
+
## 🚀 v0.1.4 版本更新说明 (Changed in v0.1.4)
|
|
96
|
+
|
|
97
|
+
* **样式隔离标记 `data-dsh-plugin`**:
|
|
98
|
+
动态 `<style>` 标签附加 `data-dsh-plugin="dsh-usage-guard"` 属性,避免被相邻插件的热重载清理机制误删。
|
|
99
|
+
* **修复插槽直接注册**:
|
|
100
|
+
替换无效的 `ctx.slots.inject()` 调用为直接标准 `ctx.slots.register('settings.plugin.item', ...)`。
|
|
101
|
+
* **规范化单一英文字典**:
|
|
102
|
+
客户端仅保留基础英语字典,翻译工作完全交由 DSH 核心翻译插件运行时接管。
|
|
103
|
+
* **安全配置初始化与全英文诊断**:
|
|
104
|
+
`Config()` 初始化增加 `try...catch` 防护,控制台输出全面切换为标准英语日志。
|
|
105
|
+
|
|
88
106
|
## 🚀 v0.1.3 版本更新说明 (Changed in v0.1.3)
|
|
89
107
|
|
|
90
108
|
* **浮点与小数 Token 防崩保护 (Floats & Decimals)**:
|
package/lib/client.js
CHANGED
|
@@ -229,10 +229,8 @@ window.__ModuleLoader__.load({
|
|
|
229
229
|
});
|
|
230
230
|
} catch (_) {}
|
|
231
231
|
|
|
232
|
-
//
|
|
233
|
-
//
|
|
234
|
-
// If the slot is not available (older DSH build), fall back to a top-level settings.section.
|
|
235
|
-
let primaryRegistered = false;
|
|
232
|
+
// Register exclusively in settings.plugin.item (DSH Settings → Plugins tab).
|
|
233
|
+
// Custom top-level sidebar sections (settings.section) are forbidden for simple plugin settings cards.
|
|
236
234
|
try {
|
|
237
235
|
if (ctx.slots && typeof ctx.slots.register === 'function') {
|
|
238
236
|
ctx.slots.register(
|
|
@@ -244,29 +242,8 @@ window.__ModuleLoader__.load({
|
|
|
244
242
|
},
|
|
245
243
|
PluginCard,
|
|
246
244
|
);
|
|
247
|
-
primaryRegistered = true;
|
|
248
245
|
}
|
|
249
|
-
} catch (_) {
|
|
250
|
-
// slot not available in this build — fall through to section fallback
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
if (!primaryRegistered) {
|
|
254
|
-
try {
|
|
255
|
-
if (ctx.slots && typeof ctx.slots.register === 'function') {
|
|
256
|
-
ctx.slots.register(
|
|
257
|
-
{
|
|
258
|
-
name: 'settings.section',
|
|
259
|
-
id: '@goodandready/dsh-usage-guard',
|
|
260
|
-
order: 50,
|
|
261
|
-
locale: NS,
|
|
262
|
-
label: () => (ctx.locale && ctx.locale.bind ? ctx.locale.bind(NS)('title') : 'Usage Guard'),
|
|
263
|
-
inject: () => ({ ctx }),
|
|
264
|
-
},
|
|
265
|
-
PluginCard,
|
|
266
|
-
);
|
|
267
|
-
}
|
|
268
|
-
} catch (_) {}
|
|
269
|
-
}
|
|
246
|
+
} catch (_) {}
|
|
270
247
|
};
|
|
271
248
|
|
|
272
249
|
return module.exports;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goodandready/dsh-usage-guard",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Keeps a malformed token-usage sample from taking a whole session history down with it: a missing or non-numeric counter becomes zero before the harness adds it up, so the fold never yields NaN and already-broken sessions open again.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|