dsh-vertex-argon 1.5.0 → 1.5.1
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/CHANGELOG.md +7 -0
- package/README.md +2 -2
- package/client.js +2 -2
- package/diagnostic-store.js +8 -5
- package/interaction-state.js +1 -1
- package/package.json +1 -1
- package/response-store.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `dsh-vertex-argon` are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.5.1] - 2026-10-19
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
- **Performance Optimization (`client.js`, `diagnostic-store.js`, `interaction-state.js`, `response-store.js`)**:
|
|
9
|
+
- Replaced the remaining 5 ISO 8601 timestamp `String.prototype.localeCompare()` sorts with direct lexicographical relational operators (`<` / `>`) across recovery lists, recent diagnostics, background task eviction, and raw response retention trimming.
|
|
10
|
+
- Reused precomputed `sumParts` when available in `extractTokenMix` (`client.js`) to avoid redundant segment filtering and reduction.
|
|
11
|
+
|
|
5
12
|
## [1.5.0] - 2026-10-18
|
|
6
13
|
|
|
7
14
|
### Added
|
package/README.md
CHANGED
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
|
|
27
27
|
`dsh-vertex-argon` 为 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH) 提供生产级的 **Gemini 4 Argon** 双通道接入支持。插件同时打通 **Google Vertex AI**(ADC 服务账号 / Express API Key)与 **Google Gemini Developer API**(AI Studio API Key),完整支持 **`GenerateContent` (`v1beta1` / `v1`) 多跳长解码续传**与 **`Interactions` (`v1beta`) 持久化后台恢复**双协议,配备显式服务层级路由(`Standard` / `Flex` / `Priority`)、仅签名空 `Part` 无损回放、模态级 Token 账本、公开价格成本估算、**Argon Inspector 全景检视台**以及只读 Agent 诊断工具 `argon_inspect`。
|
|
28
28
|
|
|
29
|
-
Current release: **[1.5.
|
|
29
|
+
Current release: **[1.5.1](https://github.com/higekibaka/dsh-vertex-argon)** · [npm](https://www.npmjs.com/package/dsh-vertex-argon) · [CHANGELOG](./CHANGELOG.md)
|
|
30
30
|
|
|
31
31
|
---
|
|
32
32
|
|
|
33
33
|
## ✨ 为什么需要这个插件?
|
|
34
34
|
|
|
35
|
-
| 能力维度 | DSH 内置 `google` / `google-vertex` 默认适配器 | `dsh-vertex-argon` (v1.5.
|
|
35
|
+
| 能力维度 | DSH 内置 `google` / `google-vertex` 默认适配器 | `dsh-vertex-argon` (v1.5.1) |
|
|
36
36
|
|---|---|---|
|
|
37
37
|
| **思考控制参数** | 误传 `thinkingBudget: -1` 触发云端 `HTTP 400`,或传入超限档位 `max` 报错 | 原生映射 `thinkingLevel: "LOW" \| "MEDIUM" \| "HIGH"`,自动将 `max` 收敛为 `high`,剔除无效采样参数 |
|
|
38
38
|
| **思维链与空块签名回放** | 容易丢失不带文本的独立 `thoughtSignature` `Part`,影响长链路多轮推理与工具续答 | 固定开启 `includeThoughts: true`,通过 `google-signatures.js` 无损编码并原样回放仅含签名的空 `Part` |
|
package/client.js
CHANGED
|
@@ -980,7 +980,7 @@ window.__ModuleLoader__.load({
|
|
|
980
980
|
}
|
|
981
981
|
}
|
|
982
982
|
const blocked = disabled || !formWritable(form) || loading || releasing
|
|
983
|
-
const sorted = [...records].sort((a, b) => Number(released(a)) - Number(released(b)) || b.updatedAt.
|
|
983
|
+
const sorted = [...records].sort((a, b) => Number(released(a)) - Number(released(b)) || (b.updatedAt < a.updatedAt ? -1 : (b.updatedAt > a.updatedAt ? 1 : 0))).slice(0, 20)
|
|
984
984
|
return h('div', { className: 'card', 'aria-label': t('recoveryTitle') },
|
|
985
985
|
h('div', { className: 'row' },
|
|
986
986
|
h('h3', null, t('recoveryTitle')),
|
|
@@ -1174,7 +1174,7 @@ window.__ModuleLoader__.load({
|
|
|
1174
1174
|
const sumParts = segments.every(s => s.count !== null) ? segments.reduce((sum, s) => sum + s.count, 0) : null
|
|
1175
1175
|
// A missing field remains unknown. Only chart recorded parts when they
|
|
1176
1176
|
// account for the reported total, both per hop and after aggregation.
|
|
1177
|
-
const recordedSum = segments.filter(s => s.count !== null).reduce((sum, s) => sum + s.count, 0)
|
|
1177
|
+
const recordedSum = sumParts !== null ? sumParts : segments.filter(s => s.count !== null).reduce((sum, s) => sum + s.count, 0)
|
|
1178
1178
|
const chartReady = complete && cacheValid && sourceTotalsValid && knownTokens(recordedSum) && total !== null && total > 0 && recordedSum === total
|
|
1179
1179
|
if (chartReady) for (const s of segments) if (s.count !== null) s.pct = s.count / total * 100
|
|
1180
1180
|
return { segments, total, sumParts, complete, chartReady, hasData: total !== null || segments.some(s => s.count !== null), cacheHitPct: cacheValid && input > 0 ? cached / input * 100 : null }
|
package/diagnostic-store.js
CHANGED
|
@@ -129,7 +129,8 @@ export function diagnosticWriter(domain, warn = () => {}, limit = 200) {
|
|
|
129
129
|
tail = tail
|
|
130
130
|
.then(async () => {
|
|
131
131
|
if (failed) return
|
|
132
|
-
|
|
132
|
+
// Bolt ⚡: Optimized ISO 8601 date string sorting by replacing slow localeCompare with operators
|
|
133
|
+
const oldest = [...table.entries()].filter(([id]) => id !== parsed.data.id).sort((a, b) => a[1].startedAt < b[1].startedAt ? -1 : (a[1].startedAt > b[1].startedAt ? 1 : 0))
|
|
133
134
|
for (const [id] of oldest.slice(0, Math.max(0, oldest.length - limit + 1))) {
|
|
134
135
|
if (!(await table.delete(id))) throw new Error('diagnostic retention failed')
|
|
135
136
|
}
|
|
@@ -148,7 +149,8 @@ export function diagnosticWriter(domain, warn = () => {}, limit = 200) {
|
|
|
148
149
|
const cap = Math.min(Math.max(1, Number(max) || 20), limit)
|
|
149
150
|
return [...table.entries()]
|
|
150
151
|
.map(([, v]) => v)
|
|
151
|
-
|
|
152
|
+
// Bolt ⚡: Optimized ISO 8601 date string sorting by replacing slow localeCompare with operators
|
|
153
|
+
.sort((a, b) => b.startedAt < a.startedAt ? -1 : (b.startedAt > a.startedAt ? 1 : 0))
|
|
152
154
|
.slice(0, cap)
|
|
153
155
|
} catch {
|
|
154
156
|
return []
|
|
@@ -170,7 +172,8 @@ export function createDiagnosticHub(limit = 200) {
|
|
|
170
172
|
let activeWriter = null
|
|
171
173
|
const trimMemory = () => {
|
|
172
174
|
if (memory.size <= limit) return
|
|
173
|
-
|
|
175
|
+
// Bolt ⚡: Optimized ISO 8601 date string sorting by replacing slow localeCompare with operators
|
|
176
|
+
const sorted = [...memory.entries()].sort((a, b) => a[1].startedAt < b[1].startedAt ? -1 : (a[1].startedAt > b[1].startedAt ? 1 : 0))
|
|
174
177
|
for (const [id] of sorted.slice(0, memory.size - limit)) {
|
|
175
178
|
memory.delete(id)
|
|
176
179
|
}
|
|
@@ -212,7 +215,7 @@ export function createDiagnosticHub(limit = 200) {
|
|
|
212
215
|
}
|
|
213
216
|
}
|
|
214
217
|
return [...merged.values()]
|
|
215
|
-
.sort((a, b) => b.startedAt.
|
|
218
|
+
.sort((a, b) => b.startedAt < a.startedAt ? -1 : (b.startedAt > a.startedAt ? 1 : 0))
|
|
216
219
|
.slice(0, cap)
|
|
217
220
|
},
|
|
218
221
|
}
|
|
@@ -321,7 +324,7 @@ export class ArgonDiagnosticsService extends TypertRemoteService {
|
|
|
321
324
|
async listRecovery(request) {
|
|
322
325
|
try {
|
|
323
326
|
const { limit } = parseListRecentRequest(request)
|
|
324
|
-
const records = this.taskHub.entries().sort((a, b) => Number(Boolean(a.releasedAt)) - Number(Boolean(b.releasedAt)) || b.updatedAt.
|
|
327
|
+
const records = this.taskHub.entries().sort((a, b) => Number(Boolean(a.releasedAt)) - Number(Boolean(b.releasedAt)) || (b.updatedAt < a.updatedAt ? -1 : (b.updatedAt > a.updatedAt ? 1 : 0))).slice(0, limit).map(row => ({
|
|
325
328
|
key: row.key, sessionHash: row.sessionHash.slice(0, 12), stage: row.stage, updatedAt: row.updatedAt,
|
|
326
329
|
releasedAt: row.releasedAt ?? null, uncertainAt: row.uncertainAt ?? null, hasRemoteId: Boolean(row.interactionId), active: this.taskHub.isActive(row.key),
|
|
327
330
|
}))
|
package/interaction-state.js
CHANGED
|
@@ -50,7 +50,7 @@ export function createInteractionStateHub({ closeTimeoutMs = BACKGROUND_CREATE_T
|
|
|
50
50
|
this.requireReady()
|
|
51
51
|
if (!table.get(identity.key) && table.size >= 200) {
|
|
52
52
|
// Bound local audit history, but never evict an unresolved cloud attempt.
|
|
53
|
-
const oldestReleased = [...table.entries()].map(([, row]) => row).filter(row => row.releasedAt).sort((a, b) => a.releasedAt.
|
|
53
|
+
const oldestReleased = [...table.entries()].map(([, row]) => row).filter(row => row.releasedAt).sort((a, b) => a.releasedAt < b.releasedAt ? -1 : (a.releasedAt > b.releasedAt ? 1 : 0))[0]
|
|
54
54
|
if (!oldestReleased) throw new Error('Background recovery storage is full; resolve outstanding remote tasks before starting another.')
|
|
55
55
|
await table.delete(oldestReleased.key)
|
|
56
56
|
}
|
package/package.json
CHANGED
package/response-store.js
CHANGED
|
@@ -19,7 +19,7 @@ export function createResponseHub(options = {}) {
|
|
|
19
19
|
let domain, table, detachPromise, closed=false, storageFailed=false, tail=Promise.resolve(), scheduled=false
|
|
20
20
|
const trim = () => {
|
|
21
21
|
let bytes=[...records.values()].reduce((n,r)=>n+r.bytes,0)
|
|
22
|
-
for (const [id,row] of [...records].sort((a,b)=>a[1].startedAt.
|
|
22
|
+
for (const [id,row] of [...records].sort((a,b)=>a[1].startedAt < b[1].startedAt ? -1 : (a[1].startedAt > b[1].startedAt ? 1 : 0))) {
|
|
23
23
|
if (records.size <= limits.maxRecords && bytes <= limits.maxBytes) break
|
|
24
24
|
records.delete(id);persisted.delete(id);bytes-=row.bytes
|
|
25
25
|
}
|