8000 Wire fallback AI providers and YouTube embeds into the Tauri app · Issue #39 · kiran-brahma/nodepad-app · GitHub
[go: up one dir, main page]

Skip to content

Wire fallback AI providers and YouTube embeds into the Tauri app #39

Closed

Description

@kiran-brahma

Parent

Part of #1. Deferred out of #19 (PR #38), whose scope fence excludes provider expansion.

What to build

Nodepad V0 talks to local Ollama and, under consent, Ollama Cloud. This issue adds fallback providers and embedded video to the shipped Tauri app.

The source material already exists in the repository, in the unshipped Next.js prototype:

  • lib/ai-settings.ts — provider configuration for OpenRouter, OpenAI, and z.ai (base URLs, key URLs, header handling).
  • lib/ai-enrich.ts — the client-side enrichment call and its JSON schema.
  • components/intro-modal.tsx, components/about-panel.tsx — youtube-nocookie.com embeds.

None of it is compiled, bundled, or shipped today: tsconfig.json includes only src/**, and the Vite entry is index.html → src/main.tsx. Porting it is real work, not a wiring change.

Decisions

  • Keep all three fallback providers: OpenRouter, OpenAI, z.ai. Ollama stays the default and the only provider used when the Assistance Policy is Local AI.
  • Each provider needs its own keychain entry. secrets.rs currently hardcodes one service/account pair for the single Ollama Cloud credential.
  • A fallback provider is cloud traffic and requires the same explicit per-Workspace consent the Cloud AI policy already gates on.
  • YouTube embeds require relaxing the webview CSP, which is default-src 'self' today with no frame-src.

Work

  • Generalize the keychain seam from one hardcoded credential to one per provider.
  • Extend cloud.rs (or add a sibling) so the provider is selectable rather than fixed to https://ollama.com.
  • Extend the Assistance Policy and consent surfaces to name which provider a Workspace would use.
  • Add frame-src https://www.youtube-nocookie.com to the CSP, scoped as narrowly as possible.
  • Update ALLOWED_OUTBOUND_HOSTS in src-tauri/src/release_audit.rs and remove the corresponding entries from FORBIDDEN_MARKERS. The release audit currently fails the build on openrouter.ai, api.openai.com, api.z.ai, and any remote origin in the CSP — by design. Those failures are the audit doing its job; this issue is the deliberate act of changing the privacy surface, and the audit's rule tables are where that decision gets recorded.
  • Update docs/v0/release-notes.md: the "no non-Ollama provider traffic" claim and the destination table both become false.

Testing

  • Each provider's request path with a recording client, proving the right key reaches the right host and no other.
  • Consent gating: no fallback provider request without per-Workspace consent.
  • The sentinel audit must still pass with several keychain entries in play.

Scope fence

No new AI features beyond provider selection. No streaming. No per-provider model management beyond what discovery already does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageMaintainer must evaluate this issue

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0