-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathstudio.app.ts
More file actions
324 lines (321 loc) · 10.6 KB
/
Copy pathstudio.app.ts
File metadata and controls
324 lines (321 loc) · 10.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
/**
* Platform Studio App — static definition.
*
* The developer/maker workbench. Studio surfaces every editable
* metadata type (objects, views, flows, agents, …) — i.e. the
* "schema-side" of the platform — and is intentionally separate from
* Setup, which is the operator/admin app for users/permissions/system
* configuration.
*
* The split mirrors the industry convention:
* - Salesforce: Setup (admin) ⟷ App Builder + Schema Builder + Flow Builder (developer)
* - ServiceNow: System Definition ⟷ Studio
* - Microsoft Power Platform: Admin Center ⟷ Maker Portal
*
* Rationale:
* - Different audience (implementers/devs vs IT admins)
* - Different risk surface (schema changes vs user/SSO changes)
* - Independent permission gating (`studio.access` vs `setup.access`)
* - Different operational cadence (continuous in dev/staging, gated in prod)
* - Future home for source-control, change sets, sandbox refresh, deploy
*
* Registration: alongside SETUP_APP in plugin-auth, so it ships out of
* the box whenever the auth/security trio is loaded.
*/
import type { App } from '@objectstack/spec/ui';
export const STUDIO_APP: App = {
name: 'studio',
label: 'Studio',
description: 'Metadata workbench for developers, analysts, and implementers',
icon: 'hammer',
active: true,
isDefault: false,
// ADR-0010 §3.7 — author-facing protection block. Loader translates
// this into the `_lock` envelope at registration time. Same rationale
// as Setup: tenant overlay edits to the metadata workbench can lock
// implementers out of the very surface used to repair metadata.
protection: {
lock: 'full',
reason: 'Core developer workbench shipped by @objectstack/platform-objects — see ADR-0010.',
docsUrl: 'https://docs.objectstack.ai/adr/0010-metadata-protection',
},
// Studio is the metadata-authoring host, so its ambient copilot is
// pinned to the schema-architect agent. Resolved by the ambient chat
// endpoint via `app.defaultAgent` — no UI-side `?agent=` override
// needed. Every other app falls back to the data-query agent.
defaultAgent: 'metadata_assistant',
branding: {
primaryColor: '#6366f1', // Indigo-500 — distinct from Setup's slate
},
requiredPermissions: ['studio.access'],
contextSelectors: [
{
// Package scope — pinned to the sidebar header. Selecting a package
// injects `{active_package}` into every `metadata:resource` nav
// item below, so the whole workbench filters to that package in
// one click. Options come from the installed-packages REST surface,
// narrowed to project-scoped packages: this dropdown exists so
// third-party developers can scope to *their* custom package, so we
// deliberately hide the platform's own system/cloud kernel packages
// (auth, security, audit, queue, …) which are not user-authored.
id: 'active_package',
label: 'Package',
icon: 'package',
optionsSource: {
endpoint: '/api/v1/packages',
valueKey: 'manifest.id',
labelKey: 'manifest.name',
filter: [{ key: 'manifest.scope', op: 'nin', value: ['system', 'cloud'] }],
},
includeAll: true,
allValue: '',
persist: 'query',
placement: 'sidebar_header',
},
],
navigation: [
{
id: 'group_overview',
type: 'group',
label: 'Overview',
icon: 'layout-dashboard',
children: [
{
id: 'nav_metadata_directory',
type: 'component',
label: 'All Metadata Types',
componentRef: 'metadata:directory',
icon: 'layers',
},
{
id: 'nav_packages',
type: 'component',
label: 'Packages',
componentRef: 'developer:packages',
icon: 'package',
},
],
},
{
// Data Model — schema-design surfaces. Objects are the primary
// entry; field management happens in-context on each object's
// detail form (master-detail), so no top-level field link.
id: 'group_data_model',
type: 'group',
label: 'Data Model',
icon: 'database',
children: [
{
id: 'nav_objects',
type: 'component',
label: 'Objects',
componentRef: 'metadata:resource',
params: { type: 'object', package: '{active_package}' },
icon: 'box',
},
{
id: 'nav_validations',
type: 'component',
label: 'Validations',
componentRef: 'metadata:resource',
params: { type: 'validation', package: '{active_package}' },
icon: 'check-square',
},
],
},
{
// User Experience — the metadata that shapes what end users see.
id: 'group_ux',
type: 'group',
label: 'User Experience',
icon: 'layout',
children: [
{
id: 'nav_apps',
type: 'component',
label: 'Apps',
componentRef: 'metadata:resource',
params: { type: 'app', package: '{active_package}' },
icon: 'app-window',
},
{
id: 'nav_views',
type: 'component',
label: 'Views',
componentRef: 'metadata:resource',
params: { type: 'view', package: '{active_package}' },
icon: 'table',
},
{
id: 'nav_pages',
type: 'component',
label: 'Pages',
componentRef: 'metadata:resource',
params: { type: 'page', package: '{active_package}' },
icon: 'file-text',
},
{
id: 'nav_dashboards',
type: 'component',
label: 'Dashboards',
componentRef: 'metadata:resource',
params: { type: 'dashboard', package: '{active_package}' },
icon: 'layout-dashboard',
},
{
id: 'nav_reports',
type: 'component',
label: 'Reports',
componentRef: 'metadata:resource',
params: { type: 'report', package: '{active_package}' },
icon: 'bar-chart-3',
},
{
// ADR-0021 — the analytics semantic layer reports/dashboards bind to.
id: 'nav_datasets',
type: 'component',
label: 'Datasets',
componentRef: 'metadata:resource',
params: { type: 'dataset', package: '{active_package}' },
icon: 'database',
},
],
},
{
// Logic — declarative + scripted business rules.
id: 'group_logic',
type: 'group',
label: 'Logic',
icon: 'function-square',
children: [
{
id: 'nav_actions',
type: 'component',
label: 'Actions',
componentRef: 'metadata:resource',
params: { type: 'action', package: '{active_package}' },
icon: 'mouse-pointer-click',
},
{
id: 'nav_hooks',
type: 'component',
label: 'Hooks',
componentRef: 'metadata:resource',
params: { type: 'hook', package: '{active_package}' },
icon: 'webhook',
},
],
},
{
// Automation — flows, declarative workflow rules, approval processes.
id: 'group_automation',
type: 'group',
label: 'Automation',
icon: 'workflow',
children: [
{
id: 'nav_flows',
type: 'component',
label: 'Flows',
componentRef: 'metadata:resource',
params: { type: 'flow', package: '{active_package}' },
icon: 'git-branch',
},
// ADR-0020: no "Workflow Rules" nav — record state machines are a
// `state_machine` validation rule on the object, edited alongside the
// object's other validation rules (not a standalone metadata type).
// ADR-0019: no standalone "Approval Processes" nav — approvals are
// authored as Approval nodes inside a Flow (see nav_flows above).
],
},
{
// AI — agent/tool/skill metadata. Configured together by the
// same team in practice; runtime conversations live in their
// own app surface, not here.
id: 'group_ai',
type: 'group',
label: 'AI',
icon: 'sparkles',
children: [
{
id: 'nav_agents',
type: 'component',
label: 'Agents',
componentRef: 'metadata:resource',
params: { type: 'agent', package: '{active_package}' },
icon: 'bot',
},
{
id: 'nav_tools',
type: 'component',
label: 'Tools',
componentRef: 'metadata:resource',
params: { type: 'tool', package: '{active_package}' },
icon: 'wrench',
},
{
id: 'nav_skills',
type: 'component',
label: 'Skills',
componentRef: 'metadata:resource',
params: { type: 'skill', package: '{active_package}' },
icon: 'brain',
},
],
},
{
// Developer — first-party developer tooling surfaces hosted by the
// console (API console, flow run inspector, public forms registry).
// Registered as built-in components in the console's
// ComponentRegistry under the `developer:*` namespace.
id: 'group_developer',
type: 'group',
label: 'Developer',
icon: 'terminal',
children: [
{
id: 'nav_api_console',
type: 'component',
label: 'API Console',
componentRef: 'developer:api-console',
icon: 'terminal',
},
{
id: 'nav_flow_runs',
type: 'component',
label: 'Flow Runs',
componentRef: 'developer:flow-runs',
icon: 'activity',
},
{
id: 'nav_public_forms',
type: 'component',
label: 'Public Forms',
componentRef: 'developer:public-forms',
icon: 'file-text',
},
],
},
{
// Integration — outbound shapes: datasources, email templates,
// routes/functions/services live here too once they have CRUD
// surfaces. Email templates are a developer artefact (templates
// referenced by transactional sends), not a Setup item.
id: 'group_integration',
type: 'group',
label: 'Integration',
icon: 'plug',
children: [
{
id: 'nav_email_templates',
type: 'component',
label: 'Email Templates',
componentRef: 'metadata:resource',
params: { type: 'email_template', package: '{active_package}' },
icon: 'mail',
},
],
},
],
};