@mulmochat-plugin/quiz 0.1.3 → 0.1.4
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 +28 -34
- package/README.md +28 -34
- package/README.npm.md +49 -0
- package/dist/common/index.d.ts +1 -1
- package/dist/common/types.d.ts +16 -2
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +2 -6
- package/dist/index.js +168 -168
- package/dist/plugin/index.d.ts +18 -0
- package/dist/plugin/samples.d.ts +5 -0
- package/dist/plugin/tools.d.ts +47 -0
- package/dist/plugin/types.d.ts +20 -0
- package/dist/style.css +1 -0
- package/package.json +2 -2
- package/dist/plugin.d.ts +0 -36
- package/dist/quiz.css +0 -1
- package/dist/types.d.ts +0 -5
- /package/dist/{previews/QuizPreview.vue.d.ts → plugin/Preview.vue.d.ts} +0 -0
- /package/dist/{views/QuizView.vue.d.ts → plugin/View.vue.d.ts} +0 -0
package/README.ja.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# MulmoChat Plugin Quiz
|
|
2
2
|
|
|
3
|
+
> **📦 テンプレートリポジトリ**
|
|
4
|
+
> これは [MulmoChat](https://github.com/receptron/MulmoChat) プラグインのリファレンス実装です。
|
|
5
|
+
> このリポジトリをテンプレートとして使用し、独自のプラグインを作成できます。
|
|
6
|
+
> 詳細は [TEMPLATE.md](./TEMPLATE.md) を参照してください。
|
|
7
|
+
|
|
3
8
|
MulmoChat用のクイズプラグイン。複数選択式のクイズをユーザーに提示します。
|
|
4
9
|
|
|
5
10
|
## 概要
|
|
@@ -72,16 +77,16 @@ yarn lint
|
|
|
72
77
|
MulmoChatPluginQuiz/
|
|
73
78
|
├── src/
|
|
74
79
|
│ ├── index.ts # エクスポート定義
|
|
75
|
-
│ ├── plugin.ts # クイズ固有のプラグイン実装
|
|
76
|
-
│ ├── types.ts # 共通型の再エクスポート(後方互換)
|
|
77
80
|
│ ├── style.css # Tailwind CSSエントリー
|
|
78
81
|
│ ├── common/ # プラグイン非依存の共通コード
|
|
79
82
|
│ │ ├── index.ts # 共通エクスポート
|
|
80
83
|
│ │ └── types.ts # ToolPlugin, ToolResult など
|
|
81
|
-
│
|
|
82
|
-
│
|
|
83
|
-
│
|
|
84
|
-
│
|
|
84
|
+
│ └── plugin/ # クイズ固有の実装
|
|
85
|
+
│ ├── index.ts # プラグインインスタンスと実行ロジック
|
|
86
|
+
│ ├── types.ts # クイズの型とTOOL_DEFINITION
|
|
87
|
+
│ ├── samples.ts # テスト用サンプルデータ
|
|
88
|
+
│ ├── View.vue # メインビューコンポーネント
|
|
89
|
+
│ └── Preview.vue # サイドバープレビューコンポーネント
|
|
85
90
|
├── demo/ # 汎用プラグインデモ(どのプラグインでも動作)
|
|
86
91
|
│ ├── App.vue # 動的コンポーネント描画
|
|
87
92
|
│ └── main.ts
|
|
@@ -94,43 +99,32 @@ MulmoChatPluginQuiz/
|
|
|
94
99
|
### ディレクトリの役割
|
|
95
100
|
|
|
96
101
|
- **src/common/**: プラグイン非依存の型とユーティリティ。新しいプラグインにコピーするか、このパッケージからインポート。
|
|
97
|
-
- **src/plugin
|
|
98
|
-
- **src/views/**, **src/previews/**: クイズ固有のVueコンポーネント。独自のものを作成。
|
|
102
|
+
- **src/plugin/**: クイズ固有の実装。独自のプラグインロジックに置き換える。
|
|
99
103
|
- **demo/**: 任意のToolPluginで動作する汎用デモ。インポートを変更するだけで使用可能。
|
|
100
104
|
|
|
101
105
|
## 新しいプラグインの作成
|
|
102
106
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
1. リポジトリをコピー:
|
|
106
|
-
```bash
|
|
107
|
-
cp -r MulmoChatPluginQuiz MulmoChatPluginYourPlugin
|
|
108
|
-
cd MulmoChatPluginYourPlugin
|
|
109
|
-
rm -rf .git node_modules dist *.tgz
|
|
110
|
-
git init
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
2. `package.json`を編集:
|
|
114
|
-
- `name`: `mulmochat-plugin-yourplugin`
|
|
115
|
-
- `description`: プラグインの説明
|
|
107
|
+
自動生成スクリプトを使用するか、詳細なテンプレートガイドを参照してください:
|
|
116
108
|
|
|
117
|
-
|
|
118
|
-
- `TOOL_DEFINITION`: ツール名、説明、パラメータを定義
|
|
119
|
-
- `execute`: ツール実行ロジックを実装
|
|
120
|
-
- 必要に応じて型定義を追加
|
|
109
|
+
### クイックスタート(推奨)
|
|
121
110
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
- Emit: `updateResult`
|
|
111
|
+
```bash
|
|
112
|
+
# 新規プラグインを生成
|
|
113
|
+
./scripts/create-plugin.sh my-plugin "My Plugin" "プラグインの説明"
|
|
126
114
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
115
|
+
# 生成されたディレクトリに移動してインストール
|
|
116
|
+
cd ../MulmoChatPluginMyPlugin
|
|
117
|
+
yarn install
|
|
118
|
+
yarn dev
|
|
119
|
+
```
|
|
130
120
|
|
|
131
|
-
|
|
121
|
+
### 手動セットアップ
|
|
132
122
|
|
|
133
|
-
|
|
123
|
+
詳細な手順は [TEMPLATE.md](./TEMPLATE.md) を参照:
|
|
124
|
+
- そのままコピーできるファイル
|
|
125
|
+
- 変更が必要なファイル(`package.json` のみ)
|
|
126
|
+
- プラグイン固有の実装要件
|
|
127
|
+
- 重要なパターン(View.vue のリアクティビティ)
|
|
134
128
|
|
|
135
129
|
## ToolPlugin インターフェース
|
|
136
130
|
|
package/README.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# MulmoChat Plugin Quiz
|
|
2
2
|
|
|
3
|
+
> **📦 Template Repository**
|
|
4
|
+
> This is the reference implementation for [MulmoChat](https://github.com/receptron/MulmoChat) plugins.
|
|
5
|
+
> Use this repository as a template to create your own plugins.
|
|
6
|
+
> See [TEMPLATE.md](./TEMPLATE.md) for detailed instructions.
|
|
7
|
+
|
|
3
8
|
A quiz plugin for MulmoChat. Presents multiple choice quizzes to users.
|
|
4
9
|
|
|
5
10
|
## Overview
|
|
@@ -72,16 +77,16 @@ yarn lint
|
|
|
72
77
|
MulmoChatPluginQuiz/
|
|
73
78
|
├── src/
|
|
74
79
|
│ ├── index.ts # Export definitions
|
|
75
|
-
│ ├── plugin.ts # Quiz-specific plugin implementation
|
|
76
|
-
│ ├── types.ts # Re-exports common types (backward compat)
|
|
77
80
|
│ ├── style.css # Tailwind CSS entry
|
|
78
81
|
│ ├── common/ # Plugin-agnostic shared code
|
|
79
82
|
│ │ ├── index.ts # Common exports
|
|
80
83
|
│ │ └── types.ts # ToolPlugin, ToolResult, etc.
|
|
81
|
-
│
|
|
82
|
-
│
|
|
83
|
-
│
|
|
84
|
-
│
|
|
84
|
+
│ └── plugin/ # Quiz-specific implementation
|
|
85
|
+
│ ├── index.ts # Plugin instance and execute logic
|
|
86
|
+
│ ├── types.ts # Quiz types and TOOL_DEFINITION
|
|
87
|
+
│ ├── samples.ts # Sample data for testing
|
|
88
|
+
│ ├── View.vue # Main view component
|
|
89
|
+
│ └── Preview.vue # Sidebar preview component
|
|
85
90
|
├── demo/ # Generic plugin demo (works with any plugin)
|
|
86
91
|
│ ├── App.vue # Dynamic component rendering
|
|
87
92
|
│ └── main.ts
|
|
@@ -94,43 +99,32 @@ MulmoChatPluginQuiz/
|
|
|
94
99
|
### Directory Purpose
|
|
95
100
|
|
|
96
101
|
- **src/common/**: Plugin-agnostic types and utilities. Copy this to your new plugin or import from this package.
|
|
97
|
-
- **src/plugin
|
|
98
|
-
- **src/views/**, **src/previews/**: Quiz-specific Vue components. Create your own.
|
|
102
|
+
- **src/plugin/**: Quiz-specific implementation. Replace with your plugin logic.
|
|
99
103
|
- **demo/**: Generic demo that works with any ToolPlugin. Just change the import.
|
|
100
104
|
|
|
101
105
|
## Creating a New Plugin
|
|
102
106
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
1. Copy the repository:
|
|
106
|
-
```bash
|
|
107
|
-
cp -r MulmoChatPluginQuiz MulmoChatPluginYourPlugin
|
|
108
|
-
cd MulmoChatPluginYourPlugin
|
|
109
|
-
rm -rf .git node_modules dist *.tgz
|
|
110
|
-
git init
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
2. Edit `package.json`:
|
|
114
|
-
- `name`: `mulmochat-plugin-yourplugin`
|
|
115
|
-
- `description`: Your plugin description
|
|
107
|
+
Use the automated script or follow the detailed template guide:
|
|
116
108
|
|
|
117
|
-
|
|
118
|
-
- `TOOL_DEFINITION`: Define tool name, description, and parameters
|
|
119
|
-
- `execute`: Implement tool execution logic
|
|
120
|
-
- Add type definitions as needed
|
|
109
|
+
### Quick Start (Recommended)
|
|
121
110
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
- Emit: `updateResult`
|
|
111
|
+
```bash
|
|
112
|
+
# Generate a new plugin
|
|
113
|
+
./scripts/create-plugin.sh my-plugin "My Plugin" "Description of my plugin"
|
|
126
114
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
115
|
+
# Move to generated directory and install
|
|
116
|
+
cd ../MulmoChatPluginMyPlugin
|
|
117
|
+
yarn install
|
|
118
|
+
yarn dev
|
|
119
|
+
```
|
|
130
120
|
|
|
131
|
-
|
|
121
|
+
### Manual Setup
|
|
132
122
|
|
|
133
|
-
|
|
123
|
+
See [TEMPLATE.md](./TEMPLATE.md) for detailed instructions on:
|
|
124
|
+
- Files that can be copied as-is
|
|
125
|
+
- Files requiring modification (only `package.json`)
|
|
126
|
+
- Plugin-specific implementation requirements
|
|
127
|
+
- Important patterns (View.vue reactivity)
|
|
134
128
|
|
|
135
129
|
## ToolPlugin Interface
|
|
136
130
|
|
package/README.npm.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# MulmoChat Plugin
|
|
2
|
+
|
|
3
|
+
A plugin for [MulmoChat](https://github.com/receptron/MulmoChat) - a multi-modal voice chat application with OpenAI's GPT-4 Realtime API.
|
|
4
|
+
|
|
5
|
+
## What this plugin does
|
|
6
|
+
|
|
7
|
+
{plugin-description}
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
yarn add @mulmochat-plugin/{plugin-name}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import Plugin from "@mulmochat-plugin/{plugin-name}";
|
|
19
|
+
import "@mulmochat-plugin/{plugin-name}/style.css";
|
|
20
|
+
|
|
21
|
+
// Add to pluginList
|
|
22
|
+
const pluginList = [
|
|
23
|
+
// ... other plugins
|
|
24
|
+
Plugin,
|
|
25
|
+
];
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Development
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Install dependencies
|
|
32
|
+
yarn install
|
|
33
|
+
|
|
34
|
+
# Start dev server (http://localhost:5173/)
|
|
35
|
+
yarn dev
|
|
36
|
+
|
|
37
|
+
# Build
|
|
38
|
+
yarn build
|
|
39
|
+
|
|
40
|
+
# Type check
|
|
41
|
+
yarn typecheck
|
|
42
|
+
|
|
43
|
+
# Lint
|
|
44
|
+
yarn lint
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## License
|
|
48
|
+
|
|
49
|
+
MIT
|
package/dist/common/index.d.ts
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* Shared types and utilities for building MulmoChat plugins.
|
|
5
5
|
* Import from "@mulmochat-plugin/quiz/common" or copy to your plugin.
|
|
6
6
|
*/
|
|
7
|
-
export type { ToolContext, ToolResult, ToolPlugin, ToolDefinition, JsonSchemaProperty, StartApiResponse, FileUploadConfig, ToolPluginConfig, ToolSample, } from "./types";
|
|
7
|
+
export type { ToolContext, ToolContextApp, ToolResult, ToolPlugin, ToolDefinition, JsonSchemaProperty, StartApiResponse, FileUploadConfig, ToolPluginConfig, ToolSample, } from "./types";
|
package/dist/common/types.d.ts
CHANGED
|
@@ -5,13 +5,25 @@
|
|
|
5
5
|
* These types are plugin-agnostic and can be used by any plugin implementation.
|
|
6
6
|
*/
|
|
7
7
|
import type { Component } from "vue";
|
|
8
|
+
/**
|
|
9
|
+
* Backend types that plugins can declare they use.
|
|
10
|
+
* App layer manages actual provider/model settings for each type.
|
|
11
|
+
*/
|
|
12
|
+
export type BackendType = "textLLM" | "imageGen" | "audio" | "search" | "browse" | "map" | "mulmocast";
|
|
13
|
+
/**
|
|
14
|
+
* App interface provided to plugins via context.app
|
|
15
|
+
* Contains backend functions and config accessors
|
|
16
|
+
*/
|
|
17
|
+
export interface ToolContextApp extends Record<string, (...args: any[]) => any> {
|
|
18
|
+
getConfig: <T = unknown>(key: string) => T | undefined;
|
|
19
|
+
setConfig: (key: string, value: unknown) => void;
|
|
20
|
+
}
|
|
8
21
|
/**
|
|
9
22
|
* Context passed to plugin execute function
|
|
10
23
|
*/
|
|
11
24
|
export interface ToolContext {
|
|
12
25
|
currentResult?: ToolResult<unknown> | null;
|
|
13
|
-
|
|
14
|
-
getPluginConfig?: <T = unknown>(key: string) => T | undefined;
|
|
26
|
+
app?: ToolContextApp;
|
|
15
27
|
}
|
|
16
28
|
/**
|
|
17
29
|
* Result returned from plugin execution
|
|
@@ -125,4 +137,6 @@ export interface ToolPlugin<T = unknown, J = unknown, A extends object = object>
|
|
|
125
137
|
config?: ToolPluginConfig;
|
|
126
138
|
/** Optional sample arguments for testing */
|
|
127
139
|
samples?: ToolSample[];
|
|
140
|
+
/** Backend types this plugin uses (e.g., ["textLLM", "imageGen"]) */
|
|
141
|
+
backends?: BackendType[];
|
|
128
142
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y={class:"size-full overflow-y-auto p-8 bg-[#1a1a2e]"},
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y="putQuestions",w={type:"function",name:y,description:"Present a set of multiple choice questions to test the user's knowledge or abilities. Each question should have 2-6 answer choices.",parameters:{type:"object",properties:{title:{type:"string",description:"Optional title for the quiz (e.g., 'JavaScript Basics Quiz')"},questions:{type:"array",description:"Array of multiple choice questions",items:{type:"object",properties:{question:{type:"string",description:"The question text"},choices:{type:"array",description:"Array of answer choices (2-6 choices)",items:{type:"string"},minItems:2,maxItems:6},correctAnswer:{type:"number",description:"Optional: The index of the correct answer (0-based). Include this if you want to track correct answers."}},required:["question","choices"]},minItems:1}},required:["questions"]}},b=[{name:"Geography Quiz",args:{title:"World Geography",questions:[{question:"What is the capital of France?",choices:["London","Berlin","Paris","Madrid"],correctAnswer:2},{question:"Which is the largest ocean?",choices:["Atlantic","Indian","Arctic","Pacific"],correctAnswer:3},{question:"Mount Everest is located in which mountain range?",choices:["Alps","Andes","Himalayas","Rockies"],correctAnswer:2}]}},{name:"Science Quiz",args:{title:"Science Basics",questions:[{question:"Which planet is known as the Red Planet?",choices:["Venus","Mars","Jupiter","Saturn"],correctAnswer:1},{question:"What is the chemical symbol for water?",choices:["O2","CO2","H2O","NaCl"],correctAnswer:2},{question:"How many bones are in the adult human body?",choices:["186","206","226","246"],correctAnswer:1},{question:"What is the speed of light?",choices:["300,000 km/s","150,000 km/s","500,000 km/s","1,000,000 km/s"],correctAnswer:0}]}},{name:"Math Quiz",args:{title:"Math Challenge",questions:[{question:"What is 15 x 15?",choices:["200","215","225","250"],correctAnswer:2},{question:"What is the square root of 144?",choices:["10","11","12","13"],correctAnswer:2}]}},{name:"No Correct Answer",args:{title:"Opinion Poll",questions:[{question:"What is your favorite color?",choices:["Red","Blue","Green","Yellow"]},{question:"Which season do you prefer?",choices:["Spring","Summer","Autumn","Winter"]}]}},{name:"Single Question",args:{title:"Quick Question",questions:[{question:"Is this quiz plugin working correctly?",choices:["Yes","No"],correctAnswer:0}]}}],_={class:"size-full overflow-y-auto p-8 bg-[#1a1a2e]"},q={key:0,class:"max-w-3xl w-full mx-auto"},x={key:0,class:"text-[#f0f0f0] text-3xl font-bold mb-8 text-center"},k={class:"flex flex-col gap-6"},E={class:"text-white text-lg font-semibold mb-4"},A={class:"text-blue-400 mr-2"},S={class:"flex flex-col gap-3"},N=["name","value","onUpdate:modelValue"],B={class:"text-white flex-1"},V={class:"font-semibold mr-2"},C={class:"mt-8 flex justify-center"},D=["disabled"],z={class:"mt-4 text-center text-gray-400 text-sm"},Q=e.defineComponent({__name:"View",props:{selectedResult:{},sendTextMessage:{type:Function}},emits:["updateResult"],setup(h,{emit:d}){const t=h,r=d,o=e.ref(null),s=e.ref([]);e.watch(()=>t.selectedResult,n=>{n?.toolName==="putQuestions"&&n.jsonData&&(o.value=n.jsonData,n.viewState?.userAnswers?s.value=n.viewState.userAnswers:s.value=new Array(o.value.questions.length).fill(null))},{immediate:!0}),e.watch(s,n=>{if(t.selectedResult&&n){const l={...t.selectedResult,viewState:{userAnswers:n}};r("updateResult",l)}},{deep:!0});const i=e.computed(()=>s.value.filter(n=>n!==null).length),m=e.computed(()=>o.value&&i.value===o.value.questions.length);function f(n,l){return s.value[n]===l?"border-blue-500 bg-blue-500/20":"border-[#4b4b6b] hover:border-[#6b6b8b] hover:bg-[#6b6b8b]/20"}function v(){if(!o.value||!m.value)return;const l=`Here are my answers:
|
|
2
2
|
${s.value.map((a,c)=>{if(a===null)return null;const p=c+1,u=String.fromCharCode(65+a),g=o.value.questions[c].choices[a];return`Q${p}: ${u} - ${g}`}).filter(a=>a!==null).join(`
|
|
3
|
-
`)}`;t.sendTextMessage(l)}return(n,l)=>(e.openBlock(),e.createElementBlock("div",
|
|
3
|
+
`)}`;t.sendTextMessage(l)}return(n,l)=>(e.openBlock(),e.createElementBlock("div",_,[o.value?(e.openBlock(),e.createElementBlock("div",q,[o.value.title?(e.openBlock(),e.createElementBlock("h2",x,e.toDisplayString(o.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",k,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value.questions,(a,c)=>(e.openBlock(),e.createElementBlock("div",{key:c,class:"bg-[#2d2d44] rounded-lg p-6 border-2 border-[#3d3d5c]"},[e.createElementVNode("div",E,[e.createElementVNode("span",A,e.toDisplayString(c+1)+".",1),e.createTextVNode(" "+e.toDisplayString(a.question),1)]),e.createElementVNode("div",S,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.choices,(p,u)=>(e.openBlock(),e.createElementBlock("label",{key:u,class:e.normalizeClass([f(c,u),"flex items-start p-4 rounded-lg cursor-pointer transition-all duration-200 border-2"])},[e.withDirectives(e.createElementVNode("input",{type:"radio",name:`question-${c}`,value:u,"onUpdate:modelValue":g=>s.value[c]=g,class:"mt-1 mr-3 size-4 shrink-0"},null,8,N),[[e.vModelRadio,s.value[c]]]),e.createElementVNode("span",B,[e.createElementVNode("span",V,e.toDisplayString(String.fromCharCode(65+u))+".",1),e.createTextVNode(" "+e.toDisplayString(p),1)])],2))),128))])]))),128))]),e.createElementVNode("div",C,[e.createElementVNode("button",{onClick:v,disabled:!m.value,class:e.normalizeClass([m.value?"bg-blue-600 hover:bg-blue-700":"bg-gray-600 cursor-not-allowed opacity-50","py-3 px-8 rounded-lg text-white font-semibold text-lg transition-colors border-none cursor-pointer"])}," Submit Answers ",10,D)]),e.createElementVNode("div",z,e.toDisplayString(i.value)+" / "+e.toDisplayString(o.value.questions.length)+" questions answered ",1)])):e.createCommentVNode("",!0)]))}}),$={class:"p-3 bg-blue-50 rounded-md"},T={key:0,class:"flex flex-col gap-2"},M={class:"text-sm font-semibold text-gray-800 text-center"},O={class:"text-center"},W={class:"inline-block bg-blue-600 text-white text-xs font-bold py-1 px-3 rounded-full"},j={class:"text-xs text-gray-600 overflow-hidden line-clamp-2"},P={class:"flex justify-center gap-1"},L={key:0,class:"text-xs text-gray-500"},R=e.defineComponent({__name:"Preview",props:{result:{}},setup(h){const d=h,t=e.computed(()=>d.result.jsonData);return(r,o)=>(e.openBlock(),e.createElementBlock("div",$,[t.value?(e.openBlock(),e.createElementBlock("div",T,[e.createElementVNode("div",M,e.toDisplayString(t.value.title||"Quiz"),1),e.createElementVNode("div",O,[e.createElementVNode("span",W,e.toDisplayString(t.value.questions.length)+" "+e.toDisplayString(t.value.questions.length===1?"Question":"Questions"),1)]),e.createElementVNode("div",j,e.toDisplayString(t.value.questions[0]?.question),1),e.createElementVNode("div",P,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Math.min(t.value.questions[0]?.choices.length||0,4),(s,i)=>(e.openBlock(),e.createElementBlock("div",{key:i,class:"size-2 bg-gray-400 rounded-full"}))),128)),(t.value.questions[0]?.choices.length||0)>4?(e.openBlock(),e.createElementBlock("div",L," +"+e.toDisplayString(t.value.questions[0].choices.length-4),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]))}}),F=async(h,d)=>{try{const{title:t,questions:r}=d;if(!r||!Array.isArray(r)||r.length===0)throw new Error("At least one question is required");for(let s=0;s<r.length;s++){const i=r[s];if(!i.question||typeof i.question!="string")throw new Error(`Question ${s+1} must have a question text`);if(!Array.isArray(i.choices)||i.choices.length<2)throw new Error(`Question ${s+1} must have at least 2 choices`);if(i.choices.length>6)throw new Error(`Question ${s+1} cannot have more than 6 choices`)}const o={title:t,questions:r};return{message:`Quiz presented with ${r.length} question${r.length>1?"s":""}`,jsonData:o,instructions:"The quiz has been presented to the user. Wait for the user to submit their answers. They will tell you their answers in text format."}}catch(t){return console.error("Quiz creation error",t),{message:`Quiz error: ${t instanceof Error?t.message:"Unknown error"}`,instructions:"Acknowledge that there was an error creating the quiz and suggest trying again."}}},H={toolDefinition:w,execute:F,generatingMessage:"Preparing quiz...",isEnabled:()=>!0,viewComponent:Q,previewComponent:R,samples:b},G={plugin:H};exports.default=G;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* MulmoChat
|
|
2
|
+
* MulmoChat Plugin
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* ```typescript
|
|
6
|
-
* import QuizPlugin from "@mulmochat-plugin/quiz";
|
|
7
|
-
* import "@mulmochat-plugin/quiz/style.css";
|
|
8
|
-
* ```
|
|
4
|
+
* See package.json for plugin details.
|
|
9
5
|
*/
|
|
10
6
|
import "./style.css";
|
|
11
7
|
import type { ToolPlugin } from "./common";
|
package/dist/index.js
CHANGED
|
@@ -1,131 +1,47 @@
|
|
|
1
1
|
import { defineComponent as z, ref as x, watch as A, computed as _, createElementBlock as i, openBlock as r, createCommentVNode as f, createElementVNode as s, toDisplayString as a, Fragment as y, renderList as q, createTextVNode as k, normalizeClass as Q, withDirectives as C, vModelRadio as E } from "vue";
|
|
2
|
-
const T =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
sendTextMessage: { type: Function }
|
|
13
|
-
},
|
|
14
|
-
emits: ["updateResult"],
|
|
15
|
-
setup(g, { emit: p }) {
|
|
16
|
-
const e = g, c = p, o = x(null), t = x([]);
|
|
17
|
-
A(
|
|
18
|
-
() => e.selectedResult,
|
|
19
|
-
(n) => {
|
|
20
|
-
n?.toolName === "putQuestions" && n.jsonData && (o.value = n.jsonData, n.viewState?.userAnswers ? t.value = n.viewState.userAnswers : t.value = new Array(o.value.questions.length).fill(null));
|
|
2
|
+
const T = "putQuestions", M = {
|
|
3
|
+
type: "function",
|
|
4
|
+
name: T,
|
|
5
|
+
description: "Present a set of multiple choice questions to test the user's knowledge or abilities. Each question should have 2-6 answer choices.",
|
|
6
|
+
parameters: {
|
|
7
|
+
type: "object",
|
|
8
|
+
properties: {
|
|
9
|
+
title: {
|
|
10
|
+
type: "string",
|
|
11
|
+
description: "Optional title for the quiz (e.g., 'JavaScript Basics Quiz')"
|
|
21
12
|
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
13
|
+
questions: {
|
|
14
|
+
type: "array",
|
|
15
|
+
description: "Array of multiple choice questions",
|
|
16
|
+
items: {
|
|
17
|
+
type: "object",
|
|
18
|
+
properties: {
|
|
19
|
+
question: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "The question text"
|
|
22
|
+
},
|
|
23
|
+
choices: {
|
|
24
|
+
type: "array",
|
|
25
|
+
description: "Array of answer choices (2-6 choices)",
|
|
26
|
+
items: {
|
|
27
|
+
type: "string"
|
|
28
|
+
},
|
|
29
|
+
minItems: 2,
|
|
30
|
+
maxItems: 6
|
|
31
|
+
},
|
|
32
|
+
correctAnswer: {
|
|
33
|
+
type: "number",
|
|
34
|
+
description: "Optional: The index of the correct answer (0-based). Include this if you want to track correct answers."
|
|
31
35
|
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
function $(n, d) {
|
|
40
|
-
return t.value[n] === d ? "border-blue-500 bg-blue-500/20" : "border-[#4b4b6b] hover:border-[#6b6b8b] hover:bg-[#6b6b8b]/20";
|
|
41
|
-
}
|
|
42
|
-
function S() {
|
|
43
|
-
if (!o.value || !v.value) return;
|
|
44
|
-
const d = `Here are my answers:
|
|
45
|
-
${t.value.map((u, h) => {
|
|
46
|
-
if (u === null) return null;
|
|
47
|
-
const w = h + 1, m = String.fromCharCode(65 + u), b = o.value.questions[h].choices[u];
|
|
48
|
-
return `Q${w}: ${m} - ${b}`;
|
|
49
|
-
}).filter((u) => u !== null).join(`
|
|
50
|
-
`)}`;
|
|
51
|
-
e.sendTextMessage(d);
|
|
52
|
-
}
|
|
53
|
-
return (n, d) => (r(), i("div", T, [
|
|
54
|
-
o.value ? (r(), i("div", M, [
|
|
55
|
-
o.value.title ? (r(), i("h2", W, a(o.value.title), 1)) : f("", !0),
|
|
56
|
-
s("div", D, [
|
|
57
|
-
(r(!0), i(y, null, q(o.value.questions, (u, h) => (r(), i("div", {
|
|
58
|
-
key: h,
|
|
59
|
-
class: "bg-[#2d2d44] rounded-lg p-6 border-2 border-[#3d3d5c]"
|
|
60
|
-
}, [
|
|
61
|
-
s("div", N, [
|
|
62
|
-
s("span", O, a(h + 1) + ".", 1),
|
|
63
|
-
k(" " + a(u.question), 1)
|
|
64
|
-
]),
|
|
65
|
-
s("div", j, [
|
|
66
|
-
(r(!0), i(y, null, q(u.choices, (w, m) => (r(), i("label", {
|
|
67
|
-
key: m,
|
|
68
|
-
class: Q([$(h, m), "flex items-start p-4 rounded-lg cursor-pointer transition-all duration-200 border-2"])
|
|
69
|
-
}, [
|
|
70
|
-
C(s("input", {
|
|
71
|
-
type: "radio",
|
|
72
|
-
name: `question-${h}`,
|
|
73
|
-
value: m,
|
|
74
|
-
"onUpdate:modelValue": (b) => t.value[h] = b,
|
|
75
|
-
class: "mt-1 mr-3 size-4 shrink-0"
|
|
76
|
-
}, null, 8, P), [
|
|
77
|
-
[E, t.value[h]]
|
|
78
|
-
]),
|
|
79
|
-
s("span", R, [
|
|
80
|
-
s("span", V, a(String.fromCharCode(65 + m)) + ".", 1),
|
|
81
|
-
k(" " + a(w), 1)
|
|
82
|
-
])
|
|
83
|
-
], 2))), 128))
|
|
84
|
-
])
|
|
85
|
-
]))), 128))
|
|
86
|
-
]),
|
|
87
|
-
s("div", B, [
|
|
88
|
-
s("button", {
|
|
89
|
-
onClick: S,
|
|
90
|
-
disabled: !v.value,
|
|
91
|
-
class: Q([v.value ? "bg-blue-600 hover:bg-blue-700" : "bg-gray-600 cursor-not-allowed opacity-50", "py-3 px-8 rounded-lg text-white font-semibold text-lg transition-colors border-none cursor-pointer"])
|
|
92
|
-
}, " Submit Answers ", 10, L)
|
|
93
|
-
]),
|
|
94
|
-
s("div", F, a(l.value) + " / " + a(o.value.questions.length) + " questions answered ", 1)
|
|
95
|
-
])) : f("", !0)
|
|
96
|
-
]));
|
|
97
|
-
}
|
|
98
|
-
}), G = { class: "p-3 bg-blue-50 rounded-md" }, U = {
|
|
99
|
-
key: 0,
|
|
100
|
-
class: "flex flex-col gap-2"
|
|
101
|
-
}, J = { class: "text-sm font-semibold text-gray-800 text-center" }, Y = { class: "text-center" }, I = { class: "inline-block bg-blue-600 text-white text-xs font-bold py-1 px-3 rounded-full" }, K = { class: "text-xs text-gray-600 overflow-hidden line-clamp-2" }, X = { class: "flex justify-center gap-1" }, Z = {
|
|
102
|
-
key: 0,
|
|
103
|
-
class: "text-xs text-gray-500"
|
|
104
|
-
}, ee = /* @__PURE__ */ z({
|
|
105
|
-
__name: "QuizPreview",
|
|
106
|
-
props: {
|
|
107
|
-
result: {}
|
|
108
|
-
},
|
|
109
|
-
setup(g) {
|
|
110
|
-
const p = g, e = _(() => p.result.jsonData);
|
|
111
|
-
return (c, o) => (r(), i("div", G, [
|
|
112
|
-
e.value ? (r(), i("div", U, [
|
|
113
|
-
s("div", J, a(e.value.title || "Quiz"), 1),
|
|
114
|
-
s("div", Y, [
|
|
115
|
-
s("span", I, a(e.value.questions.length) + " " + a(e.value.questions.length === 1 ? "Question" : "Questions"), 1)
|
|
116
|
-
]),
|
|
117
|
-
s("div", K, a(e.value.questions[0]?.question), 1),
|
|
118
|
-
s("div", X, [
|
|
119
|
-
(r(!0), i(y, null, q(Math.min(e.value.questions[0]?.choices.length || 0, 4), (t, l) => (r(), i("div", {
|
|
120
|
-
key: l,
|
|
121
|
-
class: "size-2 bg-gray-400 rounded-full"
|
|
122
|
-
}))), 128)),
|
|
123
|
-
(e.value.questions[0]?.choices.length || 0) > 4 ? (r(), i("div", Z, " +" + a(e.value.questions[0].choices.length - 4), 1)) : f("", !0)
|
|
124
|
-
])
|
|
125
|
-
])) : f("", !0)
|
|
126
|
-
]));
|
|
36
|
+
},
|
|
37
|
+
required: ["question", "choices"]
|
|
38
|
+
},
|
|
39
|
+
minItems: 1
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
required: ["questions"]
|
|
127
43
|
}
|
|
128
|
-
}
|
|
44
|
+
}, W = [
|
|
129
45
|
{
|
|
130
46
|
name: "Geography Quiz",
|
|
131
47
|
args: {
|
|
@@ -229,49 +145,133 @@ ${t.value.map((u, h) => {
|
|
|
229
145
|
]
|
|
230
146
|
}
|
|
231
147
|
}
|
|
232
|
-
],
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
148
|
+
], D = { class: "size-full overflow-y-auto p-8 bg-[#1a1a2e]" }, N = {
|
|
149
|
+
key: 0,
|
|
150
|
+
class: "max-w-3xl w-full mx-auto"
|
|
151
|
+
}, O = {
|
|
152
|
+
key: 0,
|
|
153
|
+
class: "text-[#f0f0f0] text-3xl font-bold mb-8 text-center"
|
|
154
|
+
}, j = { class: "flex flex-col gap-6" }, P = { class: "text-white text-lg font-semibold mb-4" }, R = { class: "text-blue-400 mr-2" }, V = { class: "flex flex-col gap-3" }, B = ["name", "value", "onUpdate:modelValue"], L = { class: "text-white flex-1" }, F = { class: "font-semibold mr-2" }, H = { class: "mt-8 flex justify-center" }, G = ["disabled"], U = { class: "mt-4 text-center text-gray-400 text-sm" }, J = /* @__PURE__ */ z({
|
|
155
|
+
__name: "View",
|
|
156
|
+
props: {
|
|
157
|
+
selectedResult: {},
|
|
158
|
+
sendTextMessage: { type: Function }
|
|
159
|
+
},
|
|
160
|
+
emits: ["updateResult"],
|
|
161
|
+
setup(g, { emit: p }) {
|
|
162
|
+
const e = g, c = p, o = x(null), t = x([]);
|
|
163
|
+
A(
|
|
164
|
+
() => e.selectedResult,
|
|
165
|
+
(n) => {
|
|
166
|
+
n?.toolName === "putQuestions" && n.jsonData && (o.value = n.jsonData, n.viewState?.userAnswers ? t.value = n.viewState.userAnswers : t.value = new Array(o.value.questions.length).fill(null));
|
|
242
167
|
},
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
},
|
|
253
|
-
choices: {
|
|
254
|
-
type: "array",
|
|
255
|
-
description: "Array of answer choices (2-6 choices)",
|
|
256
|
-
items: {
|
|
257
|
-
type: "string"
|
|
258
|
-
},
|
|
259
|
-
minItems: 2,
|
|
260
|
-
maxItems: 6
|
|
261
|
-
},
|
|
262
|
-
correctAnswer: {
|
|
263
|
-
type: "number",
|
|
264
|
-
description: "Optional: The index of the correct answer (0-based). Include this if you want to track correct answers."
|
|
168
|
+
{ immediate: !0 }
|
|
169
|
+
), A(
|
|
170
|
+
t,
|
|
171
|
+
(n) => {
|
|
172
|
+
if (e.selectedResult && n) {
|
|
173
|
+
const d = {
|
|
174
|
+
...e.selectedResult,
|
|
175
|
+
viewState: {
|
|
176
|
+
userAnswers: n
|
|
265
177
|
}
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
|
|
178
|
+
};
|
|
179
|
+
c("updateResult", d);
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
{ deep: !0 }
|
|
183
|
+
);
|
|
184
|
+
const l = _(() => t.value.filter((n) => n !== null).length), v = _(() => o.value && l.value === o.value.questions.length);
|
|
185
|
+
function $(n, d) {
|
|
186
|
+
return t.value[n] === d ? "border-blue-500 bg-blue-500/20" : "border-[#4b4b6b] hover:border-[#6b6b8b] hover:bg-[#6b6b8b]/20";
|
|
187
|
+
}
|
|
188
|
+
function S() {
|
|
189
|
+
if (!o.value || !v.value) return;
|
|
190
|
+
const d = `Here are my answers:
|
|
191
|
+
${t.value.map((u, h) => {
|
|
192
|
+
if (u === null) return null;
|
|
193
|
+
const w = h + 1, m = String.fromCharCode(65 + u), b = o.value.questions[h].choices[u];
|
|
194
|
+
return `Q${w}: ${m} - ${b}`;
|
|
195
|
+
}).filter((u) => u !== null).join(`
|
|
196
|
+
`)}`;
|
|
197
|
+
e.sendTextMessage(d);
|
|
198
|
+
}
|
|
199
|
+
return (n, d) => (r(), i("div", D, [
|
|
200
|
+
o.value ? (r(), i("div", N, [
|
|
201
|
+
o.value.title ? (r(), i("h2", O, a(o.value.title), 1)) : f("", !0),
|
|
202
|
+
s("div", j, [
|
|
203
|
+
(r(!0), i(y, null, q(o.value.questions, (u, h) => (r(), i("div", {
|
|
204
|
+
key: h,
|
|
205
|
+
class: "bg-[#2d2d44] rounded-lg p-6 border-2 border-[#3d3d5c]"
|
|
206
|
+
}, [
|
|
207
|
+
s("div", P, [
|
|
208
|
+
s("span", R, a(h + 1) + ".", 1),
|
|
209
|
+
k(" " + a(u.question), 1)
|
|
210
|
+
]),
|
|
211
|
+
s("div", V, [
|
|
212
|
+
(r(!0), i(y, null, q(u.choices, (w, m) => (r(), i("label", {
|
|
213
|
+
key: m,
|
|
214
|
+
class: Q([$(h, m), "flex items-start p-4 rounded-lg cursor-pointer transition-all duration-200 border-2"])
|
|
215
|
+
}, [
|
|
216
|
+
C(s("input", {
|
|
217
|
+
type: "radio",
|
|
218
|
+
name: `question-${h}`,
|
|
219
|
+
value: m,
|
|
220
|
+
"onUpdate:modelValue": (b) => t.value[h] = b,
|
|
221
|
+
class: "mt-1 mr-3 size-4 shrink-0"
|
|
222
|
+
}, null, 8, B), [
|
|
223
|
+
[E, t.value[h]]
|
|
224
|
+
]),
|
|
225
|
+
s("span", L, [
|
|
226
|
+
s("span", F, a(String.fromCharCode(65 + m)) + ".", 1),
|
|
227
|
+
k(" " + a(w), 1)
|
|
228
|
+
])
|
|
229
|
+
], 2))), 128))
|
|
230
|
+
])
|
|
231
|
+
]))), 128))
|
|
232
|
+
]),
|
|
233
|
+
s("div", H, [
|
|
234
|
+
s("button", {
|
|
235
|
+
onClick: S,
|
|
236
|
+
disabled: !v.value,
|
|
237
|
+
class: Q([v.value ? "bg-blue-600 hover:bg-blue-700" : "bg-gray-600 cursor-not-allowed opacity-50", "py-3 px-8 rounded-lg text-white font-semibold text-lg transition-colors border-none cursor-pointer"])
|
|
238
|
+
}, " Submit Answers ", 10, G)
|
|
239
|
+
]),
|
|
240
|
+
s("div", U, a(l.value) + " / " + a(o.value.questions.length) + " questions answered ", 1)
|
|
241
|
+
])) : f("", !0)
|
|
242
|
+
]));
|
|
243
|
+
}
|
|
244
|
+
}), Y = { class: "p-3 bg-blue-50 rounded-md" }, I = {
|
|
245
|
+
key: 0,
|
|
246
|
+
class: "flex flex-col gap-2"
|
|
247
|
+
}, K = { class: "text-sm font-semibold text-gray-800 text-center" }, X = { class: "text-center" }, Z = { class: "inline-block bg-blue-600 text-white text-xs font-bold py-1 px-3 rounded-full" }, ee = { class: "text-xs text-gray-600 overflow-hidden line-clamp-2" }, te = { class: "flex justify-center gap-1" }, se = {
|
|
248
|
+
key: 0,
|
|
249
|
+
class: "text-xs text-gray-500"
|
|
250
|
+
}, oe = /* @__PURE__ */ z({
|
|
251
|
+
__name: "Preview",
|
|
252
|
+
props: {
|
|
253
|
+
result: {}
|
|
254
|
+
},
|
|
255
|
+
setup(g) {
|
|
256
|
+
const p = g, e = _(() => p.result.jsonData);
|
|
257
|
+
return (c, o) => (r(), i("div", Y, [
|
|
258
|
+
e.value ? (r(), i("div", I, [
|
|
259
|
+
s("div", K, a(e.value.title || "Quiz"), 1),
|
|
260
|
+
s("div", X, [
|
|
261
|
+
s("span", Z, a(e.value.questions.length) + " " + a(e.value.questions.length === 1 ? "Question" : "Questions"), 1)
|
|
262
|
+
]),
|
|
263
|
+
s("div", ee, a(e.value.questions[0]?.question), 1),
|
|
264
|
+
s("div", te, [
|
|
265
|
+
(r(!0), i(y, null, q(Math.min(e.value.questions[0]?.choices.length || 0, 4), (t, l) => (r(), i("div", {
|
|
266
|
+
key: l,
|
|
267
|
+
class: "size-2 bg-gray-400 rounded-full"
|
|
268
|
+
}))), 128)),
|
|
269
|
+
(e.value.questions[0]?.choices.length || 0) > 4 ? (r(), i("div", se, " +" + a(e.value.questions[0].choices.length - 4), 1)) : f("", !0)
|
|
270
|
+
])
|
|
271
|
+
])) : f("", !0)
|
|
272
|
+
]));
|
|
273
273
|
}
|
|
274
|
-
}, ne = async (g, p) => {
|
|
274
|
+
}), ne = async (g, p) => {
|
|
275
275
|
try {
|
|
276
276
|
const { title: e, questions: c } = p;
|
|
277
277
|
if (!c || !Array.isArray(c) || c.length === 0)
|
|
@@ -301,13 +301,13 @@ ${t.value.map((u, h) => {
|
|
|
301
301
|
};
|
|
302
302
|
}
|
|
303
303
|
}, ie = {
|
|
304
|
-
toolDefinition:
|
|
304
|
+
toolDefinition: M,
|
|
305
305
|
execute: ne,
|
|
306
306
|
generatingMessage: "Preparing quiz...",
|
|
307
307
|
isEnabled: () => !0,
|
|
308
|
-
viewComponent:
|
|
309
|
-
previewComponent:
|
|
310
|
-
samples:
|
|
308
|
+
viewComponent: J,
|
|
309
|
+
previewComponent: oe,
|
|
310
|
+
samples: W
|
|
311
311
|
}, ae = { plugin: ie };
|
|
312
312
|
export {
|
|
313
313
|
ae as default
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MulmoChat Quiz Plugin
|
|
3
|
+
*
|
|
4
|
+
* A plugin for presenting multiple choice quizzes to users.
|
|
5
|
+
*
|
|
6
|
+
* @example Basic usage
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import { plugin } from "@mulmochat-plugin/quiz";
|
|
9
|
+
* import "@mulmochat-plugin/quiz/style.css";
|
|
10
|
+
* // Use plugin directly
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
import type { ToolPlugin } from "../common";
|
|
14
|
+
import type { QuizData, QuizArgs } from "./types";
|
|
15
|
+
/**
|
|
16
|
+
* Quiz plugin instance
|
|
17
|
+
*/
|
|
18
|
+
export declare const plugin: ToolPlugin<never, QuizData, QuizArgs>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Quiz Tool Definition
|
|
3
|
+
*/
|
|
4
|
+
export declare const TOOL_NAME = "putQuestions";
|
|
5
|
+
export declare const TOOL_DEFINITION: {
|
|
6
|
+
type: "function";
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
parameters: {
|
|
10
|
+
type: "object";
|
|
11
|
+
properties: {
|
|
12
|
+
title: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
questions: {
|
|
17
|
+
type: string;
|
|
18
|
+
description: string;
|
|
19
|
+
items: {
|
|
20
|
+
type: string;
|
|
21
|
+
properties: {
|
|
22
|
+
question: {
|
|
23
|
+
type: string;
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
choices: {
|
|
27
|
+
type: string;
|
|
28
|
+
description: string;
|
|
29
|
+
items: {
|
|
30
|
+
type: string;
|
|
31
|
+
};
|
|
32
|
+
minItems: number;
|
|
33
|
+
maxItems: number;
|
|
34
|
+
};
|
|
35
|
+
correctAnswer: {
|
|
36
|
+
type: string;
|
|
37
|
+
description: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
required: string[];
|
|
41
|
+
};
|
|
42
|
+
minItems: number;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
required: string[];
|
|
46
|
+
};
|
|
47
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Quiz Types
|
|
3
|
+
*/
|
|
4
|
+
/** Single quiz question */
|
|
5
|
+
export interface QuizQuestion {
|
|
6
|
+
question: string;
|
|
7
|
+
choices: string[];
|
|
8
|
+
correctAnswer?: number;
|
|
9
|
+
}
|
|
10
|
+
/** Quiz data stored in result.jsonData */
|
|
11
|
+
export interface QuizData {
|
|
12
|
+
title?: string;
|
|
13
|
+
questions: QuizQuestion[];
|
|
14
|
+
userAnswers?: number[];
|
|
15
|
+
}
|
|
16
|
+
/** Arguments passed to the quiz tool */
|
|
17
|
+
export interface QuizArgs {
|
|
18
|
+
title?: string;
|
|
19
|
+
questions: QuizQuestion[];
|
|
20
|
+
}
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-600:oklch(57.7% .245 27.325);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-800:oklch(43.2% .095 166.913);--color-blue-50:oklch(97% .014 254.604);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-200:oklch(87% .065 274.039);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-700:oklch(45.7% .24 277.023);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-800:oklch(27.8% .033 256.848);--color-white:#fff;--spacing:.25rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--radius-md:.375rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.static{position:static}.m-0{margin:calc(var(--spacing)*0)}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-8{margin-top:calc(var(--spacing)*8)}.mr-2{margin-right:calc(var(--spacing)*2)}.mr-3{margin-right:calc(var(--spacing)*3)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-5{margin-bottom:calc(var(--spacing)*5)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.inline-block{display:inline-block}.size-2{width:calc(var(--spacing)*2);height:calc(var(--spacing)*2)}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-full{width:100%;height:100%}.h-32{height:calc(var(--spacing)*32)}.h-full{height:100%}.w-full{width:100%}.max-w-3xl{max-width:var(--container-3xl)}.max-w-\[200px\]{max-width:200px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize-y{resize:vertical}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-6{gap:calc(var(--spacing)*6)}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-none{--tw-border-style:none;border-style:none}.border-\[\#3d3d5c\]{border-color:#3d3d5c}.border-\[\#4b4b6b\]{border-color:#4b4b6b}.border-blue-500{border-color:var(--color-blue-500)}.border-emerald-200{border-color:var(--color-emerald-200)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-indigo-200{border-color:var(--color-indigo-200)}.bg-\[\#1a1a2e\]{background-color:#1a1a2e}.bg-\[\#2d2d44\]{background-color:#2d2d44}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-500\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/20{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.bg-blue-600{background-color:var(--color-blue-600)}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-gray-400{background-color:var(--color-gray-400)}.bg-gray-600{background-color:var(--color-gray-600)}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-indigo-600{background-color:var(--color-indigo-600)}.bg-white{background-color:var(--color-white)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.px-8{padding-inline:calc(var(--spacing)*8)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.text-center{text-align:center}.font-mono{font-family:var(--font-mono)}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#f0f0f0\]{color:#f0f0f0}.text-blue-400{color:var(--color-blue-400)}.text-emerald-800{color:var(--color-emerald-800)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-800{color:var(--color-gray-800)}.text-indigo-700{color:var(--color-indigo-700)}.text-red-600{color:var(--color-red-600)}.text-white{color:var(--color-white)}.opacity-50{opacity:.5}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}@media(hover:hover){.hover\:border-\[\#6b6b8b\]:hover{border-color:#6b6b8b}.hover\:border-indigo-300:hover{border-color:var(--color-indigo-300)}.hover\:bg-\[\#6b6b8b\]\/20:hover{background-color:#6b6b8b33}.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\:bg-indigo-200:hover{background-color:var(--color-indigo-200)}.hover\:bg-indigo-700:hover{background-color:var(--color-indigo-700)}}.focus\:border-indigo-500:focus{border-color:var(--color-indigo-500)}.focus\:ring-\[3px\]:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-indigo-500\/10:focus{--tw-ring-color:#625fff1a}@supports (color:color-mix(in lab,red,red)){.focus\:ring-indigo-500\/10:focus{--tw-ring-color:color-mix(in oklab,var(--color-indigo-500)10%,transparent)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}}body{margin:calc(var(--spacing)*0);background-color:var(--color-gray-100);padding:calc(var(--spacing)*5);font-family:var(--font-sans)}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mulmochat-plugin/quiz",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Quiz plugin for MulmoChat",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"import": "./dist/index.js",
|
|
13
13
|
"require": "./dist/index.cjs"
|
|
14
14
|
},
|
|
15
|
-
"./style.css": "./dist/
|
|
15
|
+
"./style.css": "./dist/style.css"
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
18
18
|
"dist"
|
package/dist/plugin.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MulmoChat Quiz Plugin
|
|
3
|
-
*
|
|
4
|
-
* A plugin for presenting multiple choice quizzes to users.
|
|
5
|
-
*
|
|
6
|
-
* @example Basic usage
|
|
7
|
-
* ```typescript
|
|
8
|
-
* import { plugin } from "@mulmochat-plugin/quiz";
|
|
9
|
-
* import "@mulmochat-plugin/quiz/style.css";
|
|
10
|
-
* // Use plugin directly
|
|
11
|
-
* ```
|
|
12
|
-
*/
|
|
13
|
-
import type { ToolPlugin, ToolResult } from "./common";
|
|
14
|
-
/** Single quiz question */
|
|
15
|
-
export interface QuizQuestion {
|
|
16
|
-
question: string;
|
|
17
|
-
choices: string[];
|
|
18
|
-
correctAnswer?: number;
|
|
19
|
-
}
|
|
20
|
-
/** Quiz data stored in result.jsonData */
|
|
21
|
-
export interface QuizData {
|
|
22
|
-
title?: string;
|
|
23
|
-
questions: QuizQuestion[];
|
|
24
|
-
userAnswers?: number[];
|
|
25
|
-
}
|
|
26
|
-
/** Arguments passed to the quiz tool */
|
|
27
|
-
export interface QuizArgs {
|
|
28
|
-
title?: string;
|
|
29
|
-
questions: QuizQuestion[];
|
|
30
|
-
}
|
|
31
|
-
/** Quiz tool result type */
|
|
32
|
-
export type QuizResult = ToolResult<never, QuizData>;
|
|
33
|
-
/**
|
|
34
|
-
* Quiz plugin instance
|
|
35
|
-
*/
|
|
36
|
-
export declare const plugin: ToolPlugin<never, QuizData, QuizArgs>;
|
package/dist/quiz.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-600:oklch(57.7% .245 27.325);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-800:oklch(43.2% .095 166.913);--color-blue-50:oklch(97% .014 254.604);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-200:oklch(87% .065 274.039);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-700:oklch(45.7% .24 277.023);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-800:oklch(27.8% .033 256.848);--color-white:#fff;--spacing:.25rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--radius-md:.375rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.static{position:static}.m-0{margin:calc(var(--spacing)*0)}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-8{margin-top:calc(var(--spacing)*8)}.mr-2{margin-right:calc(var(--spacing)*2)}.mr-3{margin-right:calc(var(--spacing)*3)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-5{margin-bottom:calc(var(--spacing)*5)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.inline-block{display:inline-block}.size-2{width:calc(var(--spacing)*2);height:calc(var(--spacing)*2)}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-full{width:100%;height:100%}.w-full{width:100%}.max-w-3xl{max-width:var(--container-3xl)}.max-w-\[200px\]{max-width:200px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize-y{resize:vertical}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-6{gap:calc(var(--spacing)*6)}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-none{--tw-border-style:none;border-style:none}.border-\[\#3d3d5c\]{border-color:#3d3d5c}.border-\[\#4b4b6b\]{border-color:#4b4b6b}.border-blue-500{border-color:var(--color-blue-500)}.border-emerald-200{border-color:var(--color-emerald-200)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-indigo-200{border-color:var(--color-indigo-200)}.bg-\[\#1a1a2e\]{background-color:#1a1a2e}.bg-\[\#2d2d44\]{background-color:#2d2d44}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-500\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/20{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.bg-blue-600{background-color:var(--color-blue-600)}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-400{background-color:var(--color-gray-400)}.bg-gray-600{background-color:var(--color-gray-600)}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-indigo-600{background-color:var(--color-indigo-600)}.bg-white{background-color:var(--color-white)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.px-8{padding-inline:calc(var(--spacing)*8)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.text-center{text-align:center}.font-mono{font-family:var(--font-mono)}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#f0f0f0\]{color:#f0f0f0}.text-blue-400{color:var(--color-blue-400)}.text-emerald-800{color:var(--color-emerald-800)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-800{color:var(--color-gray-800)}.text-indigo-700{color:var(--color-indigo-700)}.text-red-600{color:var(--color-red-600)}.text-white{color:var(--color-white)}.opacity-50{opacity:.5}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}@media(hover:hover){.hover\:border-\[\#6b6b8b\]:hover{border-color:#6b6b8b}.hover\:border-indigo-300:hover{border-color:var(--color-indigo-300)}.hover\:bg-\[\#6b6b8b\]\/20:hover{background-color:#6b6b8b33}.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\:bg-indigo-200:hover{background-color:var(--color-indigo-200)}.hover\:bg-indigo-700:hover{background-color:var(--color-indigo-700)}}.focus\:border-indigo-500:focus{border-color:var(--color-indigo-500)}.focus\:ring-\[3px\]:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-indigo-500\/10:focus{--tw-ring-color:#625fff1a}@supports (color:color-mix(in lab,red,red)){.focus\:ring-indigo-500\/10:focus{--tw-ring-color:color-mix(in oklab,var(--color-indigo-500)10%,transparent)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}}body{margin:calc(var(--spacing)*0);background-color:var(--color-gray-100);padding:calc(var(--spacing)*5);font-family:var(--font-sans)}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}
|
package/dist/types.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Re-export common types for backward compatibility.
|
|
3
|
-
* New plugins should import from "./common" directly.
|
|
4
|
-
*/
|
|
5
|
-
export type { ToolContext, ToolResult, ToolPlugin, ToolDefinition, JsonSchemaProperty, StartApiResponse, FileUploadConfig, ToolPluginConfig, ToolSample, } from "./common";
|
|
File without changes
|
|
File without changes
|