@superblocksteam/library 2.0.101-next.0 → 2.0.101-next.2

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.
@@ -1,6 +1,6 @@
1
1
  import { Callback, ControlType, DataType, DataTypeString, EntityDefinition, HeaderType, PropertiesPanelDefinition as PropertiesPanelDefinition$1, PropertiesPanelDisplay, PropertyForData, PropsCategory, Relation, WidgetPropertyDefinition } from "@superblocksteam/library-shared/props";
2
- import { Dim, EditorConfig, EvaluateOrValueComputedArgs, Property, TailwindPropertyKey } from "@superblocksteam/library-shared";
3
2
  import { DataRouter, Location, Params } from "react-router";
3
+ import { Dim, EditorConfig, EvaluateOrValueComputedArgs, Property, TailwindPropertyKey } from "@superblocksteam/library-shared";
4
4
  import * as React$2 from "react";
5
5
  import React$1, { LegacyRef, ReactNode, createElement } from "react";
6
6
  import { OrchestratorViewMode, PlaceholderInfo, Profile } from "@superblocksteam/shared";
@@ -87,84 +87,423 @@ declare const SbProvider: ({
87
87
  context?: SuperblocksAppContext;
88
88
  }) => react_jsx_runtime0.JSX.Element;
89
89
  //#endregion
90
- //#region src/lib/internal-details/lib/types.d.ts
91
- type ExecutionError = {
92
- name?: string;
93
- message: string;
94
- formPath: string;
95
- blockPath: string;
96
- handled?: boolean;
90
+ //#region src/lib/internal-details/lib/evaluator/entity-types.d.ts
91
+ type SingleInputProp<T = EntityOutputProp, ARGS extends any[] = any[]> = T extends Callback ? Callback<ARGS> : T;
92
+ type NestedInputProp<T, ARGS extends any[] = any[]> = T extends object ? { [K in keyof T]: SingleInputProp<T[K], ARGS> | NestedInputProp<T[K], ARGS> } : never;
93
+ type InputProp<T = EntityOutputProp, ARGS extends any[] = any[]> = SingleInputProp<T, ARGS> | NestedInputProp<T, ARGS>;
94
+ type EntityFunction<ARGS extends any[] = any[], R = EntityOutputProp> = (this: Entity, ...ARGS: ARGS) => R;
95
+ //#endregion
96
+ //#region src/edit-mode/runtime-graph/types.d.ts
97
+ type ComponentNode = {
98
+ selectorId: SbSelector;
99
+ sourceId: SbElement;
100
+ type: any;
101
+ isSbComponent: boolean;
102
+ isHtmlElement: boolean;
103
+ noSelect?: boolean;
104
+ props?: Record<string, unknown>;
105
+ firstRenderedTag: SbSelector | undefined;
106
+ nearestSelectableAncestor: SbSelector | undefined;
107
+ displayName: string;
97
108
  };
98
- type ExecutionEventRequest = {
99
- summary: string;
100
- metadata: {
101
- placeHoldersInfo?: Record<string, PlaceholderInfo>;
102
- };
109
+ //#endregion
110
+ //#region src/edit-mode/features/runtime-tracking-store.d.ts
111
+ declare class RuntimeTrackingStore {
112
+ readonly editStore: EditStore | undefined;
113
+ constructor(editStore: EditStore | undefined);
114
+ private graph;
115
+ private jsxNodes;
116
+ private sourceNodes;
117
+ private disabledComponents;
118
+ registerComponent(selectorId: SbSelector, params: {
119
+ sourceId: SbElement;
120
+ type: any;
121
+ parentSelectorId?: SbSelector;
122
+ isSbComponent: boolean;
123
+ isHtmlElement: boolean;
124
+ noSelect?: boolean;
125
+ }): void;
126
+ getDisplayName(selectorId: SbSelector): string;
127
+ unregisterComponent(selectorId: SbSelector): void;
128
+ getFirstAnchorableTag(selectorId: SbSelector): SbSelector | undefined;
129
+ getNearestSelectableAncestor(selectorId: SbSelector, skipSelf?: boolean): SbSelector | undefined;
130
+ updatePropsForComponent(selectorId: SbSelector, props: Record<string, unknown>): void;
131
+ getComponent(selectorId: SbSelector): ComponentNode | undefined;
132
+ getComponentParent(selectorId: SbSelector): SbSelector;
133
+ getComponentChildren(selectorId: SbSelector): SbSelector[];
134
+ getSelectorIdsForSourceId(sourceId: SbElement): Set<SbSelector>;
135
+ getSourceId(selectorId: SbSelector): SbElement | undefined;
136
+ getClosestAncestorByType(selectorId: SbSelector, type: string): SbSelector | undefined;
137
+ hasRenderedNodes(): boolean;
138
+ getDisabledComponents(): SbSelector[];
139
+ /**
140
+ * Given a selectorId that represents a DOM element, walks up the component tree
141
+ * to find the outermost registered component whose firstRenderedTag matches this selectorId.
142
+ * This is used to select the component when clicking on its root DOM element.
143
+ *
144
+ * IMPORTANT: This only returns a component if the anchorSelectorId is the IMMEDIATE parent
145
+ * of the component (i.e., the component doesn't have any intermediate nodes between itself
146
+ * and the anchor). This prevents inner HTML elements from being treated as component roots.
147
+ *
148
+ * ONLY returns registered components (isSbComponent: true). Unregistered wrapper components
149
+ * are treated as transparent and skipped.
150
+ *
151
+ * Returns undefined if no registered component has this as its firstRenderedTag.
152
+ */
153
+ getOutermostComponentForFirstRenderedTag(anchorSelectorId: SbSelector): SbSelector | undefined;
154
+ }
155
+ //#endregion
156
+ //#region src/edit-mode/features/ai-store.d.ts
157
+ declare class AiManager {
158
+ private readonly runtimeTrackingStore;
159
+ private _isTaggingEnabled;
160
+ private _isEditing;
161
+ private _editingComponents;
162
+ private _contextMode;
163
+ private _targetedComponents;
164
+ private _targetedSelectors;
165
+ private _hasHadSuccessfulBuild;
166
+ private _hasEverHadSuccessfulBuild;
167
+ constructor(runtimeTrackingStore: RuntimeTrackingStore);
168
+ getIsTaggingEnabled(): boolean;
169
+ getIsEditing(): boolean;
170
+ getShouldShowLoader(): boolean;
171
+ setIsTaggingEnabled(isTaggingEnabled: boolean): void;
172
+ getAiContextMode(): AiContextMode;
173
+ shouldToggleComponentInAiContext(): boolean;
174
+ getTargetedComponents(): `SB-${string}`[];
175
+ getTargetedSelectors(): `S-${string}`[];
176
+ isEditingComponent(id: SbElement): boolean;
177
+ isTargetingComponent(id: SbElement): boolean;
178
+ startEditing(): void;
179
+ setEditingComponents(components: SbElement[]): void;
180
+ finishEditing(): void;
181
+ setAiContextMode(mode: AiContextMode, components?: {
182
+ id: SbElement;
183
+ selectorId?: SbSelector;
184
+ }[]): void;
185
+ addTargetedSelector(selectorId: SbSelector): void;
186
+ toggleTargetedSelector(selectorId: SbSelector): void;
187
+ isTargetedSelector(selectorId: SbSelector): boolean;
188
+ /**
189
+ * Returns true if we are targeting a different selector of the same source id, since in some cases we want to keep
190
+ * the same source targeted, but just highlight another selector of it
191
+ */
192
+ isAlternateSourceIdTarget(sourceId: SbElement, selectorId: SbSelector): boolean;
193
+ handleRuntimeError(data: RuntimeErrorData): void;
194
+ clearRuntimeError(id: string): void;
195
+ markFirstBuildSuccess(): void;
196
+ private notifyLoaderState;
197
+ private removeAllSharedSelectors;
198
+ private removeAllSelectorsForSource;
199
+ }
200
+ //#endregion
201
+ //#region src/edit-mode/features/connection-manager.d.ts
202
+ type ConnectionStatus = "pre-init" | "disconnected" | "connecting" | "connected";
203
+ declare class ConnectionManager {
204
+ connectionStatus: ConnectionStatus;
205
+ constructor();
206
+ initializeSocket(): void;
207
+ connect(): void;
208
+ disconnect(): void;
209
+ }
210
+ //#endregion
211
+ //#region src/edit-mode/features/operation-store.d.ts
212
+ type OptimisticOperation<P> = {
213
+ type: keyof EditOperations;
214
+ payload: P;
215
+ id: string;
216
+ callback?: () => void;
103
217
  };
104
- type Resolutions = Record<string,
105
- // name of the field: eg: "range", for the range field let's say the code is {{[1,2,3]}}
106
- {
107
- value: any;
108
- bindings: any[];
109
- }>;
110
- type ExecutionEvent = {
111
- name: string;
112
- type: string;
113
- timestamp: string;
114
- start?: Record<string, unknown>;
115
- end?: {
116
- performance?: {
117
- start: string | number;
118
- finish: string | number;
119
- total: string | number;
120
- execution: string | number;
121
- overhead: string | number;
218
+ type ReparentTransaction = OptimisticOperation<ReparentRequest>;
219
+ type SetPropertiesTransaction = OptimisticOperation<SetPropertiesRequest>;
220
+ type SetPropertyTransaction = OptimisticOperation<SetPropertyRequest>;
221
+ type CreateComponentTransaction = OptimisticOperation<CreateRequest>;
222
+ type DeleteComponentsTransaction = OptimisticOperation<DeleteRequest>;
223
+ type PendingTransaction = ReparentTransaction | SetPropertiesTransaction | SetPropertyTransaction | CreateComponentTransaction | DeleteComponentsTransaction;
224
+ declare class OperationManager {
225
+ private pendingTransactions;
226
+ private waitingForBatch;
227
+ private batchOperations;
228
+ private batchOperationTransactionId;
229
+ visibleSourceIds: string[];
230
+ constructor();
231
+ get allPendingTransactions(): PendingTransaction[];
232
+ get pendingDeleteOperations(): DeleteComponentsTransaction[];
233
+ get pendingSetPropertiesOperations(): SetPropertiesTransaction[];
234
+ get hasPendingOperations(): boolean;
235
+ get allNames(): never[];
236
+ private executeOrAddToBatch;
237
+ private addPendingTransaction;
238
+ clearPendingTransactions(transactionIds: string[]): void;
239
+ batchUpdate(performOperations: () => void): void;
240
+ createComponent(payload: CreateRequest): void;
241
+ dropComponent(action: {
242
+ from: {
243
+ source: SourceLocation;
122
244
  };
123
- error?: ExecutionError;
124
- output?: {
125
- result?: any;
126
- request?: string;
127
- requestV2?: ExecutionEventRequest;
128
- stdout?: Array<string>;
129
- stderr?: Array<string>;
245
+ to: {
246
+ source: SourceLocation;
130
247
  };
131
- resolved?: Resolutions;
132
- };
133
- parent: string;
134
- };
135
- interface StreamEvent {
136
- result: {
137
- event: ExecutionEvent;
138
- execution: string;
139
- };
140
- }
141
- type RouteInfo = Omit<UrlState, "host" | "hostname" | "href" | "port" | "protocol">;
142
- /**
143
- * Schema representation for SDK API input/output/chunk schemas.
144
- * Contains both TypeScript and JSON Schema formats for display in the UI.
145
- */
146
- interface SdkApiSchemaInfo {
147
- /** TypeScript type string representation, e.g., "{ userId: string; limit?: number }" */
148
- typescript: string;
149
- /** JSON Schema representation for the schema */
150
- jsonSchema: object;
248
+ propsToChange?: Record<string, PropertyInfo>;
249
+ }): void;
250
+ deleteComponents(sourceIds: SbElement[]): void;
251
+ acknowledgeEditOperation(operation: EditOperationPayload<EditOperationType>): void;
252
+ writeRuntimeProperties(sourceId: SbElement, transactionId: string, updates: Record<string, PropertyInfo<unknown>>): void;
253
+ setWidgetProperties({
254
+ sourceId,
255
+ properties,
256
+ callback
257
+ }: {
258
+ sourceId: SbElement;
259
+ properties: Record<string, PropertyInfo<unknown>>;
260
+ callback?: () => void;
261
+ }): void;
262
+ setWidgetProperty({
263
+ sourceId,
264
+ property,
265
+ value,
266
+ callback
267
+ }: {
268
+ sourceId: SbElement;
269
+ property: string;
270
+ value: PropertyInfo<unknown>;
271
+ callback?: () => void;
272
+ }): void;
273
+ ensureFilesSynced(): Promise<void>;
274
+ generateSourceId(): `SB-${string}`;
151
275
  }
152
- /**
153
- * Metadata for an SDK API, sent from the library to ui-code-mode
154
- * when an SDK API is registered.
155
- */
156
- interface SdkApiMetadata {
157
- /** Unique name of the API */
158
- name: string;
159
- /** Plain-language summary of what this API does */
160
- description?: string;
161
- /** Input schema information */
162
- inputSchema: SdkApiSchemaInfo;
163
- /** Output schema information (for non-streaming APIs) */
164
- outputSchema?: SdkApiSchemaInfo;
165
- /** Chunk schema information (for streaming APIs) */
166
- chunkSchema?: SdkApiSchemaInfo;
167
- /** Whether this is a streaming API */
276
+ //#endregion
277
+ //#region src/edit-mode/features/properties-panel-manager.d.ts
278
+ declare class PropertiesPanelManager {
279
+ readonly editStore: EditStore;
280
+ readonly componentsManager: ComponentRegistry;
281
+ private propertiesDefinitions;
282
+ private propertiesPanelTrackerDisposer;
283
+ private _propertyLookupCache;
284
+ private removeHotReloadListener;
285
+ constructor(editStore: EditStore, componentsManager: ComponentRegistry);
286
+ getPropertiesPanel(selectorId: SbSelector): PropertiesPanelDefinition$1;
287
+ trackPropertiesPanel(selectorId: SbSelector): void;
288
+ untrackPropertiesPanel(): void;
289
+ getPropertiesDefinition(type: string): PropertiesDefinition | undefined;
290
+ setPropertiesDefinition(widgetType: string, propertiesDefinition: PropertiesDefinition): void;
291
+ updatePropertiesDefinitionForType(type: string): void;
292
+ computeAndApplySideEffectsForPropertyUpdate(payload: {
293
+ sourceId: SbElement;
294
+ updates: Record<string, PropertyInfo<unknown>>;
295
+ }): Record<SbElement, Record<string, PropertyInfo<unknown>>>;
296
+ /**
297
+ * When a custom component's source code is updated, we want to update the properties definition for that component.
298
+ * In order to do that, we need to listen to vite's hot reload events. We can't put import.meta.hot calls in the library
299
+ * because Vite just compiled all of those out in library builds, so we inject a listener from the plugin instead.
300
+ * https://github.com/vitejs/vite/blob/v6.2/packages/vite/src/node/plugins/define.ts#L37
301
+ */
302
+ private attachHotReloadListener;
303
+ }
304
+ //#endregion
305
+ //#region src/edit-mode/features/resizing-store.d.ts
306
+ type ResizeState = {
307
+ selectorId: SbSelector;
308
+ sourceId: SbElement;
309
+ dragStartX: number;
310
+ dragStartY: number;
311
+ start: {
312
+ width: number;
313
+ height: number;
314
+ };
315
+ resizedPosition: string;
316
+ widthToUpdate: Dim | null;
317
+ heightToUpdate: Dim | null;
318
+ isApplyingResize: boolean;
319
+ };
320
+ declare class ResizingManager {
321
+ private root;
322
+ private _activeResizes;
323
+ constructor(root: RootStore);
324
+ get activeResize(): ResizeState | null | undefined;
325
+ private isLockedAspectRatio;
326
+ startResizing(dragStartX: number, dragStartY: number, selectorId: SbSelector, position: string): void;
327
+ private calculateDimension;
328
+ private handleResizeDimension;
329
+ resizeWidget(currentX: number, currentY: number, selectorId: SbSelector, canResizeWidth: boolean, canResizeHeight: boolean): void;
330
+ pendingResize(sourceId: SbElement): {
331
+ width: Dim | null;
332
+ height: Dim | null;
333
+ } | null;
334
+ get hasAnyPendingResize(): boolean;
335
+ get pendingResizes(): ResizeState[];
336
+ applyResize(selectorId: SbSelector): void;
337
+ }
338
+ //#endregion
339
+ //#region src/edit-mode/features/ui-store.d.ts
340
+ declare class UIStore {
341
+ readonly root: RootStore;
342
+ readonly editStore: EditStore;
343
+ resizing: ResizingManager;
344
+ private _selectedSourceIds;
345
+ private _selectedSelectorIds;
346
+ private _focusedSelectorId;
347
+ private _rootInstanceData;
348
+ private newComponentSelectPromise;
349
+ constructor(root: RootStore, editStore: EditStore);
350
+ getMostRelevantSelectorIdsForSourceId(sourceId: SbElement): SbSelector[];
351
+ isSourceSelected(sourceId: SbElement): boolean;
352
+ getSelectedSourceIds(): SbElement[];
353
+ getSelectedSelectorIds(): SbSelector[];
354
+ private get focusedSelectorId();
355
+ getFocusedSourceId(): SbElement | null;
356
+ getFocusedSelectorId(): SbSelector | null;
357
+ setSelectedSourceIds(sourceIds: SbElement[]): void;
358
+ private subscribeNewSourceIdsToRuntimeSync;
359
+ setSelectedSelectorIds(selectorIds: SbSelector[]): void;
360
+ setFocusedIds(selectorId: SbSelector | null): void;
361
+ selectWidget(selectorId: SbSelector | null, _addToSelection?: boolean): void;
362
+ /**
363
+ * This is cursed because component selection actually needs to be done by instance ids, but
364
+ * instance IDs are only guaranteed to be stable after the component is rendered, while source IDs
365
+ * are assigned by the source tracker.
366
+ *
367
+ * If _any_ other selection comes in before we select something, we will cancel this reaction
368
+ */
369
+ selectNewComponentBySourceId(sourceId: SbElement, selectorIdsToIgnore?: Set<`S-${string}`>): Promise<void>;
370
+ }
371
+ //#endregion
372
+ //#region src/edit-mode/runtime-sync/runtime-subscriptions-store.d.ts
373
+ /**
374
+ * MobX store that manages runtime component subscriptions.
375
+ * Tracks which components are subscribed and builds fresh composites on-demand.
376
+ * The subscriptions getter allows startEditorSync reactions to track deep observables
377
+ * from buildComposite, eliminating the need for manual reaction management.
378
+ */
379
+ declare class RuntimeSubscriptionsStore {
380
+ readonly editStore: EditStore;
381
+ private subscribedSourceIds;
382
+ constructor(editStore: EditStore);
383
+ subscribe(sourceId: SbElement): void;
384
+ unsubscribe(sourceId: SbElement): void;
385
+ clearAll(): void;
386
+ get subscriptions(): Record<SbElement, RuntimeSyncComposite | null>;
387
+ }
388
+ //#endregion
389
+ //#region src/edit-mode/edit-store.d.ts
390
+ declare global {
391
+ interface Window {
392
+ _SB_ENABLE_SESSION_RECORDING?: boolean;
393
+ __SUPERBLOCKS_EDITOR_HOOK__: InstanceType<typeof EditStore>;
394
+ }
395
+ }
396
+ declare class EditStore {
397
+ ui: UIStore;
398
+ operationManager: OperationManager;
399
+ propertiesPanelManager: PropertiesPanelManager;
400
+ runtimeTrackingStore: RuntimeTrackingStore;
401
+ connectionManager: ConnectionManager;
402
+ ai: AiManager;
403
+ runtimeSubscriptionsStore: RuntimeSubscriptionsStore;
404
+ isInitialized: boolean;
405
+ recordingInitialized: boolean;
406
+ interactionMode: InteractionMode;
407
+ lastInteractionMode: InteractionMode;
408
+ isDesignModeLocked: boolean;
409
+ designModeDisabled: boolean;
410
+ private viteMessageListeners;
411
+ constructor(rootStore: RootStore);
412
+ setIsInitialized(isInitialized: boolean): void;
413
+ setDesignModeDisabled(disabled: boolean): void;
414
+ setInteractionMode(mode: InteractionMode, notifyEditor?: boolean): void;
415
+ setDesignModeLocked(locked: boolean): void;
416
+ onViteMessage<T extends ViteMessageKind, Message extends Extract<ViteMessage, {
417
+ kind: T;
418
+ }>>(kind: T, callback: (message: Message) => void): () => void;
419
+ triggerViteMessage<T extends ViteMessageKind, Message extends Extract<ViteMessage, {
420
+ kind: T;
421
+ }>>(kind: T, message: Message): void;
422
+ startRecording(recording: {
423
+ userId: string;
424
+ appId: string;
425
+ sessionRecordingKey: string;
426
+ }): void;
427
+ }
428
+ //#endregion
429
+ //#region src/lib/internal-details/lib/types.d.ts
430
+ type ExecutionError = {
431
+ name?: string;
432
+ message: string;
433
+ formPath: string;
434
+ blockPath: string;
435
+ handled?: boolean;
436
+ };
437
+ type ExecutionEventRequest = {
438
+ summary: string;
439
+ metadata: {
440
+ placeHoldersInfo?: Record<string, PlaceholderInfo>;
441
+ };
442
+ };
443
+ type Resolutions = Record<string,
444
+ // name of the field: eg: "range", for the range field let's say the code is {{[1,2,3]}}
445
+ {
446
+ value: any;
447
+ bindings: any[];
448
+ }>;
449
+ type ExecutionEvent = {
450
+ name: string;
451
+ type: string;
452
+ timestamp: string;
453
+ start?: Record<string, unknown>;
454
+ end?: {
455
+ performance?: {
456
+ start: string | number;
457
+ finish: string | number;
458
+ total: string | number;
459
+ execution: string | number;
460
+ overhead: string | number;
461
+ };
462
+ error?: ExecutionError;
463
+ output?: {
464
+ result?: any;
465
+ request?: string;
466
+ requestV2?: ExecutionEventRequest;
467
+ stdout?: Array<string>;
468
+ stderr?: Array<string>;
469
+ };
470
+ resolved?: Resolutions;
471
+ };
472
+ parent: string;
473
+ };
474
+ interface StreamEvent {
475
+ result: {
476
+ event: ExecutionEvent;
477
+ execution: string;
478
+ };
479
+ }
480
+ type RouteInfo = Omit<UrlState, "host" | "hostname" | "href" | "port" | "protocol">;
481
+ /**
482
+ * Schema representation for SDK API input/output/chunk schemas.
483
+ * Contains both TypeScript and JSON Schema formats for display in the UI.
484
+ */
485
+ interface SdkApiSchemaInfo {
486
+ /** TypeScript type string representation, e.g., "{ userId: string; limit?: number }" */
487
+ typescript: string;
488
+ /** JSON Schema representation for the schema */
489
+ jsonSchema: object;
490
+ }
491
+ /**
492
+ * Metadata for an SDK API, sent from the library to ui-code-mode
493
+ * when an SDK API is registered.
494
+ */
495
+ interface SdkApiMetadata {
496
+ /** Unique name of the API */
497
+ name: string;
498
+ /** Plain-language summary of what this API does */
499
+ description?: string;
500
+ /** Input schema information */
501
+ inputSchema: SdkApiSchemaInfo;
502
+ /** Output schema information (for non-streaming APIs) */
503
+ outputSchema?: SdkApiSchemaInfo;
504
+ /** Chunk schema information (for streaming APIs) */
505
+ chunkSchema?: SdkApiSchemaInfo;
506
+ /** Whether this is a streaming API */
168
507
  isStreaming: boolean;
169
508
  /** Declared integrations for this API */
170
509
  integrations: Array<{
@@ -671,481 +1010,148 @@ type FromChildToParentMessageTypesMap = {
671
1010
  "sdk-api-execution-started": {
672
1011
  executionId: string;
673
1012
  apiName: string;
674
- input: Record<string, unknown>;
675
- };
676
- /**
677
- * Notify the parent when an SDK API execution completes successfully.
678
- */
679
- "sdk-api-execution-completed": {
680
- executionId: string;
681
- apiName: string;
682
- output: unknown;
683
- durationMs: number;
684
- diagnostics?: unknown[];
685
- };
686
- /**
687
- * Notify the parent when an SDK API execution fails.
688
- */
689
- "sdk-api-execution-failed": {
690
- executionId: string;
691
- apiName: string;
692
- error: {
693
- code: string;
694
- message: string;
695
- };
696
- durationMs: number;
697
- diagnostics?: unknown[];
698
- };
699
- } & AppToEditorMessage<PropertiesPanelDefinition$1>;
700
- type FromChildToParentMessageTypes = keyof FromChildToParentMessageTypesMap;
701
- //#endregion
702
- //#region src/lib/internal-details/location-store.d.ts
703
- declare class LocationStore {
704
- route?: RouteInfo;
705
- rootStore: RootStore;
706
- constructor(rootStore: RootStore);
707
- updateLocation(location: Location, routes: DataRouter["routes"], params: Readonly<Params<string>>): void;
708
- sendLocationToEditor(): void;
709
- private matchesToRoutePattern;
710
- locationToRouteInfo(location: Location, routes: DataRouter["routes"], params: Readonly<Params<string>>): RouteInfo | undefined;
711
- }
712
- //#endregion
713
- //#region src/lib/internal-details/lib/features/api-store.d.ts
714
- type ApiResult<T = any> = {
715
- data?: T;
716
- error?: string;
717
- };
718
- declare class ApiManager {
719
- readonly rootStore: RootStore;
720
- /**
721
- * Pre-filtered agent URLs for the current profile, sent by the parent.
722
- * Used as fallback for cloud orgs where URLs come from
723
- * SUPERBLOCKS_UI_AGENT_BASE_URL rather than agent metadata.
724
- */
725
- private _agentUrls;
726
- /**
727
- * Full on-premise agent metadata (all profiles) from the parent,
728
- * enabling local profile-based filtering without a postMessage
729
- * round-trip. Empty for cloud orgs.
730
- */
731
- private _agents;
732
- /**
733
- * DP routing config mapping profile keys to DP URLs, sent by the parent.
734
- * Only populated when dataPlaneGatewayEnabled is true.
735
- */
736
- private _dpRoutingConfig;
737
- private token;
738
- private accessToken;
739
- private runningApiControllers;
740
- private waitForInitApiPromise;
741
- private waitForBootstrapPromise;
742
- private resolveBootstrapPromise;
743
- private callContexts;
744
- constructor(rootStore: RootStore);
745
- set agentUrls(urls: string[]);
746
- set agents(agents: AgentInfo[]);
747
- set dpRoutingConfig(config: Record<string, string>);
748
- setTokens(token: string, accessToken: string): void;
749
- isInitialized(): boolean;
750
- /**
751
- * Get agent URLs for the given profile by filtering locally stored
752
- * agent metadata. Falls back to the pre-filtered `_agentUrls` when
753
- * no full agent metadata is available (cloud orgs or legacy parents).
754
- */
755
- private getAgentUrlsForProfile;
756
- /**
757
- * Selects a random agent URL from the available agents and returns it normalized
758
- * (with trailing slash) to ensure proper URL path joining.
759
- */
760
- private getRandomAgentBaseUrl;
761
- private awaitInitApiIfNeeded;
762
- private awaitBootstrapIfNeeded;
763
- notifyBootstrapComplete(): void;
764
- loadApiManifest({
765
- apis
766
- }: {
767
- apis?: Record<string, {
768
- api: DeleteMeLibraryApi;
769
- scopeId: string;
770
- }>;
771
- }): void;
772
- rerunApiByCallId(callId: string): Promise<ApiResult>;
773
- runApiByPath({
774
- path,
775
- inputs,
776
- callId,
777
- callback,
778
- isTestRun,
779
- injectedCallerId
780
- }: {
781
- path: string;
782
- inputs: SbApiRunOptions;
783
- callId?: string;
784
- callback?: () => Promise<unknown>;
785
- isTestRun?: boolean;
786
- injectedCallerId?: string;
787
- }): Promise<ApiResult>;
788
- private getHMRCallHash;
789
- private getCachedHMRExecution;
790
- private executeApi;
791
- private executeApiInternal;
792
- private findError;
793
- private extractStatusCode;
794
- /**
795
- * Extract step-level logs from execution events.
796
- * Captures console.log (stdout), console.error (stderr), output, and errors for each step.
797
- */
798
- private extractStepLogs;
799
- /**
800
- * Execute an SDK API directly via the orchestrator's v3/execute endpoint.
801
- * Reads execution context (profile, branch, tokens) from rootStore so the
802
- * caller doesn't need to resolve them through the parent frame.
803
- */
804
- executeSdkApiV3(apiName: string, inputs: Record<string, unknown>, options?: {
805
- signal?: AbortSignal;
806
- }): Promise<{
807
- success: boolean;
808
- output?: unknown;
809
- error?: {
810
- code: string;
811
- message: string;
812
- };
813
- diagnostics?: unknown[];
814
- }>;
815
- cancelApi(apiName: string, _scopeId?: string): Promise<void>;
816
- }
817
- //#endregion
818
- //#region src/edit-mode/runtime-graph/types.d.ts
819
- type ComponentNode = {
820
- selectorId: SbSelector;
821
- sourceId: SbElement;
822
- type: any;
823
- isSbComponent: boolean;
824
- isHtmlElement: boolean;
825
- noSelect?: boolean;
826
- props?: Record<string, unknown>;
827
- firstRenderedTag: SbSelector | undefined;
828
- nearestSelectableAncestor: SbSelector | undefined;
829
- displayName: string;
830
- };
831
- //#endregion
832
- //#region src/edit-mode/features/runtime-tracking-store.d.ts
833
- declare class RuntimeTrackingStore {
834
- readonly editStore: EditStore | undefined;
835
- constructor(editStore: EditStore | undefined);
836
- private graph;
837
- private jsxNodes;
838
- private sourceNodes;
839
- private disabledComponents;
840
- registerComponent(selectorId: SbSelector, params: {
841
- sourceId: SbElement;
842
- type: any;
843
- parentSelectorId?: SbSelector;
844
- isSbComponent: boolean;
845
- isHtmlElement: boolean;
846
- noSelect?: boolean;
847
- }): void;
848
- getDisplayName(selectorId: SbSelector): string;
849
- unregisterComponent(selectorId: SbSelector): void;
850
- getFirstAnchorableTag(selectorId: SbSelector): SbSelector | undefined;
851
- getNearestSelectableAncestor(selectorId: SbSelector, skipSelf?: boolean): SbSelector | undefined;
852
- updatePropsForComponent(selectorId: SbSelector, props: Record<string, unknown>): void;
853
- getComponent(selectorId: SbSelector): ComponentNode | undefined;
854
- getComponentParent(selectorId: SbSelector): SbSelector;
855
- getComponentChildren(selectorId: SbSelector): SbSelector[];
856
- getSelectorIdsForSourceId(sourceId: SbElement): Set<SbSelector>;
857
- getSourceId(selectorId: SbSelector): SbElement | undefined;
858
- getClosestAncestorByType(selectorId: SbSelector, type: string): SbSelector | undefined;
859
- hasRenderedNodes(): boolean;
860
- getDisabledComponents(): SbSelector[];
861
- /**
862
- * Given a selectorId that represents a DOM element, walks up the component tree
863
- * to find the outermost registered component whose firstRenderedTag matches this selectorId.
864
- * This is used to select the component when clicking on its root DOM element.
865
- *
866
- * IMPORTANT: This only returns a component if the anchorSelectorId is the IMMEDIATE parent
867
- * of the component (i.e., the component doesn't have any intermediate nodes between itself
868
- * and the anchor). This prevents inner HTML elements from being treated as component roots.
869
- *
870
- * ONLY returns registered components (isSbComponent: true). Unregistered wrapper components
871
- * are treated as transparent and skipped.
872
- *
873
- * Returns undefined if no registered component has this as its firstRenderedTag.
874
- */
875
- getOutermostComponentForFirstRenderedTag(anchorSelectorId: SbSelector): SbSelector | undefined;
876
- }
877
- //#endregion
878
- //#region src/edit-mode/features/ai-store.d.ts
879
- declare class AiManager {
880
- private readonly runtimeTrackingStore;
881
- private _isTaggingEnabled;
882
- private _isEditing;
883
- private _editingComponents;
884
- private _contextMode;
885
- private _targetedComponents;
886
- private _targetedSelectors;
887
- private _hasHadSuccessfulBuild;
888
- private _hasEverHadSuccessfulBuild;
889
- constructor(runtimeTrackingStore: RuntimeTrackingStore);
890
- getIsTaggingEnabled(): boolean;
891
- getIsEditing(): boolean;
892
- getShouldShowLoader(): boolean;
893
- setIsTaggingEnabled(isTaggingEnabled: boolean): void;
894
- getAiContextMode(): AiContextMode;
895
- shouldToggleComponentInAiContext(): boolean;
896
- getTargetedComponents(): `SB-${string}`[];
897
- getTargetedSelectors(): `S-${string}`[];
898
- isEditingComponent(id: SbElement): boolean;
899
- isTargetingComponent(id: SbElement): boolean;
900
- startEditing(): void;
901
- setEditingComponents(components: SbElement[]): void;
902
- finishEditing(): void;
903
- setAiContextMode(mode: AiContextMode, components?: {
904
- id: SbElement;
905
- selectorId?: SbSelector;
906
- }[]): void;
907
- addTargetedSelector(selectorId: SbSelector): void;
908
- toggleTargetedSelector(selectorId: SbSelector): void;
909
- isTargetedSelector(selectorId: SbSelector): boolean;
910
- /**
911
- * Returns true if we are targeting a different selector of the same source id, since in some cases we want to keep
912
- * the same source targeted, but just highlight another selector of it
913
- */
914
- isAlternateSourceIdTarget(sourceId: SbElement, selectorId: SbSelector): boolean;
915
- handleRuntimeError(data: RuntimeErrorData): void;
916
- clearRuntimeError(id: string): void;
917
- markFirstBuildSuccess(): void;
918
- private notifyLoaderState;
919
- private removeAllSharedSelectors;
920
- private removeAllSelectorsForSource;
921
- }
922
- //#endregion
923
- //#region src/edit-mode/features/connection-manager.d.ts
924
- type ConnectionStatus = "pre-init" | "disconnected" | "connecting" | "connected";
925
- declare class ConnectionManager {
926
- connectionStatus: ConnectionStatus;
927
- constructor();
928
- initializeSocket(): void;
929
- connect(): void;
930
- disconnect(): void;
931
- }
932
- //#endregion
933
- //#region src/edit-mode/features/operation-store.d.ts
934
- type OptimisticOperation<P> = {
935
- type: keyof EditOperations;
936
- payload: P;
937
- id: string;
938
- callback?: () => void;
939
- };
940
- type ReparentTransaction = OptimisticOperation<ReparentRequest>;
941
- type SetPropertiesTransaction = OptimisticOperation<SetPropertiesRequest>;
942
- type SetPropertyTransaction = OptimisticOperation<SetPropertyRequest>;
943
- type CreateComponentTransaction = OptimisticOperation<CreateRequest>;
944
- type DeleteComponentsTransaction = OptimisticOperation<DeleteRequest>;
945
- type PendingTransaction = ReparentTransaction | SetPropertiesTransaction | SetPropertyTransaction | CreateComponentTransaction | DeleteComponentsTransaction;
946
- declare class OperationManager {
947
- private pendingTransactions;
948
- private waitingForBatch;
949
- private batchOperations;
950
- private batchOperationTransactionId;
951
- visibleSourceIds: string[];
952
- constructor();
953
- get allPendingTransactions(): PendingTransaction[];
954
- get pendingDeleteOperations(): DeleteComponentsTransaction[];
955
- get pendingSetPropertiesOperations(): SetPropertiesTransaction[];
956
- get hasPendingOperations(): boolean;
957
- get allNames(): never[];
958
- private executeOrAddToBatch;
959
- private addPendingTransaction;
960
- clearPendingTransactions(transactionIds: string[]): void;
961
- batchUpdate(performOperations: () => void): void;
962
- createComponent(payload: CreateRequest): void;
963
- dropComponent(action: {
964
- from: {
965
- source: SourceLocation;
966
- };
967
- to: {
968
- source: SourceLocation;
969
- };
970
- propsToChange?: Record<string, PropertyInfo>;
971
- }): void;
972
- deleteComponents(sourceIds: SbElement[]): void;
973
- acknowledgeEditOperation(operation: EditOperationPayload<EditOperationType>): void;
974
- writeRuntimeProperties(sourceId: SbElement, transactionId: string, updates: Record<string, PropertyInfo<unknown>>): void;
975
- setWidgetProperties({
976
- sourceId,
977
- properties,
978
- callback
979
- }: {
980
- sourceId: SbElement;
981
- properties: Record<string, PropertyInfo<unknown>>;
982
- callback?: () => void;
983
- }): void;
984
- setWidgetProperty({
985
- sourceId,
986
- property,
987
- value,
988
- callback
989
- }: {
990
- sourceId: SbElement;
991
- property: string;
992
- value: PropertyInfo<unknown>;
993
- callback?: () => void;
994
- }): void;
995
- ensureFilesSynced(): Promise<void>;
996
- generateSourceId(): `SB-${string}`;
997
- }
998
- //#endregion
999
- //#region src/edit-mode/features/properties-panel-manager.d.ts
1000
- declare class PropertiesPanelManager {
1001
- readonly editStore: EditStore;
1002
- readonly componentsManager: ComponentRegistry;
1003
- private propertiesDefinitions;
1004
- private propertiesPanelTrackerDisposer;
1005
- private _propertyLookupCache;
1006
- private removeHotReloadListener;
1007
- constructor(editStore: EditStore, componentsManager: ComponentRegistry);
1008
- getPropertiesPanel(selectorId: SbSelector): PropertiesPanelDefinition$1;
1009
- trackPropertiesPanel(selectorId: SbSelector): void;
1010
- untrackPropertiesPanel(): void;
1011
- getPropertiesDefinition(type: string): PropertiesDefinition | undefined;
1012
- setPropertiesDefinition(widgetType: string, propertiesDefinition: PropertiesDefinition): void;
1013
- updatePropertiesDefinitionForType(type: string): void;
1014
- computeAndApplySideEffectsForPropertyUpdate(payload: {
1015
- sourceId: SbElement;
1016
- updates: Record<string, PropertyInfo<unknown>>;
1017
- }): Record<SbElement, Record<string, PropertyInfo<unknown>>>;
1018
- /**
1019
- * When a custom component's source code is updated, we want to update the properties definition for that component.
1020
- * In order to do that, we need to listen to vite's hot reload events. We can't put import.meta.hot calls in the library
1021
- * because Vite just compiled all of those out in library builds, so we inject a listener from the plugin instead.
1022
- * https://github.com/vitejs/vite/blob/v6.2/packages/vite/src/node/plugins/define.ts#L37
1013
+ input: Record<string, unknown>;
1014
+ };
1015
+ /**
1016
+ * Notify the parent when an SDK API execution completes successfully.
1023
1017
  */
1024
- private attachHotReloadListener;
1025
- }
1026
- //#endregion
1027
- //#region src/edit-mode/features/resizing-store.d.ts
1028
- type ResizeState = {
1029
- selectorId: SbSelector;
1030
- sourceId: SbElement;
1031
- dragStartX: number;
1032
- dragStartY: number;
1033
- start: {
1034
- width: number;
1035
- height: number;
1018
+ "sdk-api-execution-completed": {
1019
+ executionId: string;
1020
+ apiName: string;
1021
+ output: unknown;
1022
+ durationMs: number;
1023
+ diagnostics?: unknown[];
1036
1024
  };
1037
- resizedPosition: string;
1038
- widthToUpdate: Dim | null;
1039
- heightToUpdate: Dim | null;
1040
- isApplyingResize: boolean;
1041
- };
1042
- declare class ResizingManager {
1043
- private root;
1044
- private _activeResizes;
1045
- constructor(root: RootStore);
1046
- get activeResize(): ResizeState | null | undefined;
1047
- private isLockedAspectRatio;
1048
- startResizing(dragStartX: number, dragStartY: number, selectorId: SbSelector, position: string): void;
1049
- private calculateDimension;
1050
- private handleResizeDimension;
1051
- resizeWidget(currentX: number, currentY: number, selectorId: SbSelector, canResizeWidth: boolean, canResizeHeight: boolean): void;
1052
- pendingResize(sourceId: SbElement): {
1053
- width: Dim | null;
1054
- height: Dim | null;
1055
- } | null;
1056
- get hasAnyPendingResize(): boolean;
1057
- get pendingResizes(): ResizeState[];
1058
- applyResize(selectorId: SbSelector): void;
1059
- }
1060
- //#endregion
1061
- //#region src/edit-mode/features/ui-store.d.ts
1062
- declare class UIStore {
1063
- readonly root: RootStore;
1064
- readonly editStore: EditStore;
1065
- resizing: ResizingManager;
1066
- private _selectedSourceIds;
1067
- private _selectedSelectorIds;
1068
- private _focusedSelectorId;
1069
- private _rootInstanceData;
1070
- private newComponentSelectPromise;
1071
- constructor(root: RootStore, editStore: EditStore);
1072
- getMostRelevantSelectorIdsForSourceId(sourceId: SbElement): SbSelector[];
1073
- isSourceSelected(sourceId: SbElement): boolean;
1074
- getSelectedSourceIds(): SbElement[];
1075
- getSelectedSelectorIds(): SbSelector[];
1076
- private get focusedSelectorId();
1077
- getFocusedSourceId(): SbElement | null;
1078
- getFocusedSelectorId(): SbSelector | null;
1079
- setSelectedSourceIds(sourceIds: SbElement[]): void;
1080
- private subscribeNewSourceIdsToRuntimeSync;
1081
- setSelectedSelectorIds(selectorIds: SbSelector[]): void;
1082
- setFocusedIds(selectorId: SbSelector | null): void;
1083
- selectWidget(selectorId: SbSelector | null, _addToSelection?: boolean): void;
1084
1025
  /**
1085
- * This is cursed because component selection actually needs to be done by instance ids, but
1086
- * instance IDs are only guaranteed to be stable after the component is rendered, while source IDs
1087
- * are assigned by the source tracker.
1088
- *
1089
- * If _any_ other selection comes in before we select something, we will cancel this reaction
1026
+ * Notify the parent when an SDK API execution fails.
1090
1027
  */
1091
- selectNewComponentBySourceId(sourceId: SbElement, selectorIdsToIgnore?: Set<`S-${string}`>): Promise<void>;
1092
- }
1028
+ "sdk-api-execution-failed": {
1029
+ executionId: string;
1030
+ apiName: string;
1031
+ error: {
1032
+ code: string;
1033
+ message: string;
1034
+ };
1035
+ durationMs: number;
1036
+ diagnostics?: unknown[];
1037
+ };
1038
+ } & AppToEditorMessage<PropertiesPanelDefinition$1>;
1039
+ type FromChildToParentMessageTypes = keyof FromChildToParentMessageTypesMap;
1093
1040
  //#endregion
1094
- //#region src/edit-mode/runtime-sync/runtime-subscriptions-store.d.ts
1095
- /**
1096
- * MobX store that manages runtime component subscriptions.
1097
- * Tracks which components are subscribed and builds fresh composites on-demand.
1098
- * The subscriptions getter allows startEditorSync reactions to track deep observables
1099
- * from buildComposite, eliminating the need for manual reaction management.
1100
- */
1101
- declare class RuntimeSubscriptionsStore {
1102
- readonly editStore: EditStore;
1103
- private subscribedSourceIds;
1104
- constructor(editStore: EditStore);
1105
- subscribe(sourceId: SbElement): void;
1106
- unsubscribe(sourceId: SbElement): void;
1107
- clearAll(): void;
1108
- get subscriptions(): Record<SbElement, RuntimeSyncComposite | null>;
1041
+ //#region src/lib/internal-details/location-store.d.ts
1042
+ declare class LocationStore {
1043
+ route?: RouteInfo;
1044
+ rootStore: RootStore;
1045
+ constructor(rootStore: RootStore);
1046
+ updateLocation(location: Location, routes: DataRouter["routes"], params: Readonly<Params<string>>): void;
1047
+ sendLocationToEditor(): void;
1048
+ private matchesToRoutePattern;
1049
+ locationToRouteInfo(location: Location, routes: DataRouter["routes"], params: Readonly<Params<string>>): RouteInfo | undefined;
1109
1050
  }
1110
1051
  //#endregion
1111
- //#region src/edit-mode/edit-store.d.ts
1112
- declare global {
1113
- interface Window {
1114
- _SB_ENABLE_SESSION_RECORDING?: boolean;
1115
- __SUPERBLOCKS_EDITOR_HOOK__: InstanceType<typeof EditStore>;
1116
- }
1117
- }
1118
- declare class EditStore {
1119
- ui: UIStore;
1120
- operationManager: OperationManager;
1121
- propertiesPanelManager: PropertiesPanelManager;
1122
- runtimeTrackingStore: RuntimeTrackingStore;
1123
- connectionManager: ConnectionManager;
1124
- ai: AiManager;
1125
- runtimeSubscriptionsStore: RuntimeSubscriptionsStore;
1126
- isInitialized: boolean;
1127
- recordingInitialized: boolean;
1128
- interactionMode: InteractionMode;
1129
- lastInteractionMode: InteractionMode;
1130
- isDesignModeLocked: boolean;
1131
- designModeDisabled: boolean;
1132
- private viteMessageListeners;
1052
+ //#region src/lib/internal-details/lib/features/api-store.d.ts
1053
+ type ApiResult<T = any> = {
1054
+ data?: T;
1055
+ error?: string;
1056
+ };
1057
+ declare class ApiManager {
1058
+ readonly rootStore: RootStore;
1059
+ /**
1060
+ * Pre-filtered agent URLs for the current profile, sent by the parent.
1061
+ * Used as fallback for cloud orgs where URLs come from
1062
+ * SUPERBLOCKS_UI_AGENT_BASE_URL rather than agent metadata.
1063
+ */
1064
+ private _agentUrls;
1065
+ /**
1066
+ * Full on-premise agent metadata (all profiles) from the parent,
1067
+ * enabling local profile-based filtering without a postMessage
1068
+ * round-trip. Empty for cloud orgs.
1069
+ */
1070
+ private _agents;
1071
+ /**
1072
+ * DP routing config mapping profile keys to DP URLs, sent by the parent.
1073
+ * Only populated when dataPlaneGatewayEnabled is true.
1074
+ */
1075
+ private _dpRoutingConfig;
1076
+ private token;
1077
+ private accessToken;
1078
+ private runningApiControllers;
1079
+ private waitForInitApiPromise;
1080
+ private waitForBootstrapPromise;
1081
+ private resolveBootstrapPromise;
1082
+ private callContexts;
1133
1083
  constructor(rootStore: RootStore);
1134
- setIsInitialized(isInitialized: boolean): void;
1135
- setDesignModeDisabled(disabled: boolean): void;
1136
- setInteractionMode(mode: InteractionMode, notifyEditor?: boolean): void;
1137
- setDesignModeLocked(locked: boolean): void;
1138
- onViteMessage<T extends ViteMessageKind, Message extends Extract<ViteMessage, {
1139
- kind: T;
1140
- }>>(kind: T, callback: (message: Message) => void): () => void;
1141
- triggerViteMessage<T extends ViteMessageKind, Message extends Extract<ViteMessage, {
1142
- kind: T;
1143
- }>>(kind: T, message: Message): void;
1144
- startRecording(recording: {
1145
- userId: string;
1146
- appId: string;
1147
- sessionRecordingKey: string;
1084
+ set agentUrls(urls: string[]);
1085
+ set agents(agents: AgentInfo[]);
1086
+ set dpRoutingConfig(config: Record<string, string>);
1087
+ setTokens(token: string, accessToken: string): void;
1088
+ isInitialized(): boolean;
1089
+ /**
1090
+ * Get agent URLs for the given profile by filtering locally stored
1091
+ * agent metadata. Falls back to the pre-filtered `_agentUrls` when
1092
+ * no full agent metadata is available (cloud orgs or legacy parents).
1093
+ */
1094
+ private getAgentUrlsForProfile;
1095
+ /**
1096
+ * Selects a random agent URL from the available agents and returns it normalized
1097
+ * (with trailing slash) to ensure proper URL path joining.
1098
+ */
1099
+ private getRandomAgentBaseUrl;
1100
+ private awaitInitApiIfNeeded;
1101
+ private awaitBootstrapIfNeeded;
1102
+ notifyBootstrapComplete(): void;
1103
+ loadApiManifest({
1104
+ apis
1105
+ }: {
1106
+ apis?: Record<string, {
1107
+ api: DeleteMeLibraryApi;
1108
+ scopeId: string;
1109
+ }>;
1148
1110
  }): void;
1111
+ rerunApiByCallId(callId: string): Promise<ApiResult>;
1112
+ runApiByPath({
1113
+ path,
1114
+ inputs,
1115
+ callId,
1116
+ callback,
1117
+ isTestRun,
1118
+ injectedCallerId
1119
+ }: {
1120
+ path: string;
1121
+ inputs: SbApiRunOptions;
1122
+ callId?: string;
1123
+ callback?: () => Promise<unknown>;
1124
+ isTestRun?: boolean;
1125
+ injectedCallerId?: string;
1126
+ }): Promise<ApiResult>;
1127
+ private getHMRCallHash;
1128
+ private getCachedHMRExecution;
1129
+ private executeApi;
1130
+ private executeApiInternal;
1131
+ private findError;
1132
+ private extractStatusCode;
1133
+ /**
1134
+ * Extract step-level logs from execution events.
1135
+ * Captures console.log (stdout), console.error (stderr), output, and errors for each step.
1136
+ */
1137
+ private extractStepLogs;
1138
+ /**
1139
+ * Execute an SDK API directly via the orchestrator's v3/execute endpoint.
1140
+ * Reads execution context (profile, branch, tokens) from rootStore so the
1141
+ * caller doesn't need to resolve them through the parent frame.
1142
+ */
1143
+ executeSdkApiV3(apiName: string, inputs: Record<string, unknown>, options?: {
1144
+ signal?: AbortSignal;
1145
+ }): Promise<{
1146
+ success: boolean;
1147
+ output?: unknown;
1148
+ error?: {
1149
+ code: string;
1150
+ message: string;
1151
+ };
1152
+ diagnostics?: unknown[];
1153
+ }>;
1154
+ cancelApi(apiName: string, _scopeId?: string): Promise<void>;
1149
1155
  }
1150
1156
  //#endregion
1151
1157
  //#region src/lib/internal-details/lib/root-store.d.ts
@@ -1393,12 +1399,6 @@ type SbComponentProps<El = HTMLElement> = {
1393
1399
  loading?: boolean;
1394
1400
  } & Omit<React.HTMLAttributes<El>, "height" | "width">;
1395
1401
  //#endregion
1396
- //#region src/lib/internal-details/lib/evaluator/entity-types.d.ts
1397
- type SingleInputProp<T = EntityOutputProp, ARGS extends any[] = any[]> = T extends Callback ? Callback<ARGS> : T;
1398
- type NestedInputProp<T, ARGS extends any[] = any[]> = T extends object ? { [K in keyof T]: SingleInputProp<T[K], ARGS> | NestedInputProp<T[K], ARGS> } : never;
1399
- type InputProp<T = EntityOutputProp, ARGS extends any[] = any[]> = SingleInputProp<T, ARGS> | NestedInputProp<T, ARGS>;
1400
- type EntityFunction<ARGS extends any[] = any[], R = EntityOutputProp> = (this: Entity, ...ARGS: ARGS) => R;
1401
- //#endregion
1402
1402
  //#region src/lib/user-facing/properties-panel/props-builder.d.ts
1403
1403
  type Exact<T, Shape> = T extends Shape ? Exclude<keyof T, keyof Shape> extends never ? T : never : never;
1404
1404
  type ManagedProp<T extends DataType = DataType> = PropertyForData<T> & {