MCPcopy
hub / github.com/ChatGPTNextWeb/NextChat / create

Function create

app/store/plugin.ts:176–190  ·  view source on GitHub ↗
(plugin?: Partial<Plugin>)

Source from the content-addressed store, hash-verified

174
175 (set, get) => ({
176 create(plugin?: Partial<Plugin>) {
177 const plugins = get().plugins;
178 const id = plugin?.id || nanoid();
179 plugins[id] = {
180 ...createEmptyPlugin(),
181 ...plugin,
182 id,
183 builtin: false,
184 };
185
186 set(() => ({ plugins }));
187 get().markUpdate();
188
189 return plugins[id];
190 },
191 updatePlugin(id: string, updater: (plugin: Plugin) => void) {
192 const plugins = get().plugins;
193 const plugin = plugins[id];

Callers

nothing calls this directly

Calls 4

nanoidFunction · 0.85
createEmptyPluginFunction · 0.85
getFunction · 0.70
setFunction · 0.50

Tested by

no test coverage detected