mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-30 15:03:57 +00:00
feat(memory-sources): default sync sources on with conservative caps, per-source settings & All In (#3304)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user