@things-factory/operato-dataset 9.1.17 → 9.1.19
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/LABELING_INTEGRATION.md +584 -0
- package/dist-client/menu.d.ts +9 -0
- package/dist-client/menu.js +27 -0
- package/dist-client/menu.js.map +1 -1
- package/dist-client/pages/dataset-labeling-workflow-list.d.ts +18 -0
- package/dist-client/pages/dataset-labeling-workflow-list.js +283 -0
- package/dist-client/pages/dataset-labeling-workflow-list.js.map +1 -0
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +3 -0
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/index.d.ts +2 -2
- package/dist-server/index.js +3 -2
- package/dist-server/index.js.map +1 -1
- package/dist-server/service/index.d.ts +2 -1
- package/dist-server/service/index.js +3 -1
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/labeling/dataset-labeling-workflow.d.ts +54 -0
- package/dist-server/service/labeling/dataset-labeling-workflow.js +264 -0
- package/dist-server/service/labeling/dataset-labeling-workflow.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +45 -40
- package/schema.graphql +1592 -0
- package/things-factory.config.js +1 -1
- package/translations/en.json +1 -1
- package/translations/ja.json +1 -1
- package/translations/ko.json +1 -1
- package/translations/ms.json +1 -1
- package/translations/zh.json +1 -1
|
@@ -0,0 +1,584 @@
|
|
|
1
|
+
# Operato-Dataset Labeling Integration
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
This document describes the integration of `@things-factory/labeling` package into `@things-factory/operato-dataset` for automated labeling workflows.
|
|
6
|
+
|
|
7
|
+
**Integration Status: ✅ Complete**
|
|
8
|
+
|
|
9
|
+
### What's Integrated
|
|
10
|
+
|
|
11
|
+
1. **Generic Workflow UI** from `@things-factory/labeling`:
|
|
12
|
+
- Workflow List Page (`/workflows`)
|
|
13
|
+
- Workflow Builder Page (`/workflow-builder`)
|
|
14
|
+
- Full CRUD operations for workflows
|
|
15
|
+
|
|
16
|
+
2. **Dataset-Specific UI** in `operato-dataset`:
|
|
17
|
+
- Dataset Workflow List (`/labeling-workflows`)
|
|
18
|
+
- Preset workflows for dataset labeling
|
|
19
|
+
|
|
20
|
+
3. **Menu Items**:
|
|
21
|
+
- **Workflows**: Access generic workflow management
|
|
22
|
+
- **Create Workflow**: Create new workflows from scratch
|
|
23
|
+
- **Dataset Workflows**: Access dataset-specific workflows
|
|
24
|
+
|
|
25
|
+
## Architecture
|
|
26
|
+
|
|
27
|
+
### Package Dependencies
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
operato-dataset
|
|
31
|
+
├─ @things-factory/labeling (workflow orchestration)
|
|
32
|
+
├─ @things-factory/integration-label-studio (Label Studio API)
|
|
33
|
+
└─ @things-factory/ai-inference (AI predictions)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Components
|
|
37
|
+
|
|
38
|
+
1. **Backend Integration Layer** (`server/service/labeling/dataset-labeling-workflow.ts`)
|
|
39
|
+
- GraphQL resolvers for dataset-specific workflow operations
|
|
40
|
+
- Provides convenience methods for creating workflows from datasets
|
|
41
|
+
- Wraps `LabelingWorkflowService` from `@things-factory/labeling`
|
|
42
|
+
|
|
43
|
+
2. **Frontend UI** (`client/pages/labeling/workflow-list.ts`)
|
|
44
|
+
- Workflow list page with create/execute/monitor capabilities
|
|
45
|
+
- Built with Lit web components
|
|
46
|
+
- GraphQL client integration
|
|
47
|
+
|
|
48
|
+
3. **Menu Integration** (`client/menu.ts`)
|
|
49
|
+
- Added "Labeling Workflows" menu item under LABELING group
|
|
50
|
+
- Accessible to owner users only
|
|
51
|
+
|
|
52
|
+
4. **Route Configuration** (`client/route.ts`)
|
|
53
|
+
- Route: `/labeling-workflows`
|
|
54
|
+
- Dynamically imports workflow-list component
|
|
55
|
+
|
|
56
|
+
## GraphQL API
|
|
57
|
+
|
|
58
|
+
### Mutations
|
|
59
|
+
|
|
60
|
+
#### createDatasetLabelingWorkflow
|
|
61
|
+
|
|
62
|
+
Creates a comprehensive automated labeling workflow for a dataset.
|
|
63
|
+
|
|
64
|
+
```graphql
|
|
65
|
+
mutation CreateAutoWorkflow(
|
|
66
|
+
$dataSetId: String!
|
|
67
|
+
$projectId: Int!
|
|
68
|
+
$workflowName: String!
|
|
69
|
+
$modelId: String
|
|
70
|
+
$autoStart: Boolean
|
|
71
|
+
) {
|
|
72
|
+
createDatasetLabelingWorkflow(
|
|
73
|
+
dataSetId: $dataSetId
|
|
74
|
+
projectId: $projectId
|
|
75
|
+
workflowName: $workflowName
|
|
76
|
+
modelId: $modelId
|
|
77
|
+
autoStart: $autoStart
|
|
78
|
+
) {
|
|
79
|
+
id
|
|
80
|
+
name
|
|
81
|
+
status
|
|
82
|
+
projectId
|
|
83
|
+
steps {
|
|
84
|
+
name
|
|
85
|
+
type
|
|
86
|
+
config
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**Workflow Steps:**
|
|
93
|
+
1. Import Data from DataSet
|
|
94
|
+
2. Generate AI Predictions
|
|
95
|
+
3. Wait for Human Annotation
|
|
96
|
+
4. Sync Annotations Back to DataSet
|
|
97
|
+
5. Validate Quality
|
|
98
|
+
|
|
99
|
+
**Parameters:**
|
|
100
|
+
- `dataSetId`: Source dataset ID
|
|
101
|
+
- `projectId`: Label Studio project ID
|
|
102
|
+
- `workflowName`: Descriptive workflow name
|
|
103
|
+
- `modelId` (optional): AI model for predictions (default: "default-model")
|
|
104
|
+
- `autoStart` (optional): Auto-start after creation (default: false)
|
|
105
|
+
|
|
106
|
+
#### createQuickLabelingWorkflow
|
|
107
|
+
|
|
108
|
+
Creates a simplified manual-only labeling workflow (no AI predictions).
|
|
109
|
+
|
|
110
|
+
```graphql
|
|
111
|
+
mutation CreateQuickWorkflow(
|
|
112
|
+
$dataSetId: String!
|
|
113
|
+
$projectId: Int!
|
|
114
|
+
$workflowName: String!
|
|
115
|
+
) {
|
|
116
|
+
createQuickLabelingWorkflow(
|
|
117
|
+
dataSetId: $dataSetId
|
|
118
|
+
projectId: $projectId
|
|
119
|
+
workflowName: $workflowName
|
|
120
|
+
) {
|
|
121
|
+
id
|
|
122
|
+
name
|
|
123
|
+
status
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**Workflow Steps:**
|
|
129
|
+
1. Import Data from DataSet (limit: 100 items)
|
|
130
|
+
2. Wait for Annotation (100% completion required)
|
|
131
|
+
3. Sync to DataSet
|
|
132
|
+
|
|
133
|
+
**Use Case:** Quick annotation tasks where AI predictions are not needed or available.
|
|
134
|
+
|
|
135
|
+
#### executeDatasetWorkflow
|
|
136
|
+
|
|
137
|
+
Executes a workflow immediately.
|
|
138
|
+
|
|
139
|
+
```graphql
|
|
140
|
+
mutation ExecuteWorkflow($workflowId: String!, $parameters: String) {
|
|
141
|
+
executeDatasetWorkflow(workflowId: $workflowId, parameters: $parameters) {
|
|
142
|
+
executionId
|
|
143
|
+
status
|
|
144
|
+
summary
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
#### pauseDatasetWorkflow / resumeDatasetWorkflow
|
|
150
|
+
|
|
151
|
+
Control workflow execution state.
|
|
152
|
+
|
|
153
|
+
```graphql
|
|
154
|
+
mutation PauseWorkflow($workflowId: String!) {
|
|
155
|
+
pauseDatasetWorkflow(workflowId: $workflowId) {
|
|
156
|
+
id
|
|
157
|
+
status
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
mutation ResumeWorkflow($workflowId: String!) {
|
|
162
|
+
resumeDatasetWorkflow(workflowId: $workflowId) {
|
|
163
|
+
id
|
|
164
|
+
status
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Queries
|
|
170
|
+
|
|
171
|
+
#### datasetLabelingWorkflows
|
|
172
|
+
|
|
173
|
+
Get all workflows, optionally filtered by project.
|
|
174
|
+
|
|
175
|
+
```graphql
|
|
176
|
+
query GetWorkflows($projectId: Int) {
|
|
177
|
+
datasetLabelingWorkflows(projectId: $projectId) {
|
|
178
|
+
id
|
|
179
|
+
name
|
|
180
|
+
description
|
|
181
|
+
projectId
|
|
182
|
+
status
|
|
183
|
+
triggerType
|
|
184
|
+
createdAt
|
|
185
|
+
lastExecutedAt
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
#### datasetLabelingWorkflow
|
|
191
|
+
|
|
192
|
+
Get single workflow details.
|
|
193
|
+
|
|
194
|
+
```graphql
|
|
195
|
+
query GetWorkflow($workflowId: String!) {
|
|
196
|
+
datasetLabelingWorkflow(workflowId: $workflowId) {
|
|
197
|
+
id
|
|
198
|
+
name
|
|
199
|
+
description
|
|
200
|
+
steps {
|
|
201
|
+
name
|
|
202
|
+
type
|
|
203
|
+
order
|
|
204
|
+
config
|
|
205
|
+
continueOnError
|
|
206
|
+
}
|
|
207
|
+
status
|
|
208
|
+
createdAt
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
#### datasetWorkflowExecution
|
|
214
|
+
|
|
215
|
+
Get execution status and progress.
|
|
216
|
+
|
|
217
|
+
```graphql
|
|
218
|
+
query GetExecution($executionId: String!) {
|
|
219
|
+
datasetWorkflowExecution(executionId: $executionId) {
|
|
220
|
+
id
|
|
221
|
+
workflowName
|
|
222
|
+
status
|
|
223
|
+
steps {
|
|
224
|
+
stepName
|
|
225
|
+
stepType
|
|
226
|
+
status
|
|
227
|
+
order
|
|
228
|
+
startedAt
|
|
229
|
+
completedAt
|
|
230
|
+
durationMs
|
|
231
|
+
error
|
|
232
|
+
}
|
|
233
|
+
startedAt
|
|
234
|
+
completedAt
|
|
235
|
+
totalDurationMs
|
|
236
|
+
summary
|
|
237
|
+
error
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## Workflow Step Types
|
|
243
|
+
|
|
244
|
+
### ImportData
|
|
245
|
+
Imports data from DataSet into Label Studio.
|
|
246
|
+
|
|
247
|
+
**Config:**
|
|
248
|
+
```json
|
|
249
|
+
{
|
|
250
|
+
"sourceType": "dataset",
|
|
251
|
+
"dataSetId": "dataset-uuid",
|
|
252
|
+
"imageField": "image",
|
|
253
|
+
"limit": 1000
|
|
254
|
+
}
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### GeneratePredictions
|
|
258
|
+
Generates AI predictions for imported tasks.
|
|
259
|
+
|
|
260
|
+
**Config:**
|
|
261
|
+
```json
|
|
262
|
+
{
|
|
263
|
+
"modelId": "default-model",
|
|
264
|
+
"confidenceThreshold": 0.7,
|
|
265
|
+
"forceRegenerate": false
|
|
266
|
+
}
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### WaitForAnnotations
|
|
270
|
+
Pauses workflow until human annotations are complete.
|
|
271
|
+
|
|
272
|
+
**Config:**
|
|
273
|
+
```json
|
|
274
|
+
{
|
|
275
|
+
"minCompletionRate": 0.9,
|
|
276
|
+
"autoProceed": false
|
|
277
|
+
}
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### SyncAnnotations
|
|
281
|
+
Syncs completed annotations back to DataSet.
|
|
282
|
+
|
|
283
|
+
**Config:**
|
|
284
|
+
```json
|
|
285
|
+
{
|
|
286
|
+
"completedOnly": true
|
|
287
|
+
}
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### ValidateQuality
|
|
291
|
+
Validates annotation quality.
|
|
292
|
+
|
|
293
|
+
**Config:**
|
|
294
|
+
```json
|
|
295
|
+
{
|
|
296
|
+
"minQualityScore": 0.8
|
|
297
|
+
}
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
## UI Usage
|
|
301
|
+
|
|
302
|
+
### Accessing Workflows
|
|
303
|
+
|
|
304
|
+
1. Navigate to operato-dataset application
|
|
305
|
+
2. Click "Labeling Workflows" in the LABELING section (owner only)
|
|
306
|
+
3. View list of existing workflows
|
|
307
|
+
|
|
308
|
+
### Creating Auto Workflow
|
|
309
|
+
|
|
310
|
+
1. Click "Create Auto Workflow" button
|
|
311
|
+
2. Enter DataSet ID (e.g., "my-dataset-123")
|
|
312
|
+
3. Enter Label Studio Project ID (e.g., 42)
|
|
313
|
+
4. Enter Workflow Name (e.g., "Product Image Labeling")
|
|
314
|
+
5. Workflow will be created in Draft status
|
|
315
|
+
|
|
316
|
+
### Creating Quick Workflow
|
|
317
|
+
|
|
318
|
+
1. Click "Create Quick Workflow" button
|
|
319
|
+
2. Enter DataSet ID
|
|
320
|
+
3. Enter Label Studio Project ID
|
|
321
|
+
4. Enter Workflow Name
|
|
322
|
+
5. Simplified workflow (manual only) will be created
|
|
323
|
+
|
|
324
|
+
### Executing Workflow
|
|
325
|
+
|
|
326
|
+
1. Click on any workflow card in the list
|
|
327
|
+
2. Confirm execution in the dialog
|
|
328
|
+
3. Workflow will start executing immediately
|
|
329
|
+
4. Monitor progress in Label Studio
|
|
330
|
+
|
|
331
|
+
### Workflow Status Indicators
|
|
332
|
+
|
|
333
|
+
- **Draft** (gray): Workflow created but not started
|
|
334
|
+
- **Active** (green): Workflow is active and can be executed
|
|
335
|
+
- **Paused** (orange): Workflow execution is paused
|
|
336
|
+
|
|
337
|
+
## Database Schema
|
|
338
|
+
|
|
339
|
+
Workflows are persisted in PostgreSQL/SQLite using TypeORM entities:
|
|
340
|
+
|
|
341
|
+
### labeling_workflows
|
|
342
|
+
- `id` (UUID): Primary key
|
|
343
|
+
- `domain_id`: Multi-tenancy
|
|
344
|
+
- `creator_id`: User who created workflow
|
|
345
|
+
- `name`, `description`: Metadata
|
|
346
|
+
- `project_id`: Label Studio project
|
|
347
|
+
- `trigger_type`: Manual/Scheduled/Event
|
|
348
|
+
- `steps` (JSONB): Workflow step definitions
|
|
349
|
+
- `status`: Draft/Active/Paused/Completed/Failed
|
|
350
|
+
- `created_at`, `updated_at`, `deleted_at`: Timestamps
|
|
351
|
+
|
|
352
|
+
### workflow_executions
|
|
353
|
+
- `id` (UUID): Execution instance ID
|
|
354
|
+
- `workflow_id`: Reference to workflow
|
|
355
|
+
- `status`: running/completed/failed
|
|
356
|
+
- `started_at`, `completed_at`, `total_duration_ms`: Timing
|
|
357
|
+
- `summary`, `error`: Results
|
|
358
|
+
|
|
359
|
+
### workflow_execution_steps
|
|
360
|
+
- `id` (UUID): Step instance ID
|
|
361
|
+
- `execution_id`: Reference to execution
|
|
362
|
+
- `step_name`, `step_type`: Step info
|
|
363
|
+
- `order`: Execution sequence
|
|
364
|
+
- `status`: pending/running/completed/failed/skipped
|
|
365
|
+
- `started_at`, `completed_at`, `duration_ms`: Timing
|
|
366
|
+
- `output`, `error`: Results
|
|
367
|
+
|
|
368
|
+
## Security
|
|
369
|
+
|
|
370
|
+
### Permissions
|
|
371
|
+
|
|
372
|
+
All operations require appropriate privileges:
|
|
373
|
+
- Category: `dataset`
|
|
374
|
+
- Privilege: `mutation` (for create/execute/pause/resume)
|
|
375
|
+
- Privilege: `query` (for list/detail queries)
|
|
376
|
+
|
|
377
|
+
### Multi-tenancy
|
|
378
|
+
|
|
379
|
+
All workflows are isolated by domain:
|
|
380
|
+
- Users can only see/manage workflows in their own domain
|
|
381
|
+
- Domain filtering is applied automatically in all queries
|
|
382
|
+
|
|
383
|
+
## Example Use Cases
|
|
384
|
+
|
|
385
|
+
### Use Case 1: Image Classification Pipeline
|
|
386
|
+
|
|
387
|
+
```typescript
|
|
388
|
+
// 1. Create workflow
|
|
389
|
+
const workflow = await createDatasetLabelingWorkflow({
|
|
390
|
+
dataSetId: 'product-images-2024',
|
|
391
|
+
projectId: 123,
|
|
392
|
+
workflowName: 'Product Classification Q1',
|
|
393
|
+
modelId: 'resnet50-v2',
|
|
394
|
+
autoStart: false
|
|
395
|
+
})
|
|
396
|
+
|
|
397
|
+
// 2. Execute workflow
|
|
398
|
+
const execution = await executeDatasetWorkflow({
|
|
399
|
+
workflowId: workflow.id
|
|
400
|
+
})
|
|
401
|
+
|
|
402
|
+
// 3. Monitor progress
|
|
403
|
+
const status = await datasetWorkflowExecution({
|
|
404
|
+
executionId: execution.executionId
|
|
405
|
+
})
|
|
406
|
+
|
|
407
|
+
// Status: Import (completed) → Predictions (running) → Annotations (pending)
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
### Use Case 2: Quick Manual Labeling
|
|
411
|
+
|
|
412
|
+
```typescript
|
|
413
|
+
// For small batches that don't need AI predictions
|
|
414
|
+
const workflow = await createQuickLabelingWorkflow({
|
|
415
|
+
dataSetId: 'test-samples',
|
|
416
|
+
projectId: 456,
|
|
417
|
+
workflowName: 'Test Sample Review'
|
|
418
|
+
})
|
|
419
|
+
|
|
420
|
+
await executeDatasetWorkflow({
|
|
421
|
+
workflowId: workflow.id
|
|
422
|
+
})
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
## Troubleshooting
|
|
426
|
+
|
|
427
|
+
### Workflow Creation Fails
|
|
428
|
+
|
|
429
|
+
**Error:** "Cannot find dataset"
|
|
430
|
+
- **Solution:** Verify dataSetId exists and user has access
|
|
431
|
+
|
|
432
|
+
**Error:** "Invalid project ID"
|
|
433
|
+
- **Solution:** Ensure Label Studio project exists and is accessible
|
|
434
|
+
|
|
435
|
+
### Workflow Execution Stuck
|
|
436
|
+
|
|
437
|
+
**Symptom:** Workflow stays in "running" status
|
|
438
|
+
- **Check:** `workflow_execution_steps` table for failed steps
|
|
439
|
+
- **Check:** Label Studio API connectivity
|
|
440
|
+
- **Action:** Resume or restart workflow
|
|
441
|
+
|
|
442
|
+
### No Data Imported
|
|
443
|
+
|
|
444
|
+
**Symptom:** ImportData step completes but no tasks in Label Studio
|
|
445
|
+
- **Check:** DataSet has data with specified imageField
|
|
446
|
+
- **Check:** Label Studio project configuration accepts data format
|
|
447
|
+
- **Check:** Network connectivity to Label Studio
|
|
448
|
+
|
|
449
|
+
## UI Access Guide
|
|
450
|
+
|
|
451
|
+
### Menu Structure
|
|
452
|
+
|
|
453
|
+
The LABELING menu group now contains three workflow-related items:
|
|
454
|
+
|
|
455
|
+
1. **Workflows** (`/workflows`)
|
|
456
|
+
- **Source**: `@things-factory/labeling` package
|
|
457
|
+
- **Purpose**: Generic workflow management for all types
|
|
458
|
+
- **Features**: Full CRUD, filtering, execution control
|
|
459
|
+
- **Access**: Owner only
|
|
460
|
+
|
|
461
|
+
2. **Create Workflow** (`/workflow-builder`)
|
|
462
|
+
- **Source**: `@things-factory/labeling` package
|
|
463
|
+
- **Purpose**: Visual workflow builder from scratch
|
|
464
|
+
- **Features**: Step-by-step configuration, JSON editor
|
|
465
|
+
- **Access**: Owner only
|
|
466
|
+
|
|
467
|
+
3. **Dataset Workflows** (`/labeling-workflows`)
|
|
468
|
+
- **Source**: `operato-dataset` package (this package)
|
|
469
|
+
- **Purpose**: Dataset-specific workflow presets
|
|
470
|
+
- **Features**: Auto/Quick workflow creation with prompts
|
|
471
|
+
- **Access**: Owner only
|
|
472
|
+
|
|
473
|
+
### Route Configuration
|
|
474
|
+
|
|
475
|
+
```typescript
|
|
476
|
+
// client/route.ts
|
|
477
|
+
import labelingRoute from '@things-factory/labeling/dist-client/route'
|
|
478
|
+
|
|
479
|
+
export default function route(page: string) {
|
|
480
|
+
// Try labeling package routes first
|
|
481
|
+
const labelingPath = labelingRoute(page)
|
|
482
|
+
if (labelingPath) {
|
|
483
|
+
return labelingPath // Handles /workflows and /workflow-builder
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
// Dataset-specific routes
|
|
487
|
+
switch (page) {
|
|
488
|
+
case 'labeling-workflows':
|
|
489
|
+
import('./pages/labeling/workflow-list') // Dataset-specific UI
|
|
490
|
+
return page
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
### Translation Keys
|
|
496
|
+
|
|
497
|
+
Added to `translations/en.json` and `translations/ko.json`:
|
|
498
|
+
|
|
499
|
+
```json
|
|
500
|
+
{
|
|
501
|
+
"title.workflows": "Workflows / 워크플로우",
|
|
502
|
+
"title.create workflow": "Create Workflow / 워크플로우 생성",
|
|
503
|
+
"title.dataset workflows": "Dataset Workflows / 데이터셋 워크플로우",
|
|
504
|
+
"title.labeling workflows": "Labeling Workflows / 레이블링 워크플로우"
|
|
505
|
+
}
|
|
506
|
+
```
|
|
507
|
+
|
|
508
|
+
## Migration Guide
|
|
509
|
+
|
|
510
|
+
### From integration-label-studio (Old Scenario System)
|
|
511
|
+
|
|
512
|
+
The old `labeling-scenario` has been replaced by `labeling-workflow`:
|
|
513
|
+
|
|
514
|
+
**Old Code:**
|
|
515
|
+
```typescript
|
|
516
|
+
import { LabelingScenarioService } from '@things-factory/integration-label-studio'
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
**New Code:**
|
|
520
|
+
```typescript
|
|
521
|
+
import { LabelingWorkflowService } from '@things-factory/labeling'
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
**Breaking Changes:**
|
|
525
|
+
- Entity names changed: `LabelingScenario` → `LabelingWorkflow`
|
|
526
|
+
- GraphQL operations renamed: `createLabelingScenario` → `createLabelingWorkflow`
|
|
527
|
+
- Configuration structure unchanged (backward compatible)
|
|
528
|
+
|
|
529
|
+
### UI Migration
|
|
530
|
+
|
|
531
|
+
**Old UI** (`/labeling-workflows`):
|
|
532
|
+
- Dataset-specific workflow list with prompts
|
|
533
|
+
- Auto workflow and Quick workflow buttons
|
|
534
|
+
- Simple card-based interface
|
|
535
|
+
|
|
536
|
+
**New UI Options**:
|
|
537
|
+
|
|
538
|
+
1. **Generic Workflows UI** (`/workflows` from labeling package):
|
|
539
|
+
- Grid layout with detailed workflow cards
|
|
540
|
+
- Advanced filtering (status, project ID)
|
|
541
|
+
- Full workflow lifecycle (Edit, Pause, Resume, Delete)
|
|
542
|
+
- Professional workflow management
|
|
543
|
+
|
|
544
|
+
2. **Generic Builder UI** (`/workflow-builder` from labeling package):
|
|
545
|
+
- Visual step-by-step workflow creation
|
|
546
|
+
- Sidebar for workflow config + Main area for step editor
|
|
547
|
+
- Support for all 7 step types
|
|
548
|
+
- JSON configuration editor
|
|
549
|
+
- Continue-on-error options
|
|
550
|
+
|
|
551
|
+
3. **Dataset-Specific UI** (kept at `/labeling-workflows`):
|
|
552
|
+
- Quick access to dataset presets
|
|
553
|
+
- Simplified workflow creation with prompts
|
|
554
|
+
- Dataset context integration
|
|
555
|
+
|
|
556
|
+
## Future Enhancements
|
|
557
|
+
|
|
558
|
+
### Planned Features
|
|
559
|
+
|
|
560
|
+
- [ ] Scheduled workflow triggers (cron-based)
|
|
561
|
+
- [ ] Event-based triggers (on dataset update)
|
|
562
|
+
- [ ] Workflow templates library
|
|
563
|
+
- [ ] Advanced quality validation rules
|
|
564
|
+
- [ ] Annotation disagreement resolution
|
|
565
|
+
- [ ] Real-time execution progress streaming
|
|
566
|
+
- [ ] Workflow analytics dashboard
|
|
567
|
+
- [ ] Multi-project workflows
|
|
568
|
+
- [ ] Conditional branching in workflows
|
|
569
|
+
- [ ] Parallel step execution
|
|
570
|
+
|
|
571
|
+
## Related Documentation
|
|
572
|
+
|
|
573
|
+
- `@things-factory/labeling` - Core workflow orchestration engine
|
|
574
|
+
- `@things-factory/integration-label-studio` - Label Studio API client
|
|
575
|
+
- `@things-factory/ai-inference` - AI model inference
|
|
576
|
+
- Label Studio Documentation: https://labelstud.io/guide/
|
|
577
|
+
|
|
578
|
+
## Support
|
|
579
|
+
|
|
580
|
+
For issues or questions:
|
|
581
|
+
1. Check workflow execution logs in database
|
|
582
|
+
2. Verify Label Studio connectivity
|
|
583
|
+
3. Review DataSet data format
|
|
584
|
+
4. Contact platform administrators
|
package/dist-client/menu.d.ts
CHANGED
|
@@ -49,6 +49,15 @@ export declare function getMenuTemplate(owner: boolean | undefined, dataSets: an
|
|
|
49
49
|
type?: undefined;
|
|
50
50
|
badge?: undefined;
|
|
51
51
|
active?: undefined;
|
|
52
|
+
} | {
|
|
53
|
+
name: string;
|
|
54
|
+
icon: string;
|
|
55
|
+
path: string;
|
|
56
|
+
description: string;
|
|
57
|
+
type?: undefined;
|
|
58
|
+
badge?: undefined;
|
|
59
|
+
active?: undefined;
|
|
60
|
+
menus?: undefined;
|
|
52
61
|
} | {
|
|
53
62
|
name: string;
|
|
54
63
|
icon: string;
|
package/dist-client/menu.js
CHANGED
|
@@ -120,6 +120,33 @@ export function getMenuTemplate(owner = false, dataSets) {
|
|
|
120
120
|
icon: 'heap_snapshot_multiple',
|
|
121
121
|
path: 'kpi-metric-value-manual-entry'
|
|
122
122
|
},
|
|
123
|
+
{
|
|
124
|
+
name: 'LABELING',
|
|
125
|
+
type: 'group'
|
|
126
|
+
},
|
|
127
|
+
owner && {
|
|
128
|
+
name: i18next.t('title.labeling workflows'),
|
|
129
|
+
icon: 'account_tree',
|
|
130
|
+
path: 'labeling-workflows',
|
|
131
|
+
description: 'Manage labeling workflows'
|
|
132
|
+
},
|
|
133
|
+
owner && {
|
|
134
|
+
name: i18next.t('title.create labeling workflow'),
|
|
135
|
+
icon: 'add_circle',
|
|
136
|
+
path: 'labeling-workflow-builder',
|
|
137
|
+
description: 'Create new labeling workflow'
|
|
138
|
+
},
|
|
139
|
+
owner && {
|
|
140
|
+
name: i18next.t('title.dataset labeling workflows'),
|
|
141
|
+
icon: 'hub',
|
|
142
|
+
path: 'dataset-labeling-workflows',
|
|
143
|
+
description: 'Dataset-specific labeling workflows'
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: i18next.t('title.label project list'),
|
|
147
|
+
icon: 'dataset',
|
|
148
|
+
path: 'label-studio-project-list'
|
|
149
|
+
},
|
|
123
150
|
owner && {
|
|
124
151
|
name: 'DATASET',
|
|
125
152
|
type: 'group'
|
package/dist-client/menu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.js","sourceRoot":"","sources":["../client/menu.ts"],"names":[],"mappings":"AAA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iBACvC,CAAA;YACH,CAAC,CAAC,IAAI,EAAE;SACb;QACD;YACE,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,wBAAwB,CAAC;YACzC,IAAI,EAAE,kBAAkB;SACzB;QACD,KAAK,IAAI;YACP,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,yBAAyB,CAAC;YAC1C,IAAI,EAAE,mBAAmB;SAC1B;QACD,KAAK,IAAI;YACP,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC;YACrC,IAAI,EAAE,OAAO;SACd;QACD,KAAK,IAAI;YACP,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC;YACrC,IAAI,EAAE,cAAc;YACpB,WAAW,EAAE,6BAA6B;YAC1C,KAAK,EAAE;gBACL;oBACE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC;oBACrC,IAAI,EAAE,cAAc;iBACrB;gBACD;oBACE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,qBAAqB,CAAC;oBACtC,IAAI,EAAE,eAAe;iBACtB;gBACD;oBACE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,uBAAuB,CAAC;oBACxC,IAAI,EAAE,iBAAiB;iBACxB;gBACD;oBACE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,uBAAuB,CAAC;oBACxC,IAAI,EAAE,iBAAiB;iBACxB;gBACD;oBACE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,sCAAsC,CAAC;oBACvD,IAAI,EAAE,iCAAiC;iBACxC;gBACD;oBACE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,0CAA0C,CAAC;oBAC3D,IAAI,EAAE,qCAAqC;iBAC5C;aACF;SACF;KACF,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;AACnB,CAAC","sourcesContent":["import { asyncReplace } from 'lit/directives/async-replace.js'\nimport i18next from 'i18next'\nimport { generateActivitySummary, startSubscribeActivitySummary } from '@things-factory/worklist/dist-client'\nimport { hasPrivilege } from '@things-factory/auth-base/dist-client'\n\nstartSubscribeActivitySummary()\n\nexport function getMenuTemplate(owner: boolean = false, dataSets: any[]) {\n return [\n {\n name: i18next.t('title.my workspace'),\n type: 'group'\n },\n {\n name: i18next.t('title.todo list'),\n icon: 'things_to_do',\n path: 'todo-list',\n badge: () => asyncReplace(generateActivitySummary('numberOfToDos')),\n active: ({ path }) => /^activity\\//.test(path)\n },\n {\n name: i18next.t('title.approval pending list'),\n icon: 'approval',\n path: 'approval-pending-list',\n badge: () => asyncReplace(generateActivitySummary('numberOfApprovalPendings')),\n active: ({ path }) => /^approval\\//.test(path)\n },\n {\n name: i18next.t('title.draft list'),\n icon: 'drive_file_rename_outline',\n path: 'draft-list',\n badge: () => asyncReplace(generateActivitySummary('numberOfDrafts'))\n },\n {\n name: i18next.t('title.activity starter list'),\n icon: 'rocket_launch',\n path: 'starter-list'\n },\n {\n name: i18next.t('title.activity instance list'),\n icon: 'list_alt_check',\n path: 'activity-instance-list'\n },\n {\n name: i18next.t('title.done list calendar'),\n icon: 'calendar_month',\n path: 'done-list-calendar',\n description: '업무와 관련된 수행 또는 결재 이력을 캘린더에서 조회할 수 있습니다.',\n menus: [\n {\n name: i18next.t('title.done list'),\n icon: 'history',\n path: 'done-list'\n },\n {\n name: i18next.t('title.approval done list'),\n icon: 'history',\n path: 'approval-done-list'\n }\n ]\n },\n {\n name: 'KPI',\n type: 'group'\n },\n {\n name: i18next.t('title.kpi overview'),\n icon: 'widget_small',\n path: 'kpi-overview'\n },\n {\n name: i18next.t('title.kpi performance board'),\n icon: 'widget_small',\n path: 'kpi-dashboard'\n },\n {\n name: i18next.t('title.kpi dashboard'),\n icon: 'widget_small',\n path: 'kpi-dashboard-map'\n },\n owner && {\n name: i18next.t('title.kpi list'),\n icon: 'readiness_score',\n path: 'kpi-list'\n },\n owner && {\n name: i18next.t('title.kpi value editor'),\n icon: 'edit_square',\n path: 'kpi-value-editor'\n },\n owner && {\n name: i18next.t('title.kpi metric list'),\n icon: 'data_exploration',\n path: 'kpi-metric-list'\n },\n owner && {\n name: i18next.t('title.kpi value list'),\n icon: 'heap_snapshot_multiple',\n path: 'kpi-value-list'\n },\n owner && {\n name: i18next.t('title.kpi statistic list'),\n icon: 'candlestick_chart',\n path: 'kpi-statistic-list'\n },\n owner && {\n name: i18next.t('title.kpi statistic editor'),\n icon: 'edit_square',\n path: 'kpi-statistic-editor'\n },\n owner && {\n name: i18next.t('title.kpi metric value list'),\n icon: 'heap_snapshot_multiple',\n path: 'kpi-metric-value-list'\n },\n owner && {\n name: i18next.t('title.kpi metric value editor'),\n icon: 'edit_square',\n path: 'kpi-metric-value-editor'\n },\n owner && {\n name: i18next.t('title.kpi metric value manual entry'),\n icon: 'heap_snapshot_multiple',\n path: 'kpi-metric-value-manual-entry'\n },\n owner && {\n name: 'DATASET',\n type: 'group'\n },\n owner && {\n name: i18next.t('title.data-set list'),\n icon: 'dataset',\n path: 'data-set-list'\n },\n owner && {\n name: i18next.t('title.data-key-set list'),\n icon: 'dataset_linked',\n path: 'data-key-set-list'\n },\n owner && {\n name: i18next.t('title.data-sensor list'),\n icon: 'sensors',\n path: 'data-sensor-list'\n },\n {\n name: 'DATA ENTRY',\n type: 'group'\n },\n {\n icon: 'edit_square',\n name: i18next.t('title.data-entry list'),\n path: 'data-entry-list'\n },\n {\n name: 'DATA REPORT',\n type: 'group'\n },\n owner && {\n name: i18next.t('title.data-sample list'),\n icon: 'rule',\n path: 'data-sample-list',\n menus:\n dataSets.map(item => {\n return {\n name: item.name,\n icon: 'checklist_rtl',\n path: `data-sample-search/${item.id}`\n }\n }) || []\n },\n owner && {\n name: i18next.t('title.data-ooc list'),\n icon: 'error',\n path: 'data-ooc-list'\n },\n owner && {\n name: i18next.t('title.data-summary list'),\n icon: 'functions',\n path: 'data-summary-list',\n menus:\n dataSets\n .filter(item => item.active && item.summaryPeriod)\n .map(item => {\n return {\n name: item.name,\n icon: 'checklist',\n path: `data-summary-period/${item.id}`\n }\n }) || []\n },\n {\n icon: 'newspaper',\n name: i18next.t('title.data-report-view'),\n path: 'data-report-list'\n },\n owner && {\n icon: 'archive',\n name: i18next.t('title.data-archive list'),\n path: 'data-archive-list'\n },\n owner && {\n name: i18next.t('title.organization'),\n type: 'group'\n },\n owner && {\n name: i18next.t('title.organization'),\n icon: 'account_tree',\n description: '조직 구성과 결재선 관리를 위한 메뉴 구성입니다.',\n menus: [\n {\n name: i18next.t('title.contact list'),\n path: 'contact-list'\n },\n {\n name: i18next.t('title.employee list'),\n path: 'employee-list'\n },\n {\n name: i18next.t('title.department tree'),\n path: 'department-tree'\n },\n {\n name: i18next.t('title.department list'),\n path: 'department-list'\n },\n {\n name: i18next.t('title.my-approval-line template list'),\n path: 'my-approval-line-templates-page'\n },\n {\n name: i18next.t('title.common-approval-line template list'),\n path: 'common-approval-line-templates-page'\n }\n ]\n }\n ].filter(Boolean)\n}\n"]}
|
|
1
|
+
{"version":3,"file":"menu.js","sourceRoot":"","sources":["../client/menu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAC9D,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAA;AAG7G,6BAA6B,EAAE,CAAA;AAE/B,MAAM,UAAU,eAAe,CAAC,QAAiB,KAAK,EAAE,QAAe;IACrE,OAAO;QACL;YACE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC;YACrC,IAAI,EAAE,OAAO;SACd;QACD;YACE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC;YAClC,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,uBAAuB,CAAC,eAAe,CAAC,CAAC;YACnE,MA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F;KACF,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;AACnB,CAAC","sourcesContent":["import { asyncReplace } from 'lit/directives/async-replace.js'\nimport i18next from 'i18next'\nimport { generateActivitySummary, startSubscribeActivitySummary } from '@things-factory/worklist/dist-client'\nimport { hasPrivilege } from '@things-factory/auth-base/dist-client'\n\nstartSubscribeActivitySummary()\n\nexport function getMenuTemplate(owner: boolean = false, dataSets: any[]) {\n return [\n {\n name: i18next.t('title.my workspace'),\n type: 'group'\n },\n {\n name: i18next.t('title.todo list'),\n icon: 'things_to_do',\n path: 'todo-list',\n badge: () => asyncReplace(generateActivitySummary('numberOfToDos')),\n active: ({ path }) => /^activity\\//.test(path)\n },\n {\n name: i18next.t('title.approval pending list'),\n icon: 'approval',\n path: 'approval-pending-list',\n badge: () => asyncReplace(generateActivitySummary('numberOfApprovalPendings')),\n active: ({ path }) => /^approval\\//.test(path)\n },\n {\n name: i18next.t('title.draft list'),\n icon: 'drive_file_rename_outline',\n path: 'draft-list',\n badge: () => asyncReplace(generateActivitySummary('numberOfDrafts'))\n },\n {\n name: i18next.t('title.activity starter list'),\n icon: 'rocket_launch',\n path: 'starter-list'\n },\n {\n name: i18next.t('title.activity instance list'),\n icon: 'list_alt_check',\n path: 'activity-instance-list'\n },\n {\n name: i18next.t('title.done list calendar'),\n icon: 'calendar_month',\n path: 'done-list-calendar',\n description: '업무와 관련된 수행 또는 결재 이력을 캘린더에서 조회할 수 있습니다.',\n menus: [\n {\n name: i18next.t('title.done list'),\n icon: 'history',\n path: 'done-list'\n },\n {\n name: i18next.t('title.approval done list'),\n icon: 'history',\n path: 'approval-done-list'\n }\n ]\n },\n {\n name: 'KPI',\n type: 'group'\n },\n {\n name: i18next.t('title.kpi overview'),\n icon: 'widget_small',\n path: 'kpi-overview'\n },\n {\n name: i18next.t('title.kpi performance board'),\n icon: 'widget_small',\n path: 'kpi-dashboard'\n },\n {\n name: i18next.t('title.kpi dashboard'),\n icon: 'widget_small',\n path: 'kpi-dashboard-map'\n },\n owner && {\n name: i18next.t('title.kpi list'),\n icon: 'readiness_score',\n path: 'kpi-list'\n },\n owner && {\n name: i18next.t('title.kpi value editor'),\n icon: 'edit_square',\n path: 'kpi-value-editor'\n },\n owner && {\n name: i18next.t('title.kpi metric list'),\n icon: 'data_exploration',\n path: 'kpi-metric-list'\n },\n owner && {\n name: i18next.t('title.kpi value list'),\n icon: 'heap_snapshot_multiple',\n path: 'kpi-value-list'\n },\n owner && {\n name: i18next.t('title.kpi statistic list'),\n icon: 'candlestick_chart',\n path: 'kpi-statistic-list'\n },\n owner && {\n name: i18next.t('title.kpi statistic editor'),\n icon: 'edit_square',\n path: 'kpi-statistic-editor'\n },\n owner && {\n name: i18next.t('title.kpi metric value list'),\n icon: 'heap_snapshot_multiple',\n path: 'kpi-metric-value-list'\n },\n owner && {\n name: i18next.t('title.kpi metric value editor'),\n icon: 'edit_square',\n path: 'kpi-metric-value-editor'\n },\n owner && {\n name: i18next.t('title.kpi metric value manual entry'),\n icon: 'heap_snapshot_multiple',\n path: 'kpi-metric-value-manual-entry'\n },\n {\n name: 'LABELING',\n type: 'group'\n },\n owner && {\n name: i18next.t('title.labeling workflows'),\n icon: 'account_tree',\n path: 'labeling-workflows',\n description: 'Manage labeling workflows'\n },\n owner && {\n name: i18next.t('title.create labeling workflow'),\n icon: 'add_circle',\n path: 'labeling-workflow-builder',\n description: 'Create new labeling workflow'\n },\n owner && {\n name: i18next.t('title.dataset labeling workflows'),\n icon: 'hub',\n path: 'dataset-labeling-workflows',\n description: 'Dataset-specific labeling workflows'\n },\n {\n name: i18next.t('title.label project list'),\n icon: 'dataset',\n path: 'label-studio-project-list'\n },\n owner && {\n name: 'DATASET',\n type: 'group'\n },\n owner && {\n name: i18next.t('title.data-set list'),\n icon: 'dataset',\n path: 'data-set-list'\n },\n owner && {\n name: i18next.t('title.data-key-set list'),\n icon: 'dataset_linked',\n path: 'data-key-set-list'\n },\n owner && {\n name: i18next.t('title.data-sensor list'),\n icon: 'sensors',\n path: 'data-sensor-list'\n },\n {\n name: 'DATA ENTRY',\n type: 'group'\n },\n {\n icon: 'edit_square',\n name: i18next.t('title.data-entry list'),\n path: 'data-entry-list'\n },\n {\n name: 'DATA REPORT',\n type: 'group'\n },\n owner && {\n name: i18next.t('title.data-sample list'),\n icon: 'rule',\n path: 'data-sample-list',\n menus:\n dataSets.map(item => {\n return {\n name: item.name,\n icon: 'checklist_rtl',\n path: `data-sample-search/${item.id}`\n }\n }) || []\n },\n owner && {\n name: i18next.t('title.data-ooc list'),\n icon: 'error',\n path: 'data-ooc-list'\n },\n owner && {\n name: i18next.t('title.data-summary list'),\n icon: 'functions',\n path: 'data-summary-list',\n menus:\n dataSets\n .filter(item => item.active && item.summaryPeriod)\n .map(item => {\n return {\n name: item.name,\n icon: 'checklist',\n path: `data-summary-period/${item.id}`\n }\n }) || []\n },\n {\n icon: 'newspaper',\n name: i18next.t('title.data-report-view'),\n path: 'data-report-list'\n },\n owner && {\n icon: 'archive',\n name: i18next.t('title.data-archive list'),\n path: 'data-archive-list'\n },\n owner && {\n name: i18next.t('title.organization'),\n type: 'group'\n },\n owner && {\n name: i18next.t('title.organization'),\n icon: 'account_tree',\n description: '조직 구성과 결재선 관리를 위한 메뉴 구성입니다.',\n menus: [\n {\n name: i18next.t('title.contact list'),\n path: 'contact-list'\n },\n {\n name: i18next.t('title.employee list'),\n path: 'employee-list'\n },\n {\n name: i18next.t('title.department tree'),\n path: 'department-tree'\n },\n {\n name: i18next.t('title.department list'),\n path: 'department-list'\n },\n {\n name: i18next.t('title.my-approval-line template list'),\n path: 'my-approval-line-templates-page'\n },\n {\n name: i18next.t('title.common-approval-line template list'),\n path: 'common-approval-line-templates-page'\n }\n ]\n }\n ].filter(Boolean)\n}\n"]}
|