dsh-disk-cleaner 1.6.0 → 1.6.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/index.js +2 -1
- package/package.json +1 -1
- package/smoke.mjs +2 -0
package/lib/index.js
CHANGED
|
@@ -349,7 +349,7 @@ export function apply(ctx) {
|
|
|
349
349
|
additionalProperties: false,
|
|
350
350
|
},
|
|
351
351
|
output: {
|
|
352
|
-
schema: { type: '
|
|
352
|
+
schema: { type: 'string' },
|
|
353
353
|
render: (args, value) => [{ type: 'text', text: typeof value === 'string' ? value : JSON.stringify(value, null, 2) }],
|
|
354
354
|
},
|
|
355
355
|
timeoutMs: 300_000,
|
|
@@ -413,6 +413,7 @@ export function apply(ctx) {
|
|
|
413
413
|
if (ids === undefined || ids.length === 0) throw new Error('clean needs at least one target id');
|
|
414
414
|
const dryRun = args.confirm !== true;
|
|
415
415
|
const results = await clean(ids, { dryRun, drive: readDrive(args.drive) });
|
|
416
|
+
if (!dryRun) invalidateAudit();
|
|
416
417
|
const freed = results.reduce((sum, item) => sum + item.bytes, 0);
|
|
417
418
|
const files = results.reduce((sum, item) => sum + item.removed, 0);
|
|
418
419
|
const failed = results.reduce((sum, item) => sum + item.failed, 0);
|
package/package.json
CHANGED
package/smoke.mjs
CHANGED
|
@@ -260,6 +260,8 @@ check(
|
|
|
260
260
|
check('tool needs no id for overview', JSON.stringify(definition.parameters.required) === JSON.stringify(['action']));
|
|
261
261
|
check('tool description warns audit is read-only', /read-only: it never removes anything/.test(definition.description));
|
|
262
262
|
check('every effect is labelled', applied.every((label) => typeof label === 'string' && label.startsWith('dsh-disk-cleaner:')));
|
|
263
|
+
check('tool output schema matches its string reply', definition.output.schema.type === 'string' && typeof (await definition.execute({ action: 'overview' })) === 'string');
|
|
264
|
+
check('the read-only agent clean keeps the audit cache in sync', /if \(!dryRun\) invalidateAudit\(\);[\s\S]*const freed = results\.reduce/.test(index));
|
|
263
265
|
|
|
264
266
|
const ids = [...catalog.matchAll(/^\s{4}id: '([a-z-]+)',$/gm)].map((m) => m[1]);
|
|
265
267
|
check('catalog has the documented 32 targets', ids.length === 32, `got ${ids.length}`);
|