@fayz-ai/core 0.9.0 → 0.11.0
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/README.md +2 -2
- package/dist/access/index.js.map +1 -1
- package/dist/chunk-BEGXYHS4.js +566 -0
- package/dist/chunk-BEGXYHS4.js.map +1 -0
- package/dist/chunk-ED6NBH6U.js +348 -0
- package/dist/chunk-ED6NBH6U.js.map +1 -0
- package/dist/chunk-EWKX4VUM.js +429 -0
- package/dist/chunk-EWKX4VUM.js.map +1 -0
- package/dist/chunk-LARZWDHA.js +319 -0
- package/dist/chunk-LARZWDHA.js.map +1 -0
- package/dist/chunk-OXQGRJZT.js +125 -0
- package/dist/chunk-OXQGRJZT.js.map +1 -0
- package/dist/chunk-RRYFXUQX.js +1247 -0
- package/dist/chunk-RRYFXUQX.js.map +1 -0
- package/dist/{chunk-5RJVUC6J.js → chunk-TDI6F6PT.js} +373 -25
- package/dist/chunk-TDI6F6PT.js.map +1 -0
- package/dist/{chunk-V2MSAUHO.js → chunk-UVKH6RDX.js} +211 -335
- package/dist/chunk-UVKH6RDX.js.map +1 -0
- package/dist/chunk-V53GR4UT.js +289 -0
- package/dist/chunk-V53GR4UT.js.map +1 -0
- package/dist/connector-runtime/index.d.ts +15 -0
- package/dist/connector-runtime/index.d.ts.map +1 -0
- package/dist/connector-runtime/index.js +3 -0
- package/dist/connector-runtime/index.js.map +1 -0
- package/dist/data/archetype.d.ts.map +1 -1
- package/dist/data/backend-env.d.ts +38 -0
- package/dist/data/backend-env.d.ts.map +1 -0
- package/dist/data/bulk.d.ts +24 -0
- package/dist/data/bulk.d.ts.map +1 -1
- package/dist/data/cached.d.ts.map +1 -1
- package/dist/data/custom-fields.d.ts +5 -0
- package/dist/data/custom-fields.d.ts.map +1 -0
- package/dist/data/index.d.ts +2 -1
- package/dist/data/index.d.ts.map +1 -1
- package/dist/data/index.js +3 -1
- package/dist/data/mock.d.ts.map +1 -1
- package/dist/data/platform-api.d.ts.map +1 -1
- package/dist/data/resolve.d.ts.map +1 -1
- package/dist/data/supabase.d.ts.map +1 -1
- package/dist/data/types.d.ts +8 -0
- package/dist/data/types.d.ts.map +1 -1
- package/dist/entity/events.d.ts +14 -0
- package/dist/entity/events.d.ts.map +1 -0
- package/dist/events/envelope.d.ts +31 -0
- package/dist/events/envelope.d.ts.map +1 -0
- package/dist/events/index.d.ts +4 -0
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/log.d.ts +44 -0
- package/dist/events/log.d.ts.map +1 -0
- package/dist/events/types.d.ts +40 -0
- package/dist/events/types.d.ts.map +1 -0
- package/dist/fields/store.d.ts +45 -0
- package/dist/fields/store.d.ts.map +1 -0
- package/dist/i18n/index.d.ts +10 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/shell-translations.en.d.ts.map +1 -1
- package/dist/i18n/shell-translations.pt-br.d.ts.map +1 -1
- package/dist/index.d.ts +45 -21
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +543 -56
- package/dist/index.js.map +1 -1
- package/dist/integrations/events.d.ts +7 -0
- package/dist/integrations/events.d.ts.map +1 -0
- package/dist/integrations/index.d.ts +533 -29
- package/dist/integrations/index.d.ts.map +1 -1
- package/dist/integrations/index.js +3 -1
- package/dist/integrations/permissions.d.ts +132 -0
- package/dist/integrations/permissions.d.ts.map +1 -0
- package/dist/integrations/request.d.ts +170 -0
- package/dist/integrations/request.d.ts.map +1 -0
- package/dist/integrations/runtime-token.d.ts +33 -0
- package/dist/integrations/runtime-token.d.ts.map +1 -0
- package/dist/integrations/runtime.d.ts +398 -0
- package/dist/integrations/runtime.d.ts.map +1 -0
- package/dist/integrations/settings.d.ts +102 -0
- package/dist/integrations/settings.d.ts.map +1 -0
- package/dist/integrations/store.d.ts +145 -0
- package/dist/integrations/store.d.ts.map +1 -0
- package/dist/{address/index.d.ts → lib/address.d.ts} +1 -1
- package/dist/{address/index.d.ts.map → lib/address.d.ts.map} +1 -1
- package/dist/{phone/index.d.ts → lib/phone.d.ts} +1 -1
- package/dist/lib/phone.d.ts.map +1 -0
- package/dist/{seo/index.d.ts → lib/seo.d.ts} +18 -1
- package/dist/lib/seo.d.ts.map +1 -0
- package/dist/{tenant/index.d.ts → lib/tenant.d.ts} +1 -1
- package/dist/lib/tenant.d.ts.map +1 -0
- package/dist/manifest/index.d.ts +1 -1
- package/dist/manifest/index.d.ts.map +1 -1
- package/dist/messaging/index.d.ts +3 -0
- package/dist/messaging/index.d.ts.map +1 -0
- package/dist/messaging/registry.d.ts +35 -0
- package/dist/messaging/registry.d.ts.map +1 -0
- package/dist/messaging/types.d.ts +67 -0
- package/dist/messaging/types.d.ts.map +1 -0
- package/dist/plugin/index.js +3 -1
- package/dist/plugin/runtime.d.ts +17 -0
- package/dist/plugin/runtime.d.ts.map +1 -1
- package/dist/registry/block-catalog.d.ts +78 -0
- package/dist/registry/block-catalog.d.ts.map +1 -0
- package/dist/registry/block-constraints.d.ts +64 -0
- package/dist/registry/block-constraints.d.ts.map +1 -0
- package/dist/registry/block-schema.d.ts +69 -0
- package/dist/registry/block-schema.d.ts.map +1 -0
- package/dist/registry/blocks.d.ts +84 -0
- package/dist/registry/blocks.d.ts.map +1 -0
- package/dist/registry/entities.d.ts +179 -0
- package/dist/registry/entities.d.ts.map +1 -0
- package/dist/registry/extension-points.d.ts +117 -0
- package/dist/registry/extension-points.d.ts.map +1 -0
- package/dist/registry/handles.d.ts +41 -0
- package/dist/registry/handles.d.ts.map +1 -0
- package/dist/registry/index.d.ts +41 -41
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/loaders.d.ts +55 -0
- package/dist/registry/loaders.d.ts.map +1 -0
- package/dist/registry/registry-class.d.ts +157 -0
- package/dist/registry/registry-class.d.ts.map +1 -0
- package/dist/registry/schema-check.d.ts +14 -0
- package/dist/registry/schema-check.d.ts.map +1 -0
- package/dist/router/index.d.ts +78 -1
- package/dist/router/index.d.ts.map +1 -1
- package/dist/router/index.js +1 -1
- package/dist/{shell-translations.pt-br-2GWRQRRP.js → shell-translations.pt-br-BM5ZFSKJ.js} +72 -3
- package/dist/shell-translations.pt-br-BM5ZFSKJ.js.map +1 -0
- package/dist/telemetry/errors.d.ts +87 -0
- package/dist/telemetry/errors.d.ts.map +1 -0
- package/dist/testing/index.js +4 -1
- package/dist/{testing/index.d.ts → testing.d.ts} +5 -3
- package/dist/testing.d.ts.map +1 -0
- package/dist/types/analytics.d.ts +213 -0
- package/dist/types/analytics.d.ts.map +1 -0
- package/dist/types/crud.d.ts +37 -3
- package/dist/types/crud.d.ts.map +1 -1
- package/dist/types/plugins.d.ts +138 -1
- package/dist/types/plugins.d.ts.map +1 -1
- package/package.json +9 -17
- package/dist/blocks/index.d.ts +0 -25
- package/dist/blocks/index.d.ts.map +0 -1
- package/dist/chunk-5RJVUC6J.js.map +0 -1
- package/dist/chunk-L4TLMYGC.js +0 -42
- package/dist/chunk-L4TLMYGC.js.map +0 -1
- package/dist/chunk-V2MSAUHO.js.map +0 -1
- package/dist/chunk-X5THHG6T.js +0 -77
- package/dist/chunk-X5THHG6T.js.map +0 -1
- package/dist/chunk-Y2C2FBQP.js +0 -35
- package/dist/chunk-Y2C2FBQP.js.map +0 -1
- package/dist/chunk-YH25Y4FW.js +0 -311
- package/dist/chunk-YH25Y4FW.js.map +0 -1
- package/dist/phone/index.d.ts.map +0 -1
- package/dist/seo/index.d.ts.map +0 -1
- package/dist/shell-translations.pt-br-2GWRQRRP.js.map +0 -1
- package/dist/tenant/index.d.ts.map +0 -1
- package/dist/testing/index.d.ts.map +0 -1
- package/src/access/denial.ts +0 -33
- package/src/access/engine.test.ts +0 -48
- package/src/access/engine.ts +0 -136
- package/src/access/index.ts +0 -14
- package/src/access/limits.ts +0 -18
- package/src/address/index.ts +0 -188
- package/src/app/render.tsx +0 -69
- package/src/blocks/index.tsx +0 -68
- package/src/data/archetype.ts +0 -255
- package/src/data/bulk.ts +0 -35
- package/src/data/cached.ts +0 -55
- package/src/data/count.test.ts +0 -152
- package/src/data/count.ts +0 -131
- package/src/data/filters.test.ts +0 -70
- package/src/data/filters.ts +0 -90
- package/src/data/index.ts +0 -11
- package/src/data/mock.ts +0 -90
- package/src/data/platform-api.ts +0 -209
- package/src/data/refresh.ts +0 -115
- package/src/data/resolve.ts +0 -126
- package/src/data/supabase.ts +0 -230
- package/src/data/types.ts +0 -50
- package/src/entity/index.ts +0 -2
- package/src/entity/registry.ts +0 -49
- package/src/events/index.tsx +0 -82
- package/src/i18n/index.ts +0 -476
- package/src/i18n/shell-translations.en.ts +0 -875
- package/src/i18n/shell-translations.pt-br.ts +0 -873
- package/src/index.ts +0 -217
- package/src/integrations/index.ts +0 -237
- package/src/lib/cache.ts +0 -118
- package/src/lib/csv.ts +0 -54
- package/src/lib/format.ts +0 -58
- package/src/manifest/app-manifest.schema.json +0 -676
- package/src/manifest/index.ts +0 -518
- package/src/manifest/serialize.ts +0 -52
- package/src/phone/index.ts +0 -85
- package/src/plugin/createSafeDataProvider.ts +0 -30
- package/src/plugin/index.ts +0 -1
- package/src/plugin/runtime.ts +0 -331
- package/src/registry/index.ts +0 -163
- package/src/router/history.ts +0 -86
- package/src/router/index.ts +0 -29
- package/src/runtime/index.ts +0 -15
- package/src/runtime/oauth.ts +0 -219
- package/src/search/engine.ts +0 -559
- package/src/search/index.ts +0 -25
- package/src/search/text.ts +0 -206
- package/src/search/types.ts +0 -75
- package/src/seo/index.ts +0 -128
- package/src/tenant/index.ts +0 -38
- package/src/testing/index.ts +0 -116
- package/src/types/auth.ts +0 -41
- package/src/types/billing.ts +0 -39
- package/src/types/crud.ts +0 -184
- package/src/types/entities.ts +0 -142
- package/src/types/entitlements.ts +0 -45
- package/src/types/i18n.ts +0 -7
- package/src/types/index.ts +0 -11
- package/src/types/org.ts +0 -137
- package/src/types/payment.ts +0 -44
- package/src/types/permissions.ts +0 -32
- package/src/types/plugins.ts +0 -480
- package/src/types/theme.ts +0 -8
package/src/types/plugins.ts
DELETED
|
@@ -1,480 +0,0 @@
|
|
|
1
|
-
import type React from 'react'
|
|
2
|
-
import type { EntityDef } from './crud'
|
|
3
|
-
import type { FeatureDeclaration, PermissionAction } from './permissions'
|
|
4
|
-
import type { LimitDeclaration } from './entitlements'
|
|
5
|
-
import type { ConnectorDefinition } from '../integrations'
|
|
6
|
-
|
|
7
|
-
export type VerticalId = 'beauty' | 'food' | 'health' | 'services' | 'retail' | 'education' | (string & {})
|
|
8
|
-
export type PluginScope = 'core' | 'vertical' | 'universal' | 'addon' | 'tenant'
|
|
9
|
-
export type PluginStatus = 'pending_setup' | 'active' | 'disabled' | 'removed'
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Scaffold type this plugin targets.
|
|
13
|
-
* Plugins can declare which scaffolds they work with.
|
|
14
|
-
* If omitted, the plugin works with all scaffold types.
|
|
15
|
-
*/
|
|
16
|
-
export type ScaffoldType = 'saas' | 'ecommerce' | 'landing_page' | 'website' | (string & {})
|
|
17
|
-
|
|
18
|
-
export interface PluginPermissionRequirement {
|
|
19
|
-
feature: string
|
|
20
|
-
action: PermissionAction
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface PluginNavigationEntry {
|
|
24
|
-
id?: string
|
|
25
|
-
section: 'main' | 'secondary' | 'settings'
|
|
26
|
-
position: number
|
|
27
|
-
label: string
|
|
28
|
-
route: string
|
|
29
|
-
icon?: string
|
|
30
|
-
badge?: string | number
|
|
31
|
-
permission?: PluginPermissionRequirement
|
|
32
|
-
/**
|
|
33
|
-
* Sales-channel / external link. When set, the entry opens this URL in a new
|
|
34
|
-
* tab instead of routing internally — no page/route is registered for it. Used
|
|
35
|
-
* by "Canais de venda"-style nav (Loja Online, WhatsApp, TikTok Shop…). The
|
|
36
|
-
* `route` is still required (used as a stable identity/key), but is never
|
|
37
|
-
* navigated when `href` is present.
|
|
38
|
-
*/
|
|
39
|
-
href?: string
|
|
40
|
-
/**
|
|
41
|
-
* When this entry gains sub-path children, the shell also synthesizes a child
|
|
42
|
-
* pointing back at the parent's own route (so /courses stays reachable under
|
|
43
|
-
* the "Courses" group). Set false when the parent route is a duplicate of its
|
|
44
|
-
* first child — e.g. /shop and /shop/products render the same catalog, and
|
|
45
|
-
* listing both reads as a bug. Defaults to true.
|
|
46
|
-
*/
|
|
47
|
-
indexChild?: boolean
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export interface PluginSettingsTab {
|
|
51
|
-
id: string
|
|
52
|
-
label: string
|
|
53
|
-
icon?: string
|
|
54
|
-
/** Provide the component directly, or reference a registered component by id
|
|
55
|
-
* (resolvePluginComponent resolves componentId → the component registry).
|
|
56
|
-
* Exactly one is required. */
|
|
57
|
-
component?: React.ComponentType<unknown>
|
|
58
|
-
componentId?: string
|
|
59
|
-
pluginId?: string
|
|
60
|
-
order?: number
|
|
61
|
-
permission?: PluginPermissionRequirement
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export interface PluginRouteDefinition {
|
|
65
|
-
path: string
|
|
66
|
-
/** Component or a registered component id — exactly one is required. */
|
|
67
|
-
component?: React.ComponentType<unknown>
|
|
68
|
-
componentId?: string
|
|
69
|
-
guard?: 'authenticated' | 'role' | 'public' | 'share-token'
|
|
70
|
-
roles?: string[]
|
|
71
|
-
permission?: PluginPermissionRequirement
|
|
72
|
-
/** Render edge-to-edge with no page padding/animation wrapper (chat, kanban, canvas). */
|
|
73
|
-
fullBleed?: boolean
|
|
74
|
-
/** Archetypes this page displays (`archetype` or `archetype:kind`, e.g.
|
|
75
|
-
* `'schedule:appointment'`). A CRUD page claims its own; a hand-built page
|
|
76
|
-
* must declare it or records it owns resolve to no route. */
|
|
77
|
-
entityRoutes?: string[]
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export type PluginWidgetZone =
|
|
81
|
-
| 'shell.sidebar.before-nav'
|
|
82
|
-
| 'shell.sidebar.footer'
|
|
83
|
-
| 'shell.topbar.start'
|
|
84
|
-
| 'shell.topbar.end'
|
|
85
|
-
| 'page.before'
|
|
86
|
-
| 'page.after'
|
|
87
|
-
| 'settings.before'
|
|
88
|
-
| 'settings.after'
|
|
89
|
-
| 'shell.floating'
|
|
90
|
-
| (string & {})
|
|
91
|
-
|
|
92
|
-
export const WidgetZone = {
|
|
93
|
-
SIDEBAR_BEFORE_NAV: 'shell.sidebar.before-nav',
|
|
94
|
-
SIDEBAR_FOOTER: 'shell.sidebar.footer',
|
|
95
|
-
TOPBAR_START: 'shell.topbar.start',
|
|
96
|
-
TOPBAR_END: 'shell.topbar.end',
|
|
97
|
-
PAGE_BEFORE: 'page.before',
|
|
98
|
-
PAGE_AFTER: 'page.after',
|
|
99
|
-
SETTINGS_BEFORE: 'settings.before',
|
|
100
|
-
SETTINGS_AFTER: 'settings.after',
|
|
101
|
-
FLOATING: 'shell.floating',
|
|
102
|
-
} as const
|
|
103
|
-
|
|
104
|
-
export interface PluginRuntimeTenant {
|
|
105
|
-
id?: string
|
|
106
|
-
slug?: string
|
|
107
|
-
verticalId?: string
|
|
108
|
-
plan?: string
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export interface PluginRuntimeUser {
|
|
112
|
-
id?: string
|
|
113
|
-
role?: string
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export interface PluginWidgetVisibility {
|
|
117
|
-
routes?: string[]
|
|
118
|
-
excludeRoutes?: string[]
|
|
119
|
-
layouts?: string[]
|
|
120
|
-
roles?: string[]
|
|
121
|
-
plans?: string[]
|
|
122
|
-
permissions?: PluginPermissionRequirement[]
|
|
123
|
-
when?: (context: PluginRuntimeContext) => boolean
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export interface PluginRuntimeContext {
|
|
127
|
-
tenant: PluginRuntimeTenant | null
|
|
128
|
-
user: PluginRuntimeUser | null
|
|
129
|
-
currentPath: string
|
|
130
|
-
matchedPath?: string
|
|
131
|
-
layout: string
|
|
132
|
-
hasPermission?: (req: PluginPermissionRequirement) => boolean
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export interface PluginWidgetDefinition<TConfig extends Record<string, unknown> = Record<string, unknown>> {
|
|
136
|
-
id: string
|
|
137
|
-
zone: PluginWidgetZone
|
|
138
|
-
/** Component or a registered component id — exactly one is required. */
|
|
139
|
-
component?: React.ComponentType<unknown>
|
|
140
|
-
componentId?: string
|
|
141
|
-
title?: string
|
|
142
|
-
order?: number
|
|
143
|
-
permission?: PluginPermissionRequirement
|
|
144
|
-
visibility?: PluginWidgetVisibility
|
|
145
|
-
props?: TConfig
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// ---------------------------------------------------------------------------
|
|
149
|
-
// Dashboard widgets — first-class units a plugin contributes to the dashboard
|
|
150
|
-
// registry. Rendered both on the plugin's own home and on the global app home.
|
|
151
|
-
// ---------------------------------------------------------------------------
|
|
152
|
-
|
|
153
|
-
export type DashboardWidgetKind = 'kpi' | 'chart' | 'table' | 'onboarding' | 'custom'
|
|
154
|
-
|
|
155
|
-
/** Surfaces a widget can appear on. 'home' = global app home (the universal
|
|
156
|
-
* business dashboard every app renders via createDashboardPlugin);
|
|
157
|
-
* 'plugin-home' = the owning plugin's own overview page; 'finance-home' = a
|
|
158
|
-
* dedicated B2C consumer-finance home (norman-ai's phone-first money screen),
|
|
159
|
-
* kept separate so its full-bleed hero/cards never leak onto the B2B 'home'. */
|
|
160
|
-
export type DashboardSurface = 'home' | 'plugin-home' | 'finance-home'
|
|
161
|
-
|
|
162
|
-
export interface DashboardWidgetDef<TProps extends Record<string, unknown> = Record<string, unknown>> {
|
|
163
|
-
/** Globally unique id, e.g. 'crm.kpi.total-leads'. */
|
|
164
|
-
id: string
|
|
165
|
-
/** i18n key or plain label. */
|
|
166
|
-
title: string
|
|
167
|
-
description?: string
|
|
168
|
-
icon?: string
|
|
169
|
-
/** Owning domain used to scope plugin-home vs global home. Defaults to plugin.id. */
|
|
170
|
-
domain?: string
|
|
171
|
-
kind: DashboardWidgetKind
|
|
172
|
-
/** Column span on the 4-col grid. Defaults by kind (kpi→1, chart→2, table→4). */
|
|
173
|
-
span?: 1 | 2 | 3 | 4
|
|
174
|
-
/** Visible before any app/user customization. Default: true. */
|
|
175
|
-
defaultVisible?: boolean
|
|
176
|
-
/** Default order within the surface (lower = first). */
|
|
177
|
-
defaultOrder?: number
|
|
178
|
-
/** Surfaces this widget appears on. Default: both. */
|
|
179
|
-
surfaces?: DashboardSurface[]
|
|
180
|
-
verticalId?: VerticalId
|
|
181
|
-
permission?: PluginPermissionRequirement
|
|
182
|
-
/** Component or a registered component id — exactly one is required. */
|
|
183
|
-
component?: React.ComponentType<unknown>
|
|
184
|
-
componentId?: string
|
|
185
|
-
props?: TProps
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
/** App- or user-level overrides applied on top of the registered defaults. */
|
|
189
|
-
export interface DashboardLayoutConfig {
|
|
190
|
-
widgets?: Array<{ id: string; visible?: boolean; order?: number; span?: number }>
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
export interface ResolvedDashboardWidget extends DashboardWidgetDef {
|
|
194
|
-
/** Resolved owning domain (plugin.id when not explicitly set). */
|
|
195
|
-
domain: string
|
|
196
|
-
order: number
|
|
197
|
-
plugin: ResolvedPluginManifest
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
/** An event a plugin emits onto the event bus — declared for platform
|
|
201
|
-
* introspection and so the AppManifest can bind event→action as data. */
|
|
202
|
-
export interface PluginEventDefinition {
|
|
203
|
-
/** Namespaced event name, e.g. 'agenda.booking.confirmed'. */
|
|
204
|
-
name: string
|
|
205
|
-
description?: string
|
|
206
|
-
/** JSON Schema for the payload (editor / AI / validation). */
|
|
207
|
-
payloadSchema?: Record<string, unknown>
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
export interface PluginCapability {
|
|
211
|
-
id: string
|
|
212
|
-
label: string
|
|
213
|
-
description?: string
|
|
214
|
-
kind?: 'page' | 'widget' | 'data' | 'integration'
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
export interface PluginQuickAction {
|
|
218
|
-
id: string
|
|
219
|
-
label: string
|
|
220
|
-
icon?: string
|
|
221
|
-
description?: string
|
|
222
|
-
/** Action handler — typically navigates to a view. */
|
|
223
|
-
action: () => void
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
export type AIToolMode = 'read' | 'persist'
|
|
227
|
-
|
|
228
|
-
export interface AIToolParameterProperty {
|
|
229
|
-
type: 'string' | 'number' | 'boolean' | 'array' | 'object'
|
|
230
|
-
description?: string
|
|
231
|
-
enum?: string[]
|
|
232
|
-
items?: AIToolParameterProperty
|
|
233
|
-
default?: unknown
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
export interface AIToolParameters {
|
|
237
|
-
type: 'object'
|
|
238
|
-
properties: Record<string, AIToolParameterProperty>
|
|
239
|
-
required?: string[]
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
export interface AIToolSuggestion {
|
|
243
|
-
label: string
|
|
244
|
-
prompt?: string
|
|
245
|
-
icon?: string
|
|
246
|
-
verticalId?: VerticalId
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
export type AIToolExecution =
|
|
250
|
-
| { plane: 'server'; kind: 'rpc'; rpc: string }
|
|
251
|
-
| { plane: 'server'; kind: 'entity_read'; entity: string }
|
|
252
|
-
| { plane: 'client' }
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* A tenant-scoped pool RPC (`agent_<domain>_<verb>`) this plugin ships for the
|
|
256
|
-
* server-plane agent executor. Surfaces in the manifest as
|
|
257
|
-
* `agent.rpcs` (RpcContract) — the broker only ever calls declared functions.
|
|
258
|
-
*/
|
|
259
|
-
export interface AgentRpcDeclaration {
|
|
260
|
-
/** Function name in the pool, e.g. 'agent_agenda_create_appointment'. */
|
|
261
|
-
name: string
|
|
262
|
-
kind: 'read' | 'write'
|
|
263
|
-
description: string
|
|
264
|
-
/** JSON Schema of the p_payload argument. */
|
|
265
|
-
payloadSchema?: AIToolParameters
|
|
266
|
-
/** Whether the function writes audit_logs itself. */
|
|
267
|
-
audits?: boolean
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
export interface PluginAITool {
|
|
271
|
-
id: string
|
|
272
|
-
name: string
|
|
273
|
-
description: string
|
|
274
|
-
icon?: string
|
|
275
|
-
mode: AIToolMode
|
|
276
|
-
parameters?: AIToolParameters
|
|
277
|
-
permission?: PluginPermissionRequirement
|
|
278
|
-
/**
|
|
279
|
-
* Quantity-limit key this tool's writes consume (e.g. 'bookings_month' for a
|
|
280
|
-
* booking-creating tool). Persist-mode tools that create countable rows MUST
|
|
281
|
-
* declare it so the agent executor can run the SAME plan-limit guard the UI
|
|
282
|
-
* runs (guard before execute, invalidate after) — an AI agent never clicks a
|
|
283
|
-
* gated button, so the declarative contract is its only gate.
|
|
284
|
-
*/
|
|
285
|
-
limitKey?: string
|
|
286
|
-
/**
|
|
287
|
-
* Where the tool runs. Server-plane is what makes browserless channels
|
|
288
|
-
* (WhatsApp, MCP) able to run the tool at all:
|
|
289
|
-
* - `{ plane:'server', kind:'rpc', rpc }` — the Fayz broker calls the named
|
|
290
|
-
* `agent_*` RPC in the tenant pool (writes / guarded reads).
|
|
291
|
-
* - `{ plane:'server', kind:'entity_read', entity }` — the broker runs the
|
|
292
|
-
* generic tenant-scoped read against the entity's table (derived tools).
|
|
293
|
-
* - `{ plane:'client' }` (or absent) — a locally registered executor runs it
|
|
294
|
-
* in the surface (navigation, modals).
|
|
295
|
-
*/
|
|
296
|
-
execution?: AIToolExecution
|
|
297
|
-
/**
|
|
298
|
-
* Require an explicit human confirmation before executing. Defaults to true
|
|
299
|
-
* for `mode: 'persist'` tools — the channel renders it natively (FAB modal,
|
|
300
|
-
* WhatsApp yes/no reply).
|
|
301
|
-
*/
|
|
302
|
-
requiresConfirmation?: boolean
|
|
303
|
-
suggestions?: AIToolSuggestion[]
|
|
304
|
-
category?: string
|
|
305
|
-
tags?: string[]
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
export interface PluginRegistryDef {
|
|
309
|
-
id: string
|
|
310
|
-
entity: EntityDef
|
|
311
|
-
icon?: string
|
|
312
|
-
description?: string
|
|
313
|
-
display?: 'table' | 'cards' | 'tree'
|
|
314
|
-
seedData?: Record<string, unknown>[]
|
|
315
|
-
mockData?: Record<string, unknown>[]
|
|
316
|
-
readOnly?: boolean
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
export interface PluginMigration {
|
|
320
|
-
id: string
|
|
321
|
-
version: string
|
|
322
|
-
sql: string
|
|
323
|
-
description?: string
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
export interface PluginOnboarding {
|
|
327
|
-
/** Component or a registered component id — exactly one is required. */
|
|
328
|
-
component?: React.ComponentType<{ onComplete: () => void }>
|
|
329
|
-
componentId?: string
|
|
330
|
-
title?: string
|
|
331
|
-
description?: string
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
/**
|
|
335
|
-
* A health check a plugin contributes to the diagnostics / boot report surfaced by
|
|
336
|
-
* `fayz doctor`. Declared as data so the platform can verify a plugin's backend
|
|
337
|
-
* prerequisites are present without running it.
|
|
338
|
-
*/
|
|
339
|
-
export interface PluginDiagnostic {
|
|
340
|
-
id: string
|
|
341
|
-
description?: string
|
|
342
|
-
/** What the runtime should verify exists for this plugin to work. */
|
|
343
|
-
requires: {
|
|
344
|
-
rpcs?: string[]
|
|
345
|
-
views?: string[]
|
|
346
|
-
tables?: string[]
|
|
347
|
-
migrations?: string[]
|
|
348
|
-
env?: string[]
|
|
349
|
-
}
|
|
350
|
-
/** Severity when the requirement is missing. Defaults to 'warn'. */
|
|
351
|
-
level?: 'error' | 'warn' | 'info'
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
export interface PluginManifest {
|
|
355
|
-
id: string
|
|
356
|
-
name: string
|
|
357
|
-
icon: string
|
|
358
|
-
version: string
|
|
359
|
-
/** Plugin contract version. The runtime refuses plugins built for a newer
|
|
360
|
-
* contract than it supports (see PLUGIN_API_VERSION). Omit = legacy/compatible. */
|
|
361
|
-
apiVersion?: number
|
|
362
|
-
description?: string
|
|
363
|
-
scope?: PluginScope
|
|
364
|
-
verticalId?: VerticalId
|
|
365
|
-
/** Events this plugin emits onto the bus (declared for introspection/automation). */
|
|
366
|
-
events?: PluginEventDefinition[]
|
|
367
|
-
/** Which scaffold types this plugin targets. Omit for universal plugins. */
|
|
368
|
-
scaffolds?: ScaffoldType[]
|
|
369
|
-
tenantId?: string
|
|
370
|
-
defaultEnabled?: boolean
|
|
371
|
-
schema?: string
|
|
372
|
-
dependencies?: string[]
|
|
373
|
-
navigation: PluginNavigationEntry[]
|
|
374
|
-
settings?: PluginSettingsTab[]
|
|
375
|
-
routes: PluginRouteDefinition[]
|
|
376
|
-
widgets?: PluginWidgetDefinition[]
|
|
377
|
-
/** Dashboard widgets this plugin contributes to the dashboard registry. */
|
|
378
|
-
dashboardWidgets?: DashboardWidgetDef[]
|
|
379
|
-
capabilities?: PluginCapability[]
|
|
380
|
-
aiTools?: PluginAITool[]
|
|
381
|
-
entities?: string[]
|
|
382
|
-
permissions?: string[]
|
|
383
|
-
declaredFeatures?: FeatureDeclaration[]
|
|
384
|
-
/**
|
|
385
|
-
* Quantity limits this plugin knows how to count. Aggregated by the plugin
|
|
386
|
-
* runtime into `PluginRuntime.pluginLimits` and consumed by the access engine
|
|
387
|
-
* (useLimit / useLimitGuard) so a plugin "is born compatible" with freemium
|
|
388
|
-
* caps without any per-app wiring. See {@link LimitDeclaration}.
|
|
389
|
-
*/
|
|
390
|
-
declaredLimits?: LimitDeclaration[]
|
|
391
|
-
/** Pool RPCs this plugin ships for the server-plane agent executor. */
|
|
392
|
-
declaredRpcs?: AgentRpcDeclaration[]
|
|
393
|
-
/**
|
|
394
|
-
* Read-models this plugin exposes to the agent's generic data primitives
|
|
395
|
-
* (searchRecords/queryData) BEYOND its CRUD registries — typically its
|
|
396
|
-
* views/ledgers (v_appointments, plg_financial_movements). `key` is a stable
|
|
397
|
-
* ASCII id (never derived from a translated label); the entity's own
|
|
398
|
-
* `permission` gates each call.
|
|
399
|
-
*/
|
|
400
|
-
queryEntities?: Array<{
|
|
401
|
-
key: string
|
|
402
|
-
entity: EntityDef
|
|
403
|
-
/** Base tables may opt into createRecord; views/ledgers stay read-only. */
|
|
404
|
-
writable?: boolean
|
|
405
|
-
}>
|
|
406
|
-
registries?: PluginRegistryDef[]
|
|
407
|
-
/**
|
|
408
|
-
* Connectors this plugin contributes. An ADDON plugin declares its connector(s)
|
|
409
|
-
* here, each naming the `hostPluginId` it extends; the runtime groups them by
|
|
410
|
-
* host and the host plugin's settings render them in a unified Integrations tab.
|
|
411
|
-
*/
|
|
412
|
-
connectors?: ConnectorDefinition[]
|
|
413
|
-
migrations?: PluginMigration[]
|
|
414
|
-
/** Backend prerequisites the plugin needs; surfaced by `fayz doctor`. */
|
|
415
|
-
diagnostics?: PluginDiagnostic[]
|
|
416
|
-
onboarding?: PluginOnboarding
|
|
417
|
-
locales?: Record<string, Record<string, string>>
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
export interface TenantPluginBinding {
|
|
421
|
-
pluginId: string
|
|
422
|
-
status: PluginStatus
|
|
423
|
-
tenantId?: string
|
|
424
|
-
config?: Record<string, unknown>
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
export interface PluginRuntimeIssue {
|
|
428
|
-
type:
|
|
429
|
-
| 'duplicate_plugin'
|
|
430
|
-
| 'missing_dependency'
|
|
431
|
-
| 'circular_dependency'
|
|
432
|
-
| 'vertical_mismatch'
|
|
433
|
-
| 'incompatible_api_version'
|
|
434
|
-
pluginId: string
|
|
435
|
-
dependencyId?: string
|
|
436
|
-
message: string
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
export interface ResolvedPluginManifest extends PluginManifest {
|
|
440
|
-
status: PluginStatus
|
|
441
|
-
isActive: boolean
|
|
442
|
-
activationReason: 'default' | 'tenant' | 'dependency' | 'inactive'
|
|
443
|
-
config: Record<string, unknown>
|
|
444
|
-
missingDependencies: string[]
|
|
445
|
-
settingsTabs: PluginSettingsTab[]
|
|
446
|
-
widgets: PluginWidgetDefinition[]
|
|
447
|
-
resolvedRegistries: PluginRegistryDef[]
|
|
448
|
-
resolvedAITools: PluginAITool[]
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
export interface ResolvedPluginWidget<TConfig extends Record<string, unknown> = Record<string, unknown>>
|
|
452
|
-
extends PluginWidgetDefinition<TConfig> {
|
|
453
|
-
order: number
|
|
454
|
-
config: TConfig
|
|
455
|
-
plugin: ResolvedPluginManifest
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
export interface PluginRuntimeRoute extends PluginRouteDefinition {
|
|
459
|
-
plugin: ResolvedPluginManifest
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
export interface PluginRuntime {
|
|
463
|
-
context: PluginRuntimeContext
|
|
464
|
-
plugins: ResolvedPluginManifest[]
|
|
465
|
-
activePlugins: ResolvedPluginManifest[]
|
|
466
|
-
routes: PluginRuntimeRoute[]
|
|
467
|
-
navigation: PluginNavigationEntry[]
|
|
468
|
-
settingsTabs: PluginSettingsTab[]
|
|
469
|
-
widgets: ResolvedPluginWidget[]
|
|
470
|
-
dashboardWidgets: ResolvedDashboardWidget[]
|
|
471
|
-
capabilities: PluginCapability[]
|
|
472
|
-
aiTools: PluginAITool[]
|
|
473
|
-
issues: PluginRuntimeIssue[]
|
|
474
|
-
registries: Map<string, PluginRegistryDef[]>
|
|
475
|
-
/** Connectors contributed by active plugins, grouped by the host plugin they extend. */
|
|
476
|
-
connectorsByHost: Map<string, ConnectorDefinition[]>
|
|
477
|
-
pluginFeatures: FeatureDeclaration[]
|
|
478
|
-
/** Limit declarations aggregated from every active plugin's `declaredLimits`. */
|
|
479
|
-
pluginLimits: LimitDeclaration[]
|
|
480
|
-
}
|
package/src/types/theme.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export type ThemeBrand = 'blue' | 'violet' | 'green' | 'orange' | 'red' | 'pink' | 'teal' | (string & {})
|
|
2
|
-
export type ThemeRadius = 'none' | 'sm' | 'md' | 'lg' | 'full'
|
|
3
|
-
export type ThemeMode = 'light' | 'dark' | 'system'
|
|
4
|
-
|
|
5
|
-
// NB: the friendly admin theme shape (SaasTheme) is owned by @fayz-ai/saas
|
|
6
|
-
// (shell/config/theme/tokens.ts). A conflicting duplicate used to live here —
|
|
7
|
-
// deleted in the Phase-0 foundation cleanup; core only keeps the primitive
|
|
8
|
-
// theme unions above.
|