@olonjs/core 1.0.85 → 1.0.87
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/dist/index.d.ts +47 -40
- package/dist/olonjs-core.js +5401 -7625
- package/dist/olonjs-core.umd.cjs +45 -71
- package/package.json +1 -3
package/dist/index.d.ts
CHANGED
|
@@ -54,11 +54,9 @@ declare interface AdminSidebarProps {
|
|
|
54
54
|
onDeleteSection?: (sectionId: string) => void;
|
|
55
55
|
/** When provided, shows an "Add section" button in the inspector header that opens the section library. */
|
|
56
56
|
onAddSection?: () => void;
|
|
57
|
-
/** Whether there are unsaved changes
|
|
57
|
+
/** Whether there are unsaved changes for the current draft. */
|
|
58
58
|
hasChanges?: boolean;
|
|
59
|
-
/**
|
|
60
|
-
onExportHTML?: () => void;
|
|
61
|
-
/** Save to file (writes JSON to repo via server). Replaces Export JSON in sidebar when provided. */
|
|
59
|
+
/** Save to file (writes JSON to repo via server). */
|
|
62
60
|
onSaveToFile?: () => void;
|
|
63
61
|
/** Hot Save callback (typically cloud save2edge). */
|
|
64
62
|
onHotSave?: () => void;
|
|
@@ -68,7 +66,7 @@ declare interface AdminSidebarProps {
|
|
|
68
66
|
hotSaveSuccessFeedback?: boolean;
|
|
69
67
|
/** When true, hot save action is currently running. */
|
|
70
68
|
hotSaveInProgress?: boolean;
|
|
71
|
-
/** Controls visibility of
|
|
69
|
+
/** Controls visibility of the Save to file button. */
|
|
72
70
|
showLegacySave?: boolean;
|
|
73
71
|
/** Controls visibility of Hot Save button. */
|
|
74
72
|
showHotSave?: boolean;
|
|
@@ -84,6 +82,8 @@ declare interface AdminSidebarProps {
|
|
|
84
82
|
onPageChange?: (slug: string) => void;
|
|
85
83
|
}
|
|
86
84
|
|
|
85
|
+
export declare function applyValueAtSelectionPath(rootData: Record<string, unknown>, selectionPath: SelectionPath, value: unknown): Record<string, unknown>;
|
|
86
|
+
|
|
87
87
|
/** Optional config for the Image Picker (gallery from assets, save to assets). */
|
|
88
88
|
export declare interface AssetsConfig {
|
|
89
89
|
/** Base URL for assets (e.g. "/assets"). Used to resolve library image URLs and display gallery. */
|
|
@@ -94,16 +94,6 @@ export declare interface AssetsConfig {
|
|
|
94
94
|
onAssetUpload?: (file: File) => Promise<string>;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
/**
|
|
98
|
-
* 🍞 BAKED STATE (Optimized subset for the static HTML artifact)
|
|
99
|
-
*/
|
|
100
|
-
export declare interface BakedState {
|
|
101
|
-
page: PageConfig;
|
|
102
|
-
site: Omit<SiteConfig, 'pages'>;
|
|
103
|
-
menu: MenuConfig;
|
|
104
|
-
theme: ThemeConfig;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
97
|
export declare interface BaseSection<K extends keyof SectionDataRegistry> {
|
|
108
98
|
id: string;
|
|
109
99
|
type: K;
|
|
@@ -129,6 +119,8 @@ export declare interface BaseWidgetProps<T = unknown> {
|
|
|
129
119
|
options?: string[];
|
|
130
120
|
}
|
|
131
121
|
|
|
122
|
+
export declare function buildWebMcpToolName(sectionType: string): string;
|
|
123
|
+
|
|
132
124
|
export declare function cn(...inputs: ClassValue[]): string;
|
|
133
125
|
|
|
134
126
|
export declare interface ConfigContextValue {
|
|
@@ -147,27 +139,11 @@ export declare const ConfigProvider: default_2.FC<{
|
|
|
147
139
|
children: default_2.ReactNode;
|
|
148
140
|
}>;
|
|
149
141
|
|
|
150
|
-
export declare
|
|
151
|
-
|
|
152
|
-
declare interface ControlBarProps {
|
|
153
|
-
hasChanges: boolean;
|
|
154
|
-
onExportJSON: () => void;
|
|
155
|
-
onExportHTML: () => void;
|
|
156
|
-
/** Optional: opens the Add section library. When provided, an "Add section" icon is shown. */
|
|
157
|
-
onAddSection?: () => void;
|
|
158
|
-
}
|
|
142
|
+
export declare function createWebMcpToolInputSchema(sectionType: string): Record<string, unknown>;
|
|
159
143
|
|
|
160
144
|
export declare const DefaultNotFound: default_2.FC;
|
|
161
145
|
|
|
162
|
-
|
|
163
|
-
* 🍞 BAKE HTML (The Single File Artifact)
|
|
164
|
-
*/
|
|
165
|
-
export declare const exportBakedHTML: (state: ProjectState, slug: string, cleanHtml: string) => void;
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* 💾 EXPORT JSON (The Developer Handover)
|
|
169
|
-
*/
|
|
170
|
-
export declare const exportProjectJSON: (state: ProjectState, slug: string) => Promise<void>;
|
|
146
|
+
export declare function ensureWebMcpRuntime(): void;
|
|
171
147
|
|
|
172
148
|
/** Structural shape used when no tenant has augmented the registries. */
|
|
173
149
|
export declare interface FallbackSection {
|
|
@@ -224,7 +200,7 @@ export declare interface JsonPagesConfig {
|
|
|
224
200
|
menuConfig: MenuConfig;
|
|
225
201
|
/** Optional extra JSON documents available to the runtime $ref resolver. */
|
|
226
202
|
refDocuments?: Record<string, unknown>;
|
|
227
|
-
/** Optional persistence
|
|
203
|
+
/** Optional persistence callbacks for tenant-specific save flows. */
|
|
228
204
|
persistence?: Partial<PersistenceConfig>;
|
|
229
205
|
/** CSS strings for ThemeLoader. */
|
|
230
206
|
themeCss: ThemeCssConfig;
|
|
@@ -236,6 +212,8 @@ export declare interface JsonPagesConfig {
|
|
|
236
212
|
assets?: AssetsConfig;
|
|
237
213
|
/** Optional list of section types where Studio overlay should be disabled. */
|
|
238
214
|
overlayDisabledSectionTypes?: string[];
|
|
215
|
+
/** Optional WebMCP bridge config for Studio-only tool registration. */
|
|
216
|
+
webmcp?: WebMcpConfig;
|
|
239
217
|
}
|
|
240
218
|
|
|
241
219
|
export declare function JsonPagesEngine({ config }: JsonPagesEngineProps): JSX.Element;
|
|
@@ -298,10 +276,10 @@ export declare interface PageRendererProps {
|
|
|
298
276
|
selectedId?: string | null;
|
|
299
277
|
}
|
|
300
278
|
|
|
301
|
-
|
|
279
|
+
export declare function parseWebMcpToolName(toolName: string): string | null;
|
|
280
|
+
|
|
281
|
+
/** Persistence API exposed by the tenant app to Studio actions. */
|
|
302
282
|
export declare interface PersistenceConfig {
|
|
303
|
-
exportJSON: (state: ProjectState, slug: string) => Promise<void>;
|
|
304
|
-
exportHTML: (state: ProjectState, slug: string, cleanHtml: string) => void;
|
|
305
283
|
/**
|
|
306
284
|
* Optional. Save current state to repo files (e.g. POST to /api/save-to-file); server writes
|
|
307
285
|
* src/data/config/*.json and src/data/pages/<slug>.json. No git push.
|
|
@@ -312,7 +290,7 @@ export declare interface PersistenceConfig {
|
|
|
312
290
|
* Core only triggers this callback; tenant decides transport and endpoint.
|
|
313
291
|
*/
|
|
314
292
|
hotSave?: (state: ProjectState, slug: string) => Promise<void>;
|
|
315
|
-
/** Controls
|
|
293
|
+
/** Controls Save to file button visibility in sidebar. Default true. */
|
|
316
294
|
showLegacySave?: boolean;
|
|
317
295
|
/** Controls Hot Save button visibility in sidebar. Default false. */
|
|
318
296
|
showHotSave?: boolean;
|
|
@@ -344,6 +322,8 @@ declare type Props = PageRendererProps & {
|
|
|
344
322
|
onActiveSectionChange?: (sectionId: string | null) => void;
|
|
345
323
|
};
|
|
346
324
|
|
|
325
|
+
export declare function registerWebMcpTool(tool: WebMcpTool): () => void;
|
|
326
|
+
|
|
347
327
|
declare type Registry = JsonPagesConfig['registry'];
|
|
348
328
|
|
|
349
329
|
/**
|
|
@@ -359,6 +339,8 @@ export declare function resolveRuntimeConfig(input: RuntimeResolutionInput): Run
|
|
|
359
339
|
|
|
360
340
|
export declare function resolveSectionMenuItems(section: Section, fallbackMain: MenuItem[]): MenuItem[] | undefined;
|
|
361
341
|
|
|
342
|
+
export declare function resolveWebMcpMutationData(currentData: Record<string, unknown>, args: WebMcpMutationArgs): Record<string, unknown>;
|
|
343
|
+
|
|
362
344
|
declare interface RuntimeResolutionInput {
|
|
363
345
|
pages: Record<string, PageConfig>;
|
|
364
346
|
siteConfig: SiteConfig;
|
|
@@ -447,8 +429,6 @@ export declare interface SitePageEntry {
|
|
|
447
429
|
export declare const STUDIO_EVENTS: {
|
|
448
430
|
readonly UPDATE_DRAFTS: "jsonpages:update-drafts";
|
|
449
431
|
readonly SYNC_SELECTION: "jsonpages:sync-selection";
|
|
450
|
-
readonly REQUEST_CLEAN_HTML: "jsonpages:request-clean-html";
|
|
451
|
-
readonly SEND_CLEAN_HTML: "jsonpages:send-clean-html";
|
|
452
432
|
readonly SECTION_SELECT: "jsonpages:section-select";
|
|
453
433
|
readonly INLINE_FIELD_UPDATE: "jsonpages:inline-field-update";
|
|
454
434
|
readonly INLINE_FLUSHED: "jsonpages:inline-flushed";
|
|
@@ -456,6 +436,8 @@ export declare const STUDIO_EVENTS: {
|
|
|
456
436
|
readonly REQUEST_INLINE_FLUSH: "jsonpages:request-inline-flush";
|
|
457
437
|
readonly ACTIVE_SECTION_CHANGED: "jsonpages:active-section-changed";
|
|
458
438
|
readonly STAGE_READY: "jsonpages:stage-ready";
|
|
439
|
+
readonly WEBMCP_TOOL_CALL: "olonjs:webmcp:tool-call";
|
|
440
|
+
readonly WEBMCP_TOOL_RESULT: "olonjs:webmcp:tool-result";
|
|
459
441
|
};
|
|
460
442
|
|
|
461
443
|
declare interface StudioContextType {
|
|
@@ -563,6 +545,31 @@ export declare function useConfig(): ConfigContextValue;
|
|
|
563
545
|
|
|
564
546
|
export declare const useStudio: () => StudioContextType;
|
|
565
547
|
|
|
548
|
+
/** Optional WebMCP bridge registration in Studio mode. */
|
|
549
|
+
export declare interface WebMcpConfig {
|
|
550
|
+
/** Enables WebMCP tool registration when Studio is active. */
|
|
551
|
+
enabled?: boolean;
|
|
552
|
+
/** Optional namespace used by testing helpers and debug output. */
|
|
553
|
+
namespace?: string;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
export declare interface WebMcpMutationArgs {
|
|
557
|
+
slug?: string;
|
|
558
|
+
sectionId: string;
|
|
559
|
+
scope?: 'global' | 'local';
|
|
560
|
+
data?: Record<string, unknown>;
|
|
561
|
+
itemPath?: SelectionPath;
|
|
562
|
+
fieldKey?: string;
|
|
563
|
+
value?: unknown;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
declare type WebMcpTool = {
|
|
567
|
+
name: string;
|
|
568
|
+
description: string;
|
|
569
|
+
inputSchema: Record<string, unknown>;
|
|
570
|
+
execute: (args: unknown) => Promise<unknown> | unknown;
|
|
571
|
+
};
|
|
572
|
+
|
|
566
573
|
export declare type WidgetType = keyof typeof InputWidgets;
|
|
567
574
|
|
|
568
575
|
export { }
|