Skip to content
This repository was archived by the owner on Oct 14, 2026. It is now read-only.
TinyCloudLabsPublic archive

About

No description, website, or topics provided.

Resources

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

188 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Listen

Listen is a transcript workspace for TinyCloud. It syncs Fireflies, Granola, Soundcore, and Google Meet transcripts, supports manual transcript import, stores normalized conversation rows in TinyCloud SQL, and stores transcript content either inline on conversation rows or in TinyCloud KV compatibility blobs.

Run Locally

Prerequisites:

  • Bun 1.3+
  • An OpenKey OAuth client that allows https://listen.localhost
  • A backend private key
bun install
bun run generate-key
cp .env.example .env

Edit .env:

BACKEND_PRIVATE_KEY=0x...
VITE_OPENKEY_HOST=https://openkey.so
VITE_BACKEND_URL=https://api.listen.localhost:1355
FRONTEND_URL=https://listen.localhost:1355
PORT=3001

Run the app:

bun run dev

The default dev stack uses Portless. The frontend runs at https://listen.localhost:1355 and the backend runs at https://api.listen.localhost:1355.

For raw localhost ports:

bun run dev:localhost

This serves the frontend at http://localhost:5173 and the backend at http://localhost:3001.

Project Layout

listen/
├── frontend/              # React + Vite app
├── backend/               # Express + Bun API
├── packages/
│   ├── client/            # Browser auth/delegation/API helpers
│   ├── core/              # Shared types and constants
│   ├── server/            # Backend identity/auth/delegation helpers
│   └── agent-runtime/     # Optional local OpenCode agent sidecar
├── manifest.json          # TinyCloud app manifest
├── docker-compose.yml     # Optional local agent runtime
├── docker-compose.phala.yml
└── phala.toml

Secrets and encryption

  • Secret names are uppercase env-style identifiers such as FIREFLIES_API_KEY, GRANOLA_API_KEY, SOUNDCORE_AUTH_TOKEN, SOUNDCORE_UID, SOUNDCORE_OPENUDID, ASSEMBLYAI_API_KEY, and DEEPGRAM_API_KEY.
  • Listen stores backend secret values as encrypted vault entries under vault/secrets/<NAME>.
  • During TinyCloud sign-in, the SDK creates or discovers the default encryption network, urn:tinycloud:encryption:<ownerDid>:default, encrypts envelopes locally against the network public key, and delegates tinycloud.encryption/decrypt separately from the backend's KV and SQL reads.
  • The backend decrypts through the node with a networkId-scoped invocation. This is the supported secret flow; the backend never sees payload plaintext.
  • If you consume Listen from a published SDK build, make sure the SDK release already includes tinycloud.encryption manifest support before enabling this flow.

Environment

Backend:

Variable Required Description
BACKEND_PRIVATE_KEY Yes Backend wallet key. Generate with bun run generate-key.
FRONTEND_URL Yes Allowed browser origin for CORS. Local: https://listen.localhost. Production: https://listen.tinycloud.xyz.
PORT No Backend port. Defaults to 3001.
TINYCLOUD_HOST No TinyCloud node URL. Defaults to https://node.tinycloud.xyz.
OPENKEY_ISSUER_URL No OpenKey issuer. Defaults to https://openkey.so.
GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET Optional Enables Google Meet OAuth sync.
GOOGLE_SERVICE_ACCOUNT_KEY / GOOGLE_PUBSUB_PUSH_URL Optional Enables Google Meet push webhooks.

Frontend:

Variable Required Description
VITE_BACKEND_URL Yes Backend API URL. Production defaults to https://api.listen.tinycloud.xyz.
VITE_OPENKEY_HOST No OpenKey host. Defaults to https://openkey.so.
VITE_GOOGLE_CLIENT_ID Optional Shows Google Meet source UI.
VITE_ENABLE_TINYCLOUD_HOOKS No Enables live TinyCloud hook subscriptions. Defaults to false.
VITE_ENABLE_AGENT No Shows the optional agent connection UI. Defaults to hidden unless set to true.
VITE_AGENT_ENDPOINT No Local agent endpoint. Defaults to http://localhost:4097.

Optional Agent

The local OpenCode agent is opt-in.

VITE_ENABLE_AGENT=true docker compose up --build listen-agent

Set VITE_ENABLE_AGENT=true in .env when you want the frontend to show the agent connection control. Production config keeps it disabled.

Listen Data Contract

Normalized conversations live in the owner's applications space under xyz.tinycloud.listen/conversations. Transcript content may be stored inline on conversation rows and may also be mirrored to KV under xyz.tinycloud.listen/transcript/{id} for compatibility with readers that expect transcript blobs.

Supported conversation.source values include Fireflies, Granola, Google Meet, manual import, Soundcore Sync, and recorder-style imports such as recorder, voice_memos, and voxterm.

License

Listen is licensed under the TinyCloud Open Source License (TOSL). See LICENSE.md for the full terms.

Security

Report vulnerabilities privately through the process in SECURITY.md.

Deploy

Frontend target: Cloudflare Pages project listen, custom domain https://listen.tinycloud.xyz.

bun run deploy:frontend

Backend target: Phala Cloud TEE CVM listen-backend, instance type tdx.small, custom domain https://api.listen.tinycloud.xyz.

phala login
bun run docker:backend:push
bun run deploy:backend:phala

The backend exposes an unauthenticated health endpoint at https://api.listen.tinycloud.xyz/healthz. Manual Phala deploys verify both /healthz and /api/server-info after the CVM reports running, so TLS, ingress, and backend boot failures fail the deploy instead of appearing as a successful rollout.

Configuration still needed outside the repo:

  • Cloudflare auth (wrangler login or CLOUDFLARE_API_TOKEN) with access to the listen Pages project.
  • Cloudflare custom domain mapping for listen.tinycloud.xyz.
  • Phala auth (phala login or PHALA_CLOUD_API_KEY) with credits/workspace access.
  • DNS for api.listen.tinycloud.xyz must point at the Phala CVM: CNAME api.listen.tinycloud.xyz -> _.dstack-pha-prod5.phala.network and TXT _dstack-app-address.api.listen.tinycloud.xyz -> 4beb60ce67cd668ba9e61180a50871cce1f3f307:443. The GitHub Actions deploy verifies these records before deploying.
  • CLOUDFLARE_API_TOKEN and CERTBOT_EMAIL in .env.prod; the Phala ingress uses those if it must bootstrap or renew certificates. Existing certificates are reused without rewriting DNS records.
  • Phala backend deploys use https://tee.node.tinycloud.xyz as TINYCLOUD_HOST so backend-to-node traffic stays on the direct TEE endpoint instead of the Cloudflare-proxied node endpoint.
  • Pushed amd64 backend and ingress images. The default targets are ghcr.io/tinycloudlabs/listen-backend:latest and ghcr.io/tinycloudlabs/listen-backend:ingress-latest; set LISTEN_BACKEND_IMAGE or LISTEN_INGRESS_IMAGE to deploy a specific tag.
  • The automated backend deploy workflow was removed under TC-1126.
  • OpenKey OAuth redirect/origin allowlist entries for production and local URLs.
  • Production .env values for BACKEND_PRIVATE_KEY, FRONTEND_URL, and optional Google credentials.

Automatic pull request preview deployment and cleanup are disabled; the remaining workflow is manual-dispatch-only. See docs/pr-preview-deployments.md for its historical setup details.

Checks

bun run lint
bun run format:check
bun run build
bun run test
bun run test:app:install
bun run test:app

Delegation lifecycle and HA boundaries

Listen reads the durable delegation row without deleting it. Expired and policy-stale rows persist until a replacement delegation is accepted or an explicit DELETE is confirmed, so status remains stable across repeated reads. The frontend reports ready, needs_consent, or unavailable; operational activation, node, backend, network, timeout, and rate-limit failures do not silently open a wallet prompt.

DELETE removes Listen's stored copy and derived local cache. It does not by itself revoke capability material already issued at the TinyCloud node or cancel work already in flight; those remain usable until expiry or true node-side revocation.

Shared durable delegation rows let backend replicas reject replaced serialized grants on their next access without an invalidation bus. Nonce, OAuth callback, background-job, rate-limit, node activation, and cryptographic revocation state are not fully HA yet. Persisted root activation/replay and durable node revocation remain SDK/node follow-ups.

See App Automated Testing for the CI-safe Playwright smoke test and the opt-in real OpenKey passkey harness.

M1 compatibility dependencies

The test/ package may use the pinned -m1 SDK/bootstrap packages and vendored artifacts for the M1 owner-flow harness only. They are test-harness dependencies, not application dependencies: production frontend and backend packages must use the current published TinyCloud packages and must not declare, bundle, or import any -m1 compatibility package or artifact.

About

No description, website, or topics provided.

Resources

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages