@andrewyang/ai-workflow-editor 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -0
- package/dist/ai-workflow-editor.css +1 -1
- package/dist/ai-workflow-editor.es.js +14745 -26955
- package/dist/ai-workflow-editor.umd.js +87 -129
- package/dist/components/AiWorkflowEditor.d.ts +45 -0
- package/dist/components/ai/AiChatPanel.d.ts +21 -0
- package/dist/components/editor/Canvas.d.ts +31 -0
- package/dist/components/editor/FormatPanel.d.ts +23 -0
- package/dist/components/editor/NodePanel.d.ts +2 -0
- package/dist/components/editor/Toolbar.d.ts +14 -0
- package/dist/components/editor/nodes/AiNode.d.ts +28 -0
- package/dist/components/editor/nodes/NormalNode.d.ts +28 -0
- package/dist/components/editor/nodes/SysmlBlockNode.d.ts +28 -0
- package/dist/components/editor/nodes/SysmlRequirementNode.d.ts +28 -0
- package/dist/components/editor/nodes/SysmlUseCaseNode.d.ts +28 -0
- package/dist/composables/useAi.d.ts +13 -0
- package/dist/index.d.ts +5 -0
- package/dist/types/ai.d.ts +15 -0
- package/dist/types/workflow.d.ts +49 -0
- package/dist/utils/llmAdapter.d.ts +18 -0
- package/package.json +21 -10
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# AI Workflow Editor
|
|
2
|
+
|
|
3
|
+
A powerful workflow editor component for Vue 3, featuring AI-assisted generation and SysML support.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @andrewyang/ai-workflow-editor
|
|
9
|
+
# or
|
|
10
|
+
yarn add @andrewyang/ai-workflow-editor
|
|
11
|
+
# or
|
|
12
|
+
pnpm add @andrewyang/ai-workflow-editor
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Peer Dependencies
|
|
16
|
+
|
|
17
|
+
Ensure you have the following peer dependencies installed:
|
|
18
|
+
|
|
19
|
+
- `vue` >= 3.4.0
|
|
20
|
+
- `element-plus` >= 2.0.0
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
### Import Styles
|
|
25
|
+
|
|
26
|
+
In your entry file (e.g., `main.ts` or `App.vue`):
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
import 'element-plus/dist/index.css'
|
|
30
|
+
import '@andrewyang/ai-workflow-editor/style.css'
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Use Component
|
|
34
|
+
|
|
35
|
+
```vue
|
|
36
|
+
<template>
|
|
37
|
+
<AiWorkflowEditor
|
|
38
|
+
:default-llm-config="llmConfig"
|
|
39
|
+
@save="onSave"
|
|
40
|
+
/>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<script setup lang="ts">
|
|
44
|
+
import { AiWorkflowEditor } from '@andrewyang/ai-workflow-editor'
|
|
45
|
+
|
|
46
|
+
const llmConfig = {
|
|
47
|
+
provider: 'openai',
|
|
48
|
+
apiKey: 'your-api-key',
|
|
49
|
+
model: 'gpt-4'
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const onSave = (workflow) => {
|
|
53
|
+
console.log('Saved workflow:', workflow)
|
|
54
|
+
}
|
|
55
|
+
</script>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Use Composable
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
import { useAi } from '@andrewyang/ai-workflow-editor'
|
|
62
|
+
|
|
63
|
+
const { generateWorkflow, loading, error } = useAi()
|
|
64
|
+
```
|