Explorar el Código

Revert "feat(marketplace): retire unused specialist agents"

This reverts commit 90b5f2f2b43d5fefced2c53b4ce26ea6143e3d65.
Alvin Unreal hace 5 días
padre
commit
ec5fca843a

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "oh-my-opencode-slim",
   "name": "oh-my-opencode-slim",
-  "version": "3.0.0-beta.5",
+  "version": "3.0.0-beta.4",
   "packageManager": "bun@1.3.14",
   "packageManager": "bun@1.3.14",
   "description": "Lightweight agent orchestration plugin for OpenCode - a slimmed-down fork of oh-my-opencode",
   "description": "Lightweight agent orchestration plugin for OpenCode - a slimmed-down fork of oh-my-opencode",
   "main": "dist/index.js",
   "main": "dist/index.js",

+ 15 - 15
src/marketplace-contract/index.ts

@@ -7,10 +7,7 @@ import {
   digestMarketplaceBundle,
   digestMarketplaceBundle,
 } from '../marketplace/canonical';
 } from '../marketplace/canonical';
 import { MarketplaceRetiredError } from '../marketplace/errors';
 import { MarketplaceRetiredError } from '../marketplace/errors';
-import {
-  isMarketplacePackageRetired,
-  RETIRED_MARKETPLACE_PACKAGE_IDS,
-} from '../marketplace/retirements';
+import { isMarketplacePackageRetired } from '../marketplace/retirements';
 import { renderMarketplaceAutoDelegationBlock } from '../marketplace/routing';
 import { renderMarketplaceAutoDelegationBlock } from '../marketplace/routing';
 import {
 import {
   MARKETPLACE_DIGEST_DOMAIN,
   MARKETPLACE_DIGEST_DOMAIN,
@@ -148,6 +145,12 @@ function validateRegistryEntries(
   }
   }
 }
 }
 
 
+const CANONICAL_MARKETPLACE_RETIREMENT_IDS = [
+  'alvin/deepwork-implementer',
+  'alvin/deepwork-recon',
+  'alvin/deepwork-reviewer',
+] as const;
+
 const MarketplaceRegistryIndexV3Schema = z
 const MarketplaceRegistryIndexV3Schema = z
   .object({
   .object({
     schemaVersion: z.literal(MARKETPLACE_REGISTRY_SCHEMA_VERSION),
     schemaVersion: z.literal(MARKETPLACE_REGISTRY_SCHEMA_VERSION),
@@ -180,7 +183,7 @@ const MarketplaceRegistryIndexV3Schema = z
         });
         });
       }
       }
     }
     }
-    for (const id of RETIRED_MARKETPLACE_PACKAGE_IDS) {
+    for (const id of CANONICAL_MARKETPLACE_RETIREMENT_IDS) {
       if (!seen.has(id)) {
       if (!seen.has(id)) {
         ctx.addIssue({
         ctx.addIssue({
           code: 'custom',
           code: 'custom',
@@ -247,19 +250,16 @@ export function createMarketplaceRegistryEntry(
 
 
 export function createMarketplaceRegistryIndex(
 export function createMarketplaceRegistryIndex(
   entries: readonly MarketplaceRegistryEntry[],
   entries: readonly MarketplaceRegistryEntry[],
-  retirements: readonly MarketplaceRegistryRetirement[] = RETIRED_MARKETPLACE_PACKAGE_IDS.map(
+  retirements: readonly MarketplaceRegistryRetirement[] = CANONICAL_MARKETPLACE_RETIREMENT_IDS.map(
     (id) => ({ id }),
     (id) => ({ id }),
   ),
   ),
 ): MarketplaceRegistryIndex {
 ): MarketplaceRegistryIndex {
-  const retiredIds = new Set(retirements.map(({ id }) => id));
-  const sorted = entries
-    .filter((entry) => !retiredIds.has(entry.id))
-    .sort(
-      (left, right) =>
-        compareMarketplaceCodeUnits(left.id, right.id) ||
-        compare(left.version, right.version) ||
-        compareMarketplaceCodeUnits(left.version, right.version),
-    );
+  const sorted = [...entries].sort(
+    (left, right) =>
+      compareMarketplaceCodeUnits(left.id, right.id) ||
+      compare(left.version, right.version) ||
+      compareMarketplaceCodeUnits(left.version, right.version),
+  );
   const sortedRetirements = [...retirements].sort((left, right) =>
   const sortedRetirements = [...retirements].sort((left, right) =>
     compareMarketplaceCodeUnits(left.id, right.id),
     compareMarketplaceCodeUnits(left.id, right.id),
   );
   );

+ 5 - 4
src/marketplace/activation.test.ts

@@ -364,7 +364,7 @@ describe('marketplace runtime activation', () => {
             work: {
             work: {
               agents: {},
               agents: {},
               marketplace: {
               marketplace: {
-                agents: ['alvin/evidence-scout'],
+                agents: ['alvin/deepwork-implementer'],
               },
               },
             },
             },
           },
           },
@@ -373,13 +373,14 @@ describe('marketplace runtime activation', () => {
         'marketplace-retired-test',
         'marketplace-retired-test',
       );
       );
       expect(
       expect(
-        registry.agents.some((agent) => agent.name === 'evidencescout'),
+        registry.agents.some((agent) => agent.name === 'implementer'),
       ).toBe(false);
       ).toBe(false);
       expect(registry.diagnostics).toEqual([
       expect(registry.diagnostics).toEqual([
         {
         {
-          packageId: 'alvin/evidence-scout',
+          packageId: 'alvin/deepwork-implementer',
           code: 'retired',
           code: 'retired',
-          message: 'alvin/evidence-scout is retired and will not be activated',
+          message:
+            'alvin/deepwork-implementer is retired and will not be activated',
         },
         },
       ]);
       ]);
     } finally {
     } finally {

+ 1 - 7
src/marketplace/agents-only.test.ts

@@ -366,13 +366,7 @@ describe('agents-only marketplace contract', () => {
   );
   );
 
 
   test('uses canonical retirement IDs and rejects them before install', () => {
   test('uses canonical retirement IDs and rejects them before install', () => {
-    expect(RETIRED_MARKETPLACE_PACKAGE_IDS).toEqual([
-      'alvin/deepwork-implementer',
-      'alvin/deepwork-recon',
-      'alvin/deepwork-reviewer',
-      'alvin/evidence-scout',
-      'alvin/visual-inspector',
-    ]);
+    expect(RETIRED_MARKETPLACE_PACKAGE_IDS).toHaveLength(3);
     const store = new MarketplaceStore({
     const store = new MarketplaceStore({
       rootDir: mkdtempSync(join(tmpdir(), 'marketplace-retired-')),
       rootDir: mkdtempSync(join(tmpdir(), 'marketplace-retired-')),
     });
     });

+ 8 - 14
src/marketplace/registry-client.test.ts

@@ -28,12 +28,13 @@ import {
   MARKETPLACE_REGISTRY_INDEX_URL,
   MARKETPLACE_REGISTRY_INDEX_URL,
   MarketplaceRegistryClient,
   MarketplaceRegistryClient,
 } from './registry-client';
 } from './registry-client';
-import { RETIRED_MARKETPLACE_PACKAGE_IDS } from './retirements';
 import { MarketplaceService } from './service';
 import { MarketplaceService } from './service';
 
 
-const canonicalRetirements = RETIRED_MARKETPLACE_PACKAGE_IDS.map((id) => ({
-  id,
-}));
+const canonicalRetirements = [
+  { id: 'alvin/deepwork-implementer' },
+  { id: 'alvin/deepwork-recon' },
+  { id: 'alvin/deepwork-reviewer' },
+];
 
 
 function bundle(
 function bundle(
   version = '1.0.0',
   version = '1.0.0',
@@ -217,8 +218,6 @@ describe('marketplace registry contract', () => {
     for (const selector of [
     for (const selector of [
       { id: 'alvin/deepwork-implementer' },
       { id: 'alvin/deepwork-implementer' },
       { id: 'alvin/deepwork-implementer', version: '1.0.0' },
       { id: 'alvin/deepwork-implementer', version: '1.0.0' },
-      { id: 'alvin/evidence-scout' },
-      { id: 'alvin/visual-inspector', version: '1.0.0-beta.1' },
     ]) {
     ]) {
       expect(() =>
       expect(() =>
         resolveMarketplaceRegistryEntry(index, selector, {
         resolveMarketplaceRegistryEntry(index, selector, {
@@ -226,11 +225,6 @@ describe('marketplace registry contract', () => {
         }),
         }),
       ).toThrow(MarketplaceRetiredError);
       ).toThrow(MarketplaceRetiredError);
     }
     }
-    expect(
-      createMarketplaceRegistryIndex([
-        createMarketplaceRegistryEntry(bundle('1.0.0', 'alvin/evidence-scout')),
-      ]).entries,
-    ).toEqual([]);
   });
   });
 
 
   test('uses locale-independent code-unit ordering for JSON and catalog entries', () => {
   test('uses locale-independent code-unit ordering for JSON and catalog entries', () => {
@@ -297,7 +291,7 @@ describe('MarketplaceRegistryClient', () => {
       },
       },
     });
     });
     await expect(
     await expect(
-      client.download('alvin/evidence-scout@0.1.0-beta.1'),
+      client.download('alvin/deepwork-recon@1.0.0'),
     ).rejects.toBeInstanceOf(MarketplaceRetiredError);
     ).rejects.toBeInstanceOf(MarketplaceRetiredError);
     expect(fetches).toBe(0);
     expect(fetches).toBe(0);
 
 
@@ -314,10 +308,10 @@ describe('MarketplaceRegistryClient', () => {
         },
         },
       });
       });
       await expect(
       await expect(
-        service.installRemote('alvin/visual-inspector'),
+        service.installRemote('alvin/deepwork-implementer'),
       ).rejects.toBeInstanceOf(MarketplaceRetiredError);
       ).rejects.toBeInstanceOf(MarketplaceRetiredError);
       await expect(
       await expect(
-        service.updateRemote('alvin/evidence-scout'),
+        service.updateRemote('alvin/deepwork-reviewer'),
       ).rejects.toBeInstanceOf(MarketplaceRetiredError);
       ).rejects.toBeInstanceOf(MarketplaceRetiredError);
       expect(downloads).toBe(0);
       expect(downloads).toBe(0);
       expect(existsSync(service.store.paths.lockfilePath)).toBe(false);
       expect(existsSync(service.store.paths.lockfilePath)).toBe(false);

+ 0 - 2
src/marketplace/retirements.ts

@@ -5,8 +5,6 @@ export const RETIRED_MARKETPLACE_PACKAGE_IDS = [
   'alvin/deepwork-implementer',
   'alvin/deepwork-implementer',
   'alvin/deepwork-recon',
   'alvin/deepwork-recon',
   'alvin/deepwork-reviewer',
   'alvin/deepwork-reviewer',
-  'alvin/evidence-scout',
-  'alvin/visual-inspector',
 ] as const;
 ] as const;
 
 
 const retiredPackageIds = new Set<string>(RETIRED_MARKETPLACE_PACKAGE_IDS);
 const retiredPackageIds = new Set<string>(RETIRED_MARKETPLACE_PACKAGE_IDS);

+ 2 - 2
src/marketplace/store.test.ts

@@ -95,10 +95,10 @@ describe('MarketplaceStore', () => {
     try {
     try {
       const store = new MarketplaceStore({ rootDir: root });
       const store = new MarketplaceStore({ rootDir: root });
       expect(() =>
       expect(() =>
-        store.install(bundle('1.0.0', { id: 'alvin/evidence-scout' })),
+        store.install(bundle('1.0.0', { id: 'alvin/deepwork-implementer' })),
       ).toThrow(MarketplaceRetiredError);
       ).toThrow(MarketplaceRetiredError);
       expect(() =>
       expect(() =>
-        store.update(bundle('2.0.0', { id: 'alvin/visual-inspector' })),
+        store.update(bundle('2.0.0', { id: 'alvin/deepwork-reviewer' })),
       ).toThrow(MarketplaceRetiredError);
       ).toThrow(MarketplaceRetiredError);
       expect(existsSync(store.paths.lockfilePath)).toBe(false);
       expect(existsSync(store.paths.lockfilePath)).toBe(false);
       expect(existsSync(store.paths.packagesDir)).toBe(false);
       expect(existsSync(store.paths.packagesDir)).toBe(false);