@mulmochat-plugin/form 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.
@@ -4,4 +4,4 @@
4
4
  * Shared types and utilities for building MulmoChat plugins.
5
5
  * Import from "@mulmochat-plugin/form/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";
@@ -5,15 +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
- userPreferences?: Record<string, unknown>;
14
- getPluginConfig?: <T = unknown>(key: string) => T | undefined;
15
- /** Backend API functions provided by the host app */
16
- app?: Record<string, (...args: any[]) => any>;
26
+ app?: ToolContextApp;
17
27
  }
18
28
  /**
19
29
  * Result returned from plugin execution
@@ -127,4 +137,6 @@ export interface ToolPlugin<T = unknown, J = unknown, A extends object = object>
127
137
  config?: ToolPluginConfig;
128
138
  /** Optional sample arguments for testing */
129
139
  samples?: ToolSample[];
140
+ /** Backend types this plugin uses (e.g., ["textLLM", "imageGen"]) */
141
+ backends?: BackendType[];
130
142
  }
@@ -11,7 +11,7 @@
11
11
  * ```
12
12
  */
13
13
  import type { ToolPlugin } from "../common";
14
- import { type FormData, type FormArgs } from "./types";
14
+ import type { FormData, FormArgs } from "./types";
15
15
  /**
16
16
  * Form plugin instance
17
17
  */
@@ -0,0 +1,121 @@
1
+ /**
2
+ * Form Tool Definition
3
+ */
4
+ export declare const TOOL_NAME = "presentForm";
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
+ description: {
17
+ type: string;
18
+ description: string;
19
+ };
20
+ fields: {
21
+ type: string;
22
+ description: string;
23
+ items: {
24
+ type: string;
25
+ properties: {
26
+ id: {
27
+ type: string;
28
+ description: string;
29
+ };
30
+ type: {
31
+ type: string;
32
+ enum: string[];
33
+ description: string;
34
+ };
35
+ label: {
36
+ type: string;
37
+ description: string;
38
+ };
39
+ description: {
40
+ type: string;
41
+ description: string;
42
+ };
43
+ required: {
44
+ type: string;
45
+ description: string;
46
+ };
47
+ placeholder: {
48
+ type: string;
49
+ description: string;
50
+ };
51
+ validation: {
52
+ type: string;
53
+ description: string;
54
+ };
55
+ minLength: {
56
+ type: string;
57
+ description: string;
58
+ };
59
+ maxLength: {
60
+ type: string;
61
+ description: string;
62
+ };
63
+ rows: {
64
+ type: string;
65
+ description: string;
66
+ };
67
+ choices: {
68
+ type: string;
69
+ items: {
70
+ type: string;
71
+ };
72
+ description: string;
73
+ };
74
+ searchable: {
75
+ type: string;
76
+ description: string;
77
+ };
78
+ minSelections: {
79
+ type: string;
80
+ description: string;
81
+ };
82
+ maxSelections: {
83
+ type: string;
84
+ description: string;
85
+ };
86
+ minDate: {
87
+ type: string;
88
+ description: string;
89
+ };
90
+ maxDate: {
91
+ type: string;
92
+ description: string;
93
+ };
94
+ format: {
95
+ type: string;
96
+ description: string;
97
+ };
98
+ min: {
99
+ type: string;
100
+ description: string;
101
+ };
102
+ max: {
103
+ type: string;
104
+ description: string;
105
+ };
106
+ step: {
107
+ type: string;
108
+ description: string;
109
+ };
110
+ defaultValue: {
111
+ description: string;
112
+ };
113
+ };
114
+ required: string[];
115
+ };
116
+ minItems: number;
117
+ };
118
+ };
119
+ required: string[];
120
+ };
121
+ };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Form Tool Definition and Types
2
+ * Form Types
3
3
  */
4
4
  /** Field type discriminator */
5
5
  export type FieldType = "text" | "textarea" | "radio" | "dropdown" | "checkbox" | "date" | "time" | "number";
@@ -87,121 +87,3 @@ export interface FormArgs {
87
87
  description?: string;
88
88
  fields: FormField[];
89
89
  }
90
- export declare const TOOL_NAME = "presentForm";
91
- export declare const TOOL_DEFINITION: {
92
- type: "function";
93
- name: string;
94
- description: string;
95
- parameters: {
96
- type: "object";
97
- properties: {
98
- title: {
99
- type: string;
100
- description: string;
101
- };
102
- description: {
103
- type: string;
104
- description: string;
105
- };
106
- fields: {
107
- type: string;
108
- description: string;
109
- items: {
110
- type: string;
111
- properties: {
112
- id: {
113
- type: string;
114
- description: string;
115
- };
116
- type: {
117
- type: string;
118
- enum: string[];
119
- description: string;
120
- };
121
- label: {
122
- type: string;
123
- description: string;
124
- };
125
- description: {
126
- type: string;
127
- description: string;
128
- };
129
- required: {
130
- type: string;
131
- description: string;
132
- };
133
- placeholder: {
134
- type: string;
135
- description: string;
136
- };
137
- validation: {
138
- type: string;
139
- description: string;
140
- };
141
- minLength: {
142
- type: string;
143
- description: string;
144
- };
145
- maxLength: {
146
- type: string;
147
- description: string;
148
- };
149
- rows: {
150
- type: string;
151
- description: string;
152
- };
153
- choices: {
154
- type: string;
155
- items: {
156
- type: string;
157
- };
158
- description: string;
159
- };
160
- searchable: {
161
- type: string;
162
- description: string;
163
- };
164
- minSelections: {
165
- type: string;
166
- description: string;
167
- };
168
- maxSelections: {
169
- type: string;
170
- description: string;
171
- };
172
- minDate: {
173
- type: string;
174
- description: string;
175
- };
176
- maxDate: {
177
- type: string;
178
- description: string;
179
- };
180
- format: {
181
- type: string;
182
- description: string;
183
- };
184
- min: {
185
- type: string;
186
- description: string;
187
- };
188
- max: {
189
- type: string;
190
- description: string;
191
- };
192
- step: {
193
- type: string;
194
- description: string;
195
- };
196
- defaultValue: {
197
- description: string;
198
- };
199
- };
200
- required: string[];
201
- };
202
- minItems: number;
203
- };
204
- };
205
- required: string[];
206
- };
207
- };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mulmochat-plugin/form",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Form plugin for MulmoChat",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",