dsh-context 0.19.0 → 0.19.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/lib/client.js +1 -1
- package/lib/index.js +12 -8
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -1443,7 +1443,7 @@ function makeEventList(kit) {
|
|
|
1443
1443
|
|
|
1444
1444
|
// src/client/meta.ts
|
|
1445
1445
|
var PLUGIN_NAME = "dsh-context";
|
|
1446
|
-
var PLUGIN_VERSION = true ? "0.19.
|
|
1446
|
+
var PLUGIN_VERSION = true ? "0.19.1" : "0.0.0-dev";
|
|
1447
1447
|
var PLUGIN_REPO = true ? "https://github.com/bowenliang123/dsh-context" : "https://github.com/bowenliang123/dsh-context";
|
|
1448
1448
|
var PLUGIN_REPO_SHORT = PLUGIN_REPO.replace(/^https?:\/\/github\.com\//, "");
|
|
1449
1449
|
|
package/lib/index.js
CHANGED
|
@@ -211,10 +211,6 @@ function createTimelineState() {
|
|
|
211
211
|
systemTokens: 0,
|
|
212
212
|
toolsTokens: 0,
|
|
213
213
|
toolList: [],
|
|
214
|
-
model: void 0,
|
|
215
|
-
provider: void 0,
|
|
216
|
-
lastModel: void 0,
|
|
217
|
-
contextWindow: void 0,
|
|
218
214
|
requests: [],
|
|
219
215
|
events: [],
|
|
220
216
|
archived: [],
|
|
@@ -274,7 +270,7 @@ function applySurface(st, ev, type, data, message) {
|
|
|
274
270
|
if (utext !== "") node.text = utext;
|
|
275
271
|
}
|
|
276
272
|
const shadowedSeqs = st.pendingShadowedSeqs;
|
|
277
|
-
st.pendingShadowedSeqs
|
|
273
|
+
delete st.pendingShadowedSeqs;
|
|
278
274
|
const op = ev.surfaceOp;
|
|
279
275
|
if (op !== null && typeof op === "object" && op.op === "replace") {
|
|
280
276
|
if (Array.isArray(shadowedSeqs) && shadowedSeqs.length > 0) {
|
|
@@ -394,8 +390,6 @@ function applyTimeline(state, event, bounds) {
|
|
|
394
390
|
const s = ensure();
|
|
395
391
|
const total = s.systemTokens + s.toolsTokens + s.sums.user + s.sums.inject + s.sums.assistant + s.sums.tool;
|
|
396
392
|
const record = {
|
|
397
|
-
turn: data && typeof data.turn === "number" ? data.turn : void 0,
|
|
398
|
-
step: data && typeof data.step === "number" ? data.step : void 0,
|
|
399
393
|
time: event.time,
|
|
400
394
|
seq: event.seq,
|
|
401
395
|
system: s.systemTokens,
|
|
@@ -406,6 +400,8 @@ function applyTimeline(state, event, bounds) {
|
|
|
406
400
|
tool: s.sums.tool,
|
|
407
401
|
total
|
|
408
402
|
};
|
|
403
|
+
if (data && typeof data.turn === "number") record.turn = data.turn;
|
|
404
|
+
if (data && typeof data.step === "number") record.step = data.step;
|
|
409
405
|
if (usage && typeof usage.inputTokens === "number") {
|
|
410
406
|
record.prompt = usage.inputTokens + (usage.cacheReadTokens || 0) + (usage.cacheWriteTokens || 0);
|
|
411
407
|
if (typeof usage.outputTokens === "number") record.output = usage.outputTokens;
|
|
@@ -578,7 +574,15 @@ function createContextTimelineDefinition(config) {
|
|
|
578
574
|
// 3 since 0.12: the removed-node archive (`archived` + `archiveFloor`)
|
|
579
575
|
// joined the persisted state for the Context browser's per-step
|
|
580
576
|
// reconstruction — cached rows predate the shape and are refolded.
|
|
581
|
-
|
|
577
|
+
// 4 since 0.18: the persisted state no longer carries `undefined`-valued
|
|
578
|
+
// properties (model/provider/lastModel/contextWindow are absent until
|
|
579
|
+
// known; pendingShadowedSeqs is deleted when consumed). The previous
|
|
580
|
+
// shape violated the plain-JSON persisted-state precondition and failed
|
|
581
|
+
// EVERY session-projection-cache write (TypeError: projection checkpoint
|
|
582
|
+
// is not losslessly JSON-serializable) — which also starved the `title`
|
|
583
|
+
// projection row and broke the session list after a restart. The bump
|
|
584
|
+
// discards old cached rows and refolds them clean.
|
|
585
|
+
stateVersion: 4
|
|
582
586
|
};
|
|
583
587
|
}
|
|
584
588
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-context",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.1",
|
|
4
4
|
"description": "A DeepSeek Harness plugin for context insight and management, with context dashboard and context command, for understanding how the context is made of, and how it evolves.",
|
|
5
5
|
"author": "bowenliang123",
|
|
6
6
|
"repository": {
|