@mulmochat-plugin/quiz 0.2.0 → 0.3.0
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.ja.md +99 -36
- package/README.md +99 -36
- package/README.npm.md +39 -5
- package/dist/core/definition.d.ts +6 -0
- package/dist/core/index.d.ts +4 -2
- package/dist/core/plugin.d.ts +2 -4
- package/dist/core/samples.d.ts +5 -0
- package/dist/core/types.d.ts +3 -222
- package/dist/react/Preview.d.ts +8 -0
- package/dist/react/View.d.ts +8 -0
- package/dist/react/index.d.ts +24 -0
- package/dist/react.cjs +8 -0
- package/dist/react.js +398 -0
- package/dist/style.css +1 -1
- package/dist/vue/Preview.vue.d.ts +1 -1
- package/dist/vue/View.vue.d.ts +1 -1
- package/dist/vue/index.d.ts +7 -5
- package/dist/vue.cjs +2 -2
- package/dist/vue.js +7 -6
- package/package.json +35 -6
- package/dist/vue/types.d.ts +0 -32
package/README.ja.md
CHANGED
|
@@ -11,9 +11,18 @@ MulmoChat用のクイズプラグイン。複数選択式のクイズをユー
|
|
|
11
11
|
|
|
12
12
|
このプラグインは、MulmoChatのプラグインシステムのリファレンス実装です。サーバー通信不要なシンプルな構造のため、新しいプラグインを作成する際のテンプレートとして使用できます。
|
|
13
13
|
|
|
14
|
+
**フレームワーク非依存のcoreアーキテクチャ**と**VueおよびReact実装**を実現しています:
|
|
15
|
+
- **Core**: フレームワーク非依存のプラグインロジック(任意のUIフレームワークで使用可能)
|
|
16
|
+
- **Vue**: Vue専用のUIコンポーネント
|
|
17
|
+
- **React**: React専用のUIコンポーネント
|
|
18
|
+
|
|
19
|
+
### 特徴
|
|
20
|
+
|
|
14
21
|
- **Tailwind CSS 4** を使用したスタイリング
|
|
15
22
|
- **TypeScript** による型安全な実装
|
|
16
23
|
- **ESLint** による静的解析
|
|
24
|
+
- **フレームワーク非依存のcore** による移植性
|
|
25
|
+
- **マルチフレームワーク対応**(VueとReact)
|
|
17
26
|
|
|
18
27
|
## インストール
|
|
19
28
|
|
|
@@ -27,8 +36,7 @@ yarn add @mulmochat-plugin/quiz
|
|
|
27
36
|
|
|
28
37
|
2. MulmoChatの`src/tools/index.ts`でインポート:
|
|
29
38
|
```typescript
|
|
30
|
-
import QuizPlugin from "@mulmochat-plugin/quiz";
|
|
31
|
-
import "@mulmochat-plugin/quiz/style.css";
|
|
39
|
+
import QuizPlugin from "@mulmochat-plugin/quiz/vue";
|
|
32
40
|
|
|
33
41
|
// pluginListに追加
|
|
34
42
|
const pluginList = [
|
|
@@ -37,6 +45,32 @@ const pluginList = [
|
|
|
37
45
|
];
|
|
38
46
|
```
|
|
39
47
|
|
|
48
|
+
3. `src/main.ts`でスタイルをインポート:
|
|
49
|
+
```typescript
|
|
50
|
+
import "@mulmochat-plugin/quiz/style.css";
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## パッケージエクスポート
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
// デフォルト: Core(フレームワーク非依存)
|
|
57
|
+
import { pluginCore, TOOL_NAME, QuizData } from "@mulmochat-plugin/quiz";
|
|
58
|
+
|
|
59
|
+
// Vue実装
|
|
60
|
+
import QuizPlugin from "@mulmochat-plugin/quiz/vue";
|
|
61
|
+
import "@mulmochat-plugin/quiz/style.css";
|
|
62
|
+
|
|
63
|
+
// Vue名前付きエクスポート
|
|
64
|
+
import { plugin, View, Preview } from "@mulmochat-plugin/quiz/vue";
|
|
65
|
+
|
|
66
|
+
// React実装
|
|
67
|
+
import QuizPlugin from "@mulmochat-plugin/quiz/react";
|
|
68
|
+
import "@mulmochat-plugin/quiz/style.css";
|
|
69
|
+
|
|
70
|
+
// React名前付きエクスポート
|
|
71
|
+
import { plugin, View, Preview } from "@mulmochat-plugin/quiz/react";
|
|
72
|
+
```
|
|
73
|
+
|
|
40
74
|
## 開発
|
|
41
75
|
|
|
42
76
|
### セットアップ
|
|
@@ -48,7 +82,11 @@ yarn install
|
|
|
48
82
|
### 開発サーバー
|
|
49
83
|
|
|
50
84
|
```bash
|
|
85
|
+
# Vueデモ
|
|
51
86
|
yarn dev
|
|
87
|
+
|
|
88
|
+
# Reactデモ
|
|
89
|
+
yarn dev:react
|
|
52
90
|
```
|
|
53
91
|
|
|
54
92
|
http://localhost:5173/ でデモページが表示されます。
|
|
@@ -76,31 +114,45 @@ yarn lint
|
|
|
76
114
|
```
|
|
77
115
|
MulmoChatPluginQuiz/
|
|
78
116
|
├── src/
|
|
79
|
-
│ ├── index.ts #
|
|
117
|
+
│ ├── index.ts # デフォルトエクスポート(core)
|
|
80
118
|
│ ├── style.css # Tailwind CSSエントリー
|
|
81
|
-
│ ├──
|
|
82
|
-
│ │ ├── index.ts #
|
|
83
|
-
│ │
|
|
84
|
-
│
|
|
85
|
-
│
|
|
86
|
-
│
|
|
87
|
-
│
|
|
88
|
-
│
|
|
89
|
-
│
|
|
90
|
-
|
|
91
|
-
│
|
|
119
|
+
│ ├── core/ # フレームワーク非依存(Vue/React依存なし)
|
|
120
|
+
│ │ ├── index.ts # Coreエクスポート
|
|
121
|
+
│ │ ├── types.ts # Quiz固有の型(QuizData, QuizArgs)
|
|
122
|
+
│ │ ├── definition.ts # ツール定義(スキーマ)
|
|
123
|
+
│ │ ├── samples.ts # サンプルデータ
|
|
124
|
+
│ │ └── plugin.ts # Execute関数
|
|
125
|
+
│ ├── vue/ # Vue固有の実装
|
|
126
|
+
│ │ ├── index.ts # Vueプラグイン(core + コンポーネント)
|
|
127
|
+
│ │ ├── View.vue # メインビューコンポーネント
|
|
128
|
+
│ │ └── Preview.vue # サイドバープレビュー
|
|
129
|
+
│ └── react/ # React固有の実装
|
|
130
|
+
│ ├── index.ts # Reactプラグイン(core + コンポーネント)
|
|
131
|
+
│ ├── View.tsx # メインビューコンポーネント
|
|
132
|
+
│ └── Preview.tsx # サイドバープレビュー
|
|
133
|
+
├── demo/ # Vueデモ
|
|
134
|
+
│ ├── App.vue
|
|
92
135
|
│ └── main.ts
|
|
136
|
+
├── demo-react/ # Reactデモ
|
|
137
|
+
│ ├── App.tsx
|
|
138
|
+
│ ├── main.tsx
|
|
139
|
+
│ ├── style.css
|
|
140
|
+
│ ├── index.html
|
|
141
|
+
│ └── vite.config.ts
|
|
93
142
|
├── package.json
|
|
94
143
|
├── vite.config.ts
|
|
95
144
|
├── tsconfig.json
|
|
145
|
+
├── tsconfig.react.json # React用TypeScript設定
|
|
96
146
|
└── eslint.config.js
|
|
97
147
|
```
|
|
98
148
|
|
|
99
149
|
### ディレクトリの役割
|
|
100
150
|
|
|
101
|
-
- **src/
|
|
102
|
-
- **src/
|
|
103
|
-
- **
|
|
151
|
+
- **src/core/**: フレームワーク非依存の型とプラグインロジック。Vue/React依存なし。
|
|
152
|
+
- **src/vue/**: Vue専用UIコンポーネントとVueプラグインエクスポート。
|
|
153
|
+
- **src/react/**: React専用UIコンポーネントとReactプラグインエクスポート。
|
|
154
|
+
- **demo/**: Vueデモ。
|
|
155
|
+
- **demo-react/**: Reactデモ。
|
|
104
156
|
|
|
105
157
|
## 新しいプラグインの作成
|
|
106
158
|
|
|
@@ -121,35 +173,46 @@ yarn dev
|
|
|
121
173
|
### 手動セットアップ
|
|
122
174
|
|
|
123
175
|
詳細な手順は [TEMPLATE.md](./TEMPLATE.md) を参照:
|
|
176
|
+
- Core/Vue/Reactアーキテクチャ
|
|
124
177
|
- そのままコピーできるファイル
|
|
125
|
-
- 変更が必要なファイル(`package.json` のみ)
|
|
126
178
|
- プラグイン固有の実装要件
|
|
127
|
-
- 重要なパターン(View.vue
|
|
179
|
+
- 重要なパターン(View.vueのリアクティビティ)
|
|
180
|
+
|
|
181
|
+
## Core型定義
|
|
128
182
|
|
|
129
|
-
|
|
183
|
+
### ToolPluginCore(フレームワーク非依存)
|
|
130
184
|
|
|
131
185
|
```typescript
|
|
132
|
-
interface
|
|
133
|
-
toolDefinition:
|
|
134
|
-
type: "function";
|
|
135
|
-
name: string;
|
|
136
|
-
description: string;
|
|
137
|
-
parameters?: {
|
|
138
|
-
type: "object";
|
|
139
|
-
properties: Record<string, JsonSchemaProperty>;
|
|
140
|
-
required: string[];
|
|
141
|
-
};
|
|
142
|
-
};
|
|
186
|
+
interface ToolPluginCore<T, J, A> {
|
|
187
|
+
toolDefinition: ToolDefinition;
|
|
143
188
|
execute: (context: ToolContext, args: A) => Promise<ToolResult<T, J>>;
|
|
144
189
|
generatingMessage: string;
|
|
145
190
|
isEnabled: (startResponse?: StartApiResponse | null) => boolean;
|
|
146
|
-
viewComponent?: Component;
|
|
147
|
-
previewComponent?: Component;
|
|
148
191
|
// Optional
|
|
149
192
|
systemPrompt?: string;
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
samples?: ToolSample[];
|
|
193
|
+
inputHandlers?: InputHandler[];
|
|
194
|
+
configSchema?: PluginConfigSchema;
|
|
195
|
+
samples?: ToolSample[];
|
|
196
|
+
backends?: BackendType[];
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### ToolPlugin(Vue固有、ToolPluginCoreを拡張)
|
|
201
|
+
|
|
202
|
+
```typescript
|
|
203
|
+
interface ToolPlugin<T, J, A> extends ToolPluginCore<T, J, A> {
|
|
204
|
+
viewComponent?: Component; // Vue Component
|
|
205
|
+
previewComponent?: Component; // Vue Component
|
|
206
|
+
config?: ToolPluginConfig; // レガシーVueコンポーネントベースの設定
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### ToolPlugin(React固有、ToolPluginCoreを拡張)
|
|
211
|
+
|
|
212
|
+
```typescript
|
|
213
|
+
interface ToolPlugin<T, J, A> extends ToolPluginCore<T, J, A> {
|
|
214
|
+
viewComponent?: ComponentType; // React ComponentType
|
|
215
|
+
previewComponent?: ComponentType; // React ComponentType
|
|
153
216
|
}
|
|
154
217
|
```
|
|
155
218
|
|
package/README.md
CHANGED
|
@@ -9,11 +9,20 @@ A quiz plugin for MulmoChat. Presents multiple choice quizzes to users.
|
|
|
9
9
|
|
|
10
10
|
## Overview
|
|
11
11
|
|
|
12
|
-
This plugin is
|
|
12
|
+
This plugin is the reference implementation of the MulmoChat plugin system. With its simple structure requiring no server communication, it can be used as a template for creating new plugins.
|
|
13
|
+
|
|
14
|
+
It demonstrates the **framework-agnostic core architecture** with **Vue and React implementations**:
|
|
15
|
+
- **Core**: Framework-agnostic plugin logic (can be used with any UI framework)
|
|
16
|
+
- **Vue**: Vue-specific UI components
|
|
17
|
+
- **React**: React-specific UI components
|
|
18
|
+
|
|
19
|
+
### Features
|
|
13
20
|
|
|
14
21
|
- **Tailwind CSS 4** for styling
|
|
15
22
|
- **TypeScript** for type-safe implementation
|
|
16
23
|
- **ESLint** for static analysis
|
|
24
|
+
- **Framework-agnostic core** for portability
|
|
25
|
+
- **Multi-framework support** (Vue and React)
|
|
17
26
|
|
|
18
27
|
## Installation
|
|
19
28
|
|
|
@@ -27,8 +36,7 @@ yarn add @mulmochat-plugin/quiz
|
|
|
27
36
|
|
|
28
37
|
2. Import in MulmoChat's `src/tools/index.ts`:
|
|
29
38
|
```typescript
|
|
30
|
-
import QuizPlugin from "@mulmochat-plugin/quiz";
|
|
31
|
-
import "@mulmochat-plugin/quiz/style.css";
|
|
39
|
+
import QuizPlugin from "@mulmochat-plugin/quiz/vue";
|
|
32
40
|
|
|
33
41
|
// Add to pluginList
|
|
34
42
|
const pluginList = [
|
|
@@ -37,6 +45,32 @@ const pluginList = [
|
|
|
37
45
|
];
|
|
38
46
|
```
|
|
39
47
|
|
|
48
|
+
3. Import styles in `src/main.ts`:
|
|
49
|
+
```typescript
|
|
50
|
+
import "@mulmochat-plugin/quiz/style.css";
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Package Exports
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
// Default: Core (framework-agnostic)
|
|
57
|
+
import { pluginCore, TOOL_NAME, QuizData } from "@mulmochat-plugin/quiz";
|
|
58
|
+
|
|
59
|
+
// Vue implementation
|
|
60
|
+
import QuizPlugin from "@mulmochat-plugin/quiz/vue";
|
|
61
|
+
import "@mulmochat-plugin/quiz/style.css";
|
|
62
|
+
|
|
63
|
+
// Named Vue exports
|
|
64
|
+
import { plugin, View, Preview } from "@mulmochat-plugin/quiz/vue";
|
|
65
|
+
|
|
66
|
+
// React implementation
|
|
67
|
+
import QuizPlugin from "@mulmochat-plugin/quiz/react";
|
|
68
|
+
import "@mulmochat-plugin/quiz/style.css";
|
|
69
|
+
|
|
70
|
+
// Named React exports
|
|
71
|
+
import { plugin, View, Preview } from "@mulmochat-plugin/quiz/react";
|
|
72
|
+
```
|
|
73
|
+
|
|
40
74
|
## Development
|
|
41
75
|
|
|
42
76
|
### Setup
|
|
@@ -48,7 +82,11 @@ yarn install
|
|
|
48
82
|
### Development Server
|
|
49
83
|
|
|
50
84
|
```bash
|
|
85
|
+
# Vue demo
|
|
51
86
|
yarn dev
|
|
87
|
+
|
|
88
|
+
# React demo
|
|
89
|
+
yarn dev:react
|
|
52
90
|
```
|
|
53
91
|
|
|
54
92
|
Demo page will be available at http://localhost:5173/
|
|
@@ -76,31 +114,45 @@ yarn lint
|
|
|
76
114
|
```
|
|
77
115
|
MulmoChatPluginQuiz/
|
|
78
116
|
├── src/
|
|
79
|
-
│ ├── index.ts #
|
|
117
|
+
│ ├── index.ts # Default export (core)
|
|
80
118
|
│ ├── style.css # Tailwind CSS entry
|
|
81
|
-
│ ├──
|
|
82
|
-
│ │ ├── index.ts #
|
|
83
|
-
│ │
|
|
84
|
-
│
|
|
85
|
-
│
|
|
86
|
-
│
|
|
87
|
-
│
|
|
88
|
-
│
|
|
89
|
-
│
|
|
90
|
-
|
|
91
|
-
│
|
|
119
|
+
│ ├── core/ # Framework-agnostic (no Vue/React dependencies)
|
|
120
|
+
│ │ ├── index.ts # Core exports
|
|
121
|
+
│ │ ├── types.ts # Quiz-specific types (QuizData, QuizArgs)
|
|
122
|
+
│ │ ├── definition.ts # Tool definition (schema)
|
|
123
|
+
│ │ ├── samples.ts # Sample data
|
|
124
|
+
│ │ └── plugin.ts # Execute function
|
|
125
|
+
│ ├── vue/ # Vue-specific implementation
|
|
126
|
+
│ │ ├── index.ts # Vue plugin (combines core + components)
|
|
127
|
+
│ │ ├── View.vue # Main view component
|
|
128
|
+
│ │ └── Preview.vue # Sidebar preview component
|
|
129
|
+
│ └── react/ # React-specific implementation
|
|
130
|
+
│ ├── index.ts # React plugin (combines core + components)
|
|
131
|
+
│ ├── View.tsx # Main view component
|
|
132
|
+
│ └── Preview.tsx # Sidebar preview component
|
|
133
|
+
├── demo/ # Vue demo
|
|
134
|
+
│ ├── App.vue
|
|
92
135
|
│ └── main.ts
|
|
136
|
+
├── demo-react/ # React demo
|
|
137
|
+
│ ├── App.tsx
|
|
138
|
+
│ ├── main.tsx
|
|
139
|
+
│ ├── style.css
|
|
140
|
+
│ ├── index.html
|
|
141
|
+
│ └── vite.config.ts
|
|
93
142
|
├── package.json
|
|
94
143
|
├── vite.config.ts
|
|
95
144
|
├── tsconfig.json
|
|
145
|
+
├── tsconfig.react.json # React-specific TypeScript config
|
|
96
146
|
└── eslint.config.js
|
|
97
147
|
```
|
|
98
148
|
|
|
99
149
|
### Directory Purpose
|
|
100
150
|
|
|
101
|
-
- **src/
|
|
102
|
-
- **src/
|
|
103
|
-
- **
|
|
151
|
+
- **src/core/**: Framework-agnostic types and plugin logic. No Vue/React dependencies.
|
|
152
|
+
- **src/vue/**: Vue-specific UI components and the full Vue plugin export.
|
|
153
|
+
- **src/react/**: React-specific UI components and the full React plugin export.
|
|
154
|
+
- **demo/**: Vue demo.
|
|
155
|
+
- **demo-react/**: React demo.
|
|
104
156
|
|
|
105
157
|
## Creating a New Plugin
|
|
106
158
|
|
|
@@ -121,35 +173,46 @@ yarn dev
|
|
|
121
173
|
### Manual Setup
|
|
122
174
|
|
|
123
175
|
See [TEMPLATE.md](./TEMPLATE.md) for detailed instructions on:
|
|
176
|
+
- Core/Vue architecture
|
|
124
177
|
- Files that can be copied as-is
|
|
125
|
-
- Files requiring modification (only `package.json`)
|
|
126
178
|
- Plugin-specific implementation requirements
|
|
127
179
|
- Important patterns (View.vue reactivity)
|
|
128
180
|
|
|
129
|
-
##
|
|
181
|
+
## Core Types
|
|
182
|
+
|
|
183
|
+
### ToolPluginCore (Framework-agnostic)
|
|
130
184
|
|
|
131
185
|
```typescript
|
|
132
|
-
interface
|
|
133
|
-
toolDefinition:
|
|
134
|
-
type: "function";
|
|
135
|
-
name: string;
|
|
136
|
-
description: string;
|
|
137
|
-
parameters?: {
|
|
138
|
-
type: "object";
|
|
139
|
-
properties: Record<string, JsonSchemaProperty>;
|
|
140
|
-
required: string[];
|
|
141
|
-
};
|
|
142
|
-
};
|
|
186
|
+
interface ToolPluginCore<T, J, A> {
|
|
187
|
+
toolDefinition: ToolDefinition;
|
|
143
188
|
execute: (context: ToolContext, args: A) => Promise<ToolResult<T, J>>;
|
|
144
189
|
generatingMessage: string;
|
|
145
190
|
isEnabled: (startResponse?: StartApiResponse | null) => boolean;
|
|
146
|
-
viewComponent?: Component;
|
|
147
|
-
previewComponent?: Component;
|
|
148
191
|
// Optional
|
|
149
192
|
systemPrompt?: string;
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
samples?: ToolSample[];
|
|
193
|
+
inputHandlers?: InputHandler[];
|
|
194
|
+
configSchema?: PluginConfigSchema;
|
|
195
|
+
samples?: ToolSample[];
|
|
196
|
+
backends?: BackendType[];
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### ToolPlugin (Vue-specific, extends ToolPluginCore)
|
|
201
|
+
|
|
202
|
+
```typescript
|
|
203
|
+
interface ToolPlugin<T, J, A> extends ToolPluginCore<T, J, A> {
|
|
204
|
+
viewComponent?: Component; // Vue Component
|
|
205
|
+
previewComponent?: Component; // Vue Component
|
|
206
|
+
config?: ToolPluginConfig; // Legacy Vue component-based config
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### ToolPlugin (React-specific, extends ToolPluginCore)
|
|
211
|
+
|
|
212
|
+
```typescript
|
|
213
|
+
interface ToolPlugin<T, J, A> extends ToolPluginCore<T, J, A> {
|
|
214
|
+
viewComponent?: ComponentType; // React ComponentType
|
|
215
|
+
previewComponent?: ComponentType; // React ComponentType
|
|
153
216
|
}
|
|
154
217
|
```
|
|
155
218
|
|
package/README.npm.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @mulmochat-plugin/{plugin-name}
|
|
2
2
|
|
|
3
3
|
A plugin for [MulmoChat](https://github.com/receptron/MulmoChat) - a multi-modal voice chat application with OpenAI's GPT-4 Realtime API.
|
|
4
4
|
|
|
@@ -14,26 +14,60 @@ yarn add @mulmochat-plugin/{plugin-name}
|
|
|
14
14
|
|
|
15
15
|
## Usage
|
|
16
16
|
|
|
17
|
+
### Vue Implementation (for MulmoChat)
|
|
18
|
+
|
|
17
19
|
```typescript
|
|
18
|
-
|
|
19
|
-
import "@mulmochat-plugin/{plugin-name}/
|
|
20
|
+
// In src/tools/index.ts
|
|
21
|
+
import Plugin from "@mulmochat-plugin/{plugin-name}/vue";
|
|
20
22
|
|
|
21
|
-
// Add to pluginList
|
|
22
23
|
const pluginList = [
|
|
23
24
|
// ... other plugins
|
|
24
25
|
Plugin,
|
|
25
26
|
];
|
|
27
|
+
|
|
28
|
+
// In src/main.ts
|
|
29
|
+
import "@mulmochat-plugin/{plugin-name}/style.css";
|
|
26
30
|
```
|
|
27
31
|
|
|
32
|
+
### React Implementation
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
import Plugin from "@mulmochat-plugin/{plugin-name}/react";
|
|
36
|
+
import "@mulmochat-plugin/{plugin-name}/style.css";
|
|
37
|
+
|
|
38
|
+
// Named exports
|
|
39
|
+
import { plugin, View, Preview } from "@mulmochat-plugin/{plugin-name}/react";
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Core Only (Framework-agnostic)
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
import { pluginCore, TOOL_NAME } from "@mulmochat-plugin/{plugin-name}";
|
|
46
|
+
// or
|
|
47
|
+
import pluginCore from "@mulmochat-plugin/{plugin-name}";
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Package Exports
|
|
51
|
+
|
|
52
|
+
| Export | Description |
|
|
53
|
+
|--------|-------------|
|
|
54
|
+
| `@mulmochat-plugin/{plugin-name}` | Core (framework-agnostic) |
|
|
55
|
+
| `@mulmochat-plugin/{plugin-name}/vue` | Vue implementation with UI components |
|
|
56
|
+
| `@mulmochat-plugin/{plugin-name}/react` | React implementation with UI components |
|
|
57
|
+
| `@mulmochat-plugin/{plugin-name}/style.css` | Tailwind CSS styles |
|
|
58
|
+
|
|
28
59
|
## Development
|
|
29
60
|
|
|
30
61
|
```bash
|
|
31
62
|
# Install dependencies
|
|
32
63
|
yarn install
|
|
33
64
|
|
|
34
|
-
# Start dev server (http://localhost:5173/)
|
|
65
|
+
# Start dev server - Vue (http://localhost:5173/)
|
|
35
66
|
yarn dev
|
|
36
67
|
|
|
68
|
+
# Start dev server - React (http://localhost:5173/)
|
|
69
|
+
yarn dev:react
|
|
70
|
+
|
|
37
71
|
# Build
|
|
38
72
|
yarn build
|
|
39
73
|
|
package/dist/core/index.d.ts
CHANGED
|
@@ -4,5 +4,7 @@
|
|
|
4
4
|
* Framework-agnostic types and plugin logic.
|
|
5
5
|
* Import from "@mulmochat-plugin/quiz/core"
|
|
6
6
|
*/
|
|
7
|
-
export type {
|
|
8
|
-
export { pluginCore,
|
|
7
|
+
export type { QuizQuestion, QuizData, QuizArgs } from "./types";
|
|
8
|
+
export { pluginCore, executeQuiz } from "./plugin";
|
|
9
|
+
export { TOOL_NAME, TOOL_DEFINITION } from "./definition";
|
|
10
|
+
export { SAMPLES } from "./samples";
|
package/dist/core/plugin.d.ts
CHANGED
|
@@ -4,9 +4,7 @@
|
|
|
4
4
|
* Contains the plugin logic without UI components.
|
|
5
5
|
* Can be used by any framework (Vue, React, etc.)
|
|
6
6
|
*/
|
|
7
|
-
import type { ToolPluginCore, ToolContext, ToolResult
|
|
8
|
-
|
|
9
|
-
export declare const TOOL_DEFINITION: ToolDefinition;
|
|
10
|
-
export declare const SAMPLES: ToolSample[];
|
|
7
|
+
import type { ToolPluginCore, ToolContext, ToolResult } from "gui-chat-protocol";
|
|
8
|
+
import type { QuizData, QuizArgs } from "./types";
|
|
11
9
|
export declare const executeQuiz: (_context: ToolContext, args: QuizArgs) => Promise<ToolResult<never, QuizData>>;
|
|
12
10
|
export declare const pluginCore: ToolPluginCore<never, QuizData, QuizArgs>;
|