omp-vcc 0.1.9 → 0.1.11
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 +1 -1
- package/extensions/main.ts +9 -15
- package/extensions/vcc-core/core/drill-down.ts +3 -4
- package/extensions/vcc-core/core/migrate-stale.ts +3 -3
- package/extensions/vcc-core/core/summarize.ts +3 -5
- package/extensions/vcc-core/core/token-estimate.ts +1 -3
- package/extensions/vcc-core/hook.ts +5 -21
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -90,7 +90,7 @@ Additive VCC+shake is automatic. Eager chain: `chainShakeHint:true`. Explicit mo
|
|
|
90
90
|
|
|
91
91
|
```sh
|
|
92
92
|
bunx tsc --noEmit
|
|
93
|
-
bun test #
|
|
93
|
+
bun test # 800 tests, 61 files, 2396 expects, 0 fail
|
|
94
94
|
bun test tests/e2e --timeout 120000 # 124 E2E
|
|
95
95
|
bun run smoke # 13 checks: 3 hooks + 6 cmds + 2 tools + dedup (+ pipeline)
|
|
96
96
|
omp plugin link . && omp plugin doctor
|
package/extensions/main.ts
CHANGED
|
@@ -94,11 +94,9 @@ export default function (pi: ExtensionAPI): void {
|
|
|
94
94
|
|
|
95
95
|
const q = p.query?.trim();
|
|
96
96
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
return { content: [{ type: "text", text: "Invalid entry ref query." }], details: undefined };
|
|
101
|
-
}
|
|
97
|
+
const entryRef = q ? parseEntryRef(q) : null;
|
|
98
|
+
if (entryRef) {
|
|
99
|
+
const ref = entryRef;
|
|
102
100
|
if (lineageEntryIds) {
|
|
103
101
|
const { rendered } = loadAllMessages(sessionFile, false, lineageEntryIds);
|
|
104
102
|
const exists = rendered.some((m) => m.index === ref.index);
|
|
@@ -113,11 +111,9 @@ export default function (pi: ExtensionAPI): void {
|
|
|
113
111
|
return { content: [{ type: "text", text }], details: undefined };
|
|
114
112
|
}
|
|
115
113
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
return { content: [{ type: "text", text: "Invalid drill-down query." }], details: undefined };
|
|
120
|
-
}
|
|
114
|
+
const drill = q ? parseDrillDown(q) : null;
|
|
115
|
+
if (drill) {
|
|
116
|
+
const parsed = drill;
|
|
121
117
|
if (lineageEntryIds) {
|
|
122
118
|
const { rendered } = loadAllMessages(sessionFile, false, lineageEntryIds);
|
|
123
119
|
const exists = rendered.some((m) => m.index === parsed.index);
|
|
@@ -248,11 +244,9 @@ export default function (pi: ExtensionAPI): void {
|
|
|
248
244
|
}
|
|
249
245
|
} catch (err: unknown) {
|
|
250
246
|
const msg = err instanceof Error ? err.message : String(err);
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
254
|
-
try { c.ui.notify(`Compaction failed: ${msg}`, "error"); } catch {}
|
|
255
|
-
}
|
|
247
|
+
const cancelled = msg === "Compaction cancelled" || msg === "Already compacted";
|
|
248
|
+
const note = cancelled ? "Nothing to compact" : `Compaction failed: ${msg}`;
|
|
249
|
+
try { c.ui.notify(note, cancelled ? "warning" : "error"); } catch {}
|
|
256
250
|
}
|
|
257
251
|
},
|
|
258
252
|
});
|
|
@@ -204,13 +204,12 @@ export function parseDrillDown(query: string): {
|
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
if (suffix !== undefined) {
|
|
207
|
-
// Parse "offset" or "offset:limit"
|
|
207
|
+
// Parse "offset" or "offset:limit". The pattern above admits only
|
|
208
|
+
// numeric suffixes, so offset always parses here.
|
|
208
209
|
const parts = suffix.split(":");
|
|
209
210
|
const offset = parseInt(parts[0], 10);
|
|
210
211
|
const limit = parts[1] !== undefined ? parseInt(parts[1], 10) : undefined;
|
|
211
|
-
|
|
212
|
-
return { index, pathPattern, full: false, offset, limit };
|
|
213
|
-
}
|
|
212
|
+
return { index, pathPattern, full: false, offset, limit };
|
|
214
213
|
}
|
|
215
214
|
|
|
216
215
|
return {
|
|
@@ -84,7 +84,7 @@ export function migrateStalePluginEntries(home?: string): string {
|
|
|
84
84
|
if (k.startsWith("@")) {
|
|
85
85
|
const scopeDir = join(nm, k.split("/")[0]!);
|
|
86
86
|
try {
|
|
87
|
-
|
|
87
|
+
if (fsSync.readdirSync(scopeDir).length === 0) fsSync.rmSync(scopeDir, { force: true, recursive: true });
|
|
88
88
|
} catch {}
|
|
89
89
|
}
|
|
90
90
|
} catch {}
|
|
@@ -119,7 +119,7 @@ export function migrateStalePluginEntries(home?: string): string {
|
|
|
119
119
|
if (k.startsWith("@")) {
|
|
120
120
|
const scopeDir = join(nm, k.split("/")[0]!);
|
|
121
121
|
try {
|
|
122
|
-
if (fsSync.readdirSync(scopeDir).length === 0) fsSync.rmSync(scopeDir, { force: true });
|
|
122
|
+
if (fsSync.readdirSync(scopeDir).length === 0) fsSync.rmSync(scopeDir, { force: true, recursive: true });
|
|
123
123
|
} catch {}
|
|
124
124
|
}
|
|
125
125
|
} catch {}
|
|
@@ -145,7 +145,7 @@ export function migrateStalePluginEntries(home?: string): string {
|
|
|
145
145
|
if (cand.startsWith("@")) {
|
|
146
146
|
const scopeDir = join(nm, cand.split("/")[0]!);
|
|
147
147
|
try {
|
|
148
|
-
|
|
148
|
+
if (fsSync.readdirSync(scopeDir).length === 0) fsSync.rmSync(scopeDir, { force: true, recursive: true });
|
|
149
149
|
} catch {}
|
|
150
150
|
}
|
|
151
151
|
} catch {}
|
|
@@ -126,11 +126,9 @@ const mergeFileLines = (prev: string, fresh: string): string => {
|
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
128
128
|
const grouped = /^ \(\+(\d+) more( under (.+?))?\): (.*)$/.exec(tail);
|
|
129
|
-
if (grouped)
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
return null;
|
|
129
|
+
if (!grouped) return null;
|
|
130
|
+
const dir = grouped[3] ?? "";
|
|
131
|
+
return { prefix: dir && !dir.endsWith("/") ? `${dir}/` : dir, rest: grouped[4] };
|
|
134
132
|
};
|
|
135
133
|
for (const text of [prev, fresh]) {
|
|
136
134
|
let current: { cat: string; prefix: string; rest: string } | null = null;
|
|
@@ -32,8 +32,8 @@ try {
|
|
|
32
32
|
|
|
33
33
|
export { PI_VCC_COMPACT_INSTRUCTION } from "./core/compact-args";
|
|
34
34
|
export const OMP_VCC_COMPACT_INSTRUCTION = "__omp_vcc__";
|
|
35
|
-
//
|
|
36
|
-
|
|
35
|
+
// (Both pi/omp sentinels are matched inline at the explicit-mode bypass in
|
|
36
|
+
// the session_before_compact handler below.)
|
|
37
37
|
|
|
38
38
|
export interface CompactionStats {
|
|
39
39
|
summarized: number;
|
|
@@ -162,20 +162,6 @@ export const triggerInvisibleContinue = (pi: ExtensionAPI): void => {
|
|
|
162
162
|
);
|
|
163
163
|
};
|
|
164
164
|
|
|
165
|
-
const clearPendingAutoContinue = () => {
|
|
166
|
-
clearTimeout(pendingAutoContinueTimer as any);
|
|
167
|
-
pendingAutoContinueTimer = null;
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
const scheduleAutoContinue = (pi: any) => {
|
|
171
|
-
clearPendingAutoContinue();
|
|
172
|
-
pendingAutoContinueTimer = setTimeout(() => {
|
|
173
|
-
pendingAutoContinueTimer = null;
|
|
174
|
-
try {
|
|
175
|
-
triggerInvisibleContinue(pi);
|
|
176
|
-
} catch {}
|
|
177
|
-
}, 0);
|
|
178
|
-
};
|
|
179
165
|
|
|
180
166
|
export const getLastCompactionStats = (pi?: any) => {
|
|
181
167
|
if (pi) {
|
|
@@ -1308,11 +1294,9 @@ export const registerPiVccCommand = (pi: any) => {
|
|
|
1308
1294
|
}
|
|
1309
1295
|
},
|
|
1310
1296
|
onError: (err) => {
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
ctx.ui.notify(`Compaction failed: ${err.message}`, "error");
|
|
1315
|
-
}
|
|
1297
|
+
const cancelled = err.message === "Compaction cancelled" || err.message === "Already compacted";
|
|
1298
|
+
const msg = cancelled ? "Nothing to compact" : `Compaction failed: ${err.message}`;
|
|
1299
|
+
ctx.ui.notify(msg, cancelled ? "warning" : "error");
|
|
1316
1300
|
},
|
|
1317
1301
|
});
|
|
1318
1302
|
},
|