@kwirthmagnify/kwirth-common-ai 0.5.21 → 0.5.22

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.
Files changed (2) hide show
  1. package/dist/front.js +13 -7
  2. package/package.json +1 -1
package/dist/front.js CHANGED
@@ -32,11 +32,17 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
35
38
  Object.defineProperty(exports, "__esModule", { value: true });
36
39
  exports.ToolSelector = exports.AiConfigProvider = exports.AiConfigLlm = exports.LlmSelector = void 0;
37
40
  const react_1 = __importStar(require("react"));
38
41
  const material_1 = require("@mui/material");
39
- const icons_material_1 = require("@mui/icons-material");
42
+ const FileDownload_1 = __importDefault(require("@mui/icons-material/FileDownload"));
43
+ const FileUpload_1 = __importDefault(require("@mui/icons-material/FileUpload"));
44
+ const Visibility_1 = __importDefault(require("@mui/icons-material/Visibility"));
45
+ const VisibilityOff_1 = __importDefault(require("@mui/icons-material/VisibilityOff"));
40
46
  const downloadJson = async (data, filename) => {
41
47
  var _a;
42
48
  const json = JSON.stringify(data, null, 2);
@@ -152,7 +158,7 @@ const AiConfigLlm = (props) => {
152
158
  react_1.default.createElement(material_1.Checkbox, { checked: useProviderKey, onChange: e => setUseProviderKey(e.target.checked) })),
153
159
  react_1.default.createElement(material_1.TextField, { value: key, onChange: e => setKey(e.target.value), disabled: useProviderKey, label: 'API Key', placeholder: 'Enter API Key', variant: 'standard', fullWidth: true, type: showPassword ? 'text' : 'password', InputProps: {
154
160
  endAdornment: (react_1.default.createElement(material_1.InputAdornment, { position: 'end' },
155
- react_1.default.createElement(material_1.IconButton, { onClick: () => setShowPassword(!showPassword), edge: 'end' }, showPassword ? react_1.default.createElement(icons_material_1.VisibilityOff, null) : react_1.default.createElement(icons_material_1.Visibility, null))))
161
+ react_1.default.createElement(material_1.IconButton, { onClick: () => setShowPassword(!showPassword), edge: 'end' }, showPassword ? react_1.default.createElement(VisibilityOff_1.default, null) : react_1.default.createElement(Visibility_1.default, null))))
156
162
  } })),
157
163
  react_1.default.createElement(material_1.Stack, { direction: 'row', spacing: 1 },
158
164
  react_1.default.createElement(material_1.Button, { variant: 'outlined', size: 'small', onClick: onNew }, "New"),
@@ -173,8 +179,8 @@ const AiConfigLlm = (props) => {
173
179
  reader.readAsText(f);
174
180
  e.target.value = '';
175
181
  } }),
176
- react_1.default.createElement(material_1.Button, { startIcon: react_1.default.createElement(icons_material_1.FileUpload, { fontSize: 'small' }), onClick: () => { var _a; return (_a = importLlmRef.current) === null || _a === void 0 ? void 0 : _a.click(); } }, "Import"),
177
- react_1.default.createElement(material_1.Button, { startIcon: react_1.default.createElement(icons_material_1.FileDownload, { fontSize: 'small' }), onClick: () => downloadJson(llms, 'kwirth-llms.json') }, "Export"),
182
+ react_1.default.createElement(material_1.Button, { startIcon: react_1.default.createElement(FileUpload_1.default, { fontSize: 'small' }), onClick: () => { var _a; return (_a = importLlmRef.current) === null || _a === void 0 ? void 0 : _a.click(); } }, "Import"),
183
+ react_1.default.createElement(material_1.Button, { startIcon: react_1.default.createElement(FileDownload_1.default, { fontSize: 'small' }), onClick: () => downloadJson(llms, 'kwirth-llms.json') }, "Export"),
178
184
  react_1.default.createElement(material_1.Box, { flex: 1 }),
179
185
  react_1.default.createElement(material_1.Button, { onClick: () => props.onClose(llms), variant: 'contained' }, "OK"),
180
186
  react_1.default.createElement(material_1.Button, { onClick: () => props.onClose(undefined), color: 'inherit' }, "Cancel"))));
@@ -232,7 +238,7 @@ const AiConfigProvider = (props) => {
232
238
  react_1.default.createElement(material_1.Select, { value: providerName, onChange: e => setProviderName(e.target.value), variant: 'standard', fullWidth: true }, props.providersAvailable.map(name => (react_1.default.createElement(material_1.MenuItem, { key: name, value: name }, name))))),
233
239
  react_1.default.createElement(material_1.TextField, { label: 'API Key / Token', type: showPassword ? 'text' : 'password', variant: 'standard', fullWidth: true, value: providerKey, onChange: e => setProviderKey(e.target.value), helperText: 'This key can be afterwards linked to specific uses.', InputProps: {
234
240
  endAdornment: (react_1.default.createElement(material_1.InputAdornment, { position: 'end' },
235
- react_1.default.createElement(material_1.IconButton, { onClick: () => setShowPassword(!showPassword), edge: 'end' }, showPassword ? react_1.default.createElement(icons_material_1.VisibilityOff, null) : react_1.default.createElement(icons_material_1.Visibility, null))))
241
+ react_1.default.createElement(material_1.IconButton, { onClick: () => setShowPassword(!showPassword), edge: 'end' }, showPassword ? react_1.default.createElement(VisibilityOff_1.default, null) : react_1.default.createElement(Visibility_1.default, null))))
236
242
  } }),
237
243
  react_1.default.createElement(material_1.Box, { sx: { flexGrow: 1 } }),
238
244
  react_1.default.createElement(material_1.Stack, { direction: 'row', spacing: 1 },
@@ -254,8 +260,8 @@ const AiConfigProvider = (props) => {
254
260
  reader.readAsText(f);
255
261
  e.target.value = '';
256
262
  } }),
257
- react_1.default.createElement(material_1.Button, { startIcon: react_1.default.createElement(icons_material_1.FileUpload, { fontSize: 'small' }), onClick: () => { var _a; return (_a = importProvRef.current) === null || _a === void 0 ? void 0 : _a.click(); } }, "Import"),
258
- react_1.default.createElement(material_1.Button, { startIcon: react_1.default.createElement(icons_material_1.FileDownload, { fontSize: 'small' }), onClick: () => downloadJson(providers.map(p => ({ name: p.name, key: p.key })), 'kwirth-providers.json') }, "Export"),
263
+ react_1.default.createElement(material_1.Button, { startIcon: react_1.default.createElement(FileUpload_1.default, { fontSize: 'small' }), onClick: () => { var _a; return (_a = importProvRef.current) === null || _a === void 0 ? void 0 : _a.click(); } }, "Import"),
264
+ react_1.default.createElement(material_1.Button, { startIcon: react_1.default.createElement(FileDownload_1.default, { fontSize: 'small' }), onClick: () => downloadJson(providers.map(p => ({ name: p.name, key: p.key })), 'kwirth-providers.json') }, "Export"),
259
265
  react_1.default.createElement(material_1.Box, { flex: 1 }),
260
266
  react_1.default.createElement(material_1.Button, { onClick: () => props.onClose(providers), color: 'primary', variant: 'contained' }, "Save"),
261
267
  react_1.default.createElement(material_1.Button, { onClick: () => props.onClose(undefined), color: 'inherit' }, "Cancel"))));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kwirthmagnify/kwirth-common-ai",
3
- "version": "0.5.21",
3
+ "version": "0.5.22",
4
4
  "description": "Shared AI/LLM types and utilities for Kwirth AI plugins",
5
5
  "scripts": {
6
6
  "build": "del .\\dist\\* /s /q 2>nul & tsc"