feat(memory-sources): default sync sources on with conservative caps, per-source settings & All In (#3304)

This commit is contained in:
Cyrus Gray
2026-06-04 10:34:22 -04:00
committed by GitHub
parent 81e527ee2d
commit 0d9002fcfc
52 changed files with 3405 additions and 154 deletions
+27 -1
View File
@@ -31,9 +31,16 @@ export interface MemorySourceEntry {
branch?: string;
paths?: string[];
query?: string;
selector?: string;
// Sync limit fields (all optional; omit = use backend default / unlimited)
since_days?: number;
max_items?: number;
selector?: string;
max_commits?: number;
max_issues?: number;
max_prs?: number;
sync_depth_days?: number;
max_tokens_per_sync?: number;
max_cost_per_sync_usd?: number;
}
export interface SourceItem {
@@ -159,6 +166,25 @@ export async function syncMemorySource(sourceId: string): Promise<void> {
});
}
export interface ApplyAllInResult {
sources: MemorySourceEntry[];
sync_triggered: number;
}
/**
* Enables every memory source, clears all per-source sync caps, and
* triggers a background sync for each. Equivalent to the UI "All In"
* action. Maps to `openhuman.memory_sources_apply_all_in`.
*/
export async function applyAllIn(): Promise<ApplyAllInResult> {
log('apply_all_in');
const resp = await callCoreRpc<ApplyAllInResult>({
method: 'openhuman.memory_sources_apply_all_in',
});
const data = unwrap<ApplyAllInResult>(resp);
return { sources: data.sources ?? [], sync_triggered: data.sync_triggered ?? 0 };
}
/// i18n keys for each source kind's user-visible label. Resolve via
/// `t(SOURCE_KIND_LABEL_KEYS[kind])` in components — keeping the keys
/// as a constant lets the dialog kind-picker render the same labels