@toddzheng024/dscode-bundle 0.7.21 → 0.7.23
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/package.json +4 -4
- package/plugins/dscode/index.mjs +10 -0
- package/plugins/i18n/messages.d.mts +21 -0
- package/plugins/i18n/messages.mjs +18 -6
- package/plugins/session-bridge/index.mjs +6 -0
- package/plugins/session-bridge/tasks.mjs +227 -0
- package/plugins/session-metrics/turns.mjs +134 -0
- package/plugins/session-metrics/view.mjs +85 -33
- package/plugins/tui-tools/workspace-discovery.mjs +11 -4
- package/presets/dscode/agent.cordis.yml +3 -2
- package/vendor/tui/lib/app.mjs +124 -36
- package/vendor/tui/lib/communication.mjs +262 -0
- package/vendor/tui/lib/dscode/chat.mjs +34 -0
- package/vendor/tui/lib/dscode/model-search.mjs +2 -2
- package/vendor/tui/lib/dscode/palette.mjs +100 -0
- package/vendor/tui/lib/dscode/telemetry.mjs +18 -11
- package/vendor/tui/lib/index.mjs +140 -6
- package/vendor/tui/lib/locales/en.mjs +3 -0
- package/vendor/tui/lib/locales/zh.mjs +3 -0
- package/vendor/tui/lib/mentions.mjs +1 -1
- package/vendor/tui/lib/render/status.mjs +56 -35
- package/vendor/tui/lib/render/text.mjs +33 -0
- package/vendor/tui/lib/render/usage.mjs +11 -2
- package/vendor/tui/lib/session-directory.mjs +25 -0
- package/vendor/tui/lib/skills.mjs +19 -7
|
@@ -32,6 +32,7 @@ export function watchSkills(ctx, fallbackCwd) {
|
|
|
32
32
|
const skills = ctx.get('skills');
|
|
33
33
|
let agent;
|
|
34
34
|
let rows = [];
|
|
35
|
+
let count;
|
|
35
36
|
let error;
|
|
36
37
|
// The agent whose workspace the current rows were last successfully read
|
|
37
38
|
// from: a failure for an agent that never loaded must clear the rows, not
|
|
@@ -58,11 +59,15 @@ export function watchSkills(ctx, fallbackCwd) {
|
|
|
58
59
|
return;
|
|
59
60
|
const next = toRows(summaries);
|
|
60
61
|
// Description and invocation-flag edits must surface too: a name-only
|
|
61
|
-
// comparison silently dropped those change notifications.
|
|
62
|
-
|
|
62
|
+
// comparison silently dropped those change notifications. The catalog
|
|
63
|
+
// size is compared as well, because a model-only skill moves the footer
|
|
64
|
+
// count without changing any user-invocable row.
|
|
65
|
+
const unchanged = summaries.length === count
|
|
66
|
+
&& next.length === rows.length && next.every((row, index) => row.name === rows[index]?.name
|
|
63
67
|
&& row.description === rows[index]?.description
|
|
64
68
|
&& row.modelInvocable === rows[index]?.modelInvocable);
|
|
65
69
|
rows = next;
|
|
70
|
+
count = summaries.length;
|
|
66
71
|
loadedFor = target;
|
|
67
72
|
const recovered = error !== undefined;
|
|
68
73
|
error = undefined;
|
|
@@ -77,15 +82,19 @@ export function watchSkills(ctx, fallbackCwd) {
|
|
|
77
82
|
// next skills/change notification is the retry surface, mirroring the
|
|
78
83
|
// web directory); a target that never loaded starts from empty rows —
|
|
79
84
|
// stale rows from a previous workspace must not keep completing here.
|
|
80
|
-
//
|
|
81
|
-
//
|
|
82
|
-
//
|
|
85
|
+
// That clearing is itself a state change, so it notifies even when the
|
|
86
|
+
// error text repeats; the error text alone keeps the identity rule
|
|
87
|
+
// below, where a repeated identical error on the 0.1.5 event storm must
|
|
88
|
+
// not churn fresh identities into React's update chain.
|
|
83
89
|
const nextError = cause instanceof Error ? cause.message : String(cause);
|
|
84
|
-
|
|
90
|
+
const cleared = loadedFor !== target && (rows.length > 0 || count !== undefined);
|
|
91
|
+
if (loadedFor !== target) {
|
|
85
92
|
rows = [];
|
|
93
|
+
count = undefined;
|
|
94
|
+
}
|
|
86
95
|
const errorChanged = nextError !== error;
|
|
87
96
|
error = nextError;
|
|
88
|
-
if (!errorChanged)
|
|
97
|
+
if (!errorChanged && !cleared)
|
|
89
98
|
return;
|
|
90
99
|
for (const listener of listeners)
|
|
91
100
|
listener();
|
|
@@ -101,6 +110,9 @@ export function watchSkills(ctx, fallbackCwd) {
|
|
|
101
110
|
get rows() {
|
|
102
111
|
return rows;
|
|
103
112
|
},
|
|
113
|
+
get count() {
|
|
114
|
+
return count;
|
|
115
|
+
},
|
|
104
116
|
get error() {
|
|
105
117
|
return error;
|
|
106
118
|
},
|