Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
472 commits
Select commit Hold shift + click to select a range
792cc1a
docs: add Auth0 hackathon design spec — Token Vault + Spotify + Slack…
tmoody1973 Mar 21, 2026
10a3c3f
docs: fix Auth0 hackathon plan — security fixes from review
tmoody1973 Mar 21, 2026
d6c72ac
docs: add competitive analysis, architecture diagrams, LinkedIn post,…
tmoody1973 Mar 21, 2026
73e8f90
docs: add Auth0 Token Vault setup guide for Spotify, Slack, Google
tmoody1973 Mar 21, 2026
68250e9
feat: add pricing section to landing page and standalone /pricing route
tmoody1973 Mar 22, 2026
cde1af0
feat: add BETA_DOMAINS for domain-level Pro access without billing
tmoody1973 Mar 22, 2026
3ea4bba
feat: add Canny feedback widget with Clerk SSO in sidebar footer
tmoody1973 Mar 22, 2026
c5e6d19
fix: patch Pro gate bypass, add Perplexity timeout, cap show prep res…
tmoody1973 Mar 22, 2026
642e414
chore: add Auth0 AI SDK and Google APIs dependencies
tmoody1973 Mar 22, 2026
a4dcc2a
feat: add Auth0 Token Vault client for OAuth token resolution
tmoody1973 Mar 22, 2026
69e8cab
feat: add Auth0 connect, callback, and status API routes
tmoody1973 Mar 22, 2026
edfa336
feat: add Spotify library read and playlist export tools via Token Vault
tmoody1973 Mar 22, 2026
baabba0
feat: add Slack and Google Docs tools via Token Vault
tmoody1973 Mar 22, 2026
3a52007
feat: wire Spotify, Slack, Google Docs tools into agentic loop
tmoody1973 Mar 22, 2026
c913dc9
feat: add Connected Services UI with Spotify, Slack, Google connect b…
tmoody1973 Mar 22, 2026
0519af8
fix: address CodeRabbit review — error handling, ownership checks, UI…
tmoody1973 Mar 22, 2026
7b2a3a3
docs: add comprehensive feature testing guide for PR #10
tmoody1973 Mar 22, 2026
b899739
feat: subscription pricing, custom skills, Auth0 Token Vault (#10)
tmoody1973 Mar 22, 2026
f4730bb
fix: add missing @opentelemetry/exporter-trace-otlp-http dep for @pos…
tmoody1973 Mar 22, 2026
8dcab6b
fix: use NEXT_PUBLIC_POSTHOG_KEY to match Vercel env var name
tmoody1973 Mar 22, 2026
c1369a7
fix: add 'use client' to landing components using next/link
tmoody1973 Mar 22, 2026
9ea6718
fix: use manual 302 response instead of immutable Response.redirect()
tmoody1973 Mar 22, 2026
8638e41
fix: redirect auth0 callback to /w instead of nonexistent /settings
tmoody1973 Mar 22, 2026
74a4111
fix: handle Auth0 error responses in callback route
tmoody1973 Mar 22, 2026
a3f7313
fix: track connected services via cookie, read in status endpoint
tmoody1973 Mar 22, 2026
9d76924
fix: use correct Auth0 connection name 'sign-in-with-slack' for Slack
tmoody1973 Mar 22, 2026
8e7002d
fix: hide billing buttons for admin/beta, redirect Stripe URLs to /w
tmoody1973 Mar 22, 2026
96e9026
feat: implement Token Vault token exchange via Auth0 Management API
tmoody1973 Mar 22, 2026
77c1930
feat: add Pricing to nav, Spotify/Google to pricing table, fix connec…
tmoody1973 Mar 22, 2026
73960c7
fix: use slack-v2 custom connection name for Slack OAuth
tmoody1973 Mar 22, 2026
ae23ff1
fix: use localStorage for connection status tracking instead of cookies
tmoody1973 Mar 22, 2026
b7758af
fix: return to current session after OAuth instead of creating new chat
tmoody1973 Mar 22, 2026
06868d1
fix: add spotify/playlist/slack keywords to agent tier, add token vau…
tmoody1973 Mar 22, 2026
9cc5031
fix: add openid scope to OAuth request so id_token returns Auth0 user ID
tmoody1973 Mar 22, 2026
22555fd
chore: add temporary auth0 debug endpoint
tmoody1973 Mar 22, 2026
2a547b3
fix: decode URL-encoded auth0_user_id cookie before Management API lo…
tmoody1973 Mar 22, 2026
eefda35
feat: add read_playlist_tracks tool for fetching songs from a Spotify…
tmoody1973 Mar 22, 2026
03801d2
feat: add SpotifyPlaylist OpenUI component with track table, Spotify …
tmoody1973 Mar 22, 2026
5699b4c
feat: upgrade Slack tools with Block Kit formatting, channel picker, …
tmoody1973 Mar 22, 2026
38f9294
fix: return playlistId in read_spotify_library, update descriptions t…
tmoody1973 Mar 22, 2026
e0104c4
feat: add Deep Dive, Influence Map, and Send to Slack action buttons …
tmoody1973 Mar 22, 2026
3f2a4a6
fix: make /create-skill immediately execute dry run instead of asking…
tmoody1973 Mar 22, 2026
3e67d86
feat: add SpotifyPlaylists OpenUI component with Explore/Open buttons…
tmoody1973 Mar 22, 2026
aae14da
feat: auto-include hyperlinks in search-based skill templates and res…
tmoody1973 Mar 22, 2026
5819adb
feat: create-skill auto-uses OpenUI components for structured results
tmoody1973 Mar 22, 2026
6496d82
feat: add SlackChannelPicker OpenUI component with clickable channel …
tmoody1973 Mar 22, 2026
cff29de
fix: force SlackChannelPicker flow, add detailed error messages for S…
tmoody1973 Mar 22, 2026
f9777e0
fix: add explicit date to /news prompt, reject stale results older th…
tmoody1973 Mar 22, 2026
04ac988
fix: route send/share/post/slack/#channel/@user messages to agent tie…
tmoody1973 Mar 23, 2026
6534cba
fix: prevent /news from hallucinating URLs — only use verified links …
tmoody1973 Mar 23, 2026
5eea322
feat: add Send to Slack button on ArtistCard, ShowPrepPackage, Influe…
tmoody1973 Mar 23, 2026
2ae966b
feat: add hero banner with artist photo to InfluenceChain, fix compon…
tmoody1973 Mar 23, 2026
a3c5d19
feat: improve Slack formatting — native table blocks, proper bold, nu…
tmoody1973 Mar 23, 2026
f366f7a
feat: add Export to Spotify and Send to Slack buttons on TrackList pl…
tmoody1973 Mar 23, 2026
69d7c1c
feat: rename Artifacts to Deep Cuts, default-expand in sidebar
tmoody1973 Mar 23, 2026
03d7e97
docs: add Deep Cuts panel design spec with review fixes
tmoody1973 Mar 23, 2026
0b69f6f
docs: add Deep Cuts panel implementation plan (9 tasks, 4 chunks)
tmoody1973 Mar 23, 2026
a3a491c
chore: add nanoid, add shares table to Convex schema
tmoody1973 Mar 23, 2026
bb29405
feat: add Deep Cut type detection and action mapping utilities
tmoody1973 Mar 23, 2026
7f59b4f
feat: add Convex shares CRUD and artifacts getById query
tmoody1973 Mar 23, 2026
540506b
feat: add currentType, isSaving to artifact provider context
tmoody1973 Mar 23, 2026
b420ef3
feat: create Deep Cuts panel with dropdown selector and action buttons
tmoody1973 Mar 23, 2026
d7e6c1d
feat: resizable Deep Cuts panel replacing artifact slide-in
tmoody1973 Mar 23, 2026
efc8961
feat: add publish API route for Deep Cuts sharing
tmoody1973 Mar 23, 2026
4ff2335
feat: add public share page for Deep Cuts at /cuts/[shareId]
tmoody1973 Mar 23, 2026
420879b
feat: increase tool call cap for research (50), detect playlist/influ…
tmoody1973 Mar 23, 2026
0ecd7c9
docs: add LinkedIn article for Auth0 hackathon
tmoody1973 Mar 23, 2026
95fd380
fix: correct timeline to two weeks, not a year
tmoody1973 Mar 23, 2026
09ec7b5
docs: expand Spotify section with playlist pulls, deep dives, new pla…
tmoody1973 Mar 23, 2026
764ac71
fix: use usePlayerSafe in PlayButton so share page renders without Pl…
tmoody1973 Mar 23, 2026
351589c
feat: update onboarding wizard, help guide, FAQ, and commands for fre…
tmoody1973 Mar 23, 2026
d37eb82
fix: update artifact ID from 'pending' to real Convex ID so Publish b…
tmoody1973 Mar 23, 2026
962ab52
feat: replace sidebar text with Crate light logo + Beta badge
tmoody1973 Mar 23, 2026
b12f527
docs: add mobile UX design spec with speech-to-text, responsive layou…
tmoody1973 Mar 24, 2026
7379dcd
docs: add mobile UX implementation plan (13 tasks, 7 chunks) with rev…
tmoody1973 Mar 24, 2026
f339fdd
feat: add useIsMobile and useKeyboardVisible hooks for mobile respons…
tmoody1973 Mar 24, 2026
07693ba
feat: add mobile chat header with hamburger menu, logo, and model sel…
tmoody1973 Mar 24, 2026
ca6b725
feat: add tappable Deep Cut inline card for mobile chat
tmoody1973 Mar 24, 2026
20d4977
feat: add full-width mobile sidebar overlay
tmoody1973 Mar 24, 2026
b054d3d
feat: wire mobile sidebar overlay into workspace shell with navigatio…
tmoody1973 Mar 24, 2026
c606850
feat: add full-screen mobile Deep Cuts view with horizontal pill tabs
tmoody1973 Mar 24, 2026
d50cbdc
feat: wire mobile Deep Cuts full-screen view into session page
tmoody1973 Mar 24, 2026
e712589
feat: add mobile mini player bar that hides on keyboard focus
tmoody1973 Mar 24, 2026
1a72961
feat: add speech-to-text mic button using Web Speech API
tmoody1973 Mar 24, 2026
3e7bb45
feat: add mobile chat header, mic button, and pill-shaped input for m…
tmoody1973 Mar 24, 2026
acc9765
feat: full-page settings view on mobile with back button
tmoody1973 Mar 24, 2026
d29e94e
feat: increase touch targets and font sizes for mobile
tmoody1973 Mar 24, 2026
9fb51bd
fix: make useSidebar safe outside Sidebar provider for mobile overlay
tmoody1973 Mar 24, 2026
3ff8e15
fix: dismiss desktop panel on mobile back to prevent effect re-openin…
tmoody1973 Mar 24, 2026
8f08132
fix: mobile hero layout — headline first, contained photo below CTAs
tmoody1973 Mar 24, 2026
ae4881f
fix: only auto-open mobile Deep Cuts for new artifacts, not on re-render
tmoody1973 Mar 24, 2026
473bb2b
fix: mobile chat uses full width, hide desktop header/model selector …
tmoody1973 Mar 24, 2026
190460f
fix: only filter tools for /influence, give /news full tool access to…
tmoody1973 Mar 24, 2026
0191ef4
fix: make /news more efficient — 2 searches max, write from snippets,…
tmoody1973 Mar 24, 2026
45f78b8
chore: regenerate Convex types to include shares module
tmoody1973 Mar 24, 2026
78066bc
fix: add SidebarFooter to mobile sidebar with logout, settings, help,…
tmoody1973 Mar 24, 2026
d3be6fe
docs: add StoryCard design spec with review fixes
tmoody1973 Mar 24, 2026
dc788a4
docs: add StoryCard implementation plan (4 tasks)
tmoody1973 Mar 24, 2026
16a2369
feat: add StoryCard OpenUI component with magazine desktop + accordio…
tmoody1973 Mar 24, 2026
64ffed2
feat: register StoryCard in OpenUI library with component group and p…
tmoody1973 Mar 24, 2026
21f1ee6
feat: add StoryCard usage rules and documentation to system prompt
tmoody1973 Mar 24, 2026
fe6d6eb
feat: add /story command and force StoryCard for narrative queries
tmoody1973 Mar 24, 2026
cf2dc23
feat: add /story to slash command autocomplete menu
tmoody1973 Mar 24, 2026
7673349
fix: make StoryCard handle both object arrays and flat string arrays …
tmoody1973 Mar 24, 2026
2e847b3
fix: parse pipe-delimited chapters, markdown source links, and name-r…
tmoody1973 Mar 24, 2026
2cb8ee3
fix: constrain key people cards to fixed width with truncated roles
tmoody1973 Mar 24, 2026
d4c9e23
feat: add playable tracks section to StoryCard with play buttons and …
tmoody1973 Mar 24, 2026
29375c1
fix: parse JSON string chapters, gradient fallback for broken hero im…
tmoody1973 Mar 24, 2026
55a9976
docs: add StoryCard component guide with story types, props, and data…
tmoody1973 Mar 24, 2026
4bdb3d1
fix: redesign key facts as scrollable chips, truncate chapter tabs, i…
tmoody1973 Mar 24, 2026
eab1f1a
fix: store per-service Auth0 user IDs so Spotify and Slack tokens don…
tmoody1973 Mar 24, 2026
a386769
feat: add audio player to published Deep Cuts so anyone can listen
tmoody1973 Mar 24, 2026
02fd7cb
docs: comprehensive README update with Auth0 Token Vault, connected s…
tmoody1973 Mar 24, 2026
da38db5
fix: batch-fetch key people images in StoryCard like InfluenceChain does
tmoody1973 Mar 24, 2026
cce3240
feat: people photo collage header for genre/movement stories when no …
tmoody1973 Mar 24, 2026
2b1cf8f
feat: add iTunes and Wikipedia image fallbacks when Spotify has no ar…
tmoody1973 Mar 24, 2026
61757c7
docs: add LinkedIn post comparing Spotify SongDNA to Crate's StoryCar…
tmoody1973 Mar 24, 2026
adbe5a4
docs: add TrackCard design spec with review fixes (bpm, flat pressing…
tmoody1973 Mar 24, 2026
9d6d797
docs: add ArtistProfile design spec with tabbed layout, playable disc…
tmoody1973 Mar 24, 2026
ef21328
docs: add combined TrackCard + ArtistProfile implementation plan (5 t…
tmoody1973 Mar 24, 2026
f17fc0e
feat: add TrackCard OpenUI component with credits, samples, lyrics, v…
tmoody1973 Mar 24, 2026
0fa67e6
feat: register TrackCard, add /track command, autocomplete, and resea…
tmoody1973 Mar 24, 2026
34c4a6e
feat: add ArtistProfile OpenUI component with tabbed overview, discog…
tmoody1973 Mar 24, 2026
62e9268
feat: register ArtistProfile, add /artist command, autocomplete, and …
tmoody1973 Mar 24, 2026
43941c5
docs: add TrackCard and ArtistProfile to README — 27+ components, /tr…
tmoody1973 Mar 25, 2026
f6a739b
fix: TrackCard sample parsing handles multiple field names, adds back…
tmoody1973 Mar 25, 2026
dc3394a
fix: add Story tab to TrackCard, suppress raw OpenUI in chat, fix out…
tmoody1973 Mar 25, 2026
9765f07
fix: pricing grid centered with more gap, fix 'Unlimited' stat overfl…
tmoody1973 Mar 25, 2026
c0ad342
fix: avoid lyrics in /track to prevent content filter blocks — use an…
tmoody1973 Mar 25, 2026
d1f2b0a
fix: prioritize Perplexity first for track narrative, explicitly requ…
tmoody1973 Mar 25, 2026
f891272
docs: add press strategy design doc — SongDNA moment, acqui-hire posi…
tmoody1973 Mar 25, 2026
388c103
docs: add press release — Crate vs SongDNA, Auth0 hackathon, acqui-hi…
tmoody1973 Mar 25, 2026
cccce9b
docs: refine press release — Tarik's background, Radio Milwaukee cont…
tmoody1973 Mar 25, 2026
b082b67
docs: refined press release — tighter capabilities, punchier bios, fi…
tmoody1973 Mar 25, 2026
0eecd6a
docs: final press release with market segments, media angles, and ele…
tmoody1973 Mar 25, 2026
c374d81
docs: spec for interactive influence graph exploration
tmoody1973 Mar 25, 2026
c7df511
docs: implementation plan for influence graph exploration
tmoody1973 Mar 25, 2026
505d386
feat: add react-force-graph-2d and influence graph types
tmoody1973 Mar 25, 2026
f191507
feat: add research_influences_batch tool for parallel Perplexity enri…
tmoody1973 Mar 25, 2026
be7e88b
feat: add /api/influence/expand endpoint with Convex cache + Perplexi…
tmoody1973 Mar 25, 2026
0ee01bc
feat: add InfluenceGraph component with force-directed layout and nod…
tmoody1973 Mar 25, 2026
c33c744
feat: add List/Graph view toggle to InfluenceChain component
tmoody1973 Mar 25, 2026
d4e21db
feat: update /influence prompt to use research_influences_batch tool
tmoody1973 Mar 25, 2026
7acbe17
fix: refactor influence graph — fix Pro enrichment, node classificati…
tmoody1973 Mar 25, 2026
9759ee4
fix: address code review — hooks violation, link renderer, dead code
tmoody1973 Mar 25, 2026
c5270b5
fix: redesign graph nodes — smaller radii, artist photos, better spacing
tmoody1973 Mar 26, 2026
1ed7afc
fix: graph perf — debounce image reheat, configure forces once, reada…
tmoody1973 Mar 26, 2026
dda9a07
feat: add docs link to landing page nav and sidebar footer
tmoody1973 Apr 2, 2026
85cb131
feat: Auth0 Token Vault hackathon completion + /spotify command
tmoody1973 Apr 5, 2026
7eefaaa
fix: /spotify renders OpenUI components instead of markdown tables
tmoody1973 Apr 5, 2026
73b750d
feat: Spotify Web Playback SDK — full track streaming via Token Vault
tmoody1973 Apr 5, 2026
447a361
fix: use connection_scope to pass IdP-specific scopes to Spotify
tmoody1973 Apr 5, 2026
6344c5f
feat: add Tumblr to Auth0 Token Vault config
tmoody1973 Apr 6, 2026
af9dad4
feat: add Tumblr to Connected Services settings UI
tmoody1973 Apr 6, 2026
6b74f91
feat: add Tumblr connected tools via Auth0 Token Vault
tmoody1973 Apr 6, 2026
966dd44
feat: add /tumblr command with dashboard, likes, and tag search modes
tmoody1973 Apr 6, 2026
7cafb87
feat: wire Tumblr Token Vault tools into chat route
tmoody1973 Apr 6, 2026
b706649
feat: add TumblrFeed OpenUI component with post type rendering and fi…
tmoody1973 Apr 6, 2026
9d9e7de
feat: register TumblrFeed in OpenUI component registry
tmoody1973 Apr 6, 2026
1bf98dd
fix: use tumblr-custom connection name to match Auth0 dashboard
tmoody1973 Apr 6, 2026
6010b2c
feat: add /tumblr to slash command menu
tmoody1973 Apr 6, 2026
9033836
chore: add Tumblr API debug endpoint
tmoody1973 Apr 6, 2026
59c81a4
fix: loosen TumblrFeed Zod schema to prevent silent validation failures
tmoody1973 Apr 6, 2026
e1c77f2
fix: register TumblrFeed in OpenUI library and component groups
tmoody1973 Apr 6, 2026
bceab37
fix: strengthen /tumblr OpenUI enforcement to prevent markdown fallback
tmoody1973 Apr 6, 2026
29cc8d8
fix: add defensive guards to TumblrFeed to prevent silent render crashes
tmoody1973 Apr 6, 2026
02ff287
debug: add visible debug output to TumblrFeed when posts empty
tmoody1973 Apr 6, 2026
08202cc
fix: robust TumblrFeed prop handling with double JSON parse fallback
tmoody1973 Apr 6, 2026
aa8e90d
debug: add console.log and visible debug panel to TumblrFeed wrapper
tmoody1973 Apr 6, 2026
387ab6e
fix: proper artifact titles for TumblrFeed, Spotify, Slack components
tmoody1973 Apr 6, 2026
86c746f
feat: add blog_name param to post_to_tumblr for multi-blog selection
tmoody1973 Apr 6, 2026
90122d2
feat: add privacy policy and terms of service pages
tmoody1973 Apr 6, 2026
e1357bd
fix: update contact email to tarikjmoody@gmail.com
tmoody1973 Apr 6, 2026
a950045
feat: add Google Docs and Tumblr action buttons to response actions
tmoody1973 Apr 6, 2026
6e54dba
fix: parse Tumblr post ID from raw text to prevent 64-bit int truncation
tmoody1973 Apr 6, 2026
08851cb
fix: pass actual content to Docs/Tumblr action buttons with explicit …
tmoody1973 Apr 6, 2026
ba718df
fix: clean content and explicit formatting instructions for Tumblr/Do…
tmoody1973 Apr 6, 2026
3543b78
feat: add read_tumblr_blog tool and change /tumblr default to show bl…
tmoody1973 Apr 6, 2026
99d23a4
feat: add Slack scopes for public posting + channel picker action button
tmoody1973 Apr 6, 2026
77cc849
fix: prevent Tumblr hallucination + add /tumblr blog [name] command
tmoody1973 Apr 6, 2026
a52705d
fix: route action button tool calls to Sonnet instead of Haiku
tmoody1973 Apr 7, 2026
38ae67d
fix: clean action button messages + explicit tool instructions via pr…
tmoody1973 Apr 7, 2026
51134b2
fix: route 'post to tumblr/save to docs/send to slack' messages to So…
tmoody1973 Apr 7, 2026
8617870
fix: improve Tumblr post ID extraction with string and numeric patter…
tmoody1973 Apr 7, 2026
928b607
fix: use modern Tumblr URL format (tumblr.com/blog/id instead of blog…
tmoody1973 Apr 7, 2026
93ec28c
fix: sanitize unicode + convert markdown tables for Tumblr NPF
tmoody1973 Apr 7, 2026
d8998bb
debug: add Tumblr test-post endpoint to see raw API response
tmoody1973 Apr 7, 2026
4363b5b
fix: force agent to actually call post_to_tumblr instead of hallucina…
tmoody1973 Apr 7, 2026
8308be6
docs: update README with judges guide, Tumblr integration, service sc…
tmoody1973 Apr 7, 2026
1ee247a
docs: add YouTube demo video link
tmoody1973 Apr 7, 2026
3f9aa60
feat: add permissions summary to connected services in Settings
tmoody1973 Apr 7, 2026
330f8cf
feat: add step-up confirmation to all write-action tools
tmoody1973 Apr 7, 2026
283a3f4
feat: Clerk dev-to-prod migration support
tmoody1973 Apr 7, 2026
3c0742a
feat: add YouTube readonly + write scopes to Google Token Vault conne…
tmoody1973 Apr 7, 2026
1ca0304
feat: add YouTube connected tools via Google Token Vault (search, pla…
tmoody1973 Apr 7, 2026
e77a382
feat: update Google connection description to include YouTube capabil…
tmoody1973 Apr 7, 2026
bab8a01
feat: wire YouTube connected tools into chat route
tmoody1973 Apr 7, 2026
06bcb83
feat: add PostHog server-side analytics events (queries, connections,…
tmoody1973 Apr 7, 2026
2d110b1
feat: add PostHog client-side analytics (identify, actions, artifacts…
tmoody1973 Apr 7, 2026
ccf9839
docs: add Stripe setup guides, hackathon submission, and Agent Connec…
tmoody1973 Apr 7, 2026
00d9f79
docs: add PostHog analytics guide with dashboards, events, and weekly…
tmoody1973 Apr 7, 2026
b79c166
docs: add Crate acqui-hire thesis with sourced evidence and intellige…
tmoody1973 Apr 7, 2026
77c4d27
docs: add NPR listener features plan (public influence maps + Tiny De…
tmoody1973 Apr 7, 2026
58a1aa3
feat: add Tiny Desk Companion pages with video-linked influence chains
tmoody1973 Apr 7, 2026
8832362
feat: update Khruangbin companion with real influence data and verifi…
tmoody1973 Apr 8, 2026
f86ebf8
fix: correct Khruangbin Tiny Desk video ID and fix Meters broken link
tmoody1973 Apr 8, 2026
cacae48
feat: redesign Tiny Desk Companion as storytelling scroll with magazi…
tmoody1973 Apr 8, 2026
64640a0
feat: add sonic DNA tags, pull quotes, key works, and strength badges…
tmoody1973 Apr 8, 2026
f560e18
fix: clean up Connected Services layout — inline badges, horizontal p…
tmoody1973 Apr 8, 2026
6531665
feat: add tinydeskCompanions Convex table and functions
tmoody1973 Apr 8, 2026
ace8ebe
feat: add save_tinydesk_companion agent tool
tmoody1973 Apr 8, 2026
c8ddae5
feat: update Tiny Desk pages to read from Convex with static JSON fal…
tmoody1973 Apr 8, 2026
8b6f7bd
chore: add migration script and migrate Khruangbin to Convex
tmoody1973 Apr 8, 2026
c1d451e
fix: exclude scripts/ from Next.js build to prevent type errors
tmoody1973 Apr 8, 2026
fa4f180
fix: commit updated Convex generated types with tinydeskCompanions
tmoody1973 Apr 8, 2026
b9f7df9
docs: add Tiny Desk Catalog design doc (626 artists, genre browse, ti…
tmoody1973 Apr 8, 2026
5a1d605
feat: add 626-artist Tiny Desk Catalog with genre browse, timeline, a…
tmoody1973 Apr 8, 2026
c3c7c71
fix: wrap useSearchParams in Suspense boundary on /w page
tmoody1973 Apr 8, 2026
b2a8aa1
fix: pull YouTube thumbnail from companion data for community catalog…
tmoody1973 Apr 8, 2026
391801d
fix: use catalog YouTube IDs and genres when available in enrich API
tmoody1973 Apr 8, 2026
c2edad5
fix: resolve YouTube videos for each influence chain node and skip em…
tmoody1973 Apr 8, 2026
1e8a1b2
fix: make /tinydesk dynamic so new companions appear immediately
tmoody1973 Apr 8, 2026
443596b
fix: resolve connection videos server-side via enrich API instead of …
tmoody1973 Apr 8, 2026
e5a10ea
fix: add maxDuration, fetch timeout, and empty connections guard for …
tmoody1973 Apr 8, 2026
7770685
feat: server-side companion save pipeline with validation
tmoody1973 Apr 8, 2026
5d93a7e
feat: regenerate button on empty companion pages + deleteBySlug mutation
tmoody1973 Apr 8, 2026
8696ae0
refactor: simplify enrich API — connection videos moved to save route
tmoody1973 Apr 8, 2026
7867810
feat: show contextual status instead of "Thinking..." between tool calls
tmoody1973 Apr 8, 2026
a069e56
feat: redesign /tinydesk as "Tiny Desk DNA" with before/after hero
tmoody1973 Apr 8, 2026
399c7b7
refactor: extract duplicated code and oversized components
tmoody1973 Apr 8, 2026
9f1135f
feat: use Tiny Desk DNA logo on /tinydesk page
tmoody1973 Apr 8, 2026
9e22d0a
feat: add "Watch on NPR" button to companion pages + enlarge header logo
tmoody1973 Apr 8, 2026
fa9a511
feat: enlarge hero logo to 300px
tmoody1973 Apr 8, 2026
b05e6f0
feat: add Crate description section to /tinydesk between hero and How…
tmoody1973 Apr 8, 2026
a3d0f95
feat: add Tiny Desk DNA showcase section to landing page + nav link
tmoody1973 Apr 8, 2026
02799e3
docs: add Tiny Desk DNA feature to README
tmoody1973 Apr 8, 2026
f4b3b06
fix: add Tiny Desk DNA logo SVG to tracked files
tmoody1973 Apr 8, 2026
ff225fd
copy: update landing page tagline to 'Every Record Has a Story.'
tmoody1973 Apr 8, 2026
a4d80fa
fix: add wiki_update to CrateEvent union type to fix build
tmoody1973 Apr 8, 2026
fee1504
feat: add Music Wiki — persistent, compounding artist knowledge base
tmoody1973 Apr 8, 2026
bf1e861
fix: wiki detail page 404 — pass Clerk auth to Convex query
tmoody1973 Apr 8, 2026
85024ec
feat: wiki UX improvements — personalized title, Crate logo, visibili…
tmoody1973 Apr 8, 2026
81a4e20
fix: rewrite wiki extractors to capture full tool output
tmoody1973 Apr 8, 2026
c58106e
fix: skip empty tool results in wiki ingestion, set ANTHROPIC_API_KEY…
tmoody1973 Apr 8, 2026
b80a509
fix: add crate-cli servers to wiki qualifying list (influence, genius…
tmoody1973 Apr 8, 2026
28575d9
fix: sanitize Haiku output for Convex validators + format raw JSON fo…
tmoody1973 Apr 8, 2026
fea5526
fix: convert JSON to readable text at ingestion time, never store raw…
tmoody1973 Apr 8, 2026
93bb96a
feat: shared wiki layer, wiki-first response, parallel tool execution
tmoody1973 Apr 8, 2026
133c2cf
fix: security + privacy fixes from code review
tmoody1973 Apr 8, 2026
c5cd237
feat: usernameSlug index, Convex scheduled synthesis, 30 tests
tmoody1973 Apr 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file modified .DS_Store
Binary file not shown.
40 changes: 40 additions & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
NEXT_PUBLIC_CONVEX_URL=https://your-project.convex.cloud
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_xxx
CLERK_SECRET_KEY=sk_test_xxx
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
CLERK_WEBHOOK_SECRET=whsec_xxx
ENCRYPTION_KEY=
EMBEDDED_TICKETMASTER_KEY=
EMBEDDED_LASTFM_KEY=
EMBEDDED_DISCOGS_KEY=
EMBEDDED_DISCOGS_SECRET=

# Stripe billing
STRIPE_SECRET_KEY=sk_test_xxx
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_xxx
STRIPE_WEBHOOK_SECRET=whsec_xxx
STRIPE_PRO_MONTHLY_PRICE_ID=price_xxx
STRIPE_PRO_ANNUAL_PRICE_ID=price_xxx
STRIPE_TEAM_MONTHLY_PRICE_ID=price_xxx

# Platform key — Crate's own Anthropic key for free/pro users without BYOK
PLATFORM_ANTHROPIC_KEY=sk-ant-xxx

# Admin emails (comma-separated) — bypass all limits and feature gates
ADMIN_EMAILS=admin@example.com

# Auth0 Token Vault (for OAuth connections to Spotify, Slack, Google)
AUTH0_DOMAIN=your-tenant.us.auth0.com
AUTH0_CLIENT_ID=your-auth0-client-id
AUTH0_CLIENT_SECRET=your-auth0-client-secret
AUTH0_TOKEN_VAULT_AUDIENCE=https://your-api-audience
AUTH0_CALLBACK_URL=http://localhost:3000/api/auth0/callback

# Beta domains (comma-separated) — users from these domains get Pro access for free
# Use for observation sprint testers, radio station partners, etc.
BETA_DOMAINS=radiomilwaukee.org

# Canny feedback widget
NEXT_PUBLIC_CANNY_APP_ID=your-canny-app-id
NEXT_PUBLIC_CANNY_URL=https://your-company.canny.io
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@ yarn-error.log*

# env files (can opt-in for committing if needed)
.env*
!.env.local.example

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
.superpowers/
.gstack/
.env.local
126 changes: 126 additions & 0 deletions DEVLOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# Crate Web — Devlog

## 2026-03-12: Migration from Claude Agent SDK to Direct Anthropic SDK

### The Problem

Crate's backend uses the **Claude Agent SDK** (`@anthropic-ai/claude-agent-sdk`) to power its music research agent. The Agent SDK works by spawning **Claude Code as a subprocess** via the `query()` function. This architecture is fundamentally incompatible with:

1. **Vercel serverless functions** — Serverless environments don't support long-running subprocesses. Functions have execution time limits (60s default) and no persistent process state.
2. **Railway containers** — Even with a full Docker container running Node.js, the Claude Code subprocess fails with `exit code 1`. The CLI requires a specific environment setup (authentication, session management) that doesn't work in headless container environments.
3. **Any standard deployment** — The Agent SDK is designed for local CLI use where Claude Code is installed and authenticated interactively.

### What We Tried

#### Attempt 1: Deploy directly to Vercel
- **Result**: `Error: Claude Code process exited with code 1`
- The Agent SDK's `query()` spawns a Claude Code subprocess. Vercel's serverless runtime cannot run persistent subprocesses.

#### Attempt 2: Vercel Sandbox
- Vercel offers a "Sandbox" product specifically for the Claude Agent SDK, but it requires enterprise access and has different constraints.

#### Attempt 3: Railway long-running server
- Built a separate Express server deployed to Railway at `https://crate-agent-production.up.railway.app`
- Architecture: Vercel signs a JWT containing the user's API keys → browser sends JWT to Railway → Railway runs CrateAgent → streams SSE back
- Added `git` and `@anthropic-ai/claude-code` to the Docker image
- **Result**: Same `exit code 1`. The Claude Code CLI subprocess fails even in a Docker container with the CLI installed.

#### Attempt 4: JWT size issues (431 Request Header Fields Too Large)
- The JWT initially contained the full prompt suffix (~15KB). Moved prompt construction server-side to shrink the token.
- Also discovered trailing `\n` in Vercel env vars (from `echo "value" | npx vercel env add`) causing JWT signature mismatches. Fixed with `printf '%s'`.

### The Solution: Direct Anthropic SDK

Replace the Agent SDK entirely with the **direct Anthropic SDK** (`@anthropic-ai/sdk`). Instead of spawning a subprocess, we:

1. **Convert tool definitions**: The MCP tools in `crate-cli` use `tool()` from the Agent SDK with Zod schemas. We convert these Zod schemas to JSON Schema format for the Anthropic Messages API's `tools` parameter.
2. **Build a manual agentic loop**: Send user message → if Claude responds with `tool_use` blocks, execute the tool handlers directly in-process → send results back → repeat until Claude responds with `end_turn`.
3. **Stream everything**: Use the Anthropic SDK's streaming mode to emit `CrateEvent`s (answer_token, tool_start, tool_end, done, error) as SSE to the frontend.

### Why This Works

- **No subprocess**: The Anthropic SDK makes HTTP calls to the Messages API. No CLI, no child processes, no special environment.
- **Vercel-compatible**: Standard HTTP requests fit perfectly in serverless functions. The streaming response keeps the connection alive within the 60s limit (configurable up to 300s on Pro plans).
- **OpenRouter-compatible**: The Anthropic SDK accepts a `baseURL` parameter. Setting it to `https://openrouter.ai/api/v1` routes through OpenRouter with zero code changes.
- **Tools run in-process**: The MCP tool handlers are plain async functions that make HTTP calls to external APIs (MusicBrainz, Discogs, etc.). They don't need a subprocess — they run directly in the Node.js runtime.

### Architecture Before vs After

**Before (Agent SDK + Railway):**
```
Browser → /api/agent-token (Vercel, signs JWT)
→ Railway /agent/research (runs CrateAgent subprocess)
← SSE stream back to browser
```

**After (Direct Anthropic SDK):**
```
Browser → /api/chat (Vercel)
→ Anthropic Messages API (with tools)
→ Tool handlers run in-process
← SSE stream back to browser
```

### What Gets Deleted

- `server/` directory (entire Railway Express server)
- `src/app/api/agent-token/` (JWT signing endpoint)
- `src/lib/agent-token.ts` (JWT signing utility)
- `.vercelignore` (was excluding server/ from Vercel)
- `AGENT_SIGNING_SECRET` and `RAILWAY_AGENT_URL` env vars
- `jose` dependency (JWT library)

### What Gets Created

- `src/lib/tool-adapter.ts` — Converts `SdkMcpToolDefinition` (Zod schemas + handlers) to Anthropic API tool format (JSON Schema) and provides a tool executor
- `src/lib/agentic-loop.ts` — The manual agentic loop: message → tool_use → execute → loop, emitting CrateEvents as an async generator
- Rewritten `src/app/api/chat/route.ts` — Handles ALL tiers (chat + agent) using the direct SDK

### OpenRouter Support

The direct Anthropic SDK supports custom base URLs:

```typescript
import Anthropic from "@anthropic-ai/sdk";

// Direct Anthropic
const client = new Anthropic({ apiKey: anthropicKey });

// Via OpenRouter — same API, different endpoint
const client = new Anthropic({
apiKey: openRouterKey,
baseURL: "https://openrouter.ai/api/v1",
});
```

All tool_use, streaming, and the agentic loop work identically through OpenRouter since it's wire-compatible with the Anthropic Messages API.

### Key Decisions

1. **Keep `crate-cli` as a dependency** — We import `getActiveTools()` for tool definitions, `getSystemPrompt()` for the system prompt, and `classifyQuery()` for tier routing. We just skip the `CrateAgent` class and its `query()` calls.
2. **Tools run in the API route process** — The tool handlers are async functions that make HTTP calls. They run directly in the Vercel serverless function, no subprocess needed.
3. **Set env vars before tool resolution** — `getActiveTools()` checks `process.env` for API keys to determine which servers are active. We set env vars from the user's resolved keys before calling it, and restore them after.
4. **SSE format stays identical** — The frontend already parses `CrateEvent` SSE. The new backend emits the exact same event types.
5. **Increase maxDuration** — Research queries can involve 10-25 tool calls. We increase the Vercel function timeout from 60s to 300s.
6. **Zod 4 native JSON Schema** — crate-cli uses Zod 4 which has built-in `z.toJSONSchema()`. No need for `zod-to-json-schema` third-party lib.
7. **Non-streaming for tool turns** — The agentic loop uses non-streaming API calls during tool-use turns (where latency is dominated by tool execution), and chunks text for SSE delivery.

### Implementation Status

**Completed:**
- `src/lib/tool-adapter.ts` — Converts `SdkMcpToolDefinition` Zod schemas to Anthropic API JSON Schema format, provides tool executor
- `src/lib/agentic-loop.ts` — Manual agentic loop with CrateEvent emission
- `src/lib/openui-prompt.ts` — Copied from server/src/lib/ (OpenUI Lang system prompt)
- `src/app/api/chat/route.ts` — Rewritten to handle both chat-tier (fast) and agent-tier (agentic loop with tools)
- `src/components/workspace/chat-panel.tsx` — Simplified from two-step agent-token flow to single `/api/chat` endpoint
- Build passing (TypeScript clean, Next.js build clean)

**Ready to delete (after testing):**
- `server/` directory (Railway Express server)
- `src/app/api/agent-token/route.ts` (JWT signing endpoint)
- `src/lib/agent-token.ts` (JWT signing utility)
- `src/hooks/use-crate-agent.ts` (unused hook)
- `.vercelignore` (was excluding server/)
- Railway deployment at `https://crate-agent-production.up.railway.app`
- Vercel env vars: `AGENT_SIGNING_SECRET`, `RAILWAY_AGENT_URL`
- `jose` dependency (JWT library, check if used elsewhere first)
Loading