Skip to content

Commit c642e85

Browse files
committed
feat: enhance metadata types and schemas for improved protocol support
1 parent 694326a commit c642e85

3 files changed

Lines changed: 132 additions & 28 deletions

File tree

apps/console/src/components/app-sidebar.tsx

Lines changed: 87 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@ import {
1616
Shield,
1717
AppWindow,
1818
Layers,
19+
Eye,
20+
FileCode,
21+
Palette,
22+
CheckSquare,
23+
Webhook,
24+
Lock,
25+
Link2,
26+
Map,
27+
PieChart,
28+
Anchor,
29+
UserCog,
1930
type LucideIcon,
2031
} from "lucide-react"
2132
import { useState, useEffect, useCallback } from "react"
@@ -48,23 +59,51 @@ import {
4859

4960
/** Icon & label hints for well-known metadata types */
5061
const META_TYPE_HINTS: Record<string, { label: string; icon: LucideIcon }> = {
51-
object: { label: 'Objects', icon: Package },
52-
objects: { label: 'Objects', icon: Package },
53-
app: { label: 'Apps', icon: AppWindow },
54-
apps: { label: 'Apps', icon: AppWindow },
55-
actions: { label: 'Actions', icon: Zap },
56-
dashboards: { label: 'Dashboards', icon: BarChart3 },
57-
reports: { label: 'Reports', icon: FileText },
58-
flows: { label: 'Flows', icon: Workflow },
59-
agents: { label: 'Agents', icon: Bot },
60-
apis: { label: 'APIs', icon: Globe },
61-
ragPipelines: { label: 'RAG Pipelines', icon: BookOpen },
62-
profiles: { label: 'Profiles', icon: Shield },
63-
sharingRules: { label: 'Sharing Rules', icon: Shield },
64-
data: { label: 'Seed Data', icon: Database },
65-
plugin: { label: 'Plugins', icon: Layers },
66-
plugins: { label: 'Plugins', icon: Layers },
67-
kind: { label: 'Kinds', icon: Database },
62+
// Data Protocol
63+
object: { label: 'Objects', icon: Package },
64+
objects: { label: 'Objects', icon: Package },
65+
hooks: { label: 'Hooks', icon: Anchor },
66+
mappings: { label: 'Mappings', icon: Map },
67+
analyticsCubes: { label: 'Analytics Cubes', icon: PieChart },
68+
data: { label: 'Seed Data', icon: Database },
69+
70+
// UI Protocol
71+
app: { label: 'Apps', icon: AppWindow },
72+
apps: { label: 'Apps', icon: AppWindow },
73+
actions: { label: 'Actions', icon: Zap },
74+
views: { label: 'Views', icon: Eye },
75+
pages: { label: 'Pages', icon: FileCode },
76+
dashboards: { label: 'Dashboards', icon: BarChart3 },
77+
reports: { label: 'Reports', icon: FileText },
78+
themes: { label: 'Themes', icon: Palette },
79+
80+
// Automation Protocol
81+
flows: { label: 'Flows', icon: Workflow },
82+
workflows: { label: 'Workflows', icon: Workflow },
83+
approvals: { label: 'Approvals', icon: CheckSquare },
84+
webhooks: { label: 'Webhooks', icon: Webhook },
85+
86+
// Security Protocol
87+
roles: { label: 'Roles', icon: UserCog },
88+
permissions: { label: 'Permissions', icon: Lock },
89+
profiles: { label: 'Profiles', icon: Shield },
90+
sharingRules: { label: 'Sharing Rules', icon: Shield },
91+
policies: { label: 'Policies', icon: Shield },
92+
93+
// AI Protocol
94+
agents: { label: 'Agents', icon: Bot },
95+
ragPipelines: { label: 'RAG Pipelines', icon: BookOpen },
96+
97+
// API Protocol
98+
apis: { label: 'APIs', icon: Globe },
99+
100+
// Integration Protocol
101+
connectors: { label: 'Connectors', icon: Link2 },
102+
103+
// Internal
104+
plugin: { label: 'Plugins', icon: Layers },
105+
plugins: { label: 'Plugins', icon: Layers },
106+
kind: { label: 'Kinds', icon: Database },
68107
};
69108

70109
function getTypeLabel(type: string): string {
@@ -163,16 +202,38 @@ export function AppSidebar({ selectedObject, onSelectObject, selectedMeta, onSel
163202

164203
// Priority order for sidebar sections — lower index = higher up
165204
const TYPE_PRIORITY: Record<string, number> = {
205+
// Data
166206
objects: 0, object: 0,
167-
actions: 1,
168-
flows: 2,
169-
dashboards: 3,
170-
reports: 4,
171-
agents: 5,
172-
apis: 6,
173-
ragPipelines: 7,
174-
profiles: 8,
175-
sharingRules: 9,
207+
hooks: 1,
208+
// UI
209+
actions: 10,
210+
views: 11,
211+
pages: 12,
212+
dashboards: 13,
213+
reports: 14,
214+
themes: 15,
215+
// Automation
216+
flows: 20,
217+
workflows: 21,
218+
approvals: 22,
219+
webhooks: 23,
220+
// Security
221+
roles: 30,
222+
permissions: 31,
223+
profiles: 32,
224+
sharingRules: 33,
225+
policies: 34,
226+
// AI
227+
agents: 40,
228+
ragPipelines: 41,
229+
// API
230+
apis: 50,
231+
// Integration
232+
connectors: 51,
233+
// Data Extensions
234+
mappings: 60,
235+
analyticsCubes: 61,
236+
data: 70,
176237
};
177238
const DEFAULT_PRIORITY = 100;
178239

packages/objectql/src/engine.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,20 @@ export class ObjectQL implements IDataEngine {
219219

220220
// 5. Register all other metadata types generically
221221
const metadataArrayKeys = [
222-
'actions', 'dashboards', 'reports', 'flows', 'agents',
223-
'apis', 'ragPipelines', 'profiles', 'sharingRules'
222+
// UI Protocol
223+
'actions', 'views', 'pages', 'dashboards', 'reports', 'themes',
224+
// Automation Protocol
225+
'flows', 'workflows', 'approvals', 'webhooks',
226+
// Security Protocol
227+
'roles', 'permissions', 'profiles', 'sharingRules', 'policies',
228+
// AI Protocol
229+
'agents', 'ragPipelines',
230+
// API Protocol
231+
'apis',
232+
// Data Extensions
233+
'hooks', 'mappings', 'analyticsCubes',
234+
// Integration Protocol
235+
'connectors',
224236
];
225237
for (const key of metadataArrayKeys) {
226238
const items = (manifest as any)[key];

packages/spec/src/stack.zod.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,27 @@ import { FlowSchema } from './automation/flow.zod';
2525
// Security Protocol
2626
import { RoleSchema } from './identity/role.zod';
2727
import { PermissionSetSchema } from './security/permission.zod';
28+
import { SharingRuleSchema } from './security/sharing.zod';
29+
import { PolicySchema } from './security/policy.zod';
2830

2931
import { ApiEndpointSchema } from './api/endpoint.zod';
3032
import { ApiCapabilitiesSchema } from './api/discovery.zod';
3133
import { FeatureFlagSchema } from './kernel/feature.zod';
3234

3335
// AI Protocol
3436
import { AgentSchema } from './ai/agent.zod';
37+
import { RAGPipelineConfigSchema } from './ai/rag-pipeline.zod';
38+
39+
// Data Protocol (additional)
40+
import { HookSchema } from './data/hook.zod';
41+
import { MappingSchema } from './data/mapping.zod';
42+
import { CubeSchema } from './data/analytics.zod';
43+
44+
// Automation Protocol (additional)
45+
import { WebhookSchema } from './automation/webhook.zod';
46+
47+
// Integration Protocol
48+
import { ConnectorSchema } from './integration/connector.zod';
3549

3650
/**
3751
* ObjectStack Ecosystem Definition
@@ -106,16 +120,33 @@ export const ObjectStackDefinitionSchema = z.object({
106120
*/
107121
roles: z.array(RoleSchema).optional().describe('User Roles hierarchy'),
108122
permissions: z.array(PermissionSetSchema).optional().describe('Permission Sets and Profiles'),
123+
sharingRules: z.array(SharingRuleSchema).optional().describe('Record Sharing Rules'),
124+
policies: z.array(PolicySchema).optional().describe('Security & Compliance Policies'),
109125

110126
/**
111127
* ObjectAPI: API Layer
112128
*/
113129
apis: z.array(ApiEndpointSchema).optional().describe('API Endpoints'),
130+
webhooks: z.array(WebhookSchema).optional().describe('Outbound Webhooks'),
114131

115132
/**
116133
* ObjectAI: Artificial Intelligence Layer
117134
*/
118135
agents: z.array(AgentSchema).optional().describe('AI Agents and Assistants'),
136+
ragPipelines: z.array(RAGPipelineConfigSchema).optional().describe('RAG Pipelines'),
137+
138+
/**
139+
* ObjectQL: Data Extensions
140+
* Hooks, mappings, and analytics cubes.
141+
*/
142+
hooks: z.array(HookSchema).optional().describe('Object Lifecycle Hooks'),
143+
mappings: z.array(MappingSchema).optional().describe('Data Import/Export Mappings'),
144+
analyticsCubes: z.array(CubeSchema).optional().describe('Analytics Semantic Layer Cubes'),
145+
146+
/**
147+
* Integration Protocol
148+
*/
149+
connectors: z.array(ConnectorSchema).optional().describe('External System Connectors'),
119150

120151
/**
121152
* Data Seeding Protocol

0 commit comments

Comments
 (0)