MCPcopy Create free account
hub / github.com/MemTensor/MemOS / applyMigrationItemToState

Function applyMigrationItemToState

packages/memos-core/src/viewer/server.ts:73–91  ·  view source on GitHub ↗
(state: MigrationStateSnapshot, d: any)

Source from the content-addressed store, hash-verified

71}
72
73export function applyMigrationItemToState(state: MigrationStateSnapshot, d: any): void {
74 if (d.status === "stored") state.stored++;
75 else if (d.status === "skipped" || d.status === "duplicate") state.skipped++;
76 else if (d.status === "merged") state.merged++;
77 else if (d.status === "error") state.errors++;
78
79 if (Array.isArray(d.stepFailures)) {
80 for (const step of d.stepFailures) {
81 if (step === "summarization") state.stepFailures.summarization++;
82 else if (step === "dedup") state.stepFailures.dedup++;
83 else if (step === "embedding") state.stepFailures.embedding++;
84 }
85 }
86
87 state.processed = d.index ?? state.processed + 1;
88 state.total = d.total ?? state.total;
89 state.lastItem = d;
90 state.success = computeMigrationSuccess(state);
91}
92
93export interface ViewerBranding {
94 title?: string;

Callers 1

sendMethod · 0.70

Calls 1

computeMigrationSuccessFunction · 0.70

Tested by

no test coverage detected