plugin-agent-orchestrator 1.1.0 → 1.1.2

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.
Files changed (162) hide show
  1. package/dist/externalVersion.js +6 -6
  2. package/dist/locale/en-US.json +7 -1
  3. package/dist/locale/vi-VN.json +7 -1
  4. package/dist/locale/zh-CN.json +7 -1
  5. package/dist/node_modules/ajv/.tonic_example.js +20 -0
  6. package/dist/node_modules/ajv/LICENSE +22 -0
  7. package/dist/node_modules/ajv/dist/ajv.bundle.js +7189 -0
  8. package/dist/node_modules/ajv/dist/ajv.min.js +3 -0
  9. package/dist/node_modules/ajv/lib/ajv.d.ts +397 -0
  10. package/dist/node_modules/ajv/lib/ajv.js +3 -0
  11. package/dist/node_modules/ajv/lib/cache.js +26 -0
  12. package/dist/node_modules/ajv/lib/compile/async.js +90 -0
  13. package/dist/node_modules/ajv/lib/compile/equal.js +5 -0
  14. package/dist/node_modules/ajv/lib/compile/error_classes.js +34 -0
  15. package/dist/node_modules/ajv/lib/compile/formats.js +142 -0
  16. package/dist/node_modules/ajv/lib/compile/index.js +387 -0
  17. package/dist/node_modules/ajv/lib/compile/resolve.js +270 -0
  18. package/dist/node_modules/ajv/lib/compile/rules.js +66 -0
  19. package/dist/node_modules/ajv/lib/compile/schema_obj.js +9 -0
  20. package/dist/node_modules/ajv/lib/compile/ucs2length.js +20 -0
  21. package/dist/node_modules/ajv/lib/compile/util.js +239 -0
  22. package/dist/node_modules/ajv/lib/data.js +49 -0
  23. package/dist/node_modules/ajv/lib/definition_schema.js +37 -0
  24. package/dist/node_modules/ajv/lib/dot/_limit.jst +113 -0
  25. package/dist/node_modules/ajv/lib/dot/_limitItems.jst +12 -0
  26. package/dist/node_modules/ajv/lib/dot/_limitLength.jst +12 -0
  27. package/dist/node_modules/ajv/lib/dot/_limitProperties.jst +12 -0
  28. package/dist/node_modules/ajv/lib/dot/allOf.jst +32 -0
  29. package/dist/node_modules/ajv/lib/dot/anyOf.jst +46 -0
  30. package/dist/node_modules/ajv/lib/dot/coerce.def +51 -0
  31. package/dist/node_modules/ajv/lib/dot/comment.jst +9 -0
  32. package/dist/node_modules/ajv/lib/dot/const.jst +11 -0
  33. package/dist/node_modules/ajv/lib/dot/contains.jst +55 -0
  34. package/dist/node_modules/ajv/lib/dot/custom.jst +191 -0
  35. package/dist/node_modules/ajv/lib/dot/defaults.def +47 -0
  36. package/dist/node_modules/ajv/lib/dot/definitions.def +203 -0
  37. package/dist/node_modules/ajv/lib/dot/dependencies.jst +79 -0
  38. package/dist/node_modules/ajv/lib/dot/enum.jst +30 -0
  39. package/dist/node_modules/ajv/lib/dot/errors.def +194 -0
  40. package/dist/node_modules/ajv/lib/dot/format.jst +106 -0
  41. package/dist/node_modules/ajv/lib/dot/if.jst +73 -0
  42. package/dist/node_modules/ajv/lib/dot/items.jst +98 -0
  43. package/dist/node_modules/ajv/lib/dot/missing.def +39 -0
  44. package/dist/node_modules/ajv/lib/dot/multipleOf.jst +22 -0
  45. package/dist/node_modules/ajv/lib/dot/not.jst +43 -0
  46. package/dist/node_modules/ajv/lib/dot/oneOf.jst +54 -0
  47. package/dist/node_modules/ajv/lib/dot/pattern.jst +14 -0
  48. package/dist/node_modules/ajv/lib/dot/properties.jst +245 -0
  49. package/dist/node_modules/ajv/lib/dot/propertyNames.jst +52 -0
  50. package/dist/node_modules/ajv/lib/dot/ref.jst +85 -0
  51. package/dist/node_modules/ajv/lib/dot/required.jst +108 -0
  52. package/dist/node_modules/ajv/lib/dot/uniqueItems.jst +62 -0
  53. package/dist/node_modules/ajv/lib/dot/validate.jst +276 -0
  54. package/dist/node_modules/ajv/lib/dotjs/_limit.js +163 -0
  55. package/dist/node_modules/ajv/lib/dotjs/_limitItems.js +80 -0
  56. package/dist/node_modules/ajv/lib/dotjs/_limitLength.js +85 -0
  57. package/dist/node_modules/ajv/lib/dotjs/_limitProperties.js +80 -0
  58. package/dist/node_modules/ajv/lib/dotjs/allOf.js +42 -0
  59. package/dist/node_modules/ajv/lib/dotjs/anyOf.js +73 -0
  60. package/dist/node_modules/ajv/lib/dotjs/comment.js +14 -0
  61. package/dist/node_modules/ajv/lib/dotjs/const.js +56 -0
  62. package/dist/node_modules/ajv/lib/dotjs/contains.js +81 -0
  63. package/dist/node_modules/ajv/lib/dotjs/custom.js +228 -0
  64. package/dist/node_modules/ajv/lib/dotjs/dependencies.js +168 -0
  65. package/dist/node_modules/ajv/lib/dotjs/enum.js +66 -0
  66. package/dist/node_modules/ajv/lib/dotjs/format.js +150 -0
  67. package/dist/node_modules/ajv/lib/dotjs/if.js +103 -0
  68. package/dist/node_modules/ajv/lib/dotjs/index.js +33 -0
  69. package/dist/node_modules/ajv/lib/dotjs/items.js +140 -0
  70. package/dist/node_modules/ajv/lib/dotjs/multipleOf.js +80 -0
  71. package/dist/node_modules/ajv/lib/dotjs/not.js +84 -0
  72. package/dist/node_modules/ajv/lib/dotjs/oneOf.js +73 -0
  73. package/dist/node_modules/ajv/lib/dotjs/pattern.js +75 -0
  74. package/dist/node_modules/ajv/lib/dotjs/properties.js +335 -0
  75. package/dist/node_modules/ajv/lib/dotjs/propertyNames.js +81 -0
  76. package/dist/node_modules/ajv/lib/dotjs/ref.js +124 -0
  77. package/dist/node_modules/ajv/lib/dotjs/required.js +270 -0
  78. package/dist/node_modules/ajv/lib/dotjs/uniqueItems.js +86 -0
  79. package/dist/node_modules/ajv/lib/dotjs/validate.js +482 -0
  80. package/dist/node_modules/ajv/lib/keyword.js +146 -0
  81. package/dist/node_modules/ajv/lib/refs/data.json +17 -0
  82. package/dist/node_modules/ajv/lib/refs/json-schema-draft-04.json +149 -0
  83. package/dist/node_modules/ajv/lib/refs/json-schema-draft-06.json +154 -0
  84. package/dist/node_modules/ajv/lib/refs/json-schema-draft-07.json +168 -0
  85. package/dist/node_modules/ajv/lib/refs/json-schema-secure.json +94 -0
  86. package/dist/node_modules/ajv/node_modules/json-schema-traverse/.eslintrc.yml +27 -0
  87. package/dist/node_modules/ajv/node_modules/json-schema-traverse/.travis.yml +8 -0
  88. package/dist/node_modules/ajv/node_modules/json-schema-traverse/index.js +89 -0
  89. package/dist/node_modules/ajv/node_modules/json-schema-traverse/package.json +43 -0
  90. package/dist/node_modules/ajv/node_modules/json-schema-traverse/spec/.eslintrc.yml +6 -0
  91. package/dist/node_modules/ajv/node_modules/json-schema-traverse/spec/fixtures/schema.js +125 -0
  92. package/dist/node_modules/ajv/node_modules/json-schema-traverse/spec/index.spec.js +171 -0
  93. package/dist/node_modules/ajv/package.json +1 -0
  94. package/dist/node_modules/ajv/scripts/.eslintrc.yml +3 -0
  95. package/dist/node_modules/ajv/scripts/bundle.js +61 -0
  96. package/dist/node_modules/ajv/scripts/compile-dots.js +73 -0
  97. package/dist/node_modules/ajv/scripts/info +10 -0
  98. package/dist/node_modules/ajv/scripts/prepare-tests +12 -0
  99. package/dist/node_modules/ajv/scripts/publish-built-version +32 -0
  100. package/dist/node_modules/ajv/scripts/travis-gh-pages +23 -0
  101. package/dist/server/collections/skill-definitions.js +31 -0
  102. package/dist/server/collections/skill-executions.js +19 -0
  103. package/dist/server/collections/skill-registry-installations.js +70 -0
  104. package/dist/server/migrations/20260727010000-backfill-skill-tool-names.js +66 -0
  105. package/dist/server/plugin.js +96 -1
  106. package/dist/server/services/AgentExecutionContext.js +45 -0
  107. package/dist/server/services/CodeValidator.js +1 -0
  108. package/dist/server/services/ExecutionSpanService.js +10 -2
  109. package/dist/server/services/InputSchemaValidator.js +83 -0
  110. package/dist/server/services/NativeSubAgentObserver.js +55 -8
  111. package/dist/server/services/SandboxRunner.js +6 -2
  112. package/dist/server/services/SkillAccessService.js +109 -0
  113. package/dist/server/services/SkillManager.js +2 -0
  114. package/dist/server/services/SkillRepositoryService.js +70 -0
  115. package/dist/server/skill-hub/actions/git-import.js +479 -216
  116. package/dist/server/skill-hub/mcp/McpController.js +8 -5
  117. package/dist/server/skill-hub/middlewares/git-import-request-method-policy.js +69 -0
  118. package/dist/server/skill-hub/plugin.js +68 -14
  119. package/dist/server/skill-hub/services/RegistrySkillInstallationService.js +249 -0
  120. package/dist/server/skill-hub/services/RegistrySkillSnapshotService.js +228 -0
  121. package/dist/server/skill-hub/tasks/SkillExecutionTask.js +15 -3
  122. package/dist/server/tools/skill-execute.js +23 -2
  123. package/dist/server/utils/ctx-utils.js +2 -2
  124. package/dist/server/utils/skill-tool-name.js +73 -0
  125. package/package.json +9 -3
  126. package/src/locale/en-US.json +7 -1
  127. package/src/locale/vi-VN.json +7 -1
  128. package/src/locale/zh-CN.json +7 -1
  129. package/src/server/__tests__/agent-execution-context.test.ts +18 -0
  130. package/src/server/__tests__/input-schema-validator.test.ts +26 -0
  131. package/src/server/__tests__/native-sub-agent-observer.test.ts +52 -2
  132. package/src/server/__tests__/skill-access-service.test.ts +64 -0
  133. package/src/server/__tests__/skill-execute.test.ts +37 -0
  134. package/src/server/__tests__/skill-tool-name.test.ts +23 -0
  135. package/src/server/collections/skill-definitions.ts +31 -0
  136. package/src/server/collections/skill-executions.ts +19 -0
  137. package/src/server/collections/skill-registry-installations.ts +41 -0
  138. package/src/server/migrations/20260727010000-backfill-skill-tool-names.ts +45 -0
  139. package/src/server/plugin.ts +104 -1
  140. package/src/server/services/AgentExecutionContext.ts +23 -0
  141. package/src/server/services/CodeValidator.ts +1 -0
  142. package/src/server/services/ExecutionSpanService.ts +119 -110
  143. package/src/server/services/InputSchemaValidator.ts +44 -0
  144. package/src/server/services/NativeSubAgentObserver.ts +64 -10
  145. package/src/server/services/SandboxRunner.ts +6 -0
  146. package/src/server/services/SkillAccessService.ts +100 -0
  147. package/src/server/services/SkillManager.ts +2 -0
  148. package/src/server/services/SkillRepositoryService.ts +98 -2
  149. package/src/server/services/__tests__/SkillRepositoryService.test.ts +33 -0
  150. package/src/server/skill-hub/actions/__tests__/git-import.test.ts +501 -0
  151. package/src/server/skill-hub/actions/git-import.ts +682 -236
  152. package/src/server/skill-hub/mcp/McpController.ts +8 -14
  153. package/src/server/skill-hub/middlewares/git-import-request-method-policy.ts +51 -0
  154. package/src/server/skill-hub/plugin.ts +79 -13
  155. package/src/server/skill-hub/services/RegistrySkillInstallationService.ts +281 -0
  156. package/src/server/skill-hub/services/RegistrySkillSnapshotService.ts +239 -0
  157. package/src/server/skill-hub/services/__tests__/RegistrySkillInstallationService.test.ts +295 -0
  158. package/src/server/skill-hub/services/__tests__/RegistrySkillSnapshotService.test.ts +63 -0
  159. package/src/server/skill-hub/tasks/SkillExecutionTask.ts +14 -2
  160. package/src/server/tools/skill-execute.ts +24 -2
  161. package/src/server/utils/ctx-utils.ts +1 -1
  162. package/src/server/utils/skill-tool-name.ts +58 -0
@@ -0,0 +1,109 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var SkillAccessService_exports = {};
28
+ __export(SkillAccessService_exports, {
29
+ SkillAccessService: () => SkillAccessService
30
+ });
31
+ module.exports = __toCommonJS(SkillAccessService_exports);
32
+ var import_AgentExecutionContext = require("./AgentExecutionContext");
33
+ var import_ctx_utils = require("../utils/ctx-utils");
34
+ var import_skill_tool_name = require("../utils/skill-tool-name");
35
+ function bindingName(binding) {
36
+ if (typeof binding === "string") return binding.trim();
37
+ return typeof (binding == null ? void 0 : binding.name) === "string" ? binding.name.trim() : "";
38
+ }
39
+ class SkillAccessService {
40
+ constructor(plugin) {
41
+ this.plugin = plugin;
42
+ }
43
+ async resolveAgentUsername(ctx) {
44
+ var _a, _b, _c, _d, _e, _f;
45
+ const executionIdentity = (0, import_AgentExecutionContext.getAgentExecutionContext)();
46
+ if (executionIdentity == null ? void 0 : executionIdentity.employeeUsername) return executionIdentity.employeeUsername;
47
+ const values = (0, import_ctx_utils.valuesFromCtx)(ctx);
48
+ const direct = (0, import_ctx_utils.normalizeEmployeeUsername)(
49
+ (ctx == null ? void 0 : ctx._currentAIEmployee) || ((_a = ctx == null ? void 0 : ctx.state) == null ? void 0 : _a.currentAIEmployee) || ((_c = (_b = ctx == null ? void 0 : ctx.runtime) == null ? void 0 : _b.context) == null ? void 0 : _c.currentAIEmployee) || values.aiEmployee || values.aiEmployeeUsername
50
+ );
51
+ if (direct) return direct;
52
+ const sessionId = (executionIdentity == null ? void 0 : executionIdentity.sessionId) || values.sessionId || ((_e = (_d = ctx == null ? void 0 : ctx.action) == null ? void 0 : _d.params) == null ? void 0 : _e.sessionId) || ((_f = ctx == null ? void 0 : ctx.state) == null ? void 0 : _f.sessionId);
53
+ if (!sessionId) return void 0;
54
+ try {
55
+ const conversation = await this.plugin.db.getRepository("aiConversations").findOne({
56
+ filter: { sessionId }
57
+ });
58
+ return (0, import_ctx_utils.normalizeEmployeeUsername)((0, import_skill_tool_name.readRecordValue)(conversation, "aiEmployeeUsername")) || (0, import_ctx_utils.normalizeEmployeeUsername)((0, import_skill_tool_name.readRecordValue)(conversation, "aiEmployee")) || void 0;
59
+ } catch {
60
+ return void 0;
61
+ }
62
+ }
63
+ async canAgentUseSkill(agentUsername, skill) {
64
+ if ((0, import_skill_tool_name.normalizeSkillToolScope)((0, import_skill_tool_name.readRecordValue)(skill, "toolScope")) === "GENERAL") return true;
65
+ const employee = await this.plugin.db.getRepository("aiEmployees").findOne({
66
+ filter: { username: agentUsername }
67
+ });
68
+ if (!employee) return false;
69
+ const skillSettings = (0, import_ctx_utils.asObject)((0, import_skill_tool_name.readRecordValue)(employee, "skillSettings"));
70
+ const tools = Array.isArray(skillSettings.tools) ? skillSettings.tools : [];
71
+ const targetToolName = (0, import_skill_tool_name.getSkillToolName)(skill);
72
+ return tools.some((binding) => bindingName(binding) === targetToolName);
73
+ }
74
+ async assertCanExecute(ctx, skill, options = {}) {
75
+ if (options.privileged) return this.resolveAgentUsername(ctx);
76
+ if ((0, import_ctx_utils.isAdminUser)(ctx)) return this.resolveAgentUsername(ctx);
77
+ const agentUsername = await this.resolveAgentUsername(ctx);
78
+ if (!agentUsername) {
79
+ throw new Error("Skill execution requires an AI employee context.");
80
+ }
81
+ if (!await this.canAgentUseSkill(agentUsername, skill)) {
82
+ throw new Error(`AI employee "${agentUsername}" is not bound to skill tool "${(0, import_skill_tool_name.getSkillToolName)(skill)}".`);
83
+ }
84
+ return agentUsername;
85
+ }
86
+ async filterAccessibleSkills(ctx, skills) {
87
+ if ((0, import_ctx_utils.isAdminUser)(ctx)) return skills;
88
+ const agentUsername = await this.resolveAgentUsername(ctx);
89
+ if (!agentUsername) return [];
90
+ const checks = await Promise.all(skills.map((skill) => this.canAgentUseSkill(agentUsername, skill)));
91
+ return skills.filter((_skill, index) => checks[index]);
92
+ }
93
+ async findAgentUsernamesUsingTool(toolName) {
94
+ const employees = await this.plugin.db.getRepository("aiEmployees").find({});
95
+ const usernames = [];
96
+ for (const employee of employees || []) {
97
+ const settings = (0, import_ctx_utils.asObject)((0, import_skill_tool_name.readRecordValue)(employee, "skillSettings"));
98
+ const tools = Array.isArray(settings.tools) ? settings.tools : [];
99
+ if (!tools.some((binding) => bindingName(binding) === toolName)) continue;
100
+ const username = (0, import_ctx_utils.normalizeEmployeeUsername)((0, import_skill_tool_name.readRecordValue)(employee, "username"));
101
+ if (username) usernames.push(username);
102
+ }
103
+ return usernames;
104
+ }
105
+ }
106
+ // Annotate the CommonJS export names for ESM import in node:
107
+ 0 && (module.exports = {
108
+ SkillAccessService
109
+ });
@@ -30,6 +30,7 @@ __export(SkillManager_exports, {
30
30
  });
31
31
  module.exports = __toCommonJS(SkillManager_exports);
32
32
  var import_json_fields = require("../skill-hub/utils/json-fields");
33
+ var import_skill_tool_name = require("../utils/skill-tool-name");
33
34
  class SkillManager {
34
35
  constructor(db) {
35
36
  this.db = db;
@@ -232,6 +233,7 @@ class SkillManager {
232
233
  await repo.create({
233
234
  values: {
234
235
  ...seed,
236
+ toolName: (0, import_skill_tool_name.buildSkillToolName)(seed.name),
235
237
  inputSchema: (0, import_json_fields.stringifyJsonText)(seed.inputSchema),
236
238
  packages: (0, import_json_fields.stringifyJsonText)(seed.packages, [])
237
239
  }
@@ -68,6 +68,37 @@ class SkillRepositoryService {
68
68
  getSkillPath(skillName) {
69
69
  return (0, import_path.resolve)(this.baseDir, skillName);
70
70
  }
71
+ readSkillPackageFiles(skillName) {
72
+ const targetDir = this.getSkillPath(skillName);
73
+ if (!(0, import_fs.existsSync)(targetDir)) {
74
+ return null;
75
+ }
76
+ const files = [];
77
+ const collect = (directory) => {
78
+ for (const item of (0, import_fs.readdirSync)(directory)) {
79
+ const fullPath = (0, import_path.resolve)(directory, item);
80
+ const stat = (0, import_fs.statSync)(fullPath);
81
+ if (stat.isDirectory()) {
82
+ collect(fullPath);
83
+ continue;
84
+ }
85
+ if (!stat.isFile()) {
86
+ continue;
87
+ }
88
+ const relativePath = (0, import_path.relative)(targetDir, fullPath).replace(/\\/g, "/");
89
+ files.push({ path: relativePath, content: (0, import_fs.readFileSync)(fullPath) });
90
+ }
91
+ };
92
+ collect(targetDir);
93
+ return files;
94
+ }
95
+ removeSkillPackage(skillName) {
96
+ const targetDir = this.getSkillPath(skillName);
97
+ if (!targetDir.startsWith(`${this.baseDir}${import_path.sep}`)) {
98
+ throw new Error(`Invalid skill package name: ${skillName}`);
99
+ }
100
+ (0, import_fs.rmSync)(targetDir, { recursive: true, force: true });
101
+ }
71
102
  getSkillCode(skillName) {
72
103
  const dir = this.getSkillPath(skillName);
73
104
  if (!(0, import_fs.existsSync)(dir)) return null;
@@ -77,6 +108,45 @@ class SkillRepositoryService {
77
108
  const srcDir = this.getSkillPath(skillName);
78
109
  this.copyDirectoryTo(srcDir, destDir);
79
110
  }
111
+ writeSkillPackage(skillName, files) {
112
+ const targetDir = this.getSkillPath(skillName);
113
+ const temporaryDir = `${targetDir}.next-${Date.now()}`;
114
+ const backupDir = `${targetDir}.previous-${Date.now()}`;
115
+ const filePaths = /* @__PURE__ */ new Set();
116
+ (0, import_fs.rmSync)(temporaryDir, { recursive: true, force: true });
117
+ (0, import_fs.mkdirSync)(temporaryDir, { recursive: true });
118
+ try {
119
+ for (const file of files) {
120
+ const path = file.path.replace(/\\/g, "/");
121
+ if (!path || path.includes("\0") || path.startsWith("/") || path.split("/").some((part) => !part || part === "." || part === "..") || filePaths.has(path)) {
122
+ throw new Error(`Invalid skill package path: ${file.path}`);
123
+ }
124
+ filePaths.add(path);
125
+ const outputPath = (0, import_path.resolve)(temporaryDir, path);
126
+ if (!outputPath.startsWith(`${temporaryDir}${import_path.sep}`)) {
127
+ throw new Error(`Skill package path is outside its package root: ${file.path}`);
128
+ }
129
+ (0, import_fs.mkdirSync)((0, import_path.dirname)(outputPath), { recursive: true });
130
+ (0, import_fs.writeFileSync)(outputPath, file.content);
131
+ }
132
+ if ((0, import_fs.existsSync)(targetDir)) {
133
+ (0, import_fs.rmSync)(backupDir, { recursive: true, force: true });
134
+ (0, import_fs.renameSync)(targetDir, backupDir);
135
+ }
136
+ try {
137
+ (0, import_fs.renameSync)(temporaryDir, targetDir);
138
+ } catch (error) {
139
+ if ((0, import_fs.existsSync)(backupDir)) {
140
+ (0, import_fs.renameSync)(backupDir, targetDir);
141
+ }
142
+ throw error;
143
+ }
144
+ (0, import_fs.rmSync)(backupDir, { recursive: true, force: true });
145
+ } catch (error) {
146
+ (0, import_fs.rmSync)(temporaryDir, { recursive: true, force: true });
147
+ throw error;
148
+ }
149
+ }
80
150
  readSkillPackage(packageDir) {
81
151
  const rootDir = (0, import_path.resolve)(packageDir);
82
152
  if (!(0, import_fs.existsSync)(rootDir)) {