@molecule/app-ide-panel-logic 0.0.0-stage → 0.0.1-stage
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/LICENSE +202 -0
- package/README.md +2925 -2
- package/dist/chatTimelineOrdering.d.ts +50 -0
- package/dist/chatTimelineOrdering.d.ts.map +1 -0
- package/dist/chatTimelineOrdering.js +46 -0
- package/dist/chatTimelineOrdering.js.map +1 -0
- package/dist/command-metadata.d.ts +117 -0
- package/dist/command-metadata.d.ts.map +1 -0
- package/dist/command-metadata.js +271 -0
- package/dist/command-metadata.js.map +1 -0
- package/dist/components/activity-utilities.d.ts +107 -0
- package/dist/components/activity-utilities.d.ts.map +1 -0
- package/dist/components/activity-utilities.js +154 -0
- package/dist/components/activity-utilities.js.map +1 -0
- package/dist/components/chat-autocommit-utilities.d.ts +172 -0
- package/dist/components/chat-autocommit-utilities.d.ts.map +1 -0
- package/dist/components/chat-autocommit-utilities.js +185 -0
- package/dist/components/chat-autocommit-utilities.js.map +1 -0
- package/dist/components/chat-card-style.d.ts +81 -0
- package/dist/components/chat-card-style.d.ts.map +1 -0
- package/dist/components/chat-card-style.js +78 -0
- package/dist/components/chat-card-style.js.map +1 -0
- package/dist/components/chat-commands.d.ts +17 -0
- package/dist/components/chat-commands.d.ts.map +1 -0
- package/dist/components/chat-commands.js +17 -0
- package/dist/components/chat-commands.js.map +1 -0
- package/dist/components/chat-commit-utilities.d.ts +29 -0
- package/dist/components/chat-commit-utilities.d.ts.map +1 -0
- package/dist/components/chat-commit-utilities.js +31 -0
- package/dist/components/chat-commit-utilities.js.map +1 -0
- package/dist/components/chat-cost-utilities.d.ts +62 -0
- package/dist/components/chat-cost-utilities.d.ts.map +1 -0
- package/dist/components/chat-cost-utilities.js +66 -0
- package/dist/components/chat-cost-utilities.js.map +1 -0
- package/dist/components/chat-effort-utilities.d.ts +104 -0
- package/dist/components/chat-effort-utilities.d.ts.map +1 -0
- package/dist/components/chat-effort-utilities.js +99 -0
- package/dist/components/chat-effort-utilities.js.map +1 -0
- package/dist/components/chat-help-utilities.d.ts +89 -0
- package/dist/components/chat-help-utilities.d.ts.map +1 -0
- package/dist/components/chat-help-utilities.js +131 -0
- package/dist/components/chat-help-utilities.js.map +1 -0
- package/dist/components/chat-model-mode-utilities.d.ts +169 -0
- package/dist/components/chat-model-mode-utilities.d.ts.map +1 -0
- package/dist/components/chat-model-mode-utilities.js +221 -0
- package/dist/components/chat-model-mode-utilities.js.map +1 -0
- package/dist/components/chat-models-utilities.d.ts +162 -0
- package/dist/components/chat-models-utilities.d.ts.map +1 -0
- package/dist/components/chat-models-utilities.js +302 -0
- package/dist/components/chat-models-utilities.js.map +1 -0
- package/dist/components/chat-report-utilities.d.ts +149 -0
- package/dist/components/chat-report-utilities.d.ts.map +1 -0
- package/dist/components/chat-report-utilities.js +151 -0
- package/dist/components/chat-report-utilities.js.map +1 -0
- package/dist/components/chat-scripts-utilities.d.ts +185 -0
- package/dist/components/chat-scripts-utilities.d.ts.map +1 -0
- package/dist/components/chat-scripts-utilities.js +199 -0
- package/dist/components/chat-scripts-utilities.js.map +1 -0
- package/dist/components/chat-settings-utilities.d.ts +72 -0
- package/dist/components/chat-settings-utilities.d.ts.map +1 -0
- package/dist/components/chat-settings-utilities.js +56 -0
- package/dist/components/chat-settings-utilities.js.map +1 -0
- package/dist/components/chat-share-utilities.d.ts +110 -0
- package/dist/components/chat-share-utilities.d.ts.map +1 -0
- package/dist/components/chat-share-utilities.js +90 -0
- package/dist/components/chat-share-utilities.js.map +1 -0
- package/dist/components/chat-skills-utilities.d.ts +242 -0
- package/dist/components/chat-skills-utilities.d.ts.map +1 -0
- package/dist/components/chat-skills-utilities.js +433 -0
- package/dist/components/chat-skills-utilities.js.map +1 -0
- package/dist/components/chat-stream-utilities.d.ts +74 -0
- package/dist/components/chat-stream-utilities.d.ts.map +1 -0
- package/dist/components/chat-stream-utilities.js +103 -0
- package/dist/components/chat-stream-utilities.js.map +1 -0
- package/dist/components/chat-timestamps-utilities.d.ts +123 -0
- package/dist/components/chat-timestamps-utilities.d.ts.map +1 -0
- package/dist/components/chat-timestamps-utilities.js +177 -0
- package/dist/components/chat-timestamps-utilities.js.map +1 -0
- package/dist/components/chat-tips-utilities.d.ts +108 -0
- package/dist/components/chat-tips-utilities.d.ts.map +1 -0
- package/dist/components/chat-tips-utilities.js +137 -0
- package/dist/components/chat-tips-utilities.js.map +1 -0
- package/dist/components/device-cycle.d.ts +84 -0
- package/dist/components/device-cycle.d.ts.map +1 -0
- package/dist/components/device-cycle.js +77 -0
- package/dist/components/device-cycle.js.map +1 -0
- package/dist/components/fileExplorerPersistence.d.ts +50 -0
- package/dist/components/fileExplorerPersistence.d.ts.map +1 -0
- package/dist/components/fileExplorerPersistence.js +63 -0
- package/dist/components/fileExplorerPersistence.js.map +1 -0
- package/dist/components/search-utilities.d.ts +15 -0
- package/dist/components/search-utilities.d.ts.map +1 -0
- package/dist/components/search-utilities.js +26 -0
- package/dist/components/search-utilities.js.map +1 -0
- package/dist/components/tests-bar-utilities.d.ts +106 -0
- package/dist/components/tests-bar-utilities.d.ts.map +1 -0
- package/dist/components/tests-bar-utilities.js +167 -0
- package/dist/components/tests-bar-utilities.js.map +1 -0
- package/dist/components/tests-card-utilities.d.ts +280 -0
- package/dist/components/tests-card-utilities.d.ts.map +1 -0
- package/dist/components/tests-card-utilities.js +591 -0
- package/dist/components/tests-card-utilities.js.map +1 -0
- package/dist/components/tool-call-utilities.d.ts +256 -0
- package/dist/components/tool-call-utilities.d.ts.map +1 -0
- package/dist/components/tool-call-utilities.js +1004 -0
- package/dist/components/tool-call-utilities.js.map +1 -0
- package/dist/components/user-avatar-utilities.d.ts +41 -0
- package/dist/components/user-avatar-utilities.d.ts.map +1 -0
- package/dist/components/user-avatar-utilities.js +56 -0
- package/dist/components/user-avatar-utilities.js.map +1 -0
- package/dist/components/workspace-layout-utilities.d.ts +37 -0
- package/dist/components/workspace-layout-utilities.d.ts.map +1 -0
- package/dist/components/workspace-layout-utilities.js +58 -0
- package/dist/components/workspace-layout-utilities.js.map +1 -0
- package/dist/customEventCards.d.ts +147 -0
- package/dist/customEventCards.d.ts.map +1 -0
- package/dist/customEventCards.js +36 -0
- package/dist/customEventCards.js.map +1 -0
- package/dist/icon-names.d.ts +26 -0
- package/dist/icon-names.d.ts.map +1 -0
- package/dist/icon-names.js +14 -0
- package/dist/icon-names.js.map +1 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/dist/keyboard-shortcut-utilities.d.ts +63 -0
- package/dist/keyboard-shortcut-utilities.d.ts.map +1 -0
- package/dist/keyboard-shortcut-utilities.js +100 -0
- package/dist/keyboard-shortcut-utilities.js.map +1 -0
- package/dist/panels.d.ts +26 -0
- package/dist/panels.d.ts.map +1 -0
- package/dist/panels.js +26 -0
- package/dist/panels.js.map +1 -0
- package/dist/settings-metadata.d.ts +78 -0
- package/dist/settings-metadata.d.ts.map +1 -0
- package/dist/settings-metadata.js +137 -0
- package/dist/settings-metadata.js.map +1 -0
- package/dist/types.d.ts +588 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -0
- package/dist/viewport-queries.d.ts +19 -0
- package/dist/viewport-queries.d.ts.map +1 -0
- package/dist/viewport-queries.js +19 -0
- package/dist/viewport-queries.js.map +1 -0
- package/package.json +74 -4
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,588 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework-neutral types for the IDE panels (chat, preview, file explorer,
|
|
3
|
+
* tests) — shared by every framework's IDE package. Interfaces whose members
|
|
4
|
+
* are framework render nodes stay in each framework's IDE package.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
import type { ChatMessage } from '@molecule/app-ai-chat';
|
|
9
|
+
import type { EditorTab, FixWithAIRequest } from '@molecule/app-code-editor';
|
|
10
|
+
import type { DeviceFrame } from '@molecule/app-live-preview';
|
|
11
|
+
/**
|
|
12
|
+
* Properties for chat panel.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* A non-mutating UI action the AI agent asks the IDE to perform — reload or
|
|
16
|
+
* navigate the live preview, open a file in the editor, or drive the preview's
|
|
17
|
+
* interaction bridge (`preview_ui`). Delivered via the `client_action`
|
|
18
|
+
* chat-stream event (and, for `preview_ui`, also via the host's collab socket
|
|
19
|
+
* so a mid-build tab reload can't orphan it).
|
|
20
|
+
*/
|
|
21
|
+
export interface IdeClientAction {
|
|
22
|
+
action: 'reload_preview' | 'navigate_preview' | 'open_file' | 'preview_ui';
|
|
23
|
+
/** navigate_preview: a URL path (e.g. "/dashboard"). open_file: a file path. */
|
|
24
|
+
path?: string;
|
|
25
|
+
/** preview_ui: correlates the command with its ui-result round-trip. */
|
|
26
|
+
requestId?: string;
|
|
27
|
+
/** preview_ui: the interaction the preview bridge should perform. */
|
|
28
|
+
command?: 'snapshot' | 'click' | 'fill' | 'select' | 'waitFor';
|
|
29
|
+
/** preview_ui: the `data-mol-id` of the target element (preferred). */
|
|
30
|
+
molId?: string;
|
|
31
|
+
/** preview_ui: CSS-selector fallback when no molId is available. */
|
|
32
|
+
selector?: string;
|
|
33
|
+
/** preview_ui: visible-label match for apps whose elements carry no molId. */
|
|
34
|
+
text?: string;
|
|
35
|
+
/** preview_ui: value to set for fill/select. */
|
|
36
|
+
value?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Identity of the user whose avatar or name was clicked in the chat timeline,
|
|
40
|
+
* passed to {@link ChatPanelProps.onProfileClick} so the host can open that
|
|
41
|
+
* user's profile.
|
|
42
|
+
*
|
|
43
|
+
* The identity is always the clicked MESSAGE AUTHOR's — a teammate's click
|
|
44
|
+
* carries their persisted `author` fields, never the viewer's. An author-less
|
|
45
|
+
* message (the local optimistic echo, legacy solo rows) is the signed-in user's
|
|
46
|
+
* own, so it carries {@link ChatPanelProps.currentUserId} + the viewer's avatar.
|
|
47
|
+
* The host compares `id` against the signed-in user to pick the surface: own →
|
|
48
|
+
* editable profile, someone else → view-only. A missing `id` means "the
|
|
49
|
+
* signed-in user" (author-less rows in a host that passes no `currentUserId`).
|
|
50
|
+
*/
|
|
51
|
+
export interface ChatUserIdentity {
|
|
52
|
+
/** The clicked user's stable id (a persisted `author.id`), when known. */
|
|
53
|
+
id?: string;
|
|
54
|
+
/** The clicked user's display name (a persisted `author.name`), when known. */
|
|
55
|
+
name?: string;
|
|
56
|
+
/** The clicked user's avatar value (data-URI / URL), if any. */
|
|
57
|
+
avatar?: string | null;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Which project directory a test file belongs to: the directory that OWNS the
|
|
61
|
+
* file (the nearest ancestor holding the runner's config or a `package.json`),
|
|
62
|
+
* as a path relative to the workspace root — `app`, `api`, `my-app/app`,
|
|
63
|
+
* `packages/web` — or `.` for the workspace root itself. Nothing guarantees
|
|
64
|
+
* `app/` or `api/` at the root: the executor names its project directory, so
|
|
65
|
+
* the value is a path, not an enum.
|
|
66
|
+
*/
|
|
67
|
+
export type TestWorkspace = 'app' | 'api' | '.' | (string & {});
|
|
68
|
+
/**
|
|
69
|
+
* What a test file is: an end-to-end spec driven against the LIVE PREVIEW (the
|
|
70
|
+
* `@molecule/app-e2e-preview` bond every scaffolded app carries), or a plain
|
|
71
|
+
* unit test run by the project's own runner.
|
|
72
|
+
*/
|
|
73
|
+
export type TestKind = 'e2e' | 'unit';
|
|
74
|
+
/** One test file the host discovered in the project. */
|
|
75
|
+
export interface TestItem {
|
|
76
|
+
/** Stable id, unique across workspaces — used as the row key and to select by. */
|
|
77
|
+
id: string;
|
|
78
|
+
/** Path relative to its workspace, e.g. `e2e/home.spec.ts`. */
|
|
79
|
+
file: string;
|
|
80
|
+
kind: TestKind;
|
|
81
|
+
workspace: TestWorkspace;
|
|
82
|
+
/**
|
|
83
|
+
* The group's project name, ready to render: the same path as `workspace`,
|
|
84
|
+
* or `null` for the workspace root, which has no name of its own. Hosts that
|
|
85
|
+
* omit it get the path itself (and the translated "Project" for the root).
|
|
86
|
+
*/
|
|
87
|
+
workspaceLabel?: string | null;
|
|
88
|
+
/** Human label for the row; the bar falls back to the file path without one. */
|
|
89
|
+
title?: string;
|
|
90
|
+
}
|
|
91
|
+
/** Which runner drives each kind in one workspace (`null` = none installed). */
|
|
92
|
+
export interface TestRunners {
|
|
93
|
+
e2e: string | null;
|
|
94
|
+
unit: string | null;
|
|
95
|
+
}
|
|
96
|
+
/** What {@link ChatPanelProps.listTests} resolves with. */
|
|
97
|
+
export interface TestList {
|
|
98
|
+
tests: TestItem[];
|
|
99
|
+
/**
|
|
100
|
+
* Per project directory (keyed like {@link TestItem.workspace}), the runners
|
|
101
|
+
* the host found. Only directories that hold a listed test appear.
|
|
102
|
+
*/
|
|
103
|
+
runners: Record<string, TestRunners>;
|
|
104
|
+
}
|
|
105
|
+
/** What the bar asks the host to run. */
|
|
106
|
+
export interface TestSelection {
|
|
107
|
+
/** Specific {@link TestItem.id}s. Takes precedence over `kind`. */
|
|
108
|
+
ids?: string[];
|
|
109
|
+
/** Everything of this kind when no `ids` are given. */
|
|
110
|
+
kind?: TestKind | 'all';
|
|
111
|
+
}
|
|
112
|
+
/** How one test file ended. */
|
|
113
|
+
export type TestStatus = 'passed' | 'failed' | 'skipped';
|
|
114
|
+
/**
|
|
115
|
+
* How one TEST inside a file is doing: the three verdicts a file can end with,
|
|
116
|
+
* plus `running` — the state a file never reports, because a file is only ever
|
|
117
|
+
* seen finished.
|
|
118
|
+
*/
|
|
119
|
+
export type TestCaseStatus = TestStatus | 'running';
|
|
120
|
+
/**
|
|
121
|
+
* How a whole run ended. `skipped-by-user` is a run that otherwise finished but
|
|
122
|
+
* had at least one command skipped from the card — deliberately its OWN outcome
|
|
123
|
+
* rather than `completed` plus a count, so nothing can read a run with skipped
|
|
124
|
+
* work in it as a clean pass. A real failure still wins: `error`, `timeout` and
|
|
125
|
+
* `cancelled` take precedence over it.
|
|
126
|
+
*/
|
|
127
|
+
export type TestRunOutcome = 'completed' | 'cancelled' | 'timeout' | 'error' | 'skipped-by-user';
|
|
128
|
+
/**
|
|
129
|
+
* One event from a run in progress. The host streams these to the bar (over SSE
|
|
130
|
+
* in molecule.dev) in the order the run produces them: one `start`, then
|
|
131
|
+
* interleaved `output`/`case`/`result`, then exactly one `done`.
|
|
132
|
+
*/
|
|
133
|
+
export type TestRunEvent = ({
|
|
134
|
+
type: 'start';
|
|
135
|
+
runId: string;
|
|
136
|
+
ids: string[];
|
|
137
|
+
startedAt?: string;
|
|
138
|
+
/** Who started the run — what the test view says about a run it did not start. */
|
|
139
|
+
source?: TestRunSource;
|
|
140
|
+
/**
|
|
141
|
+
* The command a run the test view did not start is running (masked by the
|
|
142
|
+
* host). An agent's own command names no test ids up front, so this is
|
|
143
|
+
* what the view can show while its results arrive.
|
|
144
|
+
*/
|
|
145
|
+
command?: string;
|
|
146
|
+
} | {
|
|
147
|
+
type: 'output';
|
|
148
|
+
id?: string;
|
|
149
|
+
stream?: 'stdout' | 'stderr';
|
|
150
|
+
chunk: string;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* One TEST within a file — the runner's own title and group, so the person
|
|
154
|
+
* watching a five-minute spec run sees WHICH test is on screen instead of a
|
|
155
|
+
* spinner. `id` is the same file id `result` uses.
|
|
156
|
+
*/
|
|
157
|
+
| {
|
|
158
|
+
type: 'case';
|
|
159
|
+
id: string;
|
|
160
|
+
title: string;
|
|
161
|
+
describe?: string;
|
|
162
|
+
status: TestCaseStatus;
|
|
163
|
+
durationMs?: number;
|
|
164
|
+
} | {
|
|
165
|
+
type: 'result';
|
|
166
|
+
id: string;
|
|
167
|
+
status: TestStatus;
|
|
168
|
+
durationMs?: number;
|
|
169
|
+
passed?: number;
|
|
170
|
+
failed?: number;
|
|
171
|
+
skipped?: number;
|
|
172
|
+
/** The runner's output for a FAILURE, which the bar keeps visible. */
|
|
173
|
+
output?: string;
|
|
174
|
+
} | {
|
|
175
|
+
type: 'done';
|
|
176
|
+
runId?: string;
|
|
177
|
+
outcome: TestRunOutcome;
|
|
178
|
+
passed?: number;
|
|
179
|
+
failed?: number;
|
|
180
|
+
skipped?: number;
|
|
181
|
+
durationMs?: number;
|
|
182
|
+
error?: string;
|
|
183
|
+
}) & {
|
|
184
|
+
/** Server order on the direct stream too; optional only for older/custom hosts. */
|
|
185
|
+
eventId?: string;
|
|
186
|
+
};
|
|
187
|
+
/**
|
|
188
|
+
* Who started a test run: the person (the Run buttons, in this tab or another),
|
|
189
|
+
* the agent (its test tool or its own shell commands), or the platform (its
|
|
190
|
+
* checks of a deploy).
|
|
191
|
+
*/
|
|
192
|
+
export type TestRunSource = 'person' | 'agent' | 'platform';
|
|
193
|
+
/**
|
|
194
|
+
* One event of the project's test-run feed: any {@link TestRunEvent}, stamped
|
|
195
|
+
* with the run it belongs to, since the feed interleaves every run in the
|
|
196
|
+
* project.
|
|
197
|
+
*/
|
|
198
|
+
export type TestRunFeedEvent = TestRunEvent & {
|
|
199
|
+
runId: string;
|
|
200
|
+
};
|
|
201
|
+
/** Handle to a run in flight, so the bar can stop it. */
|
|
202
|
+
export interface TestRunHandle {
|
|
203
|
+
/** Stop the run — the host aborts its stream, which cancels the work. */
|
|
204
|
+
cancel(): void;
|
|
205
|
+
/**
|
|
206
|
+
* Skip the command the run is on right now WITHOUT ending the run: the files
|
|
207
|
+
* that command owned come back as `result`s with `status: 'skipped'`, and the
|
|
208
|
+
* run moves to the next command.
|
|
209
|
+
*
|
|
210
|
+
* Optional, because a host may not serve it. Resolving `false` means there
|
|
211
|
+
* was nothing to skip (the run had already moved on) — a benign race the card
|
|
212
|
+
* answers by dropping the control, never by showing an error.
|
|
213
|
+
*/
|
|
214
|
+
skipCurrent?(): void | Promise<boolean | void>;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Properties for the editor panel component.
|
|
218
|
+
*/
|
|
219
|
+
export interface EditorPanelProps {
|
|
220
|
+
className?: string;
|
|
221
|
+
/**
|
|
222
|
+
* Render the editor read-only (Monaco `readOnly`) — for read-only project
|
|
223
|
+
* VIEWERS, whose file writes the server rejects anyway. Typing is blocked at
|
|
224
|
+
* the editor, so a viewer never composes an edit that cannot be saved.
|
|
225
|
+
*/
|
|
226
|
+
readOnly?: boolean;
|
|
227
|
+
/** Called whenever the active file changes (tab switch, file open, file close). */
|
|
228
|
+
onActiveFileChange?: (path: string | null) => void;
|
|
229
|
+
/** Called once after the editor is fully mounted and ready to accept files. */
|
|
230
|
+
onEditorReady?: () => void;
|
|
231
|
+
/** Called whenever the open tab list changes (file opened or closed). */
|
|
232
|
+
onTabsChange?: (paths: string[]) => void;
|
|
233
|
+
/** Maps file path to git status for coloring tab filenames. */
|
|
234
|
+
fileStatuses?: Record<string, string>;
|
|
235
|
+
/** Path of the file currently being formatted, for visual indicator. */
|
|
236
|
+
formattingFile?: string | null;
|
|
237
|
+
/** Path of the file with an active save debounce countdown. */
|
|
238
|
+
countdownFile?: string | null;
|
|
239
|
+
/** Incremented each keystroke to restart the countdown animation. */
|
|
240
|
+
countdownKey?: number;
|
|
241
|
+
/** Estimated format duration in ms (rolling average, default 2000). */
|
|
242
|
+
formatEstimate?: number;
|
|
243
|
+
/** Called when the user triggers "Fix with AI" from the editor's lightbulb or context menu. */
|
|
244
|
+
onFixWithAI?: (request: FixWithAIRequest) => void;
|
|
245
|
+
/** Override double-click on a tab. Return `true` to skip the default pin behavior. */
|
|
246
|
+
onTabDoubleClick?: (path: string) => boolean;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Why the preview could not show the running app — the failure CLASS the host hands
|
|
250
|
+
* to its AI agent so a fix can be targeted (and so the agent isn't told "it's broken"
|
|
251
|
+
* with no hint of how). Distinct from a JS error (`onPreviewError`): these are states
|
|
252
|
+
* the iframe itself can't report once it's in them.
|
|
253
|
+
*/
|
|
254
|
+
export type PreviewStuckReason = 'frozen' | 'load-failed' | 'load-timeout';
|
|
255
|
+
/**
|
|
256
|
+
* Structured report passed to {@link PreviewPanelProps.onPreviewStuck} when the preview
|
|
257
|
+
* gives up. Carries the failure class + the route it happened on so the host can compose
|
|
258
|
+
* an actionable, agent-fixable message instead of a bare "preview is stuck".
|
|
259
|
+
*/
|
|
260
|
+
export interface PreviewStuckReport {
|
|
261
|
+
/** The failure class — what left the preview unable to show the running app. */
|
|
262
|
+
reason: PreviewStuckReason;
|
|
263
|
+
/** The preview's current location (route) when the failure was detected, if known. */
|
|
264
|
+
url?: string;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* The preview's live render verdict, derived from the iframe bridges — the one preview
|
|
268
|
+
* fact the server can't observe itself (it has no browser). The host forwards it to the
|
|
269
|
+
* server so the post-loop verification won't pass a build while the app isn't actually
|
|
270
|
+
* rendering ("compiles + serves" ≠ "renders").
|
|
271
|
+
*
|
|
272
|
+
* - `rendered` — the app drew content (`molecule:ready`).
|
|
273
|
+
* - `blank` — loaded but showed nothing (gave up / `#root` empty after settling).
|
|
274
|
+
* - `frozen` — rendered then locked up (heartbeats stopped).
|
|
275
|
+
* - `loading` — still loading / not yet determined.
|
|
276
|
+
*/
|
|
277
|
+
export type PreviewRenderState = 'rendered' | 'blank' | 'frozen' | 'loading';
|
|
278
|
+
/**
|
|
279
|
+
* Properties for preview panel.
|
|
280
|
+
*/
|
|
281
|
+
/**
|
|
282
|
+
* A live-preview interaction the host asks the panel to perform inside the iframe, so an AI
|
|
283
|
+
* agent can verify a feature end-to-end by DRIVING the app the user is watching (no headless
|
|
284
|
+
* browser). The panel just relays it to the iframe's interaction bridge — generic, so it
|
|
285
|
+
* carries no host/API specifics.
|
|
286
|
+
*/
|
|
287
|
+
export interface PreviewUiCommand {
|
|
288
|
+
/** Correlates this command with its result; the host round-trips on it. */
|
|
289
|
+
id: string;
|
|
290
|
+
/** `snapshot` the interactive UI, or act on an element. */
|
|
291
|
+
action: 'snapshot' | 'click' | 'fill' | 'select' | 'waitFor';
|
|
292
|
+
/** `data-mol-id` of the target element (preferred over selector). */
|
|
293
|
+
molId?: string;
|
|
294
|
+
/** CSS-selector fallback when no molId is available. */
|
|
295
|
+
selector?: string;
|
|
296
|
+
/** Visible-label match — targets apps whose elements carry no `data-mol-id`. */
|
|
297
|
+
text?: string;
|
|
298
|
+
/** Value to set for `fill` / `select`. */
|
|
299
|
+
value?: string;
|
|
300
|
+
/**
|
|
301
|
+
* `snapshot` only — the moment the host pointed the preview at a new URL (`Date.now()`).
|
|
302
|
+
* Only a document that loaded at or after it may answer, so a navigation snapshot can never
|
|
303
|
+
* come from the OUTGOING page still sitting in the iframe. Set it ONLY when a new document
|
|
304
|
+
* is genuinely loading (the URL actually changed) — otherwise nothing can satisfy it and the
|
|
305
|
+
* command goes unanswered. Omit for a plain read.
|
|
306
|
+
*/
|
|
307
|
+
minLoadedAt?: number;
|
|
308
|
+
}
|
|
309
|
+
/** The preview interaction bridge's reply to a {@link PreviewUiCommand}. */
|
|
310
|
+
export interface PreviewUiResult {
|
|
311
|
+
ok: boolean;
|
|
312
|
+
/** Interactive-element list + url/title from the preview (present on a snapshot / success). */
|
|
313
|
+
snapshot?: unknown;
|
|
314
|
+
found?: boolean;
|
|
315
|
+
error?: string;
|
|
316
|
+
/**
|
|
317
|
+
* Failed network requests from the last ~10s (method, url, status, bounded response body),
|
|
318
|
+
* captured in-page — so a click that 4xx'd explains itself in the same result.
|
|
319
|
+
*/
|
|
320
|
+
recentNetworkErrors?: string[];
|
|
321
|
+
/**
|
|
322
|
+
* Present when the bridge gave up on a settle budget instead of observing the page settle —
|
|
323
|
+
* it names what was still pending (document parsing, an empty root, an unreached route,
|
|
324
|
+
* in-flight requests). The snapshot may be incomplete, so a race stays distinguishable from
|
|
325
|
+
* a genuinely broken page.
|
|
326
|
+
*/
|
|
327
|
+
stillSettling?: string;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Properties for tab bar.
|
|
331
|
+
*/
|
|
332
|
+
export interface TabBarProps {
|
|
333
|
+
tabs: EditorTab[];
|
|
334
|
+
activeFile: string | null;
|
|
335
|
+
onSelect: (path: string) => void;
|
|
336
|
+
onClose: (path: string) => void;
|
|
337
|
+
onDoubleClick?: (path: string) => void;
|
|
338
|
+
/** Maps file path to git status for coloring tab filenames. */
|
|
339
|
+
fileStatuses?: Record<string, string>;
|
|
340
|
+
className?: string;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Properties for file explorer.
|
|
344
|
+
*/
|
|
345
|
+
export interface FileExplorerProps {
|
|
346
|
+
/**
|
|
347
|
+
* Read-only mode (a project viewer): the context menu omits every mutating
|
|
348
|
+
* entry. Pair with omitting the mutation handlers (onRename/onDelete/…) so
|
|
349
|
+
* keyboard shortcuts and drag-moves no-op too.
|
|
350
|
+
*/
|
|
351
|
+
readOnly?: boolean;
|
|
352
|
+
files: FileNode[];
|
|
353
|
+
onFileSelect: (path: string) => void;
|
|
354
|
+
onFileDoubleClick?: (path: string) => void;
|
|
355
|
+
onDirExpand?: (path: string) => void;
|
|
356
|
+
/** Called when the user chooses "Rename" from the context menu. */
|
|
357
|
+
onRename?: (path: string) => void;
|
|
358
|
+
/** Called when the user chooses "Delete" from the context menu. */
|
|
359
|
+
onDelete?: (path: string) => void;
|
|
360
|
+
/** Called when the user deletes multiple selected files/folders via context menu or keyboard. */
|
|
361
|
+
onDeleteMultiple?: (paths: string[]) => void;
|
|
362
|
+
/** Called when the user moves files via drag-and-drop or cut+paste. */
|
|
363
|
+
onMoveFiles?: (moves: Array<{
|
|
364
|
+
oldPath: string;
|
|
365
|
+
newPath: string;
|
|
366
|
+
}>) => void;
|
|
367
|
+
/** Called when the user chooses "New File" from the context menu. */
|
|
368
|
+
onNewFile?: (dirPath: string) => void;
|
|
369
|
+
/** Called when the user chooses "New Folder" from the context menu. */
|
|
370
|
+
onNewFolder?: (dirPath: string) => void;
|
|
371
|
+
/** Called when the user chooses "Collapse All" from the context menu. */
|
|
372
|
+
onCollapseAll?: () => void;
|
|
373
|
+
className?: string;
|
|
374
|
+
/** Storage key for persisting expand/collapse state across reloads (through `@molecule/app-storage`). */
|
|
375
|
+
persistKey?: string;
|
|
376
|
+
/** Path of the currently active file — highlighted in the tree. */
|
|
377
|
+
activeFile?: string | null;
|
|
378
|
+
/** Maps file path to git status — used to color directory names by highest-priority child status. */
|
|
379
|
+
fileStatuses?: Record<string, string>;
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* File Node interface.
|
|
383
|
+
*/
|
|
384
|
+
export interface FileNode {
|
|
385
|
+
name: string;
|
|
386
|
+
path: string;
|
|
387
|
+
type: 'file' | 'directory';
|
|
388
|
+
children?: FileNode[];
|
|
389
|
+
isDimmed?: boolean;
|
|
390
|
+
gitStatus?: 'modified' | 'added' | 'deleted' | 'untracked';
|
|
391
|
+
/** If this entry is a symlink, the target it points to. */
|
|
392
|
+
symlinkTarget?: string;
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Properties for resize handle.
|
|
396
|
+
*/
|
|
397
|
+
export interface ResizeHandleProps {
|
|
398
|
+
onResize: (delta: number) => void;
|
|
399
|
+
direction?: 'horizontal' | 'vertical';
|
|
400
|
+
className?: string;
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Properties for device frame selector.
|
|
404
|
+
*/
|
|
405
|
+
export interface DeviceFrameSelectorProps {
|
|
406
|
+
current: DeviceFrame;
|
|
407
|
+
onChange: (device: DeviceFrame) => void;
|
|
408
|
+
className?: string;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Properties for tool call card.
|
|
412
|
+
*/
|
|
413
|
+
export interface ToolCallCardProps {
|
|
414
|
+
id: string;
|
|
415
|
+
name: string;
|
|
416
|
+
input?: unknown;
|
|
417
|
+
output?: unknown;
|
|
418
|
+
status: 'pending' | 'running' | 'done' | 'error';
|
|
419
|
+
/** Snapshot of original/modified file content captured at tool-call time. */
|
|
420
|
+
fileDiff?: {
|
|
421
|
+
original: string;
|
|
422
|
+
modified: string;
|
|
423
|
+
};
|
|
424
|
+
/** Externally controlled undo state — when true, the card displays as undone. */
|
|
425
|
+
isUndone?: boolean;
|
|
426
|
+
/** Called when the undo/redo button is toggled on this tool call. */
|
|
427
|
+
onUndoToggle?: (id: string, undone: boolean) => void;
|
|
428
|
+
/** Called when a filename in the card is clicked — should open the file as a preview tab. */
|
|
429
|
+
onFileOpen?: (path: string) => void;
|
|
430
|
+
/** Called when a filename in the card is double-clicked — should pin the tab. */
|
|
431
|
+
onFileDoubleClick?: (path: string) => void;
|
|
432
|
+
/** Called when a file-changing card is clicked — should open the file diff in the editor. */
|
|
433
|
+
onFileDiff?: (path: string, diff?: {
|
|
434
|
+
original: string;
|
|
435
|
+
modified: string;
|
|
436
|
+
}) => void;
|
|
437
|
+
/** Called to undo/redo a file change — writes the given content to the file path. */
|
|
438
|
+
onFileRevert?: (path: string, content: string) => Promise<void>;
|
|
439
|
+
/** Called when the user responds to an `ask_user` tool call (clicks an option or submits free text). */
|
|
440
|
+
onAskUserResponse?: (response: string) => void;
|
|
441
|
+
/**
|
|
442
|
+
* Skip this tool call while it is RUNNING, without ending the turn: the call
|
|
443
|
+
* comes back as skipped, the model is told it did not run, and the turn
|
|
444
|
+
* carries on. Omitted by a host that does not serve it — then no control is
|
|
445
|
+
* rendered at all. Resolving `false` means nothing was in flight (the call
|
|
446
|
+
* had already finished), which returns the button to its resting state rather
|
|
447
|
+
* than reporting an error.
|
|
448
|
+
*/
|
|
449
|
+
onSkip?: (id: string) => void | Promise<boolean | void>;
|
|
450
|
+
/**
|
|
451
|
+
* Why skipping is unavailable to THIS viewer, already translated by the host
|
|
452
|
+
* — `null` when it is available. The control stays visible and disabled with
|
|
453
|
+
* the reason on it, rather than vanishing without explanation.
|
|
454
|
+
*/
|
|
455
|
+
skipDisabledReason?: string | null;
|
|
456
|
+
className?: string;
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* Properties for the chat message item component.
|
|
460
|
+
*/
|
|
461
|
+
export interface ChatMessageItemProps {
|
|
462
|
+
message: ChatMessage;
|
|
463
|
+
className?: string;
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* A keyboard shortcut definition.
|
|
467
|
+
*/
|
|
468
|
+
export interface KeyboardShortcut {
|
|
469
|
+
/** Key combo string, e.g. `"mod+p"`, `"mod+shift+f"`. `mod` = Cmd (Mac) / Ctrl (others). */
|
|
470
|
+
keys: string;
|
|
471
|
+
/** Handler invoked when the shortcut fires. */
|
|
472
|
+
handler: () => void;
|
|
473
|
+
/** If true, fires even when an `<input>` / `<textarea>` is focused. */
|
|
474
|
+
allowInInput?: boolean;
|
|
475
|
+
/** If true, fires even when the Monaco editor is focused. */
|
|
476
|
+
allowInEditor?: boolean;
|
|
477
|
+
/** Human-readable label for display in the command palette. */
|
|
478
|
+
label?: string;
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* Properties for the search-in-files panel.
|
|
482
|
+
*/
|
|
483
|
+
export interface SearchPanelProps {
|
|
484
|
+
/** Project ID used for API calls. */
|
|
485
|
+
projectId: string;
|
|
486
|
+
/** Called when the user clicks a search result. */
|
|
487
|
+
onResultClick?: (path: string, line: number) => void;
|
|
488
|
+
className?: string;
|
|
489
|
+
/**
|
|
490
|
+
* The project's excluded directory names (VS Code `search.exclude`
|
|
491
|
+
* semantics). Displayed and editable in the panel; the backend applies the
|
|
492
|
+
* SAME set server-side to every search surface (panel + AI tools), so this
|
|
493
|
+
* prop is display/edit state — searches don't send it per query. When
|
|
494
|
+
* omitted, the panel shows {@link DEFAULT_SEARCH_EXCLUDED_DIRS}.
|
|
495
|
+
*/
|
|
496
|
+
excludedDirs?: string[];
|
|
497
|
+
/** Persist an edited excluded-dir set (the host owns storage). */
|
|
498
|
+
onExcludedDirsChange?: (dirs: string[]) => void;
|
|
499
|
+
/**
|
|
500
|
+
* Read-only mode (a project viewer): search stays fully usable, but the
|
|
501
|
+
* Replace toggle/inputs/buttons are hidden (bulk writes are editor work).
|
|
502
|
+
* Pair with omitting onExcludedDirsChange so exclude edits never persist.
|
|
503
|
+
*/
|
|
504
|
+
readOnly?: boolean;
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* A single file's search results.
|
|
508
|
+
*/
|
|
509
|
+
export interface SearchResult {
|
|
510
|
+
/** Relative file path. */
|
|
511
|
+
file: string;
|
|
512
|
+
/** Matching lines within the file. */
|
|
513
|
+
matches: Array<{
|
|
514
|
+
line: number;
|
|
515
|
+
content: string;
|
|
516
|
+
}>;
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* Response from the search API endpoint.
|
|
520
|
+
*/
|
|
521
|
+
export interface SearchResponse {
|
|
522
|
+
/** The search pattern used. */
|
|
523
|
+
pattern: string;
|
|
524
|
+
/** Grouped results by file. */
|
|
525
|
+
results: SearchResult[];
|
|
526
|
+
/** Total number of matches across all files. */
|
|
527
|
+
totalCount: number;
|
|
528
|
+
/** Whether results were truncated. */
|
|
529
|
+
truncated: boolean;
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* Properties for the quick-open file finder.
|
|
533
|
+
*/
|
|
534
|
+
export interface QuickOpenProps {
|
|
535
|
+
/** Project ID used for API calls. */
|
|
536
|
+
projectId: string;
|
|
537
|
+
/** Called when the user selects a file. */
|
|
538
|
+
onFileOpen: (path: string) => void;
|
|
539
|
+
/** Called when the picker is dismissed. */
|
|
540
|
+
onDismiss: () => void;
|
|
541
|
+
}
|
|
542
|
+
/**
|
|
543
|
+
* A command available in the command palette.
|
|
544
|
+
*/
|
|
545
|
+
export interface Command {
|
|
546
|
+
/** Unique identifier. */
|
|
547
|
+
id: string;
|
|
548
|
+
/** Display label. */
|
|
549
|
+
label: string;
|
|
550
|
+
/** Keyboard shortcut hint (e.g. "Cmd+P"). */
|
|
551
|
+
shortcut?: string;
|
|
552
|
+
/** Handler invoked when the command is executed. */
|
|
553
|
+
execute: () => void;
|
|
554
|
+
/** Category prefix (e.g. "View", "File"). */
|
|
555
|
+
category?: string;
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* Properties for the command palette.
|
|
559
|
+
*/
|
|
560
|
+
export interface CommandPaletteProps {
|
|
561
|
+
/** Available commands. */
|
|
562
|
+
commands: Command[];
|
|
563
|
+
/** Called when the palette is dismissed. */
|
|
564
|
+
onDismiss: () => void;
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* A shortcut entry for display in the keyboard shortcuts panel.
|
|
568
|
+
*/
|
|
569
|
+
export interface ShortcutEntry {
|
|
570
|
+
/** Human-readable label describing the action. */
|
|
571
|
+
label: string;
|
|
572
|
+
/** Display string for the key combo (e.g. "⌘P", "⌘⇧F"). */
|
|
573
|
+
keys: string;
|
|
574
|
+
/** Optional grouping category. */
|
|
575
|
+
category?: string;
|
|
576
|
+
/** Handler invoked when the row is clicked. */
|
|
577
|
+
execute?: () => void;
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* Properties for the keyboard shortcuts reference panel.
|
|
581
|
+
*/
|
|
582
|
+
export interface KeyboardShortcutsPanelProps {
|
|
583
|
+
/** List of shortcuts to display. */
|
|
584
|
+
shortcuts: ShortcutEntry[];
|
|
585
|
+
/** Called when the panel is dismissed. */
|
|
586
|
+
onDismiss: () => void;
|
|
587
|
+
}
|
|
588
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAE7D;;GAEG;AACH;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,gBAAgB,GAAG,kBAAkB,G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AAkD;IAClD,KAAK,EAAE,MAAM,CAAA;IACb,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAA;IACZ,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,oCAAoC;IACpC,SAAS,EAAE,aAAa,EAAE,CAAA;IAC1B,0CAA0C;IAC1C,SAAS,EAAE,MAAM,IAAI,CAAA;CACtB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework-neutral types for the IDE panels (chat, preview, file explorer,
|
|
3
|
+
* tests) — shared by every framework's IDE package. Interfaces whose members
|
|
4
|
+
* are framework render nodes stay in each framework's IDE package.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The media queries the IDE panels branch on for touch- and phone-aware
|
|
3
|
+
* rendering. Each framework's viewport hooks subscribe to these. Consumers
|
|
4
|
+
* (e.g. molecule.dev's Workspace) keep their own breakpoint in sync with
|
|
5
|
+
* {@link NARROW_VIEWPORT_QUERY}'s 768px threshold.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* The phone-width media query — matches viewports below 768px, mirroring the
|
|
11
|
+
* host workspace's single-pane mobile breakpoint.
|
|
12
|
+
*/
|
|
13
|
+
export declare const NARROW_VIEWPORT_QUERY = "(max-width: 767px)";
|
|
14
|
+
/**
|
|
15
|
+
* The touch-first media query — matches when the PRIMARY pointer is coarse
|
|
16
|
+
* (finger), i.e. phones/tablets, regardless of viewport width.
|
|
17
|
+
*/
|
|
18
|
+
export declare const COARSE_POINTER_QUERY = "(pointer: coarse)";
|
|
19
|
+
//# sourceMappingURL=viewport-queries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewport-queries.d.ts","sourceRoot":"","sources":["../src/viewport-queries.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;GAGG;AACH,eAAO,MAAM,qBAAqB,uBAAuB,CAAA;AAEzD;;;GAGG;AACH,eAAO,MAAM,oBAAoB,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The media queries the IDE panels branch on for touch- and phone-aware
|
|
3
|
+
* rendering. Each framework's viewport hooks subscribe to these. Consumers
|
|
4
|
+
* (e.g. molecule.dev's Workspace) keep their own breakpoint in sync with
|
|
5
|
+
* {@link NARROW_VIEWPORT_QUERY}'s 768px threshold.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* The phone-width media query — matches viewports below 768px, mirroring the
|
|
11
|
+
* host workspace's single-pane mobile breakpoint.
|
|
12
|
+
*/
|
|
13
|
+
export const NARROW_VIEWPORT_QUERY = '(max-width: 767px)';
|
|
14
|
+
/**
|
|
15
|
+
* The touch-first media query — matches when the PRIMARY pointer is coarse
|
|
16
|
+
* (finger), i.e. phones/tablets, regardless of viewport width.
|
|
17
|
+
*/
|
|
18
|
+
export const COARSE_POINTER_QUERY = '(pointer: coarse)';
|
|
19
|
+
//# sourceMappingURL=viewport-queries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewport-queries.js","sourceRoot":"","sources":["../src/viewport-queries.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,oBAAoB,CAAA;AAEzD;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,mBAAmB,CAAA"}
|