@d34dman/flowdrop 0.0.29 → 0.0.31
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/components/App.svelte +54 -6
- package/dist/components/NodeSidebar.svelte +17 -9
- package/dist/components/SchemaForm.svelte +14 -14
- package/dist/components/SchemaForm.svelte.d.ts +1 -1
- package/dist/components/WorkflowEditor.svelte +4 -0
- package/dist/components/form/FormFieldLight.svelte +66 -66
- package/dist/components/form/FormFieldLight.svelte.d.ts +1 -1
- package/dist/components/form/types.d.ts +1 -1
- package/dist/components/nodes/ToolNode.svelte +23 -8
- package/dist/components/playground/ChatPanel.svelte +523 -0
- package/dist/components/playground/ChatPanel.svelte.d.ts +20 -0
- package/dist/components/playground/ExecutionLogs.svelte +486 -0
- package/dist/components/playground/ExecutionLogs.svelte.d.ts +14 -0
- package/dist/components/playground/InputCollector.svelte +444 -0
- package/dist/components/playground/InputCollector.svelte.d.ts +16 -0
- package/dist/components/playground/MessageBubble.svelte +398 -0
- package/dist/components/playground/MessageBubble.svelte.d.ts +15 -0
- package/dist/components/playground/Playground.svelte +851 -0
- package/dist/components/playground/Playground.svelte.d.ts +25 -0
- package/dist/components/playground/SessionManager.svelte +537 -0
- package/dist/components/playground/SessionManager.svelte.d.ts +20 -0
- package/dist/config/endpoints.d.ts +16 -0
- package/dist/config/endpoints.js +9 -0
- package/dist/core/index.d.ts +25 -23
- package/dist/core/index.js +13 -12
- package/dist/display/index.d.ts +2 -2
- package/dist/display/index.js +2 -2
- package/dist/editor/index.d.ts +57 -49
- package/dist/editor/index.js +52 -42
- package/dist/form/code.d.ts +4 -4
- package/dist/form/code.js +11 -11
- package/dist/form/fieldRegistry.d.ts +2 -2
- package/dist/form/fieldRegistry.js +8 -10
- package/dist/form/full.d.ts +5 -5
- package/dist/form/full.js +7 -7
- package/dist/form/index.d.ts +16 -16
- package/dist/form/index.js +14 -14
- package/dist/form/markdown.d.ts +3 -3
- package/dist/form/markdown.js +6 -6
- package/dist/index.d.ts +6 -4
- package/dist/index.js +9 -4
- package/dist/playground/index.d.ts +92 -0
- package/dist/playground/index.js +114 -0
- package/dist/playground/mount.d.ts +183 -0
- package/dist/playground/mount.js +178 -0
- package/dist/services/playgroundService.d.ts +129 -0
- package/dist/services/playgroundService.js +317 -0
- package/dist/stores/playgroundStore.d.ts +199 -0
- package/dist/stores/playgroundStore.js +350 -0
- package/dist/styles/base.css +5 -0
- package/dist/types/playground.d.ts +230 -0
- package/dist/types/playground.js +28 -0
- package/dist/utils/colors.d.ts +42 -0
- package/dist/utils/colors.js +77 -0
- package/package.json +6 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Workflow } from '../../types/index.js';
|
|
2
|
+
import type { EndpointConfig } from '../../config/endpoints.js';
|
|
3
|
+
import type { PlaygroundMode, PlaygroundConfig } from '../../types/playground.js';
|
|
4
|
+
/**
|
|
5
|
+
* Component props
|
|
6
|
+
*/
|
|
7
|
+
interface Props {
|
|
8
|
+
/** Target workflow ID */
|
|
9
|
+
workflowId: string;
|
|
10
|
+
/** Pre-loaded workflow (optional, will be fetched if not provided) */
|
|
11
|
+
workflow?: Workflow;
|
|
12
|
+
/** Display mode: embedded (panel) or standalone (page) */
|
|
13
|
+
mode?: PlaygroundMode;
|
|
14
|
+
/** Resume a specific session */
|
|
15
|
+
initialSessionId?: string;
|
|
16
|
+
/** API endpoint configuration */
|
|
17
|
+
endpointConfig?: EndpointConfig;
|
|
18
|
+
/** Playground configuration options */
|
|
19
|
+
config?: PlaygroundConfig;
|
|
20
|
+
/** Callback when playground is closed (for embedded mode) */
|
|
21
|
+
onClose?: () => void;
|
|
22
|
+
}
|
|
23
|
+
declare const Playground: import("svelte").Component<Props, {}, "">;
|
|
24
|
+
type Playground = ReturnType<typeof Playground>;
|
|
25
|
+
export default Playground;
|
|
@@ -0,0 +1,537 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
SessionManager Component
|
|
3
|
+
|
|
4
|
+
Manages playground sessions: list, create, switch, and delete.
|
|
5
|
+
Displayed as a sidebar or dropdown.
|
|
6
|
+
Styled with BEM syntax.
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
<script lang="ts">
|
|
10
|
+
import Icon from '@iconify/svelte';
|
|
11
|
+
import { slide } from 'svelte/transition';
|
|
12
|
+
import type { PlaygroundSession } from '../../types/playground.js';
|
|
13
|
+
import {
|
|
14
|
+
sessions,
|
|
15
|
+
currentSession,
|
|
16
|
+
isLoading,
|
|
17
|
+
sessionCount
|
|
18
|
+
} from '../../stores/playgroundStore.js';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Component props
|
|
22
|
+
*/
|
|
23
|
+
interface Props {
|
|
24
|
+
/** Whether the session list is expanded */
|
|
25
|
+
isExpanded?: boolean;
|
|
26
|
+
/** Callback when expansion state changes */
|
|
27
|
+
onToggle?: (expanded: boolean) => void;
|
|
28
|
+
/** Callback when user wants to create a new session */
|
|
29
|
+
onCreateSession?: () => void;
|
|
30
|
+
/** Callback when user selects a session */
|
|
31
|
+
onSelectSession?: (sessionId: string) => void;
|
|
32
|
+
/** Callback when user wants to delete a session */
|
|
33
|
+
onDeleteSession?: (sessionId: string) => void;
|
|
34
|
+
/** Display mode: sidebar or dropdown */
|
|
35
|
+
mode?: 'sidebar' | 'dropdown';
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
let {
|
|
39
|
+
isExpanded = $bindable(false),
|
|
40
|
+
onToggle,
|
|
41
|
+
onCreateSession,
|
|
42
|
+
onSelectSession,
|
|
43
|
+
onDeleteSession,
|
|
44
|
+
mode = 'sidebar'
|
|
45
|
+
}: Props = $props();
|
|
46
|
+
|
|
47
|
+
/** Session pending deletion (for confirmation) */
|
|
48
|
+
let pendingDeleteId = $state<string | null>(null);
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Toggle expansion
|
|
52
|
+
*/
|
|
53
|
+
function toggleExpanded(): void {
|
|
54
|
+
isExpanded = !isExpanded;
|
|
55
|
+
onToggle?.(isExpanded);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Handle session selection
|
|
60
|
+
*/
|
|
61
|
+
function handleSelectSession(sessionId: string): void {
|
|
62
|
+
onSelectSession?.(sessionId);
|
|
63
|
+
if (mode === 'dropdown') {
|
|
64
|
+
isExpanded = false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Handle delete click - show confirmation
|
|
70
|
+
*/
|
|
71
|
+
function handleDeleteClick(event: Event, sessionId: string): void {
|
|
72
|
+
event.stopPropagation();
|
|
73
|
+
if (pendingDeleteId === sessionId) {
|
|
74
|
+
// Confirm deletion
|
|
75
|
+
onDeleteSession?.(sessionId);
|
|
76
|
+
pendingDeleteId = null;
|
|
77
|
+
} else {
|
|
78
|
+
pendingDeleteId = sessionId;
|
|
79
|
+
// Auto-reset after 3 seconds
|
|
80
|
+
setTimeout(() => {
|
|
81
|
+
if (pendingDeleteId === sessionId) {
|
|
82
|
+
pendingDeleteId = null;
|
|
83
|
+
}
|
|
84
|
+
}, 3000);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Cancel delete confirmation
|
|
90
|
+
*/
|
|
91
|
+
function cancelDelete(event: Event): void {
|
|
92
|
+
event.stopPropagation();
|
|
93
|
+
pendingDeleteId = null;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Format date for display
|
|
98
|
+
*/
|
|
99
|
+
function formatDate(dateString: string): string {
|
|
100
|
+
const date = new Date(dateString);
|
|
101
|
+
const now = new Date();
|
|
102
|
+
const diffMs = now.getTime() - date.getTime();
|
|
103
|
+
const diffMins = Math.floor(diffMs / 60000);
|
|
104
|
+
const diffHours = Math.floor(diffMs / 3600000);
|
|
105
|
+
const diffDays = Math.floor(diffMs / 86400000);
|
|
106
|
+
|
|
107
|
+
if (diffMins < 1) {
|
|
108
|
+
return 'Just now';
|
|
109
|
+
}
|
|
110
|
+
if (diffMins < 60) {
|
|
111
|
+
return `${diffMins}m ago`;
|
|
112
|
+
}
|
|
113
|
+
if (diffHours < 24) {
|
|
114
|
+
return `${diffHours}h ago`;
|
|
115
|
+
}
|
|
116
|
+
if (diffDays < 7) {
|
|
117
|
+
return `${diffDays}d ago`;
|
|
118
|
+
}
|
|
119
|
+
return date.toLocaleDateString('en-US', {
|
|
120
|
+
month: 'short',
|
|
121
|
+
day: 'numeric'
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Get status icon
|
|
127
|
+
*/
|
|
128
|
+
function getStatusIcon(status: PlaygroundSession['status']): string {
|
|
129
|
+
switch (status) {
|
|
130
|
+
case 'running':
|
|
131
|
+
return 'mdi:loading';
|
|
132
|
+
case 'completed':
|
|
133
|
+
return 'mdi:check-circle';
|
|
134
|
+
case 'failed':
|
|
135
|
+
return 'mdi:alert-circle';
|
|
136
|
+
default:
|
|
137
|
+
return 'mdi:circle-outline';
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Get status color class
|
|
143
|
+
*/
|
|
144
|
+
function getStatusClass(status: PlaygroundSession['status']): string {
|
|
145
|
+
switch (status) {
|
|
146
|
+
case 'running':
|
|
147
|
+
return 'session-manager__status--running';
|
|
148
|
+
case 'completed':
|
|
149
|
+
return 'session-manager__status--completed';
|
|
150
|
+
case 'failed':
|
|
151
|
+
return 'session-manager__status--failed';
|
|
152
|
+
default:
|
|
153
|
+
return 'session-manager__status--idle';
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
</script>
|
|
157
|
+
|
|
158
|
+
<div
|
|
159
|
+
class="session-manager"
|
|
160
|
+
class:session-manager--expanded={isExpanded}
|
|
161
|
+
class:session-manager--sidebar={mode === 'sidebar'}
|
|
162
|
+
class:session-manager--dropdown={mode === 'dropdown'}
|
|
163
|
+
>
|
|
164
|
+
<!-- Header / Toggle -->
|
|
165
|
+
<button
|
|
166
|
+
type="button"
|
|
167
|
+
class="session-manager__header"
|
|
168
|
+
onclick={toggleExpanded}
|
|
169
|
+
aria-expanded={isExpanded}
|
|
170
|
+
>
|
|
171
|
+
<div class="session-manager__title">
|
|
172
|
+
<Icon icon="mdi:history" />
|
|
173
|
+
<span>Sessions</span>
|
|
174
|
+
{#if $sessionCount > 0}
|
|
175
|
+
<span class="session-manager__count">{$sessionCount}</span>
|
|
176
|
+
{/if}
|
|
177
|
+
</div>
|
|
178
|
+
<Icon
|
|
179
|
+
icon="mdi:chevron-down"
|
|
180
|
+
class="session-manager__chevron {isExpanded ? 'session-manager__chevron--expanded' : ''}"
|
|
181
|
+
/>
|
|
182
|
+
</button>
|
|
183
|
+
|
|
184
|
+
<!-- Content -->
|
|
185
|
+
{#if isExpanded}
|
|
186
|
+
<div class="session-manager__content" transition:slide={{ duration: 200 }}>
|
|
187
|
+
<!-- New Session Button -->
|
|
188
|
+
<button
|
|
189
|
+
type="button"
|
|
190
|
+
class="session-manager__new-btn"
|
|
191
|
+
onclick={onCreateSession}
|
|
192
|
+
disabled={$isLoading}
|
|
193
|
+
>
|
|
194
|
+
<Icon icon="mdi:plus" />
|
|
195
|
+
New Session
|
|
196
|
+
</button>
|
|
197
|
+
|
|
198
|
+
<!-- Sessions List -->
|
|
199
|
+
<div class="session-manager__list">
|
|
200
|
+
{#if $sessions.length === 0}
|
|
201
|
+
<div class="session-manager__empty">
|
|
202
|
+
<Icon icon="mdi:chat-outline" />
|
|
203
|
+
<span>No sessions yet</span>
|
|
204
|
+
</div>
|
|
205
|
+
{:else}
|
|
206
|
+
{#each $sessions as session (session.id)}
|
|
207
|
+
<div
|
|
208
|
+
class="session-manager__item"
|
|
209
|
+
class:session-manager__item--active={$currentSession?.id === session.id}
|
|
210
|
+
role="button"
|
|
211
|
+
tabindex="0"
|
|
212
|
+
onclick={() => handleSelectSession(session.id)}
|
|
213
|
+
onkeydown={(e) => e.key === 'Enter' && handleSelectSession(session.id)}
|
|
214
|
+
>
|
|
215
|
+
<div class="session-manager__item-info">
|
|
216
|
+
<div class="session-manager__item-header">
|
|
217
|
+
<span class="session-manager__item-name" title={session.name}>
|
|
218
|
+
{session.name}
|
|
219
|
+
</span>
|
|
220
|
+
<span
|
|
221
|
+
class="session-manager__status {getStatusClass(session.status)}"
|
|
222
|
+
title={session.status}
|
|
223
|
+
>
|
|
224
|
+
<Icon icon={getStatusIcon(session.status)} />
|
|
225
|
+
</span>
|
|
226
|
+
</div>
|
|
227
|
+
<span class="session-manager__item-time">
|
|
228
|
+
{formatDate(session.updatedAt)}
|
|
229
|
+
</span>
|
|
230
|
+
</div>
|
|
231
|
+
|
|
232
|
+
<!-- Delete Actions -->
|
|
233
|
+
<div class="session-manager__item-actions">
|
|
234
|
+
{#if pendingDeleteId === session.id}
|
|
235
|
+
<button
|
|
236
|
+
type="button"
|
|
237
|
+
class="session-manager__delete-btn session-manager__delete-btn--confirm"
|
|
238
|
+
onclick={(e) => handleDeleteClick(e, session.id)}
|
|
239
|
+
title="Click again to confirm"
|
|
240
|
+
>
|
|
241
|
+
<Icon icon="mdi:check" />
|
|
242
|
+
</button>
|
|
243
|
+
<button
|
|
244
|
+
type="button"
|
|
245
|
+
class="session-manager__delete-btn session-manager__delete-btn--cancel"
|
|
246
|
+
onclick={cancelDelete}
|
|
247
|
+
title="Cancel"
|
|
248
|
+
>
|
|
249
|
+
<Icon icon="mdi:close" />
|
|
250
|
+
</button>
|
|
251
|
+
{:else}
|
|
252
|
+
<button
|
|
253
|
+
type="button"
|
|
254
|
+
class="session-manager__delete-btn"
|
|
255
|
+
onclick={(e) => handleDeleteClick(e, session.id)}
|
|
256
|
+
title="Delete session"
|
|
257
|
+
>
|
|
258
|
+
<Icon icon="mdi:delete-outline" />
|
|
259
|
+
</button>
|
|
260
|
+
{/if}
|
|
261
|
+
</div>
|
|
262
|
+
</div>
|
|
263
|
+
{/each}
|
|
264
|
+
{/if}
|
|
265
|
+
</div>
|
|
266
|
+
</div>
|
|
267
|
+
{/if}
|
|
268
|
+
</div>
|
|
269
|
+
|
|
270
|
+
<style>
|
|
271
|
+
.session-manager {
|
|
272
|
+
background-color: #ffffff;
|
|
273
|
+
border-bottom: 1px solid #e2e8f0;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.session-manager--dropdown {
|
|
277
|
+
position: relative;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.session-manager--dropdown .session-manager__content {
|
|
281
|
+
position: absolute;
|
|
282
|
+
top: 100%;
|
|
283
|
+
left: 0;
|
|
284
|
+
right: 0;
|
|
285
|
+
z-index: 50;
|
|
286
|
+
background-color: #ffffff;
|
|
287
|
+
border: 1px solid #e2e8f0;
|
|
288
|
+
border-radius: 0 0 0.5rem 0.5rem;
|
|
289
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/* Header */
|
|
293
|
+
.session-manager__header {
|
|
294
|
+
display: flex;
|
|
295
|
+
align-items: center;
|
|
296
|
+
justify-content: space-between;
|
|
297
|
+
width: 100%;
|
|
298
|
+
padding: 0.75rem 1rem;
|
|
299
|
+
border: none;
|
|
300
|
+
background: transparent;
|
|
301
|
+
cursor: pointer;
|
|
302
|
+
transition: background-color 0.2s ease-in-out;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.session-manager__header:hover {
|
|
306
|
+
background-color: #f8fafc;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.session-manager__title {
|
|
310
|
+
display: flex;
|
|
311
|
+
align-items: center;
|
|
312
|
+
gap: 0.5rem;
|
|
313
|
+
font-size: 0.875rem;
|
|
314
|
+
font-weight: 500;
|
|
315
|
+
color: #1e293b;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.session-manager__count {
|
|
319
|
+
display: inline-flex;
|
|
320
|
+
align-items: center;
|
|
321
|
+
justify-content: center;
|
|
322
|
+
min-width: 1.25rem;
|
|
323
|
+
height: 1.25rem;
|
|
324
|
+
padding: 0 0.375rem;
|
|
325
|
+
border-radius: 0.625rem;
|
|
326
|
+
font-size: 0.6875rem;
|
|
327
|
+
font-weight: 600;
|
|
328
|
+
background-color: #e2e8f0;
|
|
329
|
+
color: #475569;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
:global(.session-manager__chevron) {
|
|
333
|
+
transition: transform 0.2s ease-in-out;
|
|
334
|
+
color: #94a3b8;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
:global(.session-manager__chevron--expanded) {
|
|
338
|
+
transform: rotate(180deg);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/* Content */
|
|
342
|
+
.session-manager__content {
|
|
343
|
+
padding: 0.5rem;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/* New Session Button */
|
|
347
|
+
.session-manager__new-btn {
|
|
348
|
+
display: flex;
|
|
349
|
+
align-items: center;
|
|
350
|
+
justify-content: center;
|
|
351
|
+
gap: 0.375rem;
|
|
352
|
+
width: 100%;
|
|
353
|
+
padding: 0.625rem 1rem;
|
|
354
|
+
margin-bottom: 0.5rem;
|
|
355
|
+
border: 1px dashed #cbd5e1;
|
|
356
|
+
border-radius: 0.5rem;
|
|
357
|
+
background: transparent;
|
|
358
|
+
font-size: 0.875rem;
|
|
359
|
+
font-weight: 500;
|
|
360
|
+
color: #64748b;
|
|
361
|
+
cursor: pointer;
|
|
362
|
+
transition: all 0.2s ease-in-out;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.session-manager__new-btn:hover:not(:disabled) {
|
|
366
|
+
background-color: #f8fafc;
|
|
367
|
+
border-color: #3b82f6;
|
|
368
|
+
color: #3b82f6;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.session-manager__new-btn:disabled {
|
|
372
|
+
opacity: 0.5;
|
|
373
|
+
cursor: not-allowed;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/* Sessions List */
|
|
377
|
+
.session-manager__list {
|
|
378
|
+
max-height: 300px;
|
|
379
|
+
overflow-y: auto;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.session-manager__empty {
|
|
383
|
+
display: flex;
|
|
384
|
+
flex-direction: column;
|
|
385
|
+
align-items: center;
|
|
386
|
+
gap: 0.5rem;
|
|
387
|
+
padding: 2rem 1rem;
|
|
388
|
+
color: #94a3b8;
|
|
389
|
+
font-size: 0.875rem;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/* Session Item */
|
|
393
|
+
.session-manager__item {
|
|
394
|
+
display: flex;
|
|
395
|
+
align-items: center;
|
|
396
|
+
justify-content: space-between;
|
|
397
|
+
width: 100%;
|
|
398
|
+
padding: 0.625rem 0.75rem;
|
|
399
|
+
margin-bottom: 0.25rem;
|
|
400
|
+
border: 1px solid transparent;
|
|
401
|
+
border-radius: 0.5rem;
|
|
402
|
+
background: transparent;
|
|
403
|
+
cursor: pointer;
|
|
404
|
+
transition: all 0.2s ease-in-out;
|
|
405
|
+
text-align: left;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
.session-manager__item:hover {
|
|
409
|
+
background-color: #f8fafc;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
.session-manager__item--active {
|
|
413
|
+
background-color: #dbeafe;
|
|
414
|
+
border-color: #3b82f6;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
.session-manager__item-info {
|
|
418
|
+
flex: 1;
|
|
419
|
+
min-width: 0;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.session-manager__item-header {
|
|
423
|
+
display: flex;
|
|
424
|
+
align-items: center;
|
|
425
|
+
gap: 0.5rem;
|
|
426
|
+
margin-bottom: 0.125rem;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.session-manager__item-name {
|
|
430
|
+
font-size: 0.875rem;
|
|
431
|
+
font-weight: 500;
|
|
432
|
+
color: #1e293b;
|
|
433
|
+
white-space: nowrap;
|
|
434
|
+
overflow: hidden;
|
|
435
|
+
text-overflow: ellipsis;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.session-manager__status {
|
|
439
|
+
display: flex;
|
|
440
|
+
align-items: center;
|
|
441
|
+
font-size: 0.75rem;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.session-manager__status--idle {
|
|
445
|
+
color: #94a3b8;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.session-manager__status--running {
|
|
449
|
+
color: #3b82f6;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
:global(.session-manager__status--running svg) {
|
|
453
|
+
animation: spin 1s linear infinite;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
.session-manager__status--completed {
|
|
457
|
+
color: #10b981;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.session-manager__status--failed {
|
|
461
|
+
color: #ef4444;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
@keyframes spin {
|
|
465
|
+
from {
|
|
466
|
+
transform: rotate(0deg);
|
|
467
|
+
}
|
|
468
|
+
to {
|
|
469
|
+
transform: rotate(360deg);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.session-manager__item-time {
|
|
474
|
+
font-size: 0.75rem;
|
|
475
|
+
color: #94a3b8;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
/* Delete Button */
|
|
479
|
+
.session-manager__item-actions {
|
|
480
|
+
display: flex;
|
|
481
|
+
gap: 0.25rem;
|
|
482
|
+
opacity: 0;
|
|
483
|
+
transition: opacity 0.2s ease-in-out;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
.session-manager__item:hover .session-manager__item-actions {
|
|
487
|
+
opacity: 1;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.session-manager__delete-btn {
|
|
491
|
+
display: flex;
|
|
492
|
+
align-items: center;
|
|
493
|
+
justify-content: center;
|
|
494
|
+
width: 1.5rem;
|
|
495
|
+
height: 1.5rem;
|
|
496
|
+
border: none;
|
|
497
|
+
border-radius: 0.25rem;
|
|
498
|
+
background: transparent;
|
|
499
|
+
color: #94a3b8;
|
|
500
|
+
cursor: pointer;
|
|
501
|
+
transition: all 0.2s ease-in-out;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
.session-manager__delete-btn:hover {
|
|
505
|
+
background-color: #fee2e2;
|
|
506
|
+
color: #dc2626;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
.session-manager__delete-btn--confirm {
|
|
510
|
+
background-color: #dcfce7;
|
|
511
|
+
color: #16a34a;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
.session-manager__delete-btn--confirm:hover {
|
|
515
|
+
background-color: #bbf7d0;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
.session-manager__delete-btn--cancel {
|
|
519
|
+
background-color: #f1f5f9;
|
|
520
|
+
color: #64748b;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
.session-manager__delete-btn--cancel:hover {
|
|
524
|
+
background-color: #e2e8f0;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
/* Responsive */
|
|
528
|
+
@media (max-width: 640px) {
|
|
529
|
+
.session-manager__content {
|
|
530
|
+
padding: 0.375rem;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
.session-manager__item {
|
|
534
|
+
padding: 0.5rem;
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component props
|
|
3
|
+
*/
|
|
4
|
+
interface Props {
|
|
5
|
+
/** Whether the session list is expanded */
|
|
6
|
+
isExpanded?: boolean;
|
|
7
|
+
/** Callback when expansion state changes */
|
|
8
|
+
onToggle?: (expanded: boolean) => void;
|
|
9
|
+
/** Callback when user wants to create a new session */
|
|
10
|
+
onCreateSession?: () => void;
|
|
11
|
+
/** Callback when user selects a session */
|
|
12
|
+
onSelectSession?: (sessionId: string) => void;
|
|
13
|
+
/** Callback when user wants to delete a session */
|
|
14
|
+
onDeleteSession?: (sessionId: string) => void;
|
|
15
|
+
/** Display mode: sidebar or dropdown */
|
|
16
|
+
mode?: 'sidebar' | 'dropdown';
|
|
17
|
+
}
|
|
18
|
+
declare const SessionManager: import("svelte").Component<Props, {}, "isExpanded">;
|
|
19
|
+
type SessionManager = ReturnType<typeof SessionManager>;
|
|
20
|
+
export default SessionManager;
|
|
@@ -42,6 +42,22 @@ export interface EndpointConfig {
|
|
|
42
42
|
execute: string;
|
|
43
43
|
stop: string;
|
|
44
44
|
};
|
|
45
|
+
playground: {
|
|
46
|
+
/** List sessions for a workflow */
|
|
47
|
+
listSessions: string;
|
|
48
|
+
/** Create a new session */
|
|
49
|
+
createSession: string;
|
|
50
|
+
/** Get session details */
|
|
51
|
+
getSession: string;
|
|
52
|
+
/** Delete a session */
|
|
53
|
+
deleteSession: string;
|
|
54
|
+
/** Get messages from a session */
|
|
55
|
+
getMessages: string;
|
|
56
|
+
/** Send a message to a session */
|
|
57
|
+
sendMessage: string;
|
|
58
|
+
/** Stop execution in a session */
|
|
59
|
+
stopExecution: string;
|
|
60
|
+
};
|
|
45
61
|
templates: {
|
|
46
62
|
list: string;
|
|
47
63
|
get: string;
|
package/dist/config/endpoints.js
CHANGED
|
@@ -43,6 +43,15 @@ export const defaultEndpointConfig = {
|
|
|
43
43
|
execute: '/pipeline/{id}/execute',
|
|
44
44
|
stop: '/pipeline/{id}/stop'
|
|
45
45
|
},
|
|
46
|
+
playground: {
|
|
47
|
+
listSessions: '/workflows/{id}/playground/sessions',
|
|
48
|
+
createSession: '/workflows/{id}/playground/sessions',
|
|
49
|
+
getSession: '/playground/sessions/{sessionId}',
|
|
50
|
+
deleteSession: '/playground/sessions/{sessionId}',
|
|
51
|
+
getMessages: '/playground/sessions/{sessionId}/messages',
|
|
52
|
+
sendMessage: '/playground/sessions/{sessionId}/messages',
|
|
53
|
+
stopExecution: '/playground/sessions/{sessionId}/stop'
|
|
54
|
+
},
|
|
46
55
|
templates: {
|
|
47
56
|
list: '/templates',
|
|
48
57
|
get: '/templates/{id}',
|
package/dist/core/index.d.ts
CHANGED
|
@@ -14,26 +14,28 @@
|
|
|
14
14
|
* import { getStatusColor, createDefaultExecutionInfo } from "@d34dman/flowdrop/core";
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
|
-
export type { NodeCategory, NodeDataType, NodePort, DynamicPort, Branch, NodeMetadata, NodeExtensions, NodeUIExtensions, ConfigValues, WorkflowNode, WorkflowEdge, Workflow, ApiResponse, NodesResponse, WorkflowResponse, WorkflowsResponse, ExecutionStatus, ExecutionResult, FlowDropConfig, WorkflowEvents, BuiltinNodeType, PortConfig, PortCompatibilityRule, ConfigSchema, ConfigProperty, HttpMethod, DynamicSchemaEndpoint, ExternalEditLink, ConfigEditOptions } from
|
|
18
|
-
export type { WorkflowEditorConfig, EditorFeatures, UIConfig, APIConfig, ExecutionConfig, StorageConfig } from
|
|
19
|
-
export type { AuthProvider, StaticAuthConfig, CallbackAuthConfig } from
|
|
20
|
-
export type { WorkflowChangeType, FlowDropEventHandlers, FlowDropFeatures } from
|
|
21
|
-
export type { FieldSchema, FieldType, FieldFormat, FieldOption, SchemaFormProps, BaseFieldProps, TextFieldProps, TextareaFieldProps, NumberFieldProps, ToggleFieldProps, RangeFieldProps, SelectFieldProps, CheckboxGroupFieldProps, ArrayFieldProps, CodeEditorFieldProps, MarkdownEditorFieldProps, TemplateEditorFieldProps, FormFieldFactoryProps, FormFieldWrapperProps } from
|
|
22
|
-
export type { NodeComponentProps, NodeComponentRegistration, NodeComponentCategory, StatusPosition, StatusSize, NodeRegistrationFilter, FlowDropPluginConfig, PluginNodeDefinition, PluginRegistrationResult } from
|
|
23
|
-
export type { ToastType, ToastOptions } from
|
|
24
|
-
export type { DynamicSchemaResult } from
|
|
25
|
-
export type {
|
|
26
|
-
export
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
31
|
-
export
|
|
32
|
-
export
|
|
33
|
-
export
|
|
34
|
-
export * from
|
|
35
|
-
export * from
|
|
36
|
-
export
|
|
37
|
-
export
|
|
38
|
-
export {
|
|
39
|
-
export
|
|
17
|
+
export type { NodeCategory, NodeDataType, NodePort, DynamicPort, Branch, NodeMetadata, NodeExtensions, NodeUIExtensions, ConfigValues, WorkflowNode, WorkflowEdge, Workflow, ApiResponse, NodesResponse, WorkflowResponse, WorkflowsResponse, ExecutionStatus, ExecutionResult, FlowDropConfig, WorkflowEvents, BuiltinNodeType, PortConfig, PortCompatibilityRule, ConfigSchema, ConfigProperty, HttpMethod, DynamicSchemaEndpoint, ExternalEditLink, ConfigEditOptions } from '../types/index.js';
|
|
18
|
+
export type { WorkflowEditorConfig, EditorFeatures, UIConfig, APIConfig, ExecutionConfig, StorageConfig } from '../types/config.js';
|
|
19
|
+
export type { AuthProvider, StaticAuthConfig, CallbackAuthConfig } from '../types/auth.js';
|
|
20
|
+
export type { WorkflowChangeType, FlowDropEventHandlers, FlowDropFeatures } from '../types/events.js';
|
|
21
|
+
export type { FieldSchema, FieldType, FieldFormat, FieldOption, SchemaFormProps, BaseFieldProps, TextFieldProps, TextareaFieldProps, NumberFieldProps, ToggleFieldProps, RangeFieldProps, SelectFieldProps, CheckboxGroupFieldProps, ArrayFieldProps, CodeEditorFieldProps, MarkdownEditorFieldProps, TemplateEditorFieldProps, FormFieldFactoryProps, FormFieldWrapperProps } from '../components/form/types.js';
|
|
22
|
+
export type { NodeComponentProps, NodeComponentRegistration, NodeComponentCategory, StatusPosition, StatusSize, NodeRegistrationFilter, FlowDropPluginConfig, PluginNodeDefinition, PluginRegistrationResult } from '../registry/index.js';
|
|
23
|
+
export type { ToastType, ToastOptions } from '../services/toastService.js';
|
|
24
|
+
export type { DynamicSchemaResult } from '../services/dynamicSchemaService.js';
|
|
25
|
+
export type { PlaygroundSession, PlaygroundMessage, PlaygroundInputField, PlaygroundMessageRequest, PlaygroundMessagesResult, PlaygroundConfig, PlaygroundMode, PlaygroundSessionStatus, PlaygroundMessageRole, PlaygroundMessageLevel, PlaygroundMessageMetadata, PlaygroundApiResponse, PlaygroundSessionsResponse, PlaygroundSessionResponse, PlaygroundMessageResponse, PlaygroundMessagesApiResponse } from '../types/playground.js';
|
|
26
|
+
export { isChatInputNode, CHAT_INPUT_PATTERNS } from '../types/playground.js';
|
|
27
|
+
export type { EndpointConfig } from '../config/endpoints.js';
|
|
28
|
+
export type { FlowDropMountOptions, MountedFlowDropApp, NavbarAction } from '../svelte-app.js';
|
|
29
|
+
export { StaticAuthProvider, CallbackAuthProvider, NoAuthProvider } from '../types/auth.js';
|
|
30
|
+
export { DEFAULT_FEATURES, mergeFeatures } from '../types/events.js';
|
|
31
|
+
export { getStatusColor, getStatusIcon, getStatusLabel, getStatusBackgroundColor, getStatusTextColor, createDefaultExecutionInfo, updateExecutionStart, updateExecutionComplete, updateExecutionFailed, resetExecutionInfo, formatExecutionDuration, formatLastExecuted } from '../utils/nodeStatus.js';
|
|
32
|
+
export { createNodeWrapperConfig, shouldShowNodeStatus, getOptimalStatusPosition, getOptimalStatusSize, DEFAULT_NODE_STATUS_CONFIG } from '../utils/nodeWrapper.js';
|
|
33
|
+
export type { NodeStatusConfig } from '../utils/nodeWrapper.js';
|
|
34
|
+
export * from '../utils/colors.js';
|
|
35
|
+
export * from '../utils/icons.js';
|
|
36
|
+
export * from '../utils/config.js';
|
|
37
|
+
export * from '../utils/nodeTypes.js';
|
|
38
|
+
export { isFieldOptionArray, normalizeOptions } from '../components/form/types.js';
|
|
39
|
+
export { DEFAULT_PORT_CONFIG } from '../config/defaultPortConfig.js';
|
|
40
|
+
export { defaultEndpointConfig, createEndpointConfig } from '../config/endpoints.js';
|
|
41
|
+
export * from '../adapters/WorkflowAdapter.js';
|