plugin-agent-orchestrator 1.0.18 → 1.0.20

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.
@@ -169,7 +169,22 @@ class SkillHubSubFeature {
169
169
  this.app.logger.warn("[skill-hub] plugin-file-manager not found, cannot extract skill package");
170
170
  return;
171
171
  }
172
- const streamData = await fileManager.getFileStream(attachment);
172
+ const rawStorageId = attachment.get("storageId") || attachment.storageId;
173
+ let matchedKey = null;
174
+ if (rawStorageId) {
175
+ const strId = String(rawStorageId);
176
+ for (const key of fileManager.storagesCache.keys()) {
177
+ if (String(key) === strId) {
178
+ matchedKey = key;
179
+ break;
180
+ }
181
+ }
182
+ }
183
+ const attachmentObj = typeof attachment.toJSON === "function" ? attachment.toJSON() : { ...attachment };
184
+ if (matchedKey !== null) {
185
+ attachmentObj.storageId = matchedKey;
186
+ }
187
+ const streamData = await fileManager.getFileStream(attachmentObj);
173
188
  if (!streamData || !streamData.stream) {
174
189
  this.app.logger.warn(
175
190
  `[skill-hub] Could not get file stream for attachment ${attachment.get("id")}`
@@ -163,8 +163,23 @@ class SkillExecutionTask {
163
163
  const fmPlugin = this.app.pm.get("@nocobase/plugin-file-manager");
164
164
  const attachment = await this.app.db.getRepository("attachments").findOne({ filter: { id: fileId } });
165
165
  if (fmPlugin && attachment) {
166
+ const rawStorageId = attachment.get("storageId") || attachment.storageId;
167
+ let matchedKey = null;
168
+ if (rawStorageId) {
169
+ const strId = String(rawStorageId);
170
+ for (const key of fmPlugin.storagesCache.keys()) {
171
+ if (String(key) === strId) {
172
+ matchedKey = key;
173
+ break;
174
+ }
175
+ }
176
+ }
177
+ const attachmentObj = typeof attachment.toJSON === "function" ? attachment.toJSON() : { ...attachment };
178
+ if (matchedKey !== null) {
179
+ attachmentObj.storageId = matchedKey;
180
+ }
166
181
  try {
167
- const streamData = await fmPlugin.getFileStream(attachment);
182
+ const streamData = await fmPlugin.getFileStream(attachmentObj);
168
183
  if (streamData == null ? void 0 : streamData.stream) {
169
184
  const tempZipPath = require("path").resolve(require("os").tmpdir(), `skill_${Date.now()}_exec.zip`);
170
185
  await new Promise((resolve2, reject) => {
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "displayName.zh-CN": "代理协调器",
5
5
  "displayName.vi-VN": "Điều phối Agent",
6
6
  "description": "Hierarchical Multi-Agent orchestration for NocoBase AI Employees. Enables Leader agents to delegate tasks to Sub-Agent employees without modifying core plugin-ai.",
7
- "version": "1.0.18",
7
+ "version": "1.0.20",
8
8
  "license": "Apache-2.0",
9
9
  "main": "dist/server/index.js",
10
10
  "keywords": [
@@ -153,7 +153,24 @@ export class SkillHubSubFeature {
153
153
  return;
154
154
  }
155
155
 
156
- const streamData = await fileManager.getFileStream(attachment);
156
+ const rawStorageId = attachment.get('storageId') || attachment.storageId;
157
+ let matchedKey = null;
158
+ if (rawStorageId) {
159
+ const strId = String(rawStorageId);
160
+ for (const key of fileManager.storagesCache.keys()) {
161
+ if (String(key) === strId) {
162
+ matchedKey = key;
163
+ break;
164
+ }
165
+ }
166
+ }
167
+
168
+ const attachmentObj = typeof attachment.toJSON === 'function' ? attachment.toJSON() : { ...attachment };
169
+ if (matchedKey !== null) {
170
+ attachmentObj.storageId = matchedKey;
171
+ }
172
+
173
+ const streamData = await fileManager.getFileStream(attachmentObj);
157
174
  if (!streamData || !streamData.stream) {
158
175
  (this as any).app.logger.warn(
159
176
  `[skill-hub] Could not get file stream for attachment ${attachment.get('id')}`,
@@ -172,8 +172,25 @@ export class SkillExecutionTask {
172
172
  const fmPlugin = (this as any).app.pm.get('@nocobase/plugin-file-manager') as any;
173
173
  const attachment = await (this as any).app.db.getRepository('attachments').findOne({ filter: { id: fileId } });
174
174
  if (fmPlugin && attachment) {
175
+ const rawStorageId = attachment.get('storageId') || attachment.storageId;
176
+ let matchedKey = null;
177
+ if (rawStorageId) {
178
+ const strId = String(rawStorageId);
179
+ for (const key of fmPlugin.storagesCache.keys()) {
180
+ if (String(key) === strId) {
181
+ matchedKey = key;
182
+ break;
183
+ }
184
+ }
185
+ }
186
+
187
+ const attachmentObj = typeof attachment.toJSON === 'function' ? attachment.toJSON() : { ...attachment };
188
+ if (matchedKey !== null) {
189
+ attachmentObj.storageId = matchedKey;
190
+ }
191
+
175
192
  try {
176
- const streamData = await fmPlugin.getFileStream(attachment);
193
+ const streamData = await fmPlugin.getFileStream(attachmentObj);
177
194
  if (streamData?.stream) {
178
195
  const tempZipPath = require('path').resolve(require('os').tmpdir(), `skill_${Date.now()}_exec.zip`);
179
196
  await new Promise((resolve, reject) => {