Skip to content
This repository was archived by the owner on May 9, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openhuman
Submodule openhuman updated 51 files
+8 −4 app/src/App.tsx
+45 −0 app/src/components/MeshGradient.tsx
+1 −1 app/src/components/OnboardingOverlay.tsx
+12 −10 app/src/components/settings/SettingsHome.tsx
+16 −18 app/src/components/settings/SettingsSectionPage.tsx
+8 −4 app/src/components/settings/components/SettingsBackButton.tsx
+4 −4 app/src/components/settings/components/SettingsHeader.tsx
+2 −2 app/src/components/settings/components/SettingsPanelLayout.tsx
+0 −2 app/src/components/settings/hooks/useSettingsNavigation.ts
+6 −6 app/src/components/settings/panels/AIPanel.tsx
+6 −6 app/src/components/settings/panels/AccessibilityPanel.tsx
+23 −33 app/src/components/settings/panels/AdvancedPanel.tsx
+4 −4 app/src/components/settings/panels/AgentChatPanel.tsx
+2 −2 app/src/components/settings/panels/AutocompletePanel.tsx
+1 −1 app/src/components/settings/panels/BillingPanel.tsx
+3 −3 app/src/components/settings/panels/ConnectionsPanel.tsx
+4 −4 app/src/components/settings/panels/CronJobsPanel.tsx
+13 −33 app/src/components/settings/panels/DeveloperOptionsPanel.tsx
+13 −13 app/src/components/settings/panels/LocalModelPanel.tsx
+189 −247 app/src/components/settings/panels/MemoryDebugPanel.tsx
+2 −2 app/src/components/settings/panels/MessagingPanel.tsx
+3 −3 app/src/components/settings/panels/PrivacyPanel.tsx
+17 −27 app/src/components/settings/panels/ProfilePanel.tsx
+2 −2 app/src/components/settings/panels/RecoveryPhrasePanel.tsx
+7 −7 app/src/components/settings/panels/ScreenIntelligencePanel.tsx
+4 −4 app/src/components/settings/panels/SkillsPanel.tsx
+2 −2 app/src/components/settings/panels/TauriCommandsPanel.tsx
+3 −3 app/src/components/settings/panels/TeamInvitesPanel.tsx
+7 −7 app/src/components/settings/panels/TeamManagementPanel.tsx
+4 −4 app/src/components/settings/panels/TeamMembersPanel.tsx
+3 −3 app/src/components/settings/panels/TeamPanel.tsx
+101 −183 app/src/components/settings/panels/WebhooksDebugPanel.tsx
+35 −28 app/src/components/skills/SkillSetupWizard.tsx
+2 −2 app/src/index.css
+14 −0 app/src/lib/meshGradient.d.ts
+686 −0 app/src/lib/meshGradient.js
+22 −0 app/src/lib/skills/manager.ts
+8 −0 app/src/lib/skills/skillsApi.ts
+2 −6 app/src/pages/Settings.tsx
+1 −1 app/src/pages/Skills.tsx
+16 −6 src/core/jsonrpc.rs
+13 −8 src/core/repl.rs
+3 −1 src/core/skills_cli.rs
+6 −71 src/openhuman/config/schema/load.rs
+1 −0 src/openhuman/config/schema/mod.rs
+6 −0 src/openhuman/config/schema/types.rs
+1 −0 src/openhuman/mod.rs
+7 −0 src/openhuman/overlay/mod.rs
+134 −0 src/openhuman/overlay/process.rs
+17 −0 src/openhuman/skills/qjs_engine.rs
+28 −3 yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Reads .env from the repo root automatically (JWT_TOKEN, BACKEND_URL, etc.).
*
* Usage:
* npx tsx src/core/gmail/__tests__/test-gmail-live.ts
* npx tsx src/core/gmail/live-test.ts
*/
import * as readline from 'readline';
import { exec } from 'child_process';
Expand All @@ -27,7 +27,7 @@ import {
setSetupComplete,
startSkill,
stopSkill,
} from '../../../../dev/test-harness';
} from '../../../dev/test-harness';

// ---------------------------------------------------------------------------
// Formatting
Expand Down Expand Up @@ -171,9 +171,7 @@ const ENV_REFRESH_TOKEN = process.env.GMAIL_REFRESH_TOKEN || '';

if (!JWT_TOKEN) {
console.error(`\n${C.red} JWT_TOKEN env var is required.${C.reset}`);
console.error(
`${C.dim} Usage: JWT_TOKEN=<jwt> npx tsx src/core/gmail/__tests__/test-gmail-live.ts${C.reset}\n`
);
console.error(`${C.dim} Usage: JWT_TOKEN=<jwt> npx tsx src/core/gmail/live-test.ts${C.reset}\n`);
process.exit(1);
}

Expand Down
83 changes: 82 additions & 1 deletion src/core/gmail/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
import { syncIntegrationMetadata } from '../../shared/integration-metadata';
import { gmailFetch, isGmailConnected } from './api';
import { loadGmailProfile } from './api/helpers';
import { emailExists, getEmailCount, getEmails, upsertEmail } from './db/helpers';
import {
emailExists,
getEmailCount,
getEmails,
getUnsubmittedEmails,
markEmailsSubmitted,
markSensitiveAsSubmitted,
upsertEmail,
} from './db/helpers';
import { getGmailSkillState, publishSkillState } from './state';
import type { GmailMessage } from './types';

Expand Down Expand Up @@ -199,6 +207,9 @@ export async function performInitialSync(onProgress?: SyncProgressCallback): Pro

log(`Initial sync complete: ${newEmails} new emails, ${skipped} skipped`, 100);

// Ingest newly synced emails into knowledge graph
ingestNewEmails();

if (newEmails > 0 && s.config.notifyOnNewEmails) {
platform.notify('Gmail Sync Complete', `Synchronized ${newEmails} new emails`);
}
Expand Down Expand Up @@ -264,6 +275,9 @@ export async function onSync(): Promise<void> {
emitSyncProgress(`Sync complete: ${newEmails} new, ${skipped} skipped`, 100);
console.log(`[gmail-sync] Incremental sync done: ${newEmails} new, ${skipped} skipped`);

// Ingest newly synced emails into knowledge graph
ingestNewEmails();

if (newEmails > 0 && s.config.notifyOnNewEmails) {
platform.notify('New Gmail Emails', `${newEmails} new emails synced`);
}
Expand All @@ -282,6 +296,73 @@ export async function onSync(): Promise<void> {
}
}

// ---------------------------------------------------------------------------
// Ingest synced emails into knowledge graph via memory.insert()
// ---------------------------------------------------------------------------

/** Max emails to pull from DB per ingestion round. */
const INGEST_QUERY_LIMIT = 500;

/**
* Ingest un-submitted emails into the knowledge graph.
* Each email is sent via memory.insert() which routes through the Rust
* ingestion pipeline (upsert → GLiNER entity/relation extraction → graph).
* Sensitive emails are marked as submitted without being ingested.
*/
function ingestNewEmails(): void {
// Mark sensitive emails as submitted so they never enter the ingestion queue
markSensitiveAsSubmitted();

const emails = getUnsubmittedEmails(INGEST_QUERY_LIMIT);
if (emails.length === 0) return;

const submittedIds: string[] = [];
let ingested = 0;

for (const email of emails) {
const content = email.body_text || email.snippet || '';
if (content.length === 0) {
submittedIds.push(email.id);
continue;
}

try {
memory.insert({
title: email.subject || `Email ${email.id}`,
content,
sourceType: 'email',
documentId: `gmail-email-${email.id}`,
metadata: {
source: 'gmail',
type: 'email',
emailId: email.id,
threadId: email.thread_id,
senderEmail: email.sender_email,
senderName: email.sender_name,
recipientEmails: email.recipient_emails,
isRead: email.is_read === 1,
isImportant: email.is_important === 1,
isStarred: email.is_starred === 1,
hasAttachments: email.has_attachments === 1,
labels: email.labels,
},
createdAt: email.date ? email.date / 1000 : undefined,
updatedAt: email.updated_at ? email.updated_at / 1000 : undefined,
});
submittedIds.push(email.id);
ingested++;
} catch (e) {
console.error(`[gmail] Failed to ingest email ${email.id}: ${e}`);
}
}

if (submittedIds.length > 0) markEmailsSubmitted(submittedIds);

if (ingested > 0) {
console.log(`[gmail] Ingested ${ingested} email(s) into knowledge graph`);
}
}

// ---------------------------------------------------------------------------
// Sync state helpers
// ---------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Reads .env from the repo root automatically (JWT_TOKEN, BACKEND_URL, etc.).
*
* Usage:
* npx tsx src/core/notion/__tests__/test-notion-live.ts
* npx tsx src/core/notion/live-test.ts
*/
import * as readline from 'readline';
import { exec } from 'child_process';
Expand All @@ -27,7 +27,7 @@ import {
setSetupComplete,
startSkill,
stopSkill,
} from '../../../../dev/test-harness';
} from '../../../dev/test-harness';

// ---------------------------------------------------------------------------
// Formatting
Expand Down Expand Up @@ -166,7 +166,7 @@ const ENV_CLIENT_KEY = process.env.NOTION_CLIENT_KEY_SHARE || '';
if (!JWT_TOKEN) {
console.error(`\n${C.red} JWT_TOKEN env var is required.${C.reset}`);
console.error(
`${C.dim} Usage: JWT_TOKEN=<jwt> npx tsx src/core/notion/__tests__/test-notion-live.ts${C.reset}\n`
`${C.dim} Usage: JWT_TOKEN=<jwt> npx tsx src/core/notion/live-test.ts${C.reset}\n`
);
process.exit(1);
}
Expand Down
Loading
Loading