loopengine 0.1.27 → 0.1.28

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.
@@ -19,7 +19,7 @@
19
19
  import { createHash } from 'node:crypto';
20
20
  import { execFileSync } from 'node:child_process';
21
21
  import { basename, dirname, join } from 'node:path';
22
- import { cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'node:fs';
22
+ import { cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmdirSync, rmSync, writeFileSync } from 'node:fs';
23
23
  import { tmpdir } from 'node:os';
24
24
  import { parse as parseYaml } from 'yaml';
25
25
  import semver from 'semver';
@@ -639,6 +639,20 @@ export function removeAbility(agentName, abilityName, force = false) {
639
639
  }
640
640
  rmSync(join(agentDir(agentName), 'skills', skillId), { recursive: true, force: true });
641
641
  removed.push(`skills/${skillId}/`);
642
+ // A namespaced skillId ("<ability-name>/<id>", see namespacedSkillId)
643
+ // leaves its own now-empty "<ability-name>/" namespace directory
644
+ // behind — best-effort cleanup, not "refuse rather than guess": rmdir
645
+ // itself already refuses (ENOTEMPTY) if another skill from this same
646
+ // ability is still namespaced under it, which is exactly the case
647
+ // this should leave alone.
648
+ if (skillId.includes('/')) {
649
+ try {
650
+ rmdirSync(join(agentDir(agentName), 'skills', dirname(skillId)));
651
+ }
652
+ catch {
653
+ // Not empty, or already gone — either way, nothing to do.
654
+ }
655
+ }
642
656
  }
643
657
  for (const ruleName of record.actauthRules) {
644
658
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loopengine",
3
- "version": "0.1.27",
3
+ "version": "0.1.28",
4
4
  "type": "module",
5
5
  "description": "Runtime for tool-using AI agents with a transparent ReAct loop.",
6
6
  "license": "MIT",