@project-ava-supernova/core 0.2.197 → 0.2.198
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/dist/agent/agent.js +24 -24
- package/dist/agent/fresh-eyes.js +10 -10
- package/dist/agent/system-prompt.js +1223 -1223
- package/dist/agent/text-tool-parser.js +14 -14
- package/dist/auto/intent-gate.js +44 -44
- package/dist/auto/task-executor.js +45 -45
- package/dist/brand/kit-py.js +41 -41
- package/dist/desktop/personas.js +116 -116
- package/dist/docs/data/tools.js +3 -3
- package/dist/docs/data/tools.js.map +1 -1
- package/dist/memory/auto-extract.js +36 -36
- package/dist/memory/insights.js +24 -24
- package/dist/memory/memory-agent.js +55 -55
- package/dist/personas/conductor.js +12 -12
- package/dist/tools/apply-plan.js +2 -2
- package/dist/tools/apply-plan.js.map +1 -1
- package/dist/tools/benchmark.d.ts.map +1 -1
- package/dist/tools/benchmark.js +4 -1
- package/dist/tools/benchmark.js.map +1 -1
- package/dist/tools/blender/runner-py.js +443 -443
- package/dist/tools/debug-logs.d.ts.map +1 -1
- package/dist/tools/debug-logs.js +4 -1
- package/dist/tools/debug-logs.js.map +1 -1
- package/dist/tools/design-docs.js +186 -186
- package/dist/tools/doc-generate.js +2 -2
- package/dist/tools/doc-generate.js.map +1 -1
- package/dist/tools/document-author.js +3 -3
- package/dist/tools/document-author.js.map +1 -1
- package/dist/tools/document-manage.js +4 -4
- package/dist/tools/document-manage.js.map +1 -1
- package/dist/tools/env-write.d.ts.map +1 -1
- package/dist/tools/env-write.js +2 -1
- package/dist/tools/env-write.js.map +1 -1
- package/dist/tools/file-edit.js +2 -2
- package/dist/tools/file-edit.js.map +1 -1
- package/dist/tools/file-write.js +2 -2
- package/dist/tools/file-write.js.map +1 -1
- package/dist/tools/generate-image.d.ts.map +1 -1
- package/dist/tools/generate-image.js +3 -2
- package/dist/tools/generate-image.js.map +1 -1
- package/dist/tools/generate-video.d.ts.map +1 -1
- package/dist/tools/generate-video.js +3 -2
- package/dist/tools/generate-video.js.map +1 -1
- package/dist/tools/generate-voice.d.ts.map +1 -1
- package/dist/tools/generate-voice.js +3 -2
- package/dist/tools/generate-voice.js.map +1 -1
- package/dist/tools/gimp/runner-py.js +740 -740
- package/dist/tools/git.d.ts.map +1 -1
- package/dist/tools/git.js +43 -1
- package/dist/tools/git.js.map +1 -1
- package/dist/tools/remove-background.d.ts.map +1 -1
- package/dist/tools/remove-background.js +4 -3
- package/dist/tools/remove-background.js.map +1 -1
- package/dist/tools/security.d.ts +5 -0
- package/dist/tools/security.d.ts.map +1 -1
- package/dist/tools/security.js +73 -8
- package/dist/tools/security.js.map +1 -1
- package/dist/tools/test-generate.js +2 -2
- package/dist/tools/test-generate.js.map +1 -1
- package/dist/tools/test-run.d.ts.map +1 -1
- package/dist/tools/test-run.js +4 -1
- package/dist/tools/test-run.js.map +1 -1
- package/package.json +6 -1
- package/dist/tools/memory-delete.d.ts +0 -11
- package/dist/tools/memory-delete.d.ts.map +0 -1
- package/dist/tools/memory-delete.js +0 -54
- package/dist/tools/memory-delete.js.map +0 -1
- package/dist/tools/memory-recall.d.ts +0 -11
- package/dist/tools/memory-recall.d.ts.map +0 -1
- package/dist/tools/memory-recall.js +0 -101
- package/dist/tools/memory-recall.js.map +0 -1
- package/dist/tools/memory-save.d.ts +0 -11
- package/dist/tools/memory-save.d.ts.map +0 -1
- package/dist/tools/memory-save.js +0 -112
- package/dist/tools/memory-save.js.map +0 -1
- package/dist/tools/memory-update.d.ts +0 -11
- package/dist/tools/memory-update.d.ts.map +0 -1
- package/dist/tools/memory-update.js +0 -88
- package/dist/tools/memory-update.js.map +0 -1
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Tool, ToolResult, ToolExecutionContext, ToolRiskLevel } from './types.js';
|
|
2
|
-
import type { FunctionSchema } from '../providers/types.js';
|
|
3
|
-
export declare class MemorySaveTool implements Tool {
|
|
4
|
-
readonly name = "memory_save";
|
|
5
|
-
readonly description = "Save information to persistent memory that survives across conversations. Use for: user preferences, project decisions, code patterns, architecture notes, bug-fix context. Categories: preference, pattern, architecture, bug-fix, convention, decision, general. Different from journal (daily reflection) and task_manage (action items).";
|
|
6
|
-
readonly riskLevel: ToolRiskLevel;
|
|
7
|
-
readonly requiresConfirmation = false;
|
|
8
|
-
readonly schema: FunctionSchema;
|
|
9
|
-
execute(args: Record<string, unknown>, context: ToolExecutionContext): Promise<ToolResult>;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=memory-save.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory-save.d.ts","sourceRoot":"","sources":["../../src/tools/memory-save.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAM5D,qBAAa,cAAe,YAAW,IAAI;IACzC,QAAQ,CAAC,IAAI,iBAAiB;IAC9B,QAAQ,CAAC,WAAW,kVAAkV;IACtW,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAU;IAC3C,QAAQ,CAAC,oBAAoB,SAAS;IAEtC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAuD7B;IAEI,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC;CA0DjG"}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { MEMORY_CATEGORIES } from '../memory/types.js';
|
|
2
|
-
import { containsCredentials } from './security.js';
|
|
3
|
-
export class MemorySaveTool {
|
|
4
|
-
name = 'memory_save';
|
|
5
|
-
description = 'Save information to persistent memory that survives across conversations. Use for: user preferences, project decisions, code patterns, architecture notes, bug-fix context. Categories: preference, pattern, architecture, bug-fix, convention, decision, general. Different from journal (daily reflection) and task_manage (action items).';
|
|
6
|
-
riskLevel = 'safe';
|
|
7
|
-
requiresConfirmation = false;
|
|
8
|
-
schema = {
|
|
9
|
-
name: 'memory_save',
|
|
10
|
-
description: 'Save information to persistent, categorized memory. Memories survive across conversations and are ' +
|
|
11
|
-
'injected into your system prompt at the start of each session. ' +
|
|
12
|
-
'Use this to remember user preferences, project patterns, key decisions, bug fixes, and solutions. ' +
|
|
13
|
-
'Two scopes: "global" (applies to all projects) and "project" (applies to current project only). ' +
|
|
14
|
-
'Memories are automatically categorized and deduplicated — if you save something similar to an existing memory, ' +
|
|
15
|
-
'it will be updated instead of duplicated. ' +
|
|
16
|
-
'NEVER save API keys, passwords, tokens, or any credentials to memory.',
|
|
17
|
-
parameters: {
|
|
18
|
-
type: 'object',
|
|
19
|
-
properties: {
|
|
20
|
-
scope: {
|
|
21
|
-
type: 'string',
|
|
22
|
-
enum: ['global', 'project'],
|
|
23
|
-
description: 'Where to save. Use "project" for: architectural decisions, code conventions, bug patterns, ' +
|
|
24
|
-
'past solutions, file structure notes, framework/library choices, design tokens, and anything ' +
|
|
25
|
-
'specific to THIS codebase. Use "global" for: personal preferences, workflow habits, ' +
|
|
26
|
-
'communication style, and patterns that apply across ALL projects. When in doubt, prefer "project" — ' +
|
|
27
|
-
'project knowledge that accidentally goes to global is invisible in other projects, while global ' +
|
|
28
|
-
'knowledge that accidentally goes to project just gets recalled in this project.',
|
|
29
|
-
},
|
|
30
|
-
content: {
|
|
31
|
-
type: 'string',
|
|
32
|
-
description: 'The memory content to save (markdown). Be clear and structured. ' +
|
|
33
|
-
'If this is similar to an existing memory, it will be merged/updated automatically.',
|
|
34
|
-
},
|
|
35
|
-
category: {
|
|
36
|
-
type: 'string',
|
|
37
|
-
enum: MEMORY_CATEGORIES,
|
|
38
|
-
description: 'Category for this memory. Helps with organization and retrieval. ' +
|
|
39
|
-
'Options: pattern (coding patterns), preference (user preferences), ' +
|
|
40
|
-
'architecture (project structure), bug-fix (issues/fixes), ' +
|
|
41
|
-
'convention (naming/style rules), tool-config (environment setup), ' +
|
|
42
|
-
'decision (key decisions), person (people/roles), ' +
|
|
43
|
-
'SEAM (a fact about the JOIN between two projects, not about either one — "changing X here does nothing until Y runs over there". These are the expensive ones, invisible from inside either project, and they surface in BOTH when the projects are linked), ' +
|
|
44
|
-
'general (catch-all). ' +
|
|
45
|
-
'If omitted, category is inferred from content.',
|
|
46
|
-
},
|
|
47
|
-
tags: {
|
|
48
|
-
type: 'array',
|
|
49
|
-
items: { type: 'string' },
|
|
50
|
-
description: 'Optional tags for additional filtering (e.g. ["auth", "api", "react"]).',
|
|
51
|
-
},
|
|
52
|
-
branch: {
|
|
53
|
-
type: 'string',
|
|
54
|
-
description: 'Scope this memory to a specific git branch. Useful for experimental work that should not pollute other branches. Omit for all-branch memories.',
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
required: ['scope', 'content'],
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
async execute(args, context) {
|
|
61
|
-
const scope = args.scope;
|
|
62
|
-
const content = args.content;
|
|
63
|
-
const category = args.category;
|
|
64
|
-
const tags = args.tags;
|
|
65
|
-
const branch = args.branch;
|
|
66
|
-
if (!scope || !content?.trim()) {
|
|
67
|
-
return { success: false, output: 'Both scope and content are required.' };
|
|
68
|
-
}
|
|
69
|
-
if (scope !== 'global' && scope !== 'project') {
|
|
70
|
-
return { success: false, output: 'Scope must be "global" or "project".' };
|
|
71
|
-
}
|
|
72
|
-
if (category && !MEMORY_CATEGORIES.includes(category)) {
|
|
73
|
-
return { success: false, output: `Invalid category. Must be one of: ${MEMORY_CATEGORIES.join(', ')}` };
|
|
74
|
-
}
|
|
75
|
-
// Block saving of credentials/secrets
|
|
76
|
-
if (containsCredentials(content)) {
|
|
77
|
-
return {
|
|
78
|
-
success: false,
|
|
79
|
-
output: 'Blocked: content appears to contain API keys, tokens, or credentials. ' +
|
|
80
|
-
'Store credentials in environment variables or a secure vault instead.',
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
const memoryManager = context.sharedState?.memoryManager;
|
|
84
|
-
if (!memoryManager) {
|
|
85
|
-
return { success: false, output: 'Memory system is not available in this context.' };
|
|
86
|
-
}
|
|
87
|
-
try {
|
|
88
|
-
const entry = await memoryManager.saveEntry({
|
|
89
|
-
scope,
|
|
90
|
-
content: content.trim(),
|
|
91
|
-
category,
|
|
92
|
-
tags,
|
|
93
|
-
branch: branch ?? null,
|
|
94
|
-
sourceConversationId: context.conversationId,
|
|
95
|
-
});
|
|
96
|
-
const path = memoryManager.getPath(scope);
|
|
97
|
-
const wasUpdated = entry.createdAt !== entry.updatedAt;
|
|
98
|
-
return {
|
|
99
|
-
success: true,
|
|
100
|
-
output: wasUpdated
|
|
101
|
-
? `Memory updated (${scope}, ${entry.category}). Merged with existing similar entry. File: ${path}`
|
|
102
|
-
: `Memory saved (${scope}, ${entry.category}). ID: ${entry.id.slice(0, 8)}. File: ${path}`,
|
|
103
|
-
metadata: { scope, category: entry.category, id: entry.id, wasUpdated, path },
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
catch (error) {
|
|
107
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
108
|
-
return { success: false, output: `Failed to save memory: ${message}` };
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
//# sourceMappingURL=memory-save.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory-save.js","sourceRoot":"","sources":["../../src/tools/memory-save.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,MAAM,OAAO,cAAc;IAChB,IAAI,GAAG,aAAa,CAAC;IACrB,WAAW,GAAG,8UAA8U,CAAC;IAC7V,SAAS,GAAkB,MAAM,CAAC;IAClC,oBAAoB,GAAG,KAAK,CAAC;IAE7B,MAAM,GAAmB;QAChC,IAAI,EAAE,aAAa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C;YAC1C,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC,SAAS,CAAC;YAEvD,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE,UAAU;oBAChB,CAAC,CAAC,mBAAmB,KAAK,KAAK,KAAK,CAAC,QAAQ,gDAAgD,IAAI,EAAE;oBACnG,CAAC,CAAC,iBAAiB,KAAK,KAAK,KAAK,CAAC,QAAQ,UAAU,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,WAAW,IAAI,EAAE;gBAC5F,QAAQ,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;aAC9E,CAAC;QACJ,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,0BAA0B,OAAO,EAAE,EAAE,CAAC;QACzE,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Tool, ToolResult, ToolExecutionContext, ToolRiskLevel } from './types.js';
|
|
2
|
-
import type { FunctionSchema } from '../providers/types.js';
|
|
3
|
-
export declare class MemoryUpdateTool implements Tool {
|
|
4
|
-
readonly name = "memory_update";
|
|
5
|
-
readonly description = "Update an existing memory entry by ID";
|
|
6
|
-
readonly riskLevel: ToolRiskLevel;
|
|
7
|
-
readonly requiresConfirmation = false;
|
|
8
|
-
readonly schema: FunctionSchema;
|
|
9
|
-
execute(args: Record<string, unknown>, context: ToolExecutionContext): Promise<ToolResult>;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=memory-update.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory-update.d.ts","sourceRoot":"","sources":["../../src/tools/memory-update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAK5D,qBAAa,gBAAiB,YAAW,IAAI;IAC3C,QAAQ,CAAC,IAAI,mBAAmB;IAChC,QAAQ,CAAC,WAAW,2CAA2C;IAC/D,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAU;IAC3C,QAAQ,CAAC,oBAAoB,SAAS;IAEtC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAuC7B;IAEI,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC;CA+CjG"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { MEMORY_CATEGORIES } from '../memory/types.js';
|
|
2
|
-
export class MemoryUpdateTool {
|
|
3
|
-
name = 'memory_update';
|
|
4
|
-
description = 'Update an existing memory entry by ID';
|
|
5
|
-
riskLevel = 'safe';
|
|
6
|
-
requiresConfirmation = false;
|
|
7
|
-
schema = {
|
|
8
|
-
name: 'memory_update',
|
|
9
|
-
description: 'Update an existing memory entry. Use this when information has changed and you need to correct ' +
|
|
10
|
-
'or expand a specific memory. Use memory_recall first to find the entry ID, then update it here. ' +
|
|
11
|
-
'You can change the content, category, or tags.',
|
|
12
|
-
parameters: {
|
|
13
|
-
type: 'object',
|
|
14
|
-
properties: {
|
|
15
|
-
scope: {
|
|
16
|
-
type: 'string',
|
|
17
|
-
enum: ['global', 'project'],
|
|
18
|
-
description: 'Which memory store the entry is in.',
|
|
19
|
-
},
|
|
20
|
-
id: {
|
|
21
|
-
type: 'string',
|
|
22
|
-
description: 'The ID of the memory entry to update (from memory_recall results).',
|
|
23
|
-
},
|
|
24
|
-
content: {
|
|
25
|
-
type: 'string',
|
|
26
|
-
description: 'New content to replace the existing content (optional).',
|
|
27
|
-
},
|
|
28
|
-
category: {
|
|
29
|
-
type: 'string',
|
|
30
|
-
enum: MEMORY_CATEGORIES,
|
|
31
|
-
description: 'New category for this entry (optional).',
|
|
32
|
-
},
|
|
33
|
-
tags: {
|
|
34
|
-
type: 'array',
|
|
35
|
-
items: { type: 'string' },
|
|
36
|
-
description: 'New tags for this entry (optional, replaces existing tags).',
|
|
37
|
-
},
|
|
38
|
-
branch: {
|
|
39
|
-
type: 'string',
|
|
40
|
-
description: 'Scope this memory to a specific git branch, or null to remove branch scoping.',
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
required: ['scope', 'id'],
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
async execute(args, context) {
|
|
47
|
-
const scope = args.scope;
|
|
48
|
-
const id = args.id;
|
|
49
|
-
const content = args.content;
|
|
50
|
-
const category = args.category;
|
|
51
|
-
const tags = args.tags;
|
|
52
|
-
const branch = args.branch;
|
|
53
|
-
if (!scope || !id) {
|
|
54
|
-
return { success: false, output: 'Both scope and id are required.' };
|
|
55
|
-
}
|
|
56
|
-
if (category && !MEMORY_CATEGORIES.includes(category)) {
|
|
57
|
-
return { success: false, output: `Invalid category. Must be one of: ${MEMORY_CATEGORIES.join(', ')}` };
|
|
58
|
-
}
|
|
59
|
-
if (!content && !category && !tags && branch === undefined) {
|
|
60
|
-
return { success: false, output: 'At least one of content, category, tags, or branch must be provided.' };
|
|
61
|
-
}
|
|
62
|
-
const memoryManager = context.sharedState?.memoryManager;
|
|
63
|
-
if (!memoryManager) {
|
|
64
|
-
return { success: false, output: 'Memory system is not available in this context.' };
|
|
65
|
-
}
|
|
66
|
-
try {
|
|
67
|
-
const updated = await memoryManager.updateEntry(scope, id, {
|
|
68
|
-
...(content !== undefined ? { content } : {}),
|
|
69
|
-
...(category !== undefined ? { category } : {}),
|
|
70
|
-
...(tags !== undefined ? { tags } : {}),
|
|
71
|
-
...(branch !== undefined ? { branch } : {}),
|
|
72
|
-
});
|
|
73
|
-
if (!updated) {
|
|
74
|
-
return { success: false, output: `No memory entry found with ID "${id}" in ${scope} scope.` };
|
|
75
|
-
}
|
|
76
|
-
return {
|
|
77
|
-
success: true,
|
|
78
|
-
output: `Memory updated (${scope}, ${updated.category}). ID: ${updated.id.slice(0, 8)}`,
|
|
79
|
-
metadata: { scope, id: updated.id, category: updated.category },
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
catch (error) {
|
|
83
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
84
|
-
return { success: false, output: `Failed to update memory: ${message}` };
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
//# sourceMappingURL=memory-update.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory-update.js","sourceRoot":"","sources":["../../src/tools/memory-update.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,OAAO,gBAAgB;IAClB,IAAI,GAAG,eAAe,CAAC;IACvB,WAAW,GAAG,uCAAuC,CAAC;IACtD,SAAS,GAAkB,MAAM,CAAC;IAClC,oBAAoB,GAAG,KAAK,CAAC;IAE7B,MAAM,GAAmB;QAChC,IAAI,EAAE,eAAe;QACrB,WAAW,EACT,iGAAiG;YACjG,kGAAkG;YAClG,gDAAgD;QAClD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;oBAC3B,WAAW,EAAE,qCAAqC;iBACnD;gBACD,EAAE,EAAE;oBACF,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,oEAAoE;iBAClF;gBACD,OAAO,EAAE;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