plugin-agent-orchestrator 1.1.2 → 1.1.3

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/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": "Native AI Employee sub-agent monitoring, policy, and memory context layer for NocoBase plugin-ai.",
7
- "version": "1.1.2",
7
+ "version": "1.1.3",
8
8
  "license": "Apache-2.0",
9
9
  "main": "dist/server/index.js",
10
10
  "keywords": [
@@ -43,7 +43,7 @@
43
43
  "@nocobase/plugin-ai": "2.x",
44
44
  "@nocobase/client-v2": "2.x",
45
45
  "@nocobase/flow-engine": "2.x",
46
- "plugin-git-manager": "^2.0.0"
46
+ "plugin-git-manager": "^1.2.24"
47
47
  },
48
48
  "peerDependenciesMeta": {
49
49
  "plugin-git-manager": {
@@ -474,6 +474,54 @@ describe('Skill Hub Git import', () => {
474
474
  );
475
475
  });
476
476
 
477
+ it('falls back to a nested skills folder only when the configured root has no direct skill', async () => {
478
+ const created: Array<Record<string, unknown>> = [];
479
+ const service = createContentService({
480
+ listTree: vi.fn().mockImplementation(async ({ rootPath }: { rootPath: string }) => {
481
+ if (rootPath === 'agent-assets') {
482
+ return [{ type: 'tree', path: 'skills', size: 0 }];
483
+ }
484
+ if (rootPath === 'agent-assets/skills') {
485
+ return [{ type: 'tree', path: 'alpha', size: 0 }];
486
+ }
487
+ if (rootPath === 'agent-assets/skills/alpha') {
488
+ return [{ type: 'blob', path: 'SKILL.md', size: 16 }];
489
+ }
490
+ return [];
491
+ }),
492
+ readFile: vi.fn().mockImplementation(async ({ filePath }: { filePath: string }) => {
493
+ if (filePath === 'agent-assets/skills/skills.json') {
494
+ return Buffer.from(JSON.stringify({ skills: [{ folder: 'alpha', name: 'alpha' }] }));
495
+ }
496
+ if (filePath === 'agent-assets/skills/alpha/SKILL.md') {
497
+ return Buffer.from('# Alpha');
498
+ }
499
+ throw gitError('REGISTRY_GIT_FILE_NOT_FOUND');
500
+ }),
501
+ });
502
+ const skillDefinitions: SkillDefinitionsRepository = {
503
+ findOne: vi.fn().mockResolvedValue(null),
504
+ create: vi.fn().mockImplementation(async ({ values }: { values: Record<string, unknown> }) => {
505
+ created.push(values);
506
+ }),
507
+ };
508
+ const { context } = createContext({
509
+ service,
510
+ skillDefinitions,
511
+ params: { repositoryId: 42, rootFolder: 'agent-assets', values: { skills: ['alpha'] } },
512
+ });
513
+
514
+ await gitSyncSkills(context, vi.fn());
515
+
516
+ expect(service.readFile).toHaveBeenCalledWith(
517
+ expect.objectContaining({ filePath: 'agent-assets/skills/alpha/SKILL.md' }),
518
+ actor,
519
+ );
520
+ expect(created).toEqual([
521
+ expect.objectContaining({ name: 'alpha', storageUrl: `git://42/agent-assets/skills@${commitSha}#alpha` }),
522
+ ]);
523
+ });
524
+
477
525
  it('keeps a direct child folder named skills when the configured root already ends in skills', async () => {
478
526
  const service = createContentService({
479
527
  listTree: vi.fn().mockImplementation(async ({ rootPath }: { rootPath: string }) => {