Skip to content

Commit 322a2a6

Browse files
Claudehotlong
andauthored
Fix broker shim to use proper MetadataService API
The broker shim was incorrectly accessing the private `.registry` property of MetadataManager using `(metadataService as any).registry.keys()`. This is an internal implementation detail that should not be accessed directly. Fixed to use the proper `getRegisteredTypes()` method from the IMetadataService interface, which is the correct way to query all registered metadata types. Also added missing Wrench icon registration for tools in the AI protocol plugin's activate() method. Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/d86787db-36e6-48fa-88cf-ff327fa67b0c Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent b39df73 commit 322a2a6

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

apps/studio/src/lib/create-broker-shim.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,10 @@ export function createBrokerShim(kernel: any): BrokerShim {
185185
// Combine types from both SchemaRegistry (static) and MetadataService (runtime)
186186
const schemaTypes = SchemaRegistry.getRegisteredTypes();
187187

188-
// MetadataService exposes types through its internal registry
189-
// Access via the manager's registry property if available
188+
// MetadataService exposes types through getRegisteredTypes() method
190189
let runtimeTypes: string[] = [];
191-
if (metadataService && (metadataService as any).registry) {
192-
runtimeTypes = Array.from((metadataService as any).registry.keys());
190+
if (metadataService && typeof metadataService.getRegisteredTypes === 'function') {
191+
runtimeTypes = await metadataService.getRegisteredTypes();
193192
}
194193

195194
// Merge and deduplicate

apps/studio/src/plugins/built-in/ai-plugin.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import { defineStudioPlugin } from '@objectstack/spec/studio';
1111
import type { StudioPlugin } from '../types';
12-
import { Bot, BookOpen } from 'lucide-react';
12+
import { Bot, BookOpen, Wrench } from 'lucide-react';
1313

1414
export const aiProtocolPlugin: StudioPlugin = {
1515
manifest: defineStudioPlugin({
@@ -37,6 +37,7 @@ export const aiProtocolPlugin: StudioPlugin = {
3737

3838
activate(api) {
3939
api.registerMetadataIcon('agent', Bot, 'Agents');
40+
api.registerMetadataIcon('tool', Wrench, 'Tools');
4041
api.registerMetadataIcon('ragPipeline', BookOpen, 'RAG Pipelines');
4142
},
4243
};

0 commit comments

Comments
 (0)