@mingxy/cerebro 1.16.9 → 1.17.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.
Files changed (59) hide show
  1. package/package.json +6 -1
  2. package/src/config.ts +19 -4
  3. package/src/hooks.ts +25 -13
  4. package/src/index.ts +30 -0
  5. package/src/web-server.ts +180 -0
  6. package/web/assets/geist-cyrillic-wght-normal-CHSlOQsW.woff2 +0 -0
  7. package/web/assets/geist-latin-ext-wght-normal-DMtmJ5ZE.woff2 +0 -0
  8. package/web/assets/geist-latin-wght-normal-Dm3htQBi.woff2 +0 -0
  9. package/web/assets/index-B-0ucKQF.js +119 -0
  10. package/web/assets/index-Dxd5Um3O.css +1 -0
  11. package/web/favicon.svg +1 -0
  12. package/web/icons.svg +24 -0
  13. package/web/index.html +15 -0
  14. package/.omo/evidence/f1-verification.txt +0 -44
  15. package/INJECTION_FLOW.md +0 -434
  16. package/cerebro.example.jsonc +0 -72
  17. package/dist/client.d.ts +0 -165
  18. package/dist/client.d.ts.map +0 -1
  19. package/dist/client.js +0 -222
  20. package/dist/client.js.map +0 -1
  21. package/dist/config.d.ts +0 -46
  22. package/dist/config.d.ts.map +0 -1
  23. package/dist/config.js +0 -201
  24. package/dist/config.js.map +0 -1
  25. package/dist/hooks.d.ts +0 -41
  26. package/dist/hooks.d.ts.map +0 -1
  27. package/dist/hooks.js +0 -1066
  28. package/dist/hooks.js.map +0 -1
  29. package/dist/index.d.ts +0 -11
  30. package/dist/index.d.ts.map +0 -1
  31. package/dist/index.js +0 -118
  32. package/dist/index.js.map +0 -1
  33. package/dist/keywords.d.ts +0 -3
  34. package/dist/keywords.d.ts.map +0 -1
  35. package/dist/keywords.js +0 -21
  36. package/dist/keywords.js.map +0 -1
  37. package/dist/logger.d.ts +0 -5
  38. package/dist/logger.d.ts.map +0 -1
  39. package/dist/logger.js +0 -62
  40. package/dist/logger.js.map +0 -1
  41. package/dist/privacy.d.ts +0 -3
  42. package/dist/privacy.d.ts.map +0 -1
  43. package/dist/privacy.js +0 -10
  44. package/dist/privacy.js.map +0 -1
  45. package/dist/tags.d.ts +0 -3
  46. package/dist/tags.d.ts.map +0 -1
  47. package/dist/tags.js +0 -13
  48. package/dist/tags.js.map +0 -1
  49. package/dist/tools.d.ts +0 -209
  50. package/dist/tools.d.ts.map +0 -1
  51. package/dist/tools.js +0 -344
  52. package/dist/tools.js.map +0 -1
  53. package/dist/tui.d.ts +0 -7
  54. package/dist/tui.d.ts.map +0 -1
  55. package/dist/tui.js +0 -63
  56. package/dist/tui.js.map +0 -1
  57. package/mingxy-omem-0.1.6.tgz +0 -0
  58. package/schema.json +0 -225
  59. package/tsconfig.json +0 -26
package/dist/tools.js DELETED
@@ -1,344 +0,0 @@
1
- import { tool } from "@opencode-ai/plugin";
2
- import { isAutoStoreEnabled, setAutoStoreEnabled } from "./index.js";
3
- export function buildTools(client, containerTags, context) {
4
- return {
5
- memory_store: tool({
6
- description: "Store a new memory in the user's long-term memory. " +
7
- "Use when the user explicitly asks to remember something, " +
8
- "or when you identify important preferences, facts, or decisions worth preserving. " +
9
- "IMPORTANT: Before calling, you MUST analyze: (1) Which category fits best? (2) Is this project-specific or cross-project? (3) Does it contain sensitive data? (4) Are tags accurate and descriptive? " +
10
- "Every memory MUST have a correct category and at least 1 meaningful tag. " +
11
- "Memories are automatically scoped to the current project via project_path. " +
12
- "Set scope='global' for cross-project memories that should be visible everywhere. " +
13
- "Private memories (visibility='private') are always agent-scoped and not bound to any project — use for sensitive data.",
14
- args: {
15
- content: tool.schema.string().describe("The information to remember. MUST be: atomic (one fact per memory), complete (self-contained without context), and precise (no ambiguity). " +
16
- "BAD: 'fixed some bugs'. GOOD: 'Fixed memory_type validation bug in memory.rs:1480 - LLM returns illegal \"pinned\" value, added match guard to normalize to WORK/EMOTIONAL fallback'."),
17
- tags: tool.schema
18
- .array(tool.schema.string())
19
- .optional()
20
- .describe("REQUIRED. At least 1 tag in snake_case. Tags describe the memory's topic/domain for future retrieval. " +
21
- "Examples: rust_backend, memory_system, bug_fix, user_preference, project_config. " +
22
- "NEVER leave empty — if unsure, use a broad tag like the project name or topic area."),
23
- source: tool.schema
24
- .string()
25
- .describe("Origin context, e.g. 'conversation', 'code-review', 'user-input', 'debugging', 'architecture-decision'"),
26
- scope: tool.schema
27
- .string()
28
- .optional()
29
- .describe("'project' (default) = only visible in current project context. 'global' = visible across all projects. " +
30
- "Rule: if the memory applies generally (user preferences, general knowledge, cross-project patterns) use 'global'. " +
31
- "If it's specific to one project's code/architecture, use 'project'."),
32
- visibility: tool.schema
33
- .string()
34
- .optional()
35
- .describe("'global' (default) = all agents can see and recall this memory. 'private' = ONLY the current agent can see it. " +
36
- "MUST use 'private' when content contains: passwords, API keys, tokens, database credentials, SSH keys, personal information (phone, email, address), " +
37
- "internal company details, or anything the user would NOT want other agents to access. " +
38
- "WARNING: private memories are invisible to ALL other agents — if in doubt, ask the user. " +
39
- "Do NOT overuse 'private' for normal work notes — default 'global' is correct for most cases."),
40
- category: tool.schema
41
- .enum(["cases", "preferences", "entities", "events", "profile", "patterns"])
42
- .optional()
43
- .describe("Memory category. MUST be one of these exact values (lowercase): " +
44
- "'cases' (default) = work records, bug fixes, architecture decisions; " +
45
- "'preferences' = user likes/dislikes, coding style, tool choices; " +
46
- "'entities' = projects, tools, people, concepts; " +
47
- "'events' = time-bound milestones (deployments, releases, incidents); " +
48
- "'profile' = user identity traits (role, skills, team membership); " +
49
- "'patterns' = workflows, methodologies, best practices. " +
50
- "When in doubt, omit this field (defaults to 'cases')."),
51
- },
52
- async execute(args) {
53
- const allTags = [...containerTags, ...(args.tags ?? [])];
54
- const effectiveAgentId = context.getAgentName?.() || context.agentId;
55
- const result = await client.createMemory(args.content, allTags, args.source, args.scope ?? "project", effectiveAgentId, context.getSessionId(), args.visibility, args.category, context.getProjectPath?.());
56
- if (!result)
57
- return JSON.stringify({ ok: false, error: "The Cerebro server may be unavailable." });
58
- return JSON.stringify({ ok: true, id: result.id, tags: result.tags });
59
- },
60
- }),
61
- memory_search: tool({
62
- description: "Search the user's long-term memory by semantic similarity. " +
63
- "Use to recall previously stored preferences, facts, or context. " +
64
- "Searches are automatically filtered by the current project_path. " +
65
- "Global-scope memories and memories without a project_path are always included in results. " +
66
- "Private memories are visible only to the creating agent.",
67
- args: {
68
- query: tool.schema.string().describe("Natural-language search query"),
69
- limit: tool.schema
70
- .number()
71
- .optional()
72
- .describe("Max results to return (default 10)"),
73
- scope: tool.schema
74
- .string()
75
- .optional()
76
- .describe("Optional scope filter"),
77
- },
78
- async execute(args) {
79
- const results = await client.searchMemories(args.query, args.limit ?? 10, args.scope, containerTags, context.getProjectPath?.());
80
- if (results.length === 0)
81
- return JSON.stringify({ ok: true, count: 0, results: [] });
82
- const items = results.map((r) => ({
83
- id: r.memory.id,
84
- score: r.score,
85
- content: r.memory.content.slice(0, 200),
86
- }));
87
- return JSON.stringify({ ok: true, count: results.length, results: items });
88
- },
89
- }),
90
- memory_get: tool({
91
- description: "Retrieve a specific memory by its ID. " +
92
- "Use when a recalled memory's content was truncated (e.g. medium relevance summary) " +
93
- "and you need the full details, or when you see [rel:<id>] markers in injected context " +
94
- "and want to fetch related memories.",
95
- args: {
96
- id: tool.schema.string().describe("Memory ID"),
97
- },
98
- async execute(args) {
99
- const memory = await client.getMemory(args.id);
100
- if (!memory)
101
- return JSON.stringify({ ok: false, error: "not found" });
102
- return JSON.stringify({ ok: true, memory });
103
- },
104
- }),
105
- memory_update: tool({
106
- description: "Update the content or tags of an existing memory. " +
107
- "Use when information needs correction or enrichment.",
108
- args: {
109
- id: tool.schema.string().describe("Memory ID to update"),
110
- content: tool.schema.string().describe("New content"),
111
- tags: tool.schema
112
- .array(tool.schema.string())
113
- .optional()
114
- .describe("Replacement tags"),
115
- },
116
- async execute(args) {
117
- const result = await client.updateMemory(args.id, args.content, args.tags);
118
- if (!result)
119
- return JSON.stringify({ ok: false, error: `Failed to update memory ${args.id}` });
120
- return JSON.stringify({ ok: true, id: args.id });
121
- },
122
- }),
123
- memory_profile: tool({
124
- description: "Get the user profile synthesized from stored memories. Shows preferences, patterns, and key information.",
125
- args: {},
126
- async execute() {
127
- const preferences = await client.getProfile();
128
- if (preferences.length === 0)
129
- return JSON.stringify({ ok: true, count: 0, preferences: [] });
130
- return JSON.stringify({ ok: true, count: preferences.length, preferences });
131
- },
132
- }),
133
- memory_profile_stats: tool({
134
- description: "View user profile statistics — total preferences, slot distribution, induction run counts, etc.",
135
- args: {},
136
- async execute() {
137
- const stats = await client.getProfileStats();
138
- return JSON.stringify({ ok: true, stats });
139
- },
140
- }),
141
- memory_list: tool({
142
- description: "List the most recent memories. Use to browse what's been remembered without a search query.",
143
- args: {
144
- limit: tool.schema
145
- .number()
146
- .optional()
147
- .describe("Max memories to return (default: 20)"),
148
- },
149
- async execute(args) {
150
- const memories = await client.listRecent(args.limit ?? 20);
151
- if (memories.length === 0)
152
- return JSON.stringify({ ok: true, count: 0, memories: [] });
153
- const items = memories.map((m) => ({
154
- id: m.id,
155
- content: m.content.slice(0, 120),
156
- category: m.category,
157
- tags: m.tags,
158
- }));
159
- return JSON.stringify({ ok: true, count: memories.length, memories: items });
160
- },
161
- }),
162
- memory_ingest: tool({
163
- description: "Ingest conversation messages for intelligent extraction. The system extracts atomic facts, deduplicates, and reconciles with existing memories. " +
164
- "Extracted memories are automatically scoped to the current project via project_path. " +
165
- "Global-scope memories are visible across all projects.",
166
- args: {
167
- messages: tool.schema
168
- .array(tool.schema.object({
169
- role: tool.schema.string().describe("Message role: user, assistant, or system"),
170
- content: tool.schema.string().describe("Message content"),
171
- }))
172
- .describe("Conversation messages to ingest"),
173
- mode: tool.schema
174
- .enum(["smart", "raw"])
175
- .optional()
176
- .describe("Extraction mode: 'smart' (default) or 'raw'"),
177
- tags: tool.schema
178
- .array(tool.schema.string())
179
- .optional()
180
- .describe("Tags to apply to extracted memories"),
181
- session_id: tool.schema
182
- .string()
183
- .optional()
184
- .describe("Session ID to associate with the ingestion"),
185
- },
186
- async execute(args) {
187
- const effectiveAgentId = context.getAgentName?.() || context.agentId;
188
- const result = await client.ingestMessages(args.messages, {
189
- mode: args.mode ?? "smart",
190
- tags: args.tags,
191
- sessionId: args.session_id,
192
- agentId: effectiveAgentId,
193
- projectPath: context.getProjectPath?.(),
194
- });
195
- if (result === null)
196
- return JSON.stringify({ ok: false, error: "Ingestion failed" });
197
- return JSON.stringify({ ok: true, result });
198
- },
199
- }),
200
- memory_stats: tool({
201
- description: "Get statistics about stored memories — counts by category, type, tier, and timeline.",
202
- args: {},
203
- async execute() {
204
- const stats = await client.getStats();
205
- if (!stats)
206
- return JSON.stringify({ ok: false, error: "Failed to get stats" });
207
- return JSON.stringify({ ok: true, stats });
208
- },
209
- }),
210
- memory_delete: tool({
211
- description: "Delete a memory by ID. Use when the user asks to forget something.",
212
- args: {
213
- id: tool.schema.string().describe("Memory ID to delete"),
214
- },
215
- async execute(args) {
216
- try {
217
- await client.deleteMemory(args.id);
218
- return JSON.stringify({ ok: true, id: args.id });
219
- }
220
- catch {
221
- return JSON.stringify({ ok: false, error: `Failed to delete memory ${args.id}` });
222
- }
223
- },
224
- }),
225
- space_create: tool({
226
- description: "Create a shared space (team or organization) for sharing memories across users and agents.",
227
- args: {
228
- name: tool.schema.string().describe("Name of the space"),
229
- space_type: tool.schema
230
- .string()
231
- .describe("Type of space: 'team' or 'organization'"),
232
- members: tool.schema
233
- .array(tool.schema.object({
234
- user_id: tool.schema.string().describe("User/tenant ID to add"),
235
- role: tool.schema.string().describe("Member role: admin, member, or reader"),
236
- }))
237
- .optional()
238
- .describe("Initial members to add"),
239
- },
240
- async execute(args) {
241
- const result = await client.createSpace(args.name, args.space_type, args.members);
242
- if (!result)
243
- return JSON.stringify({ ok: false, error: "Failed to create space" });
244
- return JSON.stringify({ ok: true, space: result });
245
- },
246
- }),
247
- space_list: tool({
248
- description: "List all spaces you own or are a member of.",
249
- args: {},
250
- async execute() {
251
- const spaces = await client.listSpaces();
252
- return JSON.stringify({ ok: true, spaces });
253
- },
254
- }),
255
- space_add_member: tool({
256
- description: "Add a user to an existing shared space with a specified role.",
257
- args: {
258
- space_id: tool.schema.string().describe("Space ID"),
259
- user_id: tool.schema.string().describe("User/tenant ID to add"),
260
- role: tool.schema.string().describe("Role: admin, member, or reader"),
261
- },
262
- async execute(args) {
263
- const result = await client.addSpaceMember(args.space_id, args.user_id, args.role);
264
- if (!result)
265
- return JSON.stringify({ ok: false, error: "Failed to add member" });
266
- return JSON.stringify({ ok: true, result });
267
- },
268
- }),
269
- memory_share: tool({
270
- description: "Share a memory to a team or organization space. Creates a copy with provenance tracking.",
271
- args: {
272
- memory_id: tool.schema.string().describe("Memory ID to share"),
273
- target_space: tool.schema.string().describe("Target space ID"),
274
- },
275
- async execute(args) {
276
- const result = await client.shareMemory(args.memory_id, args.target_space);
277
- if (!result)
278
- return JSON.stringify({ ok: false, error: "Failed to share memory" });
279
- return JSON.stringify({ ok: true, result });
280
- },
281
- }),
282
- memory_pull: tool({
283
- description: "Pull a shared memory from a team/organization space into your personal space.",
284
- args: {
285
- memory_id: tool.schema.string().describe("Memory ID to pull"),
286
- source_space: tool.schema.string().describe("Source space ID"),
287
- visibility: tool.schema
288
- .string()
289
- .optional()
290
- .describe("Visibility of the pulled copy"),
291
- },
292
- async execute(args) {
293
- const result = await client.pullMemory(args.memory_id, args.source_space, args.visibility);
294
- if (!result)
295
- return JSON.stringify({ ok: false, error: "Failed to pull memory" });
296
- return JSON.stringify({ ok: true, result });
297
- },
298
- }),
299
- memory_reshare: tool({
300
- description: "Refresh a stale shared copy with the latest content and vector from the source memory.",
301
- args: {
302
- memory_id: tool.schema.string().describe("Shared copy memory ID to refresh"),
303
- target_space: tool.schema
304
- .string()
305
- .optional()
306
- .describe("Target space containing the copy (optional)"),
307
- },
308
- async execute(args) {
309
- const result = await client.reshareMemory(args.memory_id, args.target_space);
310
- if (!result)
311
- return JSON.stringify({ ok: false, error: "Failed to reshare memory" });
312
- return JSON.stringify({ ok: true, result });
313
- },
314
- }),
315
- memory_toggle: tool({
316
- description: "Toggle Cerebro auto-store ON or OFF for current session. Does NOT affect manual memory_store calls.",
317
- args: {
318
- state: tool.schema
319
- .string()
320
- .optional()
321
- .describe("Set to 'on' or 'off'. Omit to check current status."),
322
- },
323
- async execute(args) {
324
- const sessionId = context.getSessionId();
325
- if (!sessionId)
326
- return JSON.stringify({ ok: false, error: "No active session" });
327
- const state = args.state?.toLowerCase();
328
- if (state === "on") {
329
- setAutoStoreEnabled(sessionId, true);
330
- return JSON.stringify({ ok: true, auto_store: true, message: "Cerebro auto-store: ON" });
331
- }
332
- else if (state === "off") {
333
- setAutoStoreEnabled(sessionId, false);
334
- return JSON.stringify({ ok: true, auto_store: false, message: "Cerebro auto-store: OFF" });
335
- }
336
- else {
337
- const current = isAutoStoreEnabled(sessionId);
338
- return JSON.stringify({ ok: true, auto_store: current, message: `Cerebro auto-store: ${current ? "ON" : "OFF"}` });
339
- }
340
- },
341
- }),
342
- };
343
- }
344
- //# sourceMappingURL=tools.js.map
package/dist/tools.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE3C,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AASrE,MAAM,UAAU,UAAU,CAAC,MAAqB,EAAE,aAAuB,EAAE,OAAoB;IAC7F,OAAO;QACL,YAAY,EAAE,IAAI,CAAC;YACjB,WAAW,EACT,qDAAqD;gBACrD,2DAA2D;gBAC3D,oFAAoF;gBACpF,uMAAuM;gBACvM,2EAA2E;gBAC3E,6EAA6E;gBAC7E,mFAAmF;gBACnF,wHAAwH;YAC1H,IAAI,EAAE;gBACJ,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,QAAQ,CACpC,6IAA6I;oBAC7I,uLAAuL,CACxL;gBACD,IAAI,EAAE,IA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IAAI,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC,CAAC;gBAC3F,CAAC;qBAAM,IAAI,KAAK,KAAK,KAAK,EAAE,CAAC;oBAC3B,mBAAmB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;oBACtC,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,yBAAyB,EAAE,CAAC,CAAC;gBAC7F,CAAC;qBAAM,CAAC;oBACN,MAAM,OAAO,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;oBAC9C,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,uBAAuB,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;gBACrH,CAAC;YACH,CAAC;SACF,CAAC;KACH,CAAC;AACJ,CAAC"}
package/dist/tui.d.ts DELETED
@@ -1,7 +0,0 @@
1
- /** @jsxImportSource @opentui/solid */
2
- import type { TuiPluginModule } from "@opencode-ai/plugin/tui";
3
- declare const pluginModule: TuiPluginModule & {
4
- id: string;
5
- };
6
- export default pluginModule;
7
- //# sourceMappingURL=tui.d.ts.map
package/dist/tui.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"tui.d.ts","sourceRoot":"","sources":["../src/tui.tsx"],"names":[],"mappings":"AACA,sCAAsC;AACtC,OAAO,KAAK,EAA2B,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAqFxF,QAAA,MAAM,YAAY,EAAE,eAAe,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAGjD,CAAC;AAEF,eAAe,YAAY,CAAC"}
package/dist/tui.js DELETED
@@ -1,63 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@opentui/solid/jsx-runtime";
2
- import { createEffect, createSignal, onCleanup } from "solid-js";
3
- import { readFileSync } from "node:fs";
4
- import { join } from "node:path";
5
- import { tmpdir } from "node:os";
6
- const id = "@mingxy/cerebro";
7
- const SIDEBAR_ORDER = 160;
8
- function readAutoStoreFromFile(sessionId) {
9
- if (!sessionId)
10
- return true;
11
- try {
12
- const filePath = join(tmpdir(), `cerebro_autostore_${sessionId}.json`);
13
- const data = JSON.parse(readFileSync(filePath, "utf-8"));
14
- return data.enabled ?? true;
15
- }
16
- catch {
17
- return true;
18
- }
19
- }
20
- function SidebarContentView(props) {
21
- const [autoStore, setAutoStore] = createSignal(true);
22
- const theme = () => props.api.theme.current;
23
- const readAutoStore = () => readAutoStoreFromFile(props.sessionID);
24
- const unsubscribers = [
25
- props.api.event.on("session.updated", () => {
26
- setAutoStore(readAutoStore());
27
- }),
28
- props.api.event.on("tui.session.select", (event) => {
29
- if (event.properties?.sessionID === props.sessionID) {
30
- setAutoStore(readAutoStore());
31
- }
32
- }),
33
- ];
34
- createEffect(() => {
35
- props.sessionID;
36
- setAutoStore(readAutoStore());
37
- });
38
- const interval = setInterval(() => {
39
- setAutoStore(readAutoStore());
40
- }, 2000);
41
- onCleanup(() => {
42
- clearInterval(interval);
43
- for (const unsubscribe of unsubscribers)
44
- unsubscribe();
45
- });
46
- return (_jsxs("box", { gap: 0, children: [_jsx("text", { fg: theme()?.text, wrapMode: "none", children: "Cerebro" }), _jsxs("box", { flexDirection: "row", gap: 1, children: [_jsx("text", { flexShrink: 0, style: { fg: autoStore() ? theme()?.success : theme()?.textMuted }, children: "\u2022" }), _jsx("text", { fg: theme()?.textMuted, wrapMode: "none", children: "Auto-store: " + (autoStore() ? "ON" : "OFF") })] })] }));
47
- }
48
- const tui = async (api) => {
49
- api.slots.register({
50
- order: SIDEBAR_ORDER,
51
- slots: {
52
- sidebar_content(_ctx, props) {
53
- return _jsx(SidebarContentView, { api: api, sessionID: props.session_id });
54
- },
55
- },
56
- });
57
- };
58
- const pluginModule = {
59
- id,
60
- tui,
61
- };
62
- export default pluginMod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