Skip to content
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
10 changes: 10 additions & 0 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@ export default defineConfig({
access: "public",
optional: true,
}),
PUBLIC_SYNTWIN_ENABLED: envField.boolean({
context: "client",
access: "public",
default: true,
}),
PUBLIC_SYNTWIN_ROOM_ID: envField.string({
context: "client",
access: "public",
default: "j97dc3ekdfj0hffadfwwqb19w98h3q3m",
}),
},
},
})
8 changes: 8 additions & 0 deletions docs/ai-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@
- Tool functions in `tools.ts` use operations internally
- Return sanitized data (exclude `_ref` properties)
- No file upload support in AI tools

## Person summaries

The shared field guidance lives in `src/shared/tools/person-summary-guidance.ts`. The in-app system prompt and create/update person tools use it directly.

A summary is a compact bio: "How would you introduce them to your friends?" Temporary events belong in notes. Leave summary empty when there is no known biographical context. The in-app assistant can update an outdated bio from journal evidence.

written with gpt-6.1-sol in Codex
29 changes: 29 additions & 0 deletions docs/syntwin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Syntwin integration

The website loads Carl's Syntwin through `src/shared/ui/syntwin-embed.astro`. The app loads it through `src/app/components/syntwin-guide.tsx` once the account locale is known. The script stays outside the React router. Syntwin restores the conversation across full page loads on the same origin.

Both scripts set `data-context` to identify website exploration or in-app help. The attribute contains no account or journal data. Syntwin manages the greeting and conversation behavior.

The website has a CTA below the hero and a floating launcher. Fresh app visits open the guide through Settings → Help → Talk to Carl's AI twin. The app uses `data-launcher="none"`; Syntwin keeps a launcher for an ongoing conversation carried from the website. The Settings button uses `data-syntwin-open`.

## Configuration

- Public room: https://my.syntwin.ai/app/d/j97dc3ekdfj0hffadfwwqb19w98h3q3m
- Room settings: https://my.syntwin.ai/app/deploy/j97dc3ekdfj0hffadfwwqb19w98h3q3m?settings=room
- Embed script: https://my.syntwin.ai/omny.js

Room instructions, knowledge sources, source access, notifications and test mode are managed in Syntwin. Edit them there. This repository documents the integration and Tilly's product behavior.

`PUBLIC_SYNTWIN_ROOM_ID` defaults to Carl's Tilly room. Set it to another room for your own deployment. Set `PUBLIC_SYNTWIN_ENABLED=false` to disable the script, website CTA and Settings Help section. An empty room ID is not an off switch: Astro treats empty environment variables as unset and restores the default. No Syntwin secret belongs in Tilly.

Launcher appearance, interaction modes and page permissions come from the room's Omny settings. The embed starts in the page's language and retains the conversation language across navigation. The room's operator privacy notice points to https://tilly.social/en/privacy.

Account controls are hidden with `data-syntwin-hidden`. Sign-in and bulk data controls use `data-syntwin-readonly`. `data-syntwin-avoid="0px"` on the hero actions folds the launcher while those actions are visible on phones. Its value is an IntersectionObserver margin.

## Local verification

In a fresh worktree, run `work setup` before `work up`. Use `work urls` to find the local website. The embed connects to production Syntwin. Use a separate test room and fictional journal details for automated or exploratory conversations.

Check a fresh website conversation and a fresh app conversation from Settings Help. Verify that website-to-app navigation keeps the session and sends the app context. Check an ongoing minimized call, English and German, declined and revoked page access, and phone layouts. Do not clear site data to restart a conversation, because that can erase anonymous journal entries.

written with gpt-6.1-sol in Codex
6 changes: 5 additions & 1 deletion src/app/components/splash-screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ function SplashScreenStatic() {
}, [])

return (
<div className="flex min-h-screen flex-col items-center justify-center gap-4">
<div
aria-busy="true"
className="flex min-h-screen flex-col items-center justify-center gap-4"
>
<img src="/app/icons/icon-192x192.png" className="size-24 rounded-lg" />
<TypographyH1>Tilly</TypographyH1>
</div>
Expand All @@ -75,6 +78,7 @@ function SplashScreen({ show }: { show?: boolean }) {
<AnimatePresence>
{show !== false && (
<motion.div
aria-busy="true"
className="bg-background pointer-events-none fixed inset-0 z-50 flex min-h-screen flex-col items-center justify-center gap-4"
initial={{ opacity: 1 }}
exit={{ opacity: 0 }}
Expand Down
33 changes: 33 additions & 0 deletions src/app/components/syntwin-guide.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { useEffect } from "react"
import {
PUBLIC_SYNTWIN_ENABLED,
PUBLIC_SYNTWIN_ROOM_ID,
} from "astro:env/client"

export { SyntwinGuide }

function SyntwinGuide({ locale }: { locale: string }) {
useEffect(() => {
document.documentElement.lang = locale
if (
!PUBLIC_SYNTWIN_ENABLED ||
!PUBLIC_SYNTWIN_ROOM_ID ||
document.getElementById("tilly-syntwin")
) {
return
}

// Syntwin reads the page language once, so wait for the account locale.
let script = document.createElement("script")
script.id = "tilly-syntwin"
script.src = "https://my.syntwin.ai/omny.js"
script.async = true
script.dataset.room = PUBLIC_SYNTWIN_ROOM_ID
script.dataset.launcher = "none"
script.dataset.context =
"The visitor is inside the Tilly app, where they can manage people, notes and reminders. This is in-app help, possibly continuing a walkthrough from the website."
document.body.append(script)
}, [locale])

return null
}
2 changes: 2 additions & 0 deletions src/app/features/settings/screens/settings-screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { PWASection } from "../widgets/pwa-section"
import { AppSection } from "../widgets/app-section"
import { DataSection } from "../widgets/data-section"
import { AboutSection } from "../widgets/about-section"
import { HelpSection } from "../widgets/help-section"

export { SettingsScreen }

Expand All @@ -38,6 +39,7 @@ function SettingsScreen({ fallback }: SettingsScreenProps) {
{!isPWAInstalled && <PWASection />}
<AppSection />
<DataSection me={me} />
<HelpSection />
<AboutSection me={me} />
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/features/settings/widgets/account-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function AccountSection() {
: t("settings.account.description.signedOut.offline")
}
>
<div className={sectionStackClass}>
<div className={sectionStackClass} data-syntwin-hidden>
{isAuthenticated ? (
<>
<div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/features/settings/widgets/data-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function DataSection({ me }: { me: SettingsAccount }) {
title={t("settings.data.title")}
description={t("settings.data.description")}
>
<div className={sectionStackClass}>
<div className={sectionStackClass} data-syntwin-readonly>
<div className="space-y-2">
<p className="mb-1 text-sm font-medium">
<T k="settings.data.export.label" />
Expand Down
44 changes: 44 additions & 0 deletions src/app/features/settings/widgets/help-section.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import {
PUBLIC_SYNTWIN_ENABLED,
PUBLIC_SYNTWIN_ROOM_ID,
} from "astro:env/client"
import { Button, buttonVariants } from "#shared/ui/button"
import { T, useIntl } from "#shared/intl/setup"
import { SettingsSection } from "#app/features/settings/parts/settings-section"
import { useOnlineStatus } from "#app/hooks/use-online-status"

export { HelpSection }

function HelpSection() {
let t = useIntl()
let isOnline = useOnlineStatus()

if (!PUBLIC_SYNTWIN_ENABLED || !PUBLIC_SYNTWIN_ROOM_ID) return null

return (
<SettingsSection
title={t("settings.help.title")}
description={t("settings.help.description")}
>
<div className="flex flex-wrap gap-2">
<Button variant="outline" data-syntwin-open disabled={!isOnline}>
<T k="settings.help.open" />
</Button>
<a
href="mailto:assmann@hey.com"
className={buttonVariants({ variant: "outline" })}
>
<T k="settings.help.email" />
</a>
<a
href="https://github.com/carlassmann/tilly/issues/new"
target="_blank"
rel="noopener noreferrer"
className={buttonVariants({ variant: "outline" })}
>
<T k="settings.help.issue" />
</a>
</div>
</SettingsSection>
)
}
2 changes: 2 additions & 0 deletions src/app/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
import { PWAInstallHint } from "#app/components/pwa-install-hint"
import { Toaster } from "#shared/ui/sonner"
import { MainErrorBoundary } from "#app/components/main-error-boundary"
import { SyntwinGuide } from "#app/components/syntwin-guide"

export function PWA() {
return (
Expand Down Expand Up @@ -74,6 +75,7 @@ function RouterWithJazz() {

return (
<SplashVisibilityProvider visible={showSplash}>
{contextMe && <SyntwinGuide locale={locale} />}
<LayoutGroup>
<SplashScreen show={showSplash} />
{locale === "de" ? (
Expand Down
1 change: 1 addition & 0 deletions src/app/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ function WelcomeIndex() {
<SignInButton mode="redirect" forceRedirectUrl="/app/people">
<Button
variant="secondary"
data-syntwin-readonly
onClick={() => setTourSkipped(true)}
>
<PersonCircle />
Expand Down
11 changes: 7 additions & 4 deletions src/pages/app/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let metaDescription =
---

<!doctype html>
<html lang="en" class="min-h-dvh overscroll-y-none bg-background">
<html lang="en" class="bg-background min-h-dvh overscroll-y-none">
<head>
<title>{pageTitle}</title>
<meta name="description" content={metaDescription} />
Expand Down Expand Up @@ -61,12 +61,15 @@ let metaDescription =
/>
)
}

</head>
<body
class="selection:bg-primary selection:text-primary-foreground select-none bg-background text-foreground *:border-border overscroll-y-none"
class="selection:bg-primary selection:text-primary-foreground bg-background text-foreground *:border-border overscroll-y-none select-none"
>
<div id="splash" class="flex min-h-dvh flex-col items-center justify-center gap-4 bg-background">
<div
id="splash"
aria-busy="true"
class="bg-background flex min-h-dvh flex-col items-center justify-center gap-4"
>
<img src="/app/icons/icon-192x192.png" class="size-24 rounded-lg" />
<span class="text-4xl font-bold tracking-tight">Tilly</span>
</div>
Expand Down
7 changes: 7 additions & 0 deletions src/pages/de/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import MinimalMarketingLayout from "#www/layouts/MinimalMarketingLayout.astro"
import { Navbar } from "#www/components/Navbar"
import { Hero } from "#www/components/Hero"
import { SyntwinCTA } from "#www/components/SyntwinCTA"
import { ContentWithTestimonial } from "#www/components/ContentWithTestimonial"
import { FeatureGridOffset } from "#www/components/FeatureGridOffset"
import { FeaturesWithProductScreenshot } from "#www/components/FeaturesWithProductScreenshot"
Expand Down Expand Up @@ -68,6 +69,12 @@ import { Footer } from "#www/components/Footer"
}}
/>
</div>
<SyntwinCTA
title="Sprich mit meinem Syntwin über Tilly"
description="Mein Syntwin beantwortet deine Fragen und zeigt dir die App, in meinen Worten."
creator="Carl, der Tilly gebaut hat"
action="Gespräch starten"
/>
<div id="story" class="py-12 md:py-24">
<ContentWithTestimonial
title="Hier ist das Problem."
Expand Down
16 changes: 15 additions & 1 deletion src/pages/de/privacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ locale: "de"

# Datenschutzerklärung

_Stand: 1. September 2025_
_Stand: 27. Oktober 2026_

## Verantwortlicher

Expand Down Expand Up @@ -40,6 +40,18 @@ E-Mail: assmann@hey.com

## Drittanbieter-Dienste

### Syntwin-Websitebegleiter

Carls KI-Zwilling kann Tilly erklären und durch die Website und App führen. Dieser optionale Begleiter ist unabhängig vom Tilly Agent.

- Beim Laden einer Seite mit dem Begleiter wird Syntwin kontaktiert, um das Skript und die Raumeinstellungen abzurufen, bevor du ein Gespräch beginnst. Dabei erhält Syntwin Verbindungsdaten wie deine IP-Adresse und die Website-Herkunft.
- Nachrichten an den Begleiter werden in Syntwin verarbeitet und gespeichert. Anrufe werden transkribiert. Carl kann Gespräche einschließlich deines Feedbacks einsehen.
- Der Begleiter fragt um Erlaubnis, bevor er die Seite liest oder bedient. Mit deiner Zustimmung können sichtbare Seiteninhalte einschließlich angezeigter Journaldetails zur Hilfestellung an Syntwin übermittelt werden. Den Seitenzugriff kannst du im Begleiter widerrufen.
- Die Kontosteuerung in den Einstellungen ist vom Seitenzugriff ausgeschlossen. Passwort- und Kreditkartenfelder schließt die Einbettung aus.
- Gesprächsstatus und Zugriffsentscheidung werden im Sitzungsspeicher dieses Browsertabs gespeichert, damit das Gespräch beim Seitenwechsel weitergeht.
- Tillys Journalverschlüsselung verbirgt keine Seiteninhalte, die du mit dem Begleiter teilst. Für eine Einführung kannst du erfundene Beispiele verwenden.
- Datenschutzhinweis von Syntwin: https://my.syntwin.ai/de/legal/privacy

### Clerk (Authentifizierung)

- Verarbeitet Authentifizierung und speichert Verschlüsselungsschlüssel
Expand Down Expand Up @@ -72,6 +84,8 @@ E-Mail: assmann@hey.com
- Kontolöschung entfernt alle Daten und Verschlüsselungsschlüssel
- Backups werden automatisch innerhalb von 30 Tagen gelöscht

Gespräche mit dem Begleiter werden separat in Syntwin gespeichert. Das Löschen deines Tilly-Kontos löscht diese Gespräche nicht automatisch. Wende dich für die Löschung von Gesprächen an assmann@hey.com.

## Deine Rechte (DSGVO)

- **Zugriff** auf deine Daten jederzeit mit dem kostenlosen Tarif und Herunterladen deiner Daten
Expand Down
7 changes: 7 additions & 0 deletions src/pages/en/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import MinimalMarketingLayout from "#www/layouts/MinimalMarketingLayout.astro"
import { Navbar } from "#www/components/Navbar"
import { Hero } from "#www/components/Hero"
import { SyntwinCTA } from "#www/components/SyntwinCTA"
import { ContentWithTestimonial } from "#www/components/ContentWithTestimonial"
import { FeatureGridOffset } from "#www/components/FeatureGridOffset"
import { FeaturesWithProductScreenshot } from "#www/components/FeaturesWithProductScreenshot"
Expand Down Expand Up @@ -68,6 +69,12 @@ import { Footer } from "#www/components/Footer"
}}
/>
</div>
<SyntwinCTA
title="Talk to my Syntwin about Tilly"
description="My Syntwin answers questions and shows you around, in my words."
creator="Carl, creator of Tilly"
action="Start talking"
/>
<div id="story" class="py-24">
<ContentWithTestimonial
title="Here's the problem."
Expand Down
16 changes: 15 additions & 1 deletion src/pages/en/privacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ locale: "en"

# Privacy Policy

_Last updated: September 1, 2025_
_Last updated: October 27, 2026_

## Controller

Expand Down Expand Up @@ -40,6 +40,18 @@ Email: assmann@hey.com

## Third-Party Services

### Syntwin website guide

Carl's AI twin can explain Tilly and guide you through the website and app. This optional guide is separate from Tilly Agent.

- Loading a page with the guide contacts Syntwin to fetch its script and room settings, before you start a conversation. Syntwin receives connection information such as your IP address and the website origin.
- Messages you send to the guide are processed and stored in Syntwin. Calls are transcribed. Carl can review conversations, including feedback you leave there.
- The guide asks permission before reading or acting on the page. If you allow it, visible page content, including journal details on that page, can be sent to Syntwin for guidance. You can revoke page access in the guide.
- Settings account controls are excluded from page access. Password and payment-card fields are excluded by the embed.
- The guide stores its conversation state and page-access choice in this browser tab's session storage so it can continue between Tilly pages.
- Tilly's journal encryption does not hide page contents you share with the guide. You can use fictional details for a walkthrough.
- Syntwin's privacy notice: https://my.syntwin.ai/legal/privacy

### Clerk (Authentication)

- Processes authentication and stores encryption keys
Expand Down Expand Up @@ -72,6 +84,8 @@ Email: assmann@hey.com
- Account deletion removes all data and encryption keys
- Backups are automatically deleted within 30 days

Guide conversations are stored separately in Syntwin. Deleting your Tilly account does not automatically delete those conversations. Contact assmann@hey.com about deleting guide conversations.

## Your Rights (GDPR)

- **Access** your data anytime using the free tier and downloading your data
Expand Down
4 changes: 3 additions & 1 deletion src/server/features/chat/lib/system-prompt.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { personSummaryGuidance } from "#shared/tools/person-summary-guidance"

export { makeStaticSystemPrompt }

function makeStaticSystemPrompt() {
Expand Down Expand Up @@ -46,7 +48,7 @@ DUPLICATE PREVENTION: Before adding memories or reminders, ALWAYS check the pers
- If you find similar content, either skip adding it or merge/update the existing entry instead
- When in doubt, use the userQuestion tool to ask if they want to add similar content or update existing content

PERSON SUMMARY/BIO: The summary field is like a bio that helps get the most important information about a person at a glance. It should include key details like relationship, profession, location, and personality traits.
PERSON SUMMARY/BIO: ${personSummaryGuidance}
- When you learn new important information about someone (job changes, relationship status, major life events), check if their current summary still accurately represents them
- If the summary seems outdated or incomplete based on the notes you've collected, proactively update it or ask the user for clarification to create a better summary
- For new people, if you don't have enough information to create a good summary, it's okay to ask the user for key details about them
Expand Down
Loading
Loading