@openmixer/plugin-qualify 0.18.4 → 0.18.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/bin/plugin-qualify-sync.mjs +3 -1
- package/dist/jack-registry.d.ts +6 -0
- package/dist/jack-registry.js +52 -0
- package/dist/jack-registry.js.map +1 -0
- package/dist/probe-judge.d.ts +5 -0
- package/dist/probe-judge.js.map +1 -1
- package/dist/probe-runner.d.ts +8 -0
- package/dist/probe-runner.js +8 -4
- package/dist/probe-runner.js.map +1 -1
- package/dist/qualification-record.d.ts +19 -0
- package/dist/qualification-record.js +15 -0
- package/dist/qualification-record.js.map +1 -1
- package/dist/qualify-adapter-pass.js +20 -5
- package/dist/qualify-adapter-pass.js.map +1 -1
- package/dist/qualify-sync.d.ts +10 -0
- package/dist/qualify-sync.js +40 -0
- package/dist/qualify-sync.js.map +1 -1
- package/package.json +1 -1
- package/src/jack-registry.ts +49 -0
- package/src/probe-judge.ts +2 -0
- package/src/probe-runner.ts +18 -4
- package/src/qualification-record.ts +31 -0
- package/src/qualify-adapter-pass.ts +18 -5
- package/src/qualify-sync.ts +47 -0
package/src/qualify-sync.ts
CHANGED
|
@@ -1218,6 +1218,53 @@ export function descriptorAccessProblems(dir: string): string[] {
|
|
|
1218
1218
|
return problems;
|
|
1219
1219
|
}
|
|
1220
1220
|
|
|
1221
|
+
/** What the records say per plugin, not per record: a CLAP plugin has a record per offer (.default, the console's
|
|
1222
|
+
* in-process tier, and .custom, omx-clap-host's isolated tier), and is offered when any of its records is. */
|
|
1223
|
+
export interface PluginCounts {
|
|
1224
|
+
readonly plugins: Readonly<Record<string, number>>;
|
|
1225
|
+
readonly offered: Readonly<Record<string, number>>;
|
|
1226
|
+
readonly notOffered: Readonly<Record<string, number>>;
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
export function pluginCounts(qualificationDir: string): PluginCounts {
|
|
1230
|
+
const offeredBy = new Map<string, boolean>();
|
|
1231
|
+
let files: string[] = [];
|
|
1232
|
+
try {
|
|
1233
|
+
files = readdirSync(qualificationDir).filter((f) => f.endsWith(".qualification.json"));
|
|
1234
|
+
} catch {
|
|
1235
|
+
// no directory, no record
|
|
1236
|
+
}
|
|
1237
|
+
for (const f of files) {
|
|
1238
|
+
let r: { plugin?: { format?: string; id?: string }; tiers?: { offeredOn?: readonly string[] } };
|
|
1239
|
+
try {
|
|
1240
|
+
r = JSON.parse(readFileSync(join(qualificationDir, f), "utf8"));
|
|
1241
|
+
} catch {
|
|
1242
|
+
continue;
|
|
1243
|
+
}
|
|
1244
|
+
if (!r.plugin?.format || !r.plugin.id) continue;
|
|
1245
|
+
const key = `${r.plugin.format}\0${r.plugin.id}`;
|
|
1246
|
+
offeredBy.set(key, (offeredBy.get(key) ?? false) || (r.tiers?.offeredOn?.length ?? 0) > 0);
|
|
1247
|
+
}
|
|
1248
|
+
const plugins: Record<string, number> = {}, offered: Record<string, number> = {}, notOffered: Record<string, number> = {};
|
|
1249
|
+
for (const [key, isOffered] of offeredBy) {
|
|
1250
|
+
const format = key.split("\0")[0]!;
|
|
1251
|
+
plugins[format] = (plugins[format] ?? 0) + 1;
|
|
1252
|
+
const into = isOffered ? offered : notOffered;
|
|
1253
|
+
into[format] = (into[format] ?? 0) + 1;
|
|
1254
|
+
}
|
|
1255
|
+
return { plugins, offered, notOffered };
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
/** The per-plugin counts as one line: `plugins 1577 (clap 248, lv2 1329), offered 1399 (...), not offered 178 (...)`. */
|
|
1259
|
+
export function pluginCountsLine(c: PluginCounts): string {
|
|
1260
|
+
const part = (m: Readonly<Record<string, number>>): string => {
|
|
1261
|
+
const keys = Object.keys(m).sort();
|
|
1262
|
+
const total = keys.reduce((n, k) => n + m[k]!, 0);
|
|
1263
|
+
return `${String(total)}${keys.length === 0 ? "" : ` (${keys.map((k) => `${k} ${String(m[k])}`).join(", ")})`}`;
|
|
1264
|
+
};
|
|
1265
|
+
return `plugins ${part(c.plugins)}, offered ${part(c.offered)}, not offered ${part(c.notOffered)}`;
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1221
1268
|
export function summaryLine(s: SyncSummary): string {
|
|
1222
1269
|
return `qualified ${String(s.qualified)}, skipped ${String(s.skipped)}, refused ${String(s.refused)}, crashed ${String(s.crashed)}, hung ${String(s.hung)}, unmeasured ${String(s.unmeasured)}, distributed ${String(s.distributed)}${s.refreshed ? `, pins refreshed ${String(s.refreshed)}` : ""}${s.rejudge === undefined ? "" : `, rejudged ${String(s.rejudge.changed)}, unchanged ${String(s.rejudge.unchanged)}, owing ${String(s.rejudge.owing)}`}${s.memoryOnly === undefined ? "" : `, memory measured ${String(s.memoryOnly.measured)}, already ${String(s.memoryOnly.already)}, failed ${String(s.memoryOnly.failed)}, leaks not measured`}${s.adapterOnly === undefined ? "" : `, adapter run ${String(s.adapterOnly.measured)}, already ${String(s.adapterOnly.already)}, failed ${String(s.adapterOnly.failed)}`}, ${s.seconds.toFixed(1)} s`;
|
|
1223
1270
|
}
|