@memberjunction/ai-agents 6.2.2 → 6.3.0-edge.1
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/README.md +29 -6
- package/dist/AgentContextAssembler.d.ts +127 -0
- package/dist/AgentContextAssembler.d.ts.map +1 -0
- package/dist/AgentContextAssembler.js +482 -0
- package/dist/AgentContextAssembler.js.map +1 -0
- package/dist/AgentDataPreloader.d.ts +14 -3
- package/dist/AgentDataPreloader.d.ts.map +1 -1
- package/dist/AgentDataPreloader.js +147 -22
- package/dist/AgentDataPreloader.js.map +1 -1
- package/dist/AgentDecisionService.d.ts +10 -1
- package/dist/AgentDecisionService.d.ts.map +1 -1
- package/dist/AgentDecisionService.js +28 -13
- package/dist/AgentDecisionService.js.map +1 -1
- package/dist/AgentFeedbackCoordinator.d.ts +169 -0
- package/dist/AgentFeedbackCoordinator.d.ts.map +1 -0
- package/dist/AgentFeedbackCoordinator.js +593 -0
- package/dist/AgentFeedbackCoordinator.js.map +1 -0
- package/dist/AgentRunner.d.ts +57 -15
- package/dist/AgentRunner.d.ts.map +1 -1
- package/dist/AgentRunner.js +692 -101
- package/dist/AgentRunner.js.map +1 -1
- package/dist/AgentStepDispatcher.d.ts +211 -0
- package/dist/AgentStepDispatcher.d.ts.map +1 -0
- package/dist/AgentStepDispatcher.js +729 -0
- package/dist/AgentStepDispatcher.js.map +1 -0
- package/dist/AgentTreeBudgetTracker.d.ts +163 -0
- package/dist/AgentTreeBudgetTracker.d.ts.map +1 -0
- package/dist/AgentTreeBudgetTracker.js +415 -0
- package/dist/AgentTreeBudgetTracker.js.map +1 -0
- package/dist/AgentWakeTriggerService.d.ts +41 -1
- package/dist/AgentWakeTriggerService.d.ts.map +1 -1
- package/dist/AgentWakeTriggerService.js +154 -8
- package/dist/AgentWakeTriggerService.js.map +1 -1
- package/dist/ArtifactToolManager.d.ts +134 -39
- package/dist/ArtifactToolManager.d.ts.map +1 -1
- package/dist/ArtifactToolManager.js +2761 -321
- package/dist/ArtifactToolManager.js.map +1 -1
- package/dist/GovernedArtifactService.d.ts +367 -0
- package/dist/GovernedArtifactService.d.ts.map +1 -0
- package/dist/GovernedArtifactService.js +2569 -0
- package/dist/GovernedArtifactService.js.map +1 -0
- package/dist/MJAIAgentRequestEntityServer.d.ts +32 -1
- package/dist/MJAIAgentRequestEntityServer.d.ts.map +1 -1
- package/dist/MJAIAgentRequestEntityServer.js +105 -3
- package/dist/MJAIAgentRequestEntityServer.js.map +1 -1
- package/dist/SkillMarkdownConverter.d.ts +1 -1
- package/dist/SkillMarkdownConverter.d.ts.map +1 -1
- package/dist/SkillMarkdownConverter.js +8 -6
- package/dist/SkillMarkdownConverter.js.map +1 -1
- package/dist/agent-context-injector.d.ts +2 -25
- package/dist/agent-context-injector.d.ts.map +1 -1
- package/dist/agent-context-injector.js +38 -153
- package/dist/agent-context-injector.js.map +1 -1
- package/dist/agent-instance.d.ts +28 -0
- package/dist/agent-instance.d.ts.map +1 -0
- package/dist/agent-instance.js +39 -0
- package/dist/agent-instance.js.map +1 -0
- package/dist/agent-memory-context-builder.d.ts.map +1 -1
- package/dist/agent-memory-context-builder.js +46 -42
- package/dist/agent-memory-context-builder.js.map +1 -1
- package/dist/agent-pre-execution-rag.d.ts +5 -0
- package/dist/agent-pre-execution-rag.d.ts.map +1 -1
- package/dist/agent-pre-execution-rag.js +10 -0
- package/dist/agent-pre-execution-rag.js.map +1 -1
- package/dist/agent-run-watchdog.d.ts +38 -6
- package/dist/agent-run-watchdog.d.ts.map +1 -1
- package/dist/agent-run-watchdog.js +75 -13
- package/dist/agent-run-watchdog.js.map +1 -1
- package/dist/agent-types/flow-agent-type.d.ts +6 -1
- package/dist/agent-types/flow-agent-type.d.ts.map +1 -1
- package/dist/agent-types/flow-agent-type.js +30 -7
- package/dist/agent-types/flow-agent-type.js.map +1 -1
- package/dist/agent-types/loop-agent-prompt-params.d.ts +18 -0
- package/dist/agent-types/loop-agent-prompt-params.d.ts.map +1 -1
- package/dist/agent-types/loop-agent-prompt-params.js +2 -0
- package/dist/agent-types/loop-agent-prompt-params.js.map +1 -1
- package/dist/agent-types/loop-agent-type.d.ts +4 -0
- package/dist/agent-types/loop-agent-type.d.ts.map +1 -1
- package/dist/agent-types/loop-agent-type.js +29 -0
- package/dist/agent-types/loop-agent-type.js.map +1 -1
- package/dist/artifact-presence-locator.d.ts +132 -0
- package/dist/artifact-presence-locator.d.ts.map +1 -0
- package/dist/artifact-presence-locator.js +472 -0
- package/dist/artifact-presence-locator.js.map +1 -0
- package/dist/artifact-tools/CSVToolLibrary.d.ts +2 -2
- package/dist/artifact-tools/CSVToolLibrary.d.ts.map +1 -1
- package/dist/artifact-tools/CSVToolLibrary.js +41 -14
- package/dist/artifact-tools/CSVToolLibrary.js.map +1 -1
- package/dist/artifact-tools/DataSnapshotToolLibrary.d.ts +2 -2
- package/dist/artifact-tools/DataSnapshotToolLibrary.d.ts.map +1 -1
- package/dist/artifact-tools/DataSnapshotToolLibrary.js +53 -21
- package/dist/artifact-tools/DataSnapshotToolLibrary.js.map +1 -1
- package/dist/artifact-tools/DocumentToolLibrary.d.ts +101 -0
- package/dist/artifact-tools/DocumentToolLibrary.d.ts.map +1 -0
- package/dist/artifact-tools/DocumentToolLibrary.js +1846 -0
- package/dist/artifact-tools/DocumentToolLibrary.js.map +1 -0
- package/dist/artifact-tools/DocxToolLibrary.d.ts +2 -4
- package/dist/artifact-tools/DocxToolLibrary.d.ts.map +1 -1
- package/dist/artifact-tools/DocxToolLibrary.js +42 -30
- package/dist/artifact-tools/DocxToolLibrary.js.map +1 -1
- package/dist/artifact-tools/ExcelToolLibrary.d.ts +2 -3
- package/dist/artifact-tools/ExcelToolLibrary.d.ts.map +1 -1
- package/dist/artifact-tools/ExcelToolLibrary.js +105 -49
- package/dist/artifact-tools/ExcelToolLibrary.js.map +1 -1
- package/dist/artifact-tools/GenericBinaryToolLibrary.d.ts +2 -2
- package/dist/artifact-tools/GenericBinaryToolLibrary.d.ts.map +1 -1
- package/dist/artifact-tools/GenericBinaryToolLibrary.js +3 -2
- package/dist/artifact-tools/GenericBinaryToolLibrary.js.map +1 -1
- package/dist/artifact-tools/JSONToolLibrary.d.ts +4 -4
- package/dist/artifact-tools/JSONToolLibrary.d.ts.map +1 -1
- package/dist/artifact-tools/JSONToolLibrary.js +32 -11
- package/dist/artifact-tools/JSONToolLibrary.js.map +1 -1
- package/dist/artifact-tools/PDFToolLibrary.d.ts +27 -3
- package/dist/artifact-tools/PDFToolLibrary.d.ts.map +1 -1
- package/dist/artifact-tools/PDFToolLibrary.js +36 -21
- package/dist/artifact-tools/PDFToolLibrary.js.map +1 -1
- package/dist/artifact-tools/SearchResultSetToolLibrary.d.ts +2 -2
- package/dist/artifact-tools/SearchResultSetToolLibrary.d.ts.map +1 -1
- package/dist/artifact-tools/SearchResultSetToolLibrary.js +83 -24
- package/dist/artifact-tools/SearchResultSetToolLibrary.js.map +1 -1
- package/dist/artifact-tools/SlideDeckToolLibrary.d.ts +50 -0
- package/dist/artifact-tools/SlideDeckToolLibrary.d.ts.map +1 -0
- package/dist/artifact-tools/SlideDeckToolLibrary.js +1617 -0
- package/dist/artifact-tools/SlideDeckToolLibrary.js.map +1 -0
- package/dist/artifact-tools/SpreadsheetToolLibrary.d.ts +87 -0
- package/dist/artifact-tools/SpreadsheetToolLibrary.d.ts.map +1 -0
- package/dist/artifact-tools/SpreadsheetToolLibrary.js +3351 -0
- package/dist/artifact-tools/SpreadsheetToolLibrary.js.map +1 -0
- package/dist/artifact-tools/TextToolLibrary.d.ts +3 -3
- package/dist/artifact-tools/TextToolLibrary.d.ts.map +1 -1
- package/dist/artifact-tools/TextToolLibrary.js +34 -24
- package/dist/artifact-tools/TextToolLibrary.js.map +1 -1
- package/dist/artifact-tools/WhiteboardToolLibrary.d.ts +69 -0
- package/dist/artifact-tools/WhiteboardToolLibrary.d.ts.map +1 -0
- package/dist/artifact-tools/WhiteboardToolLibrary.js +555 -0
- package/dist/artifact-tools/WhiteboardToolLibrary.js.map +1 -0
- package/dist/artifact-tools/artifact-comment-suggestion-helper.d.ts +98 -0
- package/dist/artifact-tools/artifact-comment-suggestion-helper.d.ts.map +1 -0
- package/dist/artifact-tools/artifact-comment-suggestion-helper.js +851 -0
- package/dist/artifact-tools/artifact-comment-suggestion-helper.js.map +1 -0
- package/dist/artifact-tools/artifact-tool-helpers.d.ts +21 -0
- package/dist/artifact-tools/artifact-tool-helpers.d.ts.map +1 -0
- package/dist/artifact-tools/artifact-tool-helpers.js +74 -0
- package/dist/artifact-tools/artifact-tool-helpers.js.map +1 -0
- package/dist/artifact-tools/grepHelper.d.ts +27 -0
- package/dist/artifact-tools/grepHelper.d.ts.map +1 -0
- package/dist/artifact-tools/grepHelper.js +229 -0
- package/dist/artifact-tools/grepHelper.js.map +1 -0
- package/dist/artifact-tools/node-vm-safe-regex.d.ts +10 -0
- package/dist/artifact-tools/node-vm-safe-regex.d.ts.map +1 -0
- package/dist/artifact-tools/node-vm-safe-regex.js +148 -0
- package/dist/artifact-tools/node-vm-safe-regex.js.map +1 -0
- package/dist/base-agent.d.ts +151 -137
- package/dist/base-agent.d.ts.map +1 -1
- package/dist/base-agent.js +727 -1550
- package/dist/base-agent.js.map +1 -1
- package/dist/catalog-narrowing.d.ts +112 -5
- package/dist/catalog-narrowing.d.ts.map +1 -1
- package/dist/catalog-narrowing.js +181 -6
- package/dist/catalog-narrowing.js.map +1 -1
- package/dist/decision-discovery.d.ts +42 -15
- package/dist/decision-discovery.d.ts.map +1 -1
- package/dist/decision-discovery.js +90 -20
- package/dist/decision-discovery.js.map +1 -1
- package/dist/index.d.ts +17 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -3
- package/dist/index.js.map +1 -1
- package/dist/memory-decision-uses.d.ts +206 -0
- package/dist/memory-decision-uses.d.ts.map +1 -0
- package/dist/memory-decision-uses.js +259 -0
- package/dist/memory-decision-uses.js.map +1 -0
- package/dist/memory-manager-agent.d.ts +66 -6
- package/dist/memory-manager-agent.d.ts.map +1 -1
- package/dist/memory-manager-agent.js +184 -31
- package/dist/memory-manager-agent.js.map +1 -1
- package/dist/memory-note-gate.d.ts +12 -9
- package/dist/memory-note-gate.d.ts.map +1 -1
- package/dist/memory-note-gate.js +16 -11
- package/dist/memory-note-gate.js.map +1 -1
- package/dist/native-tools/control-tools.d.ts +8 -1
- package/dist/native-tools/control-tools.d.ts.map +1 -1
- package/dist/native-tools/control-tools.js +38 -5
- package/dist/native-tools/control-tools.js.map +1 -1
- package/dist/native-tools/framework-tools.d.ts +3 -3
- package/dist/native-tools/framework-tools.d.ts.map +1 -1
- package/dist/native-tools/framework-tools.js +20 -8
- package/dist/native-tools/framework-tools.js.map +1 -1
- package/dist/pipeline/operators.d.ts.map +1 -1
- package/dist/pipeline/operators.js +1 -1
- package/dist/pipeline/operators.js.map +1 -1
- package/dist/pipeline/pipeline-executor.d.ts +29 -1
- package/dist/pipeline/pipeline-executor.d.ts.map +1 -1
- package/dist/pipeline/pipeline-executor.js +159 -2
- package/dist/pipeline/pipeline-executor.js.map +1 -1
- package/dist/pipeline/pipeline.types.d.ts +19 -1
- package/dist/pipeline/pipeline.types.d.ts.map +1 -1
- package/dist/pipeline/template.d.ts +16 -0
- package/dist/pipeline/template.d.ts.map +1 -1
- package/dist/pipeline/template.js +55 -6
- package/dist/pipeline/template.js.map +1 -1
- package/dist/realtime/artifact-workspace-channel-server.d.ts +27 -0
- package/dist/realtime/artifact-workspace-channel-server.d.ts.map +1 -0
- package/dist/realtime/artifact-workspace-channel-server.js +43 -0
- package/dist/realtime/artifact-workspace-channel-server.js.map +1 -0
- package/dist/realtime/bridge-realtime-session-factory.d.ts +2 -2
- package/dist/realtime/bridge-realtime-session-factory.d.ts.map +1 -1
- package/dist/realtime/bridge-realtime-session-factory.js +7 -56
- package/dist/realtime/bridge-realtime-session-factory.js.map +1 -1
- package/dist/realtime/bridge-room-transcript-sink.d.ts.map +1 -1
- package/dist/realtime/bridge-room-transcript-sink.js +28 -1
- package/dist/realtime/bridge-room-transcript-sink.js.map +1 -1
- package/dist/realtime/media-channel-server.js +1 -1
- package/dist/realtime/media-channel-server.js.map +1 -1
- package/dist/realtime/realtime-artifact-helpers.d.ts +37 -0
- package/dist/realtime/realtime-artifact-helpers.d.ts.map +1 -0
- package/dist/realtime/realtime-artifact-helpers.js +150 -0
- package/dist/realtime/realtime-artifact-helpers.js.map +1 -0
- package/dist/realtime/realtime-client-session-service.d.ts +209 -19
- package/dist/realtime/realtime-client-session-service.d.ts.map +1 -1
- package/dist/realtime/realtime-client-session-service.js +670 -41
- package/dist/realtime/realtime-client-session-service.js.map +1 -1
- package/dist/realtime/realtime-coagent-config.d.ts +26 -9
- package/dist/realtime/realtime-coagent-config.d.ts.map +1 -1
- package/dist/realtime/realtime-coagent-config.js +47 -60
- package/dist/realtime/realtime-coagent-config.js.map +1 -1
- package/dist/realtime/realtime-delegation-narrator.js +1 -1
- package/dist/realtime/realtime-delegation-narrator.js.map +1 -1
- package/dist/realtime/realtime-moderator-decision.d.ts +86 -0
- package/dist/realtime/realtime-moderator-decision.d.ts.map +1 -0
- package/dist/realtime/realtime-moderator-decision.js +131 -0
- package/dist/realtime/realtime-moderator-decision.js.map +1 -0
- package/dist/realtime/realtime-session-runner.d.ts +2 -0
- package/dist/realtime/realtime-session-runner.d.ts.map +1 -1
- package/dist/realtime/realtime-session-runner.js +24 -3
- package/dist/realtime/realtime-session-runner.js.map +1 -1
- package/dist/realtime/realtime-tool-broker.d.ts +6 -0
- package/dist/realtime/realtime-tool-broker.d.ts.map +1 -1
- package/dist/realtime/realtime-tool-broker.js +4 -2
- package/dist/realtime/realtime-tool-broker.js.map +1 -1
- package/dist/realtime/realtime-turn-moderator.d.ts +20 -0
- package/dist/realtime/realtime-turn-moderator.d.ts.map +1 -1
- package/dist/realtime/realtime-turn-moderator.js +63 -8
- package/dist/realtime/realtime-turn-moderator.js.map +1 -1
- package/dist/repeated-failing-step.d.ts +50 -0
- package/dist/repeated-failing-step.d.ts.map +1 -0
- package/dist/repeated-failing-step.js +130 -0
- package/dist/repeated-failing-step.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +20 -20
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview The Memory Manager's closed-set LLM calls, asked as typed decisions: whether a
|
|
3
|
+
* candidate note or example duplicates what is already stored, and whether two stored notes
|
|
4
|
+
* contradict each other.
|
|
5
|
+
*
|
|
6
|
+
* Each use runs through `RunDecisionUse` (`@memberjunction/ai-prompts`) in the mode the run names in
|
|
7
|
+
* `data.memoryDecisionMode` (`Prompt`, `Shadow` or `Decision`), defaulting to
|
|
8
|
+
* {@link MEMORY_DECISION_DEFAULT_MODE}. None of the three has a fitted calibration yet, so the
|
|
9
|
+
* default is `Shadow`: the LLM prompt still decides, and every shadow run records the decision's raw
|
|
10
|
+
* answer next to the prompt's verdict as labelled data for the `fit-decision-calibration` rig. Once a
|
|
11
|
+
* fit ships on the answering model's `ModelConfiguration.Decision.Calibrations` under these use and
|
|
12
|
+
* question keys, `Decision` mode acts on it. Until then, `Decision` mode finds no calibration, treats
|
|
13
|
+
* every answer as unsure and falls back to the prompt, so switching the mode early changes nothing.
|
|
14
|
+
*
|
|
15
|
+
* What stays in code: everything that is not a closed-set judgment. The contradiction prompt also
|
|
16
|
+
* extracted entity triples (only ever counted) and picked which note wins; the winner follows the
|
|
17
|
+
* prompt's own stated rule (recency beyond seven days, then importance, then access count, a tie
|
|
18
|
+
* keeping both), so the decision path applies that rule deterministically
|
|
19
|
+
* ({@link PickContradictionAuthority}) and asks the model only whether the notes conflict.
|
|
20
|
+
*
|
|
21
|
+
* No I/O: calibrations come from the loaded `AIEngine`, so each rule is unit-tested on its own.
|
|
22
|
+
*
|
|
23
|
+
* @module @memberjunction/ai-agents
|
|
24
|
+
*/
|
|
25
|
+
import { DescribeAnsweringModel } from '@memberjunction/ai-core-plus';
|
|
26
|
+
import { AIEngine } from '@memberjunction/aiengine';
|
|
27
|
+
/** The mode a Memory Manager run uses for these calls when `data.memoryDecisionMode` names none. */
|
|
28
|
+
export const MEMORY_DECISION_DEFAULT_MODE = 'Shadow';
|
|
29
|
+
/** The decision use for "does this candidate note duplicate a stored note?". */
|
|
30
|
+
export const MEMORY_NOTE_DEDUPE_USE = 'memory-note-dedupe';
|
|
31
|
+
/** The decision use for "does this candidate example duplicate a stored example?". */
|
|
32
|
+
export const MEMORY_EXAMPLE_DEDUPE_USE = 'memory-example-dedupe';
|
|
33
|
+
/** The decision use for "do these two stored notes contradict each other?". */
|
|
34
|
+
export const MEMORY_CONTRADICTION_USE = 'memory-contradiction';
|
|
35
|
+
/** The question key of both dedupe uses: the candidate adds nothing the stored items do not. */
|
|
36
|
+
export const MEMORY_DUPLICATE_QUESTION = 'duplicate';
|
|
37
|
+
/** The question key of the contradiction use: the two notes cannot both be true now. */
|
|
38
|
+
export const MEMORY_CONTRADICTS_QUESTION = 'contradicts';
|
|
39
|
+
/** The calibration keys, one per use. */
|
|
40
|
+
export const MEMORY_NOTE_DEDUPE_CALIBRATION_KEY = Object.freeze({ Use: MEMORY_NOTE_DEDUPE_USE, Question: MEMORY_DUPLICATE_QUESTION });
|
|
41
|
+
export const MEMORY_EXAMPLE_DEDUPE_CALIBRATION_KEY = Object.freeze({ Use: MEMORY_EXAMPLE_DEDUPE_USE, Question: MEMORY_DUPLICATE_QUESTION });
|
|
42
|
+
export const MEMORY_CONTRADICTION_CALIBRATION_KEY = Object.freeze({ Use: MEMORY_CONTRADICTION_USE, Question: MEMORY_CONTRADICTS_QUESTION });
|
|
43
|
+
/** The provisional bands for every Memory Manager decision use. */
|
|
44
|
+
export const MEMORY_DECISION_BANDS = Object.freeze({ Yes: 0.7, No: 0.3 });
|
|
45
|
+
/** Characters of a note, an example input or an example output quoted in a decision's state. */
|
|
46
|
+
export const MEMORY_DECISION_MAX_TEXT_CHARS = 1500;
|
|
47
|
+
/** Days by which the newer note must postdate the older for recency alone to decide a contradiction. */
|
|
48
|
+
export const CONTRADICTION_RECENCY_DAYS = 7;
|
|
49
|
+
const NOTE_DUPLICATE_INSTRUCTIONS = 'The candidate note is redundant: an agent holding only the existing notes would act exactly as it would with the candidate added (the same advice, tools, constraints and assumptions about the user). Rewording, reframing, added justification or backstory do not make it different; a genuinely broader or narrower scope, a different tool, domain, constraint or fact does.';
|
|
50
|
+
const EXAMPLE_DUPLICATE_INSTRUCTIONS = 'The candidate example adds nothing the existing examples do not already show: it repeats a pattern they cover, as a minor variation or at lower quality. It is not redundant when it shows a different aspect, edge case or approach, or a clearly better response.';
|
|
51
|
+
const CONTRADICTS_INSTRUCTIONS = 'Note A and note B cannot both be true now: they assert different values for the same attribute of the same subject, or one states a changed policy or practice that the other contradicts. Complementary facts, different attributes, similar wording about different things, and a one-off exception to a stated policy are not contradictions.';
|
|
52
|
+
/** Text capped for a decision's state. */
|
|
53
|
+
function cap(text) {
|
|
54
|
+
return (text ?? '').slice(0, MEMORY_DECISION_MAX_TEXT_CHARS);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The note dedupe decision: the candidate and its similar stored notes as state, one Likelihood that
|
|
58
|
+
* the candidate is redundant.
|
|
59
|
+
*
|
|
60
|
+
* @param candidate The candidate note.
|
|
61
|
+
* @param similar The stored notes the semantic search found near it.
|
|
62
|
+
*/
|
|
63
|
+
export function BuildNoteDedupeDecision(candidate, similar) {
|
|
64
|
+
return {
|
|
65
|
+
State: {
|
|
66
|
+
candidateNote: { type: candidate.type, content: cap(candidate.content) },
|
|
67
|
+
existingNotes: similar.map(n => ({ type: n.type, content: cap(n.content), similarity: roundSimilarity(n.similarity) }))
|
|
68
|
+
},
|
|
69
|
+
Questions: { [MEMORY_DUPLICATE_QUESTION]: { Kind: 'Likelihood', Instructions: NOTE_DUPLICATE_INSTRUCTIONS } }
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The example dedupe decision: the candidate and its similar stored examples as state, one Likelihood
|
|
74
|
+
* that the candidate is redundant.
|
|
75
|
+
*
|
|
76
|
+
* @param candidate The candidate example.
|
|
77
|
+
* @param similar The stored examples the semantic search found near it.
|
|
78
|
+
*/
|
|
79
|
+
export function BuildExampleDedupeDecision(candidate, similar) {
|
|
80
|
+
return {
|
|
81
|
+
State: {
|
|
82
|
+
candidateExample: { input: cap(candidate.exampleInput), output: cap(candidate.exampleOutput), successScore: candidate.successScore ?? null },
|
|
83
|
+
existingExamples: similar.map(e => ({ input: cap(e.input), output: cap(e.output), successScore: e.successScore ?? null, similarity: roundSimilarity(e.similarity) }))
|
|
84
|
+
},
|
|
85
|
+
Questions: { [MEMORY_DUPLICATE_QUESTION]: { Kind: 'Likelihood', Instructions: EXAMPLE_DUPLICATE_INSTRUCTIONS } }
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The contradiction decision: the two notes as state, one Likelihood that they conflict. Which note
|
|
90
|
+
* wins is not asked: {@link PickContradictionAuthority} applies the rule the prompt states.
|
|
91
|
+
*
|
|
92
|
+
* @param noteA The first note.
|
|
93
|
+
* @param noteB The second note.
|
|
94
|
+
*/
|
|
95
|
+
export function BuildContradictionDecision(noteA, noteB) {
|
|
96
|
+
return {
|
|
97
|
+
State: { noteA: contradictionNoteState(noteA), noteB: contradictionNoteState(noteB) },
|
|
98
|
+
Questions: { [MEMORY_CONTRADICTS_QUESTION]: { Kind: 'Likelihood', Instructions: CONTRADICTS_INSTRUCTIONS } }
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function contradictionNoteState(note) {
|
|
102
|
+
return { type: note.Type, content: cap(note.Note), importanceScore: note.ImportanceScore ?? null, accessCount: note.AccessCount ?? 0 };
|
|
103
|
+
}
|
|
104
|
+
function roundSimilarity(similarity) {
|
|
105
|
+
return Math.round(similarity * 100) / 100;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Reads one Likelihood answer against its calibration and the bands. Unsure when the answer is
|
|
109
|
+
* missing or not a Likelihood, when the answering model has no calibration for this use and question,
|
|
110
|
+
* or when the calibrated probability falls between the bands.
|
|
111
|
+
*
|
|
112
|
+
* @param answer The answer to the use's question.
|
|
113
|
+
* @param key The use and question, for the calibration lookup.
|
|
114
|
+
* @param answeredBy The model that answered.
|
|
115
|
+
* @param bands The yes and no bands (default: {@link MEMORY_DECISION_BANDS}).
|
|
116
|
+
*/
|
|
117
|
+
export function ReadMemoryDecision(answer, key, answeredBy, bands = MEMORY_DECISION_BANDS) {
|
|
118
|
+
const raw = answer?.Kind === 'Likelihood' && typeof answer.Probability === 'number' && Number.isFinite(answer.Probability)
|
|
119
|
+
? answer.Probability
|
|
120
|
+
: undefined;
|
|
121
|
+
if (raw === undefined) {
|
|
122
|
+
return { Band: 'Unsure', Reason: `No Likelihood answer to '${key.Question}'` };
|
|
123
|
+
}
|
|
124
|
+
const calibrated = AIEngine.Instance.CalibrateDecisionProbability(key, raw, answeredBy);
|
|
125
|
+
if (calibrated === null) {
|
|
126
|
+
return { Band: 'Unsure', RawProbability: raw, Reason: `${DescribeAnsweringModel(answeredBy)} has no '${key.Use}' calibration` };
|
|
127
|
+
}
|
|
128
|
+
const band = calibrated >= bands.Yes ? 'Yes' : calibrated <= bands.No ? 'No' : 'Unsure';
|
|
129
|
+
return { Band: band, RawProbability: raw, CalibratedProbability: calibrated, Reason: `calibrated '${key.Question}' ${calibrated.toFixed(4)} (${band})` };
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* The dedupe verdict from a decision, or null when it is unsure. A redundant candidate is not added.
|
|
133
|
+
*
|
|
134
|
+
* @param answers The decision's answers.
|
|
135
|
+
* @param key The dedupe use's calibration key.
|
|
136
|
+
* @param answeredBy The model that answered.
|
|
137
|
+
*/
|
|
138
|
+
export function DedupeVerdictFromDecision(answers, key, answeredBy) {
|
|
139
|
+
const reading = ReadMemoryDecision(answers[key.Question], key, answeredBy);
|
|
140
|
+
if (reading.Band === 'Unsure') {
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
return { shouldAdd: reading.Band === 'No', reason: `decision: ${reading.Reason}` };
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* The contradiction verdict from a decision, or null when it is unsure. A contradiction names its
|
|
147
|
+
* winner by {@link PickContradictionAuthority}; when that rule ties, the prompt keeps both, so the
|
|
148
|
+
* verdict is no contradiction.
|
|
149
|
+
*
|
|
150
|
+
* @param answers The decision's answers.
|
|
151
|
+
* @param noteA The first note.
|
|
152
|
+
* @param noteB The second note.
|
|
153
|
+
* @param answeredBy The model that answered.
|
|
154
|
+
*/
|
|
155
|
+
export function ContradictionVerdictFromDecision(answers, noteA, noteB, answeredBy) {
|
|
156
|
+
const reading = ReadMemoryDecision(answers[MEMORY_CONTRADICTS_QUESTION], MEMORY_CONTRADICTION_CALIBRATION_KEY, answeredBy);
|
|
157
|
+
if (reading.Band === 'Unsure') {
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
if (reading.Band === 'No') {
|
|
161
|
+
return { isContradiction: false, reason: `decision: ${reading.Reason}`, triplesExtracted: 0 };
|
|
162
|
+
}
|
|
163
|
+
const authority = PickContradictionAuthority(noteA, noteB);
|
|
164
|
+
if (!authority) {
|
|
165
|
+
return { isContradiction: false, reason: `decision: ${reading.Reason}; recency, importance and access count tie, so both are kept`, triplesExtracted: 0 };
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
isContradiction: true,
|
|
169
|
+
keepNoteId: authority.Keep.ID,
|
|
170
|
+
revokeNoteId: authority.Revoke.ID,
|
|
171
|
+
reason: `decision: ${reading.Reason}; ${authority.Reason}`,
|
|
172
|
+
triplesExtracted: 0
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* The authoritative note of a contradicting pair, by the rule the contradiction prompt states: the
|
|
177
|
+
* newer note when it is more than {@link CONTRADICTION_RECENCY_DAYS} days newer; otherwise the higher
|
|
178
|
+
* importance score; otherwise the higher access count. Null on a tie, which keeps both.
|
|
179
|
+
*
|
|
180
|
+
* @param noteA The first note.
|
|
181
|
+
* @param noteB The second note.
|
|
182
|
+
*/
|
|
183
|
+
export function PickContradictionAuthority(noteA, noteB) {
|
|
184
|
+
const ageGapDays = (timeOf(noteB) - timeOf(noteA)) / 86_400_000;
|
|
185
|
+
if (Number.isFinite(ageGapDays) && Math.abs(ageGapDays) > CONTRADICTION_RECENCY_DAYS) {
|
|
186
|
+
return ageGapDays > 0
|
|
187
|
+
? { Keep: noteB, Revoke: noteA, Reason: 'note B is more than 7 days newer' }
|
|
188
|
+
: { Keep: noteA, Revoke: noteB, Reason: 'note A is more than 7 days newer' };
|
|
189
|
+
}
|
|
190
|
+
const byImportance = compareSignal(noteA.ImportanceScore, noteB.ImportanceScore, 'importance score');
|
|
191
|
+
if (byImportance) {
|
|
192
|
+
return byImportance(noteA, noteB);
|
|
193
|
+
}
|
|
194
|
+
const byAccess = compareSignal(noteA.AccessCount, noteB.AccessCount, 'access count');
|
|
195
|
+
return byAccess ? byAccess(noteA, noteB) : null;
|
|
196
|
+
}
|
|
197
|
+
function timeOf(note) {
|
|
198
|
+
if (!note.CreatedAt) {
|
|
199
|
+
return Number.NaN;
|
|
200
|
+
}
|
|
201
|
+
return note.CreatedAt instanceof Date ? note.CreatedAt.getTime() : Date.parse(note.CreatedAt);
|
|
202
|
+
}
|
|
203
|
+
/** A picker for the higher of two signals, or null when they are equal or either is missing. */
|
|
204
|
+
function compareSignal(a, b, label) {
|
|
205
|
+
if (typeof a !== 'number' || typeof b !== 'number' || !Number.isFinite(a) || !Number.isFinite(b) || a === b) {
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
return a > b
|
|
209
|
+
? (noteA, noteB) => ({ Keep: noteA, Revoke: noteB, Reason: `note A has the higher ${label}` })
|
|
210
|
+
: (noteA, noteB) => ({ Keep: noteB, Revoke: noteA, Reason: `note B has the higher ${label}` });
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* How a dedupe decision compares with the prompt's verdict, for a shadow run. The prompt's verdict
|
|
214
|
+
* is the label for a later fit: the question asks "redundant?", so its truth is `!shouldAdd`. Without
|
|
215
|
+
* a calibration the raw probability is compared at 0.5, which is only the agreement figure; the fit
|
|
216
|
+
* reads the raw answer from the run's `Result`.
|
|
217
|
+
*
|
|
218
|
+
* @param answers The decision's answers.
|
|
219
|
+
* @param existing The prompt's verdict.
|
|
220
|
+
* @param key The dedupe use's calibration key.
|
|
221
|
+
* @param answeredBy The model that answered.
|
|
222
|
+
*/
|
|
223
|
+
export function CompareDedupeDecision(answers, existing, key, answeredBy) {
|
|
224
|
+
return compareYesNo(answers, !existing.shouldAdd, key, answeredBy, existing.shouldAdd ? 'LLM added it' : 'LLM rejected it as a duplicate');
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* How a contradiction decision compares with the prompt's verdict, for a shadow run; the label is the
|
|
228
|
+
* prompt's `isContradiction`.
|
|
229
|
+
*
|
|
230
|
+
* @param answers The decision's answers.
|
|
231
|
+
* @param existing The prompt's verdict, or null when the prompt failed (then nothing is compared).
|
|
232
|
+
* @param answeredBy The model that answered.
|
|
233
|
+
*/
|
|
234
|
+
export function CompareContradictionDecision(answers, existing, answeredBy) {
|
|
235
|
+
if (!existing) {
|
|
236
|
+
return { Agreed: false, Summary: 'the LLM prompt gave no verdict to compare with', Details: { Question: MEMORY_CONTRADICTS_QUESTION } };
|
|
237
|
+
}
|
|
238
|
+
return compareYesNo(answers, existing.isContradiction, MEMORY_CONTRADICTION_CALIBRATION_KEY, answeredBy, existing.isContradiction ? 'LLM found a contradiction' : 'LLM found none');
|
|
239
|
+
}
|
|
240
|
+
/** Compares one yes/no answer with the prompt's yes/no. */
|
|
241
|
+
function compareYesNo(answers, existingYes, key, answeredBy, existingSummary) {
|
|
242
|
+
const reading = ReadMemoryDecision(answers[key.Question], key, answeredBy);
|
|
243
|
+
const decisionYes = reading.CalibratedProbability !== undefined
|
|
244
|
+
? reading.Band === 'Yes' ? true : reading.Band === 'No' ? false : null
|
|
245
|
+
: reading.RawProbability !== undefined ? reading.RawProbability >= 0.5 : null;
|
|
246
|
+
const decisionSummary = decisionYes === null ? `decision unsure (${reading.Reason})` : `decision said ${decisionYes ? 'yes' : 'no'} to '${key.Question}'`;
|
|
247
|
+
return {
|
|
248
|
+
Agreed: decisionYes === existingYes,
|
|
249
|
+
Summary: `${decisionSummary}, ${existingSummary}`,
|
|
250
|
+
Details: {
|
|
251
|
+
Question: key.Question,
|
|
252
|
+
Label: existingYes,
|
|
253
|
+
RawProbability: reading.RawProbability ?? null,
|
|
254
|
+
CalibratedProbability: reading.CalibratedProbability ?? null,
|
|
255
|
+
Band: reading.Band
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
//# sourceMappingURL=memory-decision-uses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-decision-uses.js","sourceRoot":"","sources":["../src/memory-decision-uses.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,EACH,sBAAsB,EAGzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,oGAAoG;AACpG,MAAM,CAAC,MAAM,4BAA4B,GAAoB,QAAQ,CAAC;AAEtE,gFAAgF;AAChF,MAAM,CAAC,MAAM,sBAAsB,GAAG,oBAAoB,CAAC;AAE3D,sFAAsF;AACtF,MAAM,CAAC,MAAM,yBAAyB,GAAG,uBAAuB,CAAC;AAEjE,+EAA+E;AAC/E,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAE/D,gGAAgG;AAChG,MAAM,CAAC,MAAM,yBAAyB,GAAG,WAAW,CAAC;AAErD,wFAAwF;AACxF,MAAM,CAAC,MAAM,2BAA2B,GAAG,aAAa,CAAC;AAEzD,yCAAyC;AACzC,MAAM,CAAC,MAAM,kCAAkC,GAA2B,MAAM,CAAC,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CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;QACtE,CAAC,CAAC,OAAO,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;IAClF,MAAM,eAAe,GAAG,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,oBAAoB,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,iBAAiB,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,QAAQ,GAAG,CAAC,QAAQ,GAAG,CAAC;IAC1J,OAAO;QACH,MAAM,EAAE,WAAW,KAAK,WAAW;QACnC,OAAO,EAAE,GAAG,eAAe,KAAK,eAAe,EAAE;QACjD,OAAO,EAAE;YACL,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,KAAK,EAAE,WAAW;YAClB,cAAc,EAAE,OAAO,CAAC,cAAc,IAAI,IAAI;YAC9C,qBAAqB,EAAE,OAAO,CAAC,qBAAqB,IAAI,IAAI;YAC5D,IAAI,EAAE,OAAO,CAAC,IAAI;SACrB;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseAgent } from './base-agent.js';
|
|
2
2
|
import { UserInfo } from '@memberjunction/core';
|
|
3
3
|
import { MJAIAgentNoteEntity } from '@memberjunction/core-entities';
|
|
4
|
-
import { AIPromptRunner } from '@memberjunction/ai-prompts';
|
|
4
|
+
import { AIPromptRunner, type ShadowDecisionRunner } from '@memberjunction/ai-prompts';
|
|
5
5
|
import { ExecuteAgentParams, AgentConfiguration, BaseAgentNextStep, MJAIPromptEntityExtended, MJAIAgentRunStepEntityExtended } from '@memberjunction/ai-core-plus';
|
|
6
6
|
/** Per-cluster verification result, aggregated into a phase-level observability step. */
|
|
7
7
|
interface ConsolidationVerificationResult {
|
|
@@ -66,8 +66,19 @@ export declare class MemoryManagerAgent extends BaseAgent {
|
|
|
66
66
|
private _stepCounter;
|
|
67
67
|
/** Context user for step operations */
|
|
68
68
|
private _contextUser;
|
|
69
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* Whether the typed decision gate may replace the self-confidence threshold. On by default; it
|
|
71
|
+
* still needs the master switch ({@link DecisionsEnabled}), and a run turns it off with
|
|
72
|
+
* `data.enableDecisionGate: false`.
|
|
73
|
+
*/
|
|
70
74
|
private _enableDecisionGate;
|
|
75
|
+
/**
|
|
76
|
+
* How the run answers its dedupe and contradiction calls (`data.memoryDecisionMode`), see
|
|
77
|
+
* {@link MEMORY_DECISION_DEFAULT_MODE}.
|
|
78
|
+
*/
|
|
79
|
+
private _memoryDecisionMode;
|
|
80
|
+
/** The run's execution scope (keys, configuration, credential scope), passed to every decision call */
|
|
81
|
+
private _memoryDecisionScope;
|
|
71
82
|
/**
|
|
72
83
|
* The run's merged agent-type prompt params, read when the run starts. They carry the master
|
|
73
84
|
* switch for decision-model use ({@link DecisionsEnabled}), which the note gate needs.
|
|
@@ -76,10 +87,10 @@ export declare class MemoryManagerAgent extends BaseAgent {
|
|
|
76
87
|
/** The run's cancellation signal, passed to the decision gate's calls */
|
|
77
88
|
private _cancellationToken;
|
|
78
89
|
/**
|
|
79
|
-
* Whether the typed decision gate is enabled for filtering extracted memory notes.
|
|
80
|
-
* When false
|
|
81
|
-
*
|
|
82
|
-
*
|
|
90
|
+
* Whether the typed decision gate is enabled for filtering extracted memory notes. True by
|
|
91
|
+
* default. When false, or when the master switch is off (the run's agent-type prompt params must
|
|
92
|
+
* set `decisionsEnabled: true`, {@link DecisionsEnabled}), the self-reported confidence filter
|
|
93
|
+
* (confidence >= 80) is used.
|
|
83
94
|
*/
|
|
84
95
|
get EnableDecisionGate(): boolean;
|
|
85
96
|
set EnableDecisionGate(value: boolean);
|
|
@@ -278,6 +289,49 @@ export declare class MemoryManagerAgent extends BaseAgent {
|
|
|
278
289
|
* neighbors. Returns the decision plus reason string — callers handle logging.
|
|
279
290
|
*/
|
|
280
291
|
private runDedupePromptForCandidate;
|
|
292
|
+
/**
|
|
293
|
+
* Whether a candidate note adds to its similar stored notes, answered in the run's memory decision
|
|
294
|
+
* mode: by the dedupe prompt, by the prompt with a decision recorded beside it (`Shadow`), or by a
|
|
295
|
+
* calibrated decision that falls back to the prompt when unsure (`Decision`). Fails closed as the
|
|
296
|
+
* prompt does: no path adds a note on a failure.
|
|
297
|
+
*/
|
|
298
|
+
private decideNoteDedupe;
|
|
299
|
+
/**
|
|
300
|
+
* Whether a candidate example adds to its similar stored examples, answered in the run's memory
|
|
301
|
+
* decision mode, as {@link decideNoteDedupe} answers it for notes.
|
|
302
|
+
*/
|
|
303
|
+
private decideExampleDedupe;
|
|
304
|
+
/**
|
|
305
|
+
* Invoke the example dedupe LLM prompt for one candidate against its similar stored examples. A
|
|
306
|
+
* failed or unreadable call skips the example.
|
|
307
|
+
*/
|
|
308
|
+
private runExampleDedupePrompt;
|
|
309
|
+
/**
|
|
310
|
+
* Answers one Memory Manager closed-set call through `RunDecisionUse`, in the run's mode. The
|
|
311
|
+
* decision is built from the run's decision prompt and execution scope, and asked only in `Shadow`
|
|
312
|
+
* and `Decision` modes.
|
|
313
|
+
*/
|
|
314
|
+
private runMemoryDecisionUse;
|
|
315
|
+
/**
|
|
316
|
+
* The mode the run's dedupe and contradiction calls use: the configured `data.memoryDecisionMode`,
|
|
317
|
+
* or `Prompt` when the master switch for decision-model use is off ({@link DecisionsEnabled}),
|
|
318
|
+
* since a shadow decision is a decision call too.
|
|
319
|
+
*/
|
|
320
|
+
private effectiveMemoryDecisionMode;
|
|
321
|
+
/** A Memory Manager decision as the runner takes it, or null when the decision prompt is missing. */
|
|
322
|
+
private buildMemoryDecision;
|
|
323
|
+
/**
|
|
324
|
+
* The runner `RunDecisionUse` asks the Memory Manager's decisions with, or undefined for a new
|
|
325
|
+
* `AIDecisionRunner`. An override point for tests and for hosts that route decisions elsewhere.
|
|
326
|
+
*/
|
|
327
|
+
protected CreateMemoryDecisionRunner(): ShadowDecisionRunner | undefined;
|
|
328
|
+
/** The run's decision prompt: its agent-type prompt params' `decisionPromptName`, else `Default Decision`. */
|
|
329
|
+
private decisionPromptName;
|
|
330
|
+
/**
|
|
331
|
+
* The run's execution scope for its decision calls: the scope `BaseAgent` recorded for the run,
|
|
332
|
+
* or, when this run did not start through `Execute`, the same scope built from its params.
|
|
333
|
+
*/
|
|
334
|
+
private memoryDecisionScope;
|
|
281
335
|
/**
|
|
282
336
|
* Populate userId and sourceAgentRunId on approved notes from the source
|
|
283
337
|
* conversation's context. Only fills fields the LLM didn't already set.
|
|
@@ -451,6 +505,12 @@ export declare class MemoryManagerAgent extends BaseAgent {
|
|
|
451
505
|
private detectAndResolveContradictions;
|
|
452
506
|
/** Build unique candidate pairs of semantically similar notes for contradiction analysis. */
|
|
453
507
|
private buildContradictionCandidatePairs;
|
|
508
|
+
/**
|
|
509
|
+
* Whether two stored notes contradict each other, answered in the run's memory decision mode. The
|
|
510
|
+
* decision answers only whether they conflict; the winner follows the prompt's own stated rule
|
|
511
|
+
* (`PickContradictionAuthority`). A failed prompt still skips the pair.
|
|
512
|
+
*/
|
|
513
|
+
private decideContradiction;
|
|
454
514
|
/** Evaluate a single note pair for contradiction using the LLM prompt. */
|
|
455
515
|
private evaluateContradictionPair;
|
|
456
516
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-manager-agent.d.ts","sourceRoot":"","sources":["../src/memory-manager-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAA0E,MAAM,sBAAsB,CAAC;AACxH,OAAO,EAEH,mBAAmB,EAKtB,MAAM,+BAA+B,CAAC;AACvC,OAAO,
|
|
1
|
+
{"version":3,"file":"memory-manager-agent.d.ts","sourceRoot":"","sources":["../src/memory-manager-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,E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