Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
395 commits
Select commit Hold shift + click to select a range
2747c28
fix: set selected step and block ids on setstepsaction
jianwei1 Jun 10, 2025
b2e0475
feat: update system prompt on submit and append
jianwei1 Jun 10, 2025
f7fd216
Merge branch 'main' into 25-03-NC-feat-ai-guided-journey-ui
jianwei1 Jun 11, 2025
55c774c
feat: update dependencies and enhance chat API with Zod validation
tataihono Jun 11, 2025
d26db4d
chore: update package-lock.json with new dependencies and version upg…
mikeallisonJS Jun 11, 2025
c75fcff
fix: lint issues
autofix-ci[bot] Jun 11, 2025
c34ee3a
Merge branch 'main' into 25-03-NC-feat-ai-guided-journey-ui
jianwei1 Jun 11, 2025
b243c63
feat: enhance instrumentation and chat API with journey context
tataihono Jun 11, 2025
1ad89eb
feat: log environment details in chat API
tataihono Jun 12, 2025
a4b7dff
feat: update jwt-decode dependency and integrate decoding in chat API
tataihono Jun 12, 2025
975ffaa
test: state tests
jianwei1 Jun 12, 2025
5cae771
test: textpart test file
jianwei1 Jun 12, 2025
8ad5e2b
test: toolinvocationpart folder tests (except requestformtool)
jianwei1 Jun 12, 2025
5fbc942
feat: enhance chat API and instrumentation with Langfuse integration
tataihono Jun 12, 2025
d951996
Merge branch '25-03-NC-feat-ai-guided-journey-ui' of https://github.c…
tataihono Jun 12, 2025
297a24d
fix: correct environment variable assignment in Langfuse configuration
tataihono Jun 12, 2025
37d727f
fix: lint issues
autofix-ci[bot] Jun 12, 2025
1121950
refactor: simplify AiChat component and remove system prompt handling
tataihono Jun 12, 2025
eeb2f58
Merge branch '25-03-NC-feat-ai-guided-journey-ui' of https://github.c…
tataihono Jun 12, 2025
943f15a
fix: lint issues
autofix-ci[bot] Jun 12, 2025
ab437eb
feat: enhance chat API with structured request validation and UUID tr…
tataihono Jun 12, 2025
eb6afeb
Merge branch '25-03-NC-feat-ai-guided-journey-ui' of https://github.c…
tataihono Jun 12, 2025
6783cb7
feat: enhance AiChat component with authorization and trace ID handling
tataihono Jun 13, 2025
e6c0c86
refactor: streamline POST request handling in chat API
tataihono Jun 13, 2025
ee3de8d
refactor: update Langfuse integration and clean up imports
tataihono Jun 13, 2025
9267638
Merge branch 'main' into 25-03-NC-feat-ai-guided-journey-ui
tataihono Jun 13, 2025
50ccfbf
refactor: update UserFeedback component to use new scoring API
tataihono Jun 13, 2025
5ec3a5b
Merge branch '25-03-NC-feat-ai-guided-journey-ui' of https://github.c…
tataihono Jun 13, 2025
f43dafd
fix: improve error handling in chat API POST request
tataihono Jun 13, 2025
0255e11
test: block create tests
jianwei1 Jun 13, 2025
dbbde6a
test: tool block update tests
jianwei1 Jun 13, 2025
092334c
test: use restoreallmocks
jianwei1 Jun 13, 2025
73b5b9a
test: step block tool tests
jianwei1 Jun 13, 2025
e89a026
test: tests for delete
jianwei1 Jun 15, 2025
d3221e1
test: client tests
jianwei1 Jun 16, 2025
7887f91
test: journey tool tests
jianwei1 Jun 16, 2025
873b271
test: userfeedback tests
jianwei1 Jun 16, 2025
11ad675
feat: add sessionId handling in chat API and AiChat component
tataihono Jun 16, 2025
c68b38d
Merge branch '25-03-NC-feat-ai-guided-journey-ui' of https://github.c…
tataihono Jun 16, 2025
3bcd478
feat: enhance AI tools with langfuseTraceId support
tataihono Jun 16, 2025
0f2f787
Merge branch 'main' into 25-03-NC-feat-ai-guided-journey-ui
jianwei1 Jun 16, 2025
590f5ff
chore: commented out experimental_telementary to fix type check
jianwei1 Jun 16, 2025
2bd71d0
test: editorprovider test updates for setstepsaction
jianwei1 Jun 16, 2025
781b2f7
test: editor provider setstepsaction fallback case
jianwei1 Jun 16, 2025
0cc4cac
feat: enhance AiChat and MessageList components with status handling
tataihono Jun 16, 2025
19f5b25
Merge branch '25-03-NC-feat-ai-guided-journey-ui' of https://github.c…
tataihono Jun 16, 2025
80e2df6
test: createjourneybutton test fix
jianwei1 Jun 16, 2025
8c6b7a8
feat: only enable create with ai button on template page
jianwei1 Jun 17, 2025
0652778
test: copytoteamdialog, createjourneybutton, translationdialogwrapper…
jianwei1 Jun 17, 2025
243ebee
fix: lint issues
autofix-ci[bot] Jun 17, 2025
5f5e605
feat: enhance chat API with Langfuse telemetry support
tataihono Jun 17, 2025
2602eb3
Merge branch '25-03-NC-feat-ai-guided-journey-ui' of https://github.c…
tataihono Jun 17, 2025
cc62dd6
Merge branch 'main' into 25-03-NC-feat-ai-guided-journey-ui
jianwei1 Jun 17, 2025
bcb11b7
fix: move createwithai tests to top of test file to ensure passing
jianwei1 Jun 17, 2025
4a2e848
test: messagelist tests, update textpart and toolinvocationpart tests
jianwei1 Jun 18, 2025
5402a16
test: requestformtool tests
jianwei1 Jun 18, 2025
9eb392e
feat: update chat API to streamline message handling and enhance tele…
tataihono Jun 18, 2025
f60fce6
Merge branch '25-03-NC-feat-ai-guided-journey-ui' of https://github.c…
tataihono Jun 18, 2025
56c3019
feat: enhance chat API with maxSteps limit and improved logging
tataihono Jun 18, 2025
259b1de
refactor: improve Langfuse trace update in chat API
tataihono Jun 18, 2025
6e5b7c2
test: form component tests
jianwei1 Jun 18, 2025
b9001f0
Merge branch 'main' into 25-03-NC-feat-ai-guided-journey-ui
jianwei1 Jun 18, 2025
1a4dc43
test: websearch tests
jianwei1 Jun 18, 2025
5f2e02f
chore: removed console error spy from websearch tests
jianwei1 Jun 18, 2025
3abe4c5
test: upload tests
jianwei1 Jun 18, 2025
a72664d
chore: added try catch to websearch, updated tests
jianwei1 Jun 19, 2025
7738c79
test: generateimage tests
jianwei1 Jun 19, 2025
af74b55
test: aieditbutton tests
jianwei1 Jun 19, 2025
70bc0a1
test: added editor test, added test id to aieditbutton
jianwei1 Jun 19, 2025
9f7e758
fix: mock aichat on editor tests to fix failing tests
jianwei1 Jun 19, 2025
7503046
Merge branch 'main' into 25-03-NC-feat-ai-guided-journey-ui
jianwei1 Jun 19, 2025
1e0b9a4
chore: removed all console.error instances from tools folder, updated…
jianwei1 Jun 24, 2025
9c5986d
chore: removed try catch for userfeedback, removed error tests
jianwei1 Jun 24, 2025
1d00aca
test: aichat component
jianwei1 Jun 25, 2025
d8dac7d
chore: added testids on form buttons
jianwei1 Jun 25, 2025
c4748c2
chore: removed comments on messagelist tests
jianwei1 Jun 25, 2025
6f54e66
feat: added flags for AiEditButton and Create with Ai button
jianwei1 Jun 25, 2025
e39d84b
chore: changed flag name to aiCreateButton
jianwei1 Jun 25, 2025
166eb2f
Merge branch 'main' into 25-03-NC-feat-ai-guided-journey-ui
jianwei1 Jun 26, 2025
10115c4
fix: lint issues
autofix-ci[bot] Jun 26, 2025
91dca21
Merge branch 'main' into 25-03-NC-feat-ai-guided-journey-ui
jianwei1 Jun 26, 2025
5c349d9
Merge branch 'main' into 25-03-NC-feat-ai-guided-journey-ui
jianwei1 Jun 26, 2025
b0ea687
Merge branch 'main' into 25-03-NC-feat-ai-guided-journey-ui
jianwei1 Jun 26, 2025
5624213
fix: added flags provider to tests, removed comments
jianwei1 Jun 26, 2025
c48134b
fix: aichat test
jianwei1 Jun 26, 2025
45fd5fc
chore: removed comments on test files in aichat folder
jianwei1 Jun 26, 2025
551248d
chore: removed unnecessary comments in test files in tools folder
jianwei1 Jun 26, 2025
a5e697e
Merge branch 'main' into 25-03-NC-feat-ai-guided-journey-ui
tataihono Jun 30, 2025
b8bbe3a
fix: aiCreateButton flag set up
jianwei1 Jun 30, 2025
1e876b9
Merge branch 'main' into 25-03-NC-feat-ai-guided-journey-ui
jianwei1 Jun 30, 2025
00a7194
fix: updated the update input schemas
jianwei1 Jun 30, 2025
a6eb44f
chore: update the create input schemas
jianwei1 Jun 30, 2025
e213c32
feat: generateuuid tool
jianwei1 Jul 1, 2025
983230c
fix: make id on step create required, call generateuuid tool
jianwei1 Jul 1, 2025
e6ff608
fix: video create test
jianwei1 Jul 1, 2025
66544c5
fix: image create test
jianwei1 Jul 1, 2025
85e3e2c
Merge branch 'main' into 25-03-NC-feat-ai-guided-journey-ui
jianwei1 Jul 1, 2025
e0779ba
chore: update types on block schemas
jianwei1 Jul 1, 2025
bc8d3f1
chore: added delete tool to refetch
jianwei1 Jul 1, 2025
b23ec20
fix: lint issues
autofix-ci[bot] Jul 1, 2025
2523efc
revert: delete accidentally committed pitch and bug documentation files
jianwei1 Jul 1, 2025
9a58c36
Merge branch 'main' into 25-03-NC-feat-ai-guided-journey-ui
jianwei1 Jul 1, 2025
a80ad92
fix: handle empty and whitespace only inputs on form
jianwei1 Jul 2, 2025
a1aa7ff
Merge branch 'main' into 25-03-NC-feat-ai-guided-journey-ui
jianwei1 Jul 3, 2025
4e5e018
feat: add latest PRD and journey simple types from ENG-2822 branch
jianwei1 Jul 3, 2025
f212edc
feat: journey simple get and update tools
jianwei1 Jul 4, 2025
f049a62
feat: implement journeySimpleGet query and update related types
tataihono Jul 4, 2025
01b5eb0
feat: add journeySimpleUpdate mutation for updating simplified journe…
tataihono Jul 4, 2025
6b88320
fix: ensure card block is found in simplifyJourney function
tataihono Jul 4, 2025
f46ebca
refactor: update step and card block creation in updateSimpleJourney …
tataihono Jul 4, 2025
85e0c38
feat: use journeysimpleget query on frontend tool
jianwei1 Jul 4, 2025
9efad42
refactor: enhance step block creation with grid layout in updateSimpl…
tataihono Jul 4, 2025
869b14b
Merge branch '25-04-JC-feat-ai-simplified-tool-prototype' of https://…
tataihono Jul 4, 2025
71b59c5
feat: use journeysimpleupdate mutation on frontend update tool
jianwei1 Jul 4, 2025
dfa8f18
feat: implement ACL checks in journeySimpleUpdate mutation
tataihono Jul 4, 2025
c228aae
Merge branch '25-04-JC-feat-ai-simplified-tool-prototype' of https://…
tataihono Jul 4, 2025
e4243a2
feat: add alt text support for images in updateSimpleJourney function
tataihono Jul 4, 2025
753abe6
feat: enhance image handling in journey schemas and functions
tataihono Jul 4, 2025
c16a112
fix: update image schema to remove URL validation for src property
tataihono Jul 4, 2025
0b4af46
feat: extend journeySimpleImageSchema to include blurHash property
tataihono Jul 4, 2025
2344211
feat: add blurHash support to image properties in simplifyJourney and…
tataihono Jul 4, 2025
c276c5e
chore: udpate system prompt
jianwei1 Jul 4, 2025
0d8592e
Merge branch '25-04-JC-feat-ai-simplified-tool-prototype' of https://…
jianwei1 Jul 4, 2025
2ce9be3
fix: adjust cache TTL logic in chat route
tataihono Jul 4, 2025
93e9b85
refactor: simplify cache TTL logic in chat route
tataihono Jul 4, 2025
0b70b68
fix: update default width and height for images in updateSimpleJourne…
tataihono Jul 4, 2025
a6b70e7
feat: integrate Firecrawl for web search functionality
tataihono Jul 4, 2025
534e5be
fix: remove unused parameter from agentWebSearch function
tataihono Jul 4, 2025
88272bb
feat: enhance webSearch schema to include image properties
tataihono Jul 4, 2025
daa4575
feat: enhance webSearch schema and improve extraction logic
tataihono Jul 4, 2025
373670a
feat: update agentWebSearch to improve search and extraction logic
tataihono Jul 4, 2025
692ffeb
chore: update package-lock.json and next.config.js
tataihono Jul 4, 2025
d2d1f15
refactor: streamline web search extraction logic
tataihono Jul 4, 2025
c43847e
feat: extend webSearch schema to include color palette
tataihono Jul 4, 2025
aa2d94a
fix: lint issues
autofix-ci[bot] Jul 4, 2025
f1c2418
refactor: update agentWebSearch to enforce query validation
tataihono Jul 4, 2025
8048d44
Merge branch '25-04-JC-feat-ai-simplified-tool-prototype' of https://…
tataihono Jul 4, 2025
b909953
feat: enhance journey schemas to support URL navigation
tataihono Jul 4, 2025
1a418ae
feat: add support for Google Vertex and enhance journey schemas
tataihono Jul 6, 2025
54b9554
fix: update image handling in journey schemas and API
tataihono Jul 7, 2025
eeba030
Merge branch 'main' into 25-04-JC-feat-ai-simplified-tool-prototype
tataihono Jul 7, 2025
0914389
test: get and update tests
jianwei1 Jul 7, 2025
fb64598
test: simplifyJourney tests
jianwei1 Jul 7, 2025
ead9254
test: getsimplejourney tests
jianwei1 Jul 7, 2025
4cff6ec
test: updateSimpleJourney tests
jianwei1 Jul 7, 2025
67035c6
Merge branch 'main' into 25-04-JC-feat-ai-simplified-tool-prototype
jianwei1 Jul 7, 2025
9fc3ba8
test: update AiChat component tests for image handling and form submi…
jianwei1 Jul 7, 2025
c5f791f
Merge branch 'main' into 25-04-JC-feat-ai-simplified-tool-prototype
jianwei1 Jul 7, 2025
da43687
fix: revert package lock back to main and re run npm i
jianwei1 Jul 7, 2025
e3eb1ee
chore: reverted tsconfig to main
jianwei1 Jul 8, 2025
8bfca33
chore: ran codegen
jianwei1 Jul 8, 2025
caf7247
fix: update Google Vertex import and adjust authentication structure …
jianwei1 Jul 8, 2025
99c0cfa
Merge branch 'main' into 25-04-JC-feat-ai-simplified-tool-prototype
jianwei1 Jul 8, 2025
2f667f2
Merge branch 'main' into 25-04-JC-feat-ai-simplified-tool-prototype
jianwei1 Jul 8, 2025
34daf10
Merge branch 'main' into 25-04-JC-feat-ai-simplified-tool-prototype
jianwei1 Jul 8, 2025
1d3c484
feat: add video support to journey card schema
jianwei1 Jul 10, 2025
555198e
feat: enhance journey card handling with YouTube video support
jianwei1 Jul 10, 2025
7ec8c80
feat: prd to implement AI-powered video journey with interactive cards
jianwei1 Jul 10, 2025
83e5708
feat: add YouTube transcript tool integration
jianwei1 Jul 10, 2025
9a46ccd
Merge branch 'main' into 25-04-JC-feat-ai-simplified-tool-prototype
jianwei1 Jul 10, 2025
8f2063d
fix: lint issues
autofix-ci[bot] Jul 10, 2025
299b103
Merge branch 'main' into 25-04-JC-feat-ai-simplified-tool-prototype
jianwei1 Jul 11, 2025
65487db
Merge branch 'main' into 25-04-JC-feat-ai-simplified-tool-prototype
jianwei1 Jul 11, 2025
7325935
refactor: remove AI creation functionality from CopyToTeamDialog and …
tataihono Jul 11, 2025
0fad50e
chore: remove deprecated pitch and PRD documents for AI-powered journ…
tataihono Jul 11, 2025
ab4d46b
refactor: remove AI-related flags from TemplateDetailsPage
tataihono Jul 11, 2025
33b0d27
refactor: remove AI-related page and localization strings
tataihono Jul 11, 2025
34d1d2d
refactor: simplify layout in JourneyFlow component
tataihono Jul 11, 2025
8b6a25f
fix: lint issues
autofix-ci[bot] Jul 11, 2025
931c49a
feat: add video block support to journeySimpleTypes and simplifyJourn…
tataihono Jul 11, 2025
971ee92
feat: add video block support to updateSimpleJourney function [ENG-3057]
tataihono Jul 11, 2025
a4a755c
feat: enhance updateSimpleJourney with YouTube video handling
tataihono Jul 11, 2025
8a416a1
test: add comprehensive video schema tests to journeySimpleTypes.spec…
tataihono Jul 11, 2025
ca0b7e4
test: add comprehensive video block tests to simplifyJourney.spec.ts …
tataihono Jul 11, 2025
5473152
test: add comprehensive video block tests to updateSimpleJourney.spec…
tataihono Jul 11, 2025
00966a8
Merge branch 'main' into tataihono/eng-3057-add-video-block-support-t…
tataihono Jul 11, 2025
0c1e1bb
chore: update dependencies and add new AI tools
jianwei1 Jul 11, 2025
4320939
chore: remove video logic from backend
jianwei1 Jul 11, 2025
4a48b2d
chore: remove getTranscript youtube tool
jianwei1 Jul 11, 2025
9765da2
fix: update youtubeAnalyzerTool2 structure for consistency
jianwei1 Jul 11, 2025
cdd608d
fix: get transcript
jianwei1 Jul 11, 2025
e56f8e9
chore: added try catch, experiemented with new system prompt
jianwei1 Jul 11, 2025
ccfd606
chore: commented out tool
jianwei1 Jul 11, 2025
cc26d01
Merge branch 'main' into 25-04-JC-feat-ai-simplified-tool-prototype
tataihono Jul 15, 2025
c823e38
chore: uncommented tool
jianwei1 Jul 15, 2025
839a241
Update apis/api-journeys-modern/src/schema/journey/simple/updateSimpl…
tataihono Jul 15, 2025
b844235
refactor: rename journeyUpdate and journeyCreate tool calls to journe…
jianwei1 Jul 16, 2025
84160be
feat: implement Cloudflare image upload functionality in updateSimple…
jianwei1 Jul 20, 2025
1a279da
Merge branch 'main' into 25-04-JC-feat-ai-simplified-tool-prototype
jianwei1 Jul 20, 2025
2f35d47
refactor: removed files and renamed tool
jianwei1 Jul 21, 2025
f416540
Merge branch '25-04-JC-feat-ai-simplified-tool-prototype' into 25-04-…
jianwei1 Jul 21, 2025
2293143
feat: added gettranscript tool
jianwei1 Jul 21, 2025
c0e50d7
feat: implement Cloudflare image upload functionality in updateSimple…
jianwei1 Jul 20, 2025
408250a
fix: update default userId in Cloudflare image schema to 'system-ai'
jianwei1 Jul 21, 2025
8d351fd
test: mock generateBlurhashAndMetadataFromUrl in updateSimpleJourney …
jianwei1 Jul 21, 2025
e03e2f5
test: update image dimensions in updateSimpleJourney tests
jianwei1 Jul 21, 2025
9a3d64f
Merge branch '25-05-JC-feat-upload-ai-images' into edmondshen/nes-562…
edmonday Jul 23, 2025
d792b03
fix: process images outside of transaction
edmonday Jul 25, 2025
0479ef1
Merge branch 'main' into feature/25-05-ES-ai-journey-creation
edmonday Jul 25, 2025
15303d5
Merge branch 'main' into edmondshen/nes-562-background-images-work-co…
edmonday Jul 25, 2025
b94f99c
Merge branch 'edmondshen/nes-562-background-images-work-consistently'…
edmonday Jul 25, 2025
c45d8f5
fix: lint issues
autofix-ci[bot] Jul 25, 2025
7f242ab
feat: add video block to schema
edmonday Aug 4, 2025
c05dd51
feat: add video block to update
edmonday Aug 4, 2025
c4da1f1
Merge branch 'main' into feature/25-05-ES-ai-journey-creation
edmonday Aug 5, 2025
562c40c
chore: remove comment
edmonday Aug 5, 2025
fe680c5
chore: remove double up
edmonday Aug 5, 2025
1dc7793
Merge branch 'feature/25-05-ES-ai-journey-creation' into edmondshen/n…
edmonday Aug 5, 2025
def20f2
Merge branch 'main' into feature/25-05-ES-ai-journey-creation
edmonday Aug 5, 2025
bf0b320
Merge branch 'feature/25-05-ES-ai-journey-creation' into edmondshen/n…
edmonday Aug 5, 2025
232b6ad
Merge branch 'tataihono/eng-3057-add-video-block-support-to-journeysi…
edmonday Aug 6, 2025
67432e9
fix: update internal videos
edmonday Aug 6, 2025
0888a6b
Merge branch '25-04-JC-feat-ai-simplified-youtube' into edmondshen/ne…
edmonday Aug 6, 2025
c545b12
fix: restore langfuse env
edmonday Aug 6, 2025
f95731c
feat: add internal video search tool
jaco-brink Aug 6, 2025
2c36d7c
feat: add search status
jaco-brink Aug 7, 2025
ebdf56b
fix: add missing test
jaco-brink Aug 7, 2025
d0d0270
fix: lint issues
autofix-ci[bot] Aug 7, 2025
7f12745
feat: add request orchestrator
edmonday Aug 8, 2025
6275c1b
feat: increase default results
jaco-brink Aug 10, 2025
ef9ee74
feat: add videoSubtitle and language tools
jaco-brink Aug 10, 2025
49e2b02
fix: add image from video meta blurhash fix
jaco-brink Aug 10, 2025
88c8b75
feat: upgrade gemini
jaco-brink Aug 10, 2025
229e9fe
fix: return error intent
edmonday Aug 11, 2025
367267c
chore: merge in latest
jaco-brink Aug 11, 2025
eb75557
Merge branch 'edmondshen/nes-643-orchestration-architecture' into fea…
edmonday Aug 11, 2025
126e84f
fix: update prompt path
edmonday Aug 11, 2025
c58cc6d
feat: add prompt for youtube analysis
edmonday Aug 11, 2025
a849149
Merge branch 'edmondshen/nes-628-use-youtube-tools-to-analyze-video' …
edmonday Aug 11, 2025
168b0f7
feat: add visual progress youtube analyzer
jaco-brink Aug 11, 2025
23a53d3
fix: remove orchestrator
edmonday Aug 11, 2025
6cf8519
Merge branch 'main' into feature/25-05-ES-ai-journey-creation
edmonday Aug 13, 2025
482f510
chore: npm install
edmonday Aug 13, 2025
2b02702
fix: remove double up from merge conflict
edmonday Aug 13, 2025
8c2d3c6
fix: remove double up
edmonday Aug 13, 2025
1d6a381
fix: update youtube analyzer prompt
edmonday Aug 13, 2025
2aa4f5b
fix: revert langfuse env
edmonday Aug 15, 2025
3418c1e
Merge branch 'main' into feature/25-05-ES-ai-journey-creation
edmonday Aug 15, 2025
0095a1f
merge: integrate main into ai-journey-creation-revival
jaco-brink Feb 24, 2026
4478809
feat: add gql code gen files
jaco-brink Feb 24, 2026
cb397e5
feat: new pnpm lock
jaco-brink Feb 24, 2026
33db599
docs: add AI Journey Creation Revival plan and issue resolution report
jaco-brink Feb 24, 2026
fc8df4c
fix: add missing langfuse and @ai-sdk/react dependencies for AI proto…
jaco-brink Feb 24, 2026
9d1364f
chore(journeys-admin): apply Next.js suggested tsconfig and type refe…
jaco-brink Feb 24, 2026
1fc7bb0
fix: guard Form isInputEmpty for undefined input (AI SDK v5); update …
jaco-brink Feb 24, 2026
f69486e
fix: migrate AiChat to AI SDK v5 (useChat API, transport, local input…
jaco-brink Feb 24, 2026
a148d9a
fix: use toUIMessageStreamResponse in chat route (AI SDK v5); defensi…
jaco-brink Feb 24, 2026
32af23f
docs: update PLAN current status – Phase 1 complete, early Step 2 obs…
jaco-brink Feb 24, 2026
685c286
fix(journeys-admin): ESLint, route exports, AI SDK compat, types; doc…
jaco-brink Feb 25, 2026
15e196d
Merge branch 'main' into feature/26-02-JB-ai-journey-creation-revival
edmonday Feb 26, 2026
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
308 changes: 308 additions & 0 deletions PLAN.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,44 @@ export function simplifyJourney(
)

// --- VIDEO BLOCK HANDLING ---
const videoBlock = childBlocks.find(
const youtubeBlock = childBlocks.find(
(block) => block.typename === 'VideoBlock' && block.source === 'youTube'
)
if (youtubeBlock) {
const card: JourneySimpleCard = {
id: `card-${index + 1}`,
x: stepBlock.x ?? 0,
y: stepBlock.y ?? 0,
video: {
src: `https://youtube.com/watch?v=${youtubeBlock.videoId}`,
startAt: youtubeBlock.startAt ?? undefined,
endAt: youtubeBlock.endAt ?? undefined,
source: 'youTube'
}
}
if (stepBlock.nextBlockId) {
const nextStepBlockIndex = stepBlocks.findIndex(
(s) => s.id === stepBlock.nextBlockId
)
if (nextStepBlockIndex >= 0) {
card.defaultNextCard = `card-${nextStepBlockIndex + 1}`
}
}
return card
}
const videoBlock = childBlocks.find(
(block) => block.typename === 'VideoBlock' && block.source === 'internal'
)
if (videoBlock) {
const card: JourneySimpleCard = {
id: `card-${index + 1}`,
x: stepBlock.x ?? 0,
y: stepBlock.y ?? 0,
video: {
url: `https://youtube.com/watch?v=${videoBlock.videoId}`,
src: videoBlock.src ?? '',
startAt: videoBlock.startAt ?? undefined,
endAt: videoBlock.endAt ?? undefined
endAt: videoBlock.endAt ?? undefined,
source: 'internal'
}
}
if (stepBlock.nextBlockId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,19 +228,26 @@ export async function updateSimpleJourney(
card.defaultNextCard != null
? stepBlocks.find((s) => s.simpleCardId === card.defaultNextCard)
: undefined
const videoId = extractYouTubeVideoId(card.video.url)
const videoId =
card.video.source === 'youTube'
? extractYouTubeVideoId(card.video.src ?? '')
: card.video.src
if (videoId == null) {
throw new Error('Invalid YouTube video URL')
}
const videoDuration = await getYouTubeVideoDuration(videoId)
const videoDuration =
card.video.source === 'youTube'
? await getYouTubeVideoDuration(videoId)
: undefined
await tx.block.create({
data: {
journeyId,
typename: 'VideoBlock',
parentBlockId: cardBlockId,
parentOrder: parentOrder++,
videoId,
source: 'youTube',
videoVariantLanguageId: '529',
source: card.video.source,
autoplay: true,
startAt: card.video.startAt ?? 0,
endAt: card.video.endAt ?? videoDuration,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions apps/journeys-admin/__generated__/JourneySimpleGet.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions apps/journeys-admin/__generated__/JourneySimpleUpdate.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions apps/journeys-admin/__generated__/LoadLanguages.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions apps/journeys-admin/__generated__/LoadVideoSubtitleContent.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

119 changes: 119 additions & 0 deletions apps/journeys-admin/app/api/chat/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
import { google } from '@ai-sdk/google'
import { NoSuchToolError, streamText } from 'ai'
import { jwtDecode } from 'jwt-decode'
import { NextRequest } from 'next/server'
import { v4 as uuidv4 } from 'uuid'
import { z } from 'zod'

import { messagesSchema } from '../../../src/libs/ai/chatRouteUtils'
import {
langfuse,
langfuseEnvironment,
langfuseExporter
} from '../../../src/libs/ai/langfuse/server'
import { tools } from '../../../src/libs/ai/tools'
import { createApolloClient } from '../../../src/libs/apolloClient'

// Allow streaming responses up to 30 seconds
export const maxDuration = 30

export async function POST(req: NextRequest) {
const body = await req.json().catch(() => ({}))
if (body.messages == null) {
return Response.json(
{
error: 'Missing or invalid request body: messages array is required',
detail: 'The chat client must send { messages: [{ role, content }], ... }. Received keys: ' +
Object.keys(body).join(', ')
},
{ status: 400 }
)
}
const schema = z.object({
messages: messagesSchema,
journeyId: z.string().optional(),
selectedStepId: z.string().optional(),
selectedBlockId: z.string().optional(),
sessionId: z.string().optional()
})
const parseResult = schema.safeParse(body)
if (!parseResult.success) {
return Response.json(
{ error: 'Invalid request body', detail: parseResult.error.flatten() },
{ status: 400 }
)
}
const { messages, journeyId, selectedStepId, selectedBlockId, sessionId } =
parseResult.data

const token = req.headers.get('Authorization')

if (token == null)
return Response.json({ error: 'Missing token' }, { status: 400 })
const decoded = z
.object({
user_id: z.string(),
auth_time: z.number()
})
.parse(jwtDecode(token.split(' ')[1]))

const client = createApolloClient(token.split(' ')[1])

const langfuseTraceId = uuidv4()

const systemPrompt = await langfuse.getPrompt(
'system/api/chat/route',
undefined,
{
label: langfuseEnvironment,
cacheTtlSeconds: ['development', 'preview'].includes(langfuseEnvironment)
? 0
: 60
}
)

const result = streamText({
model: google('gemini-2.5-flash'),
messages: messages.filter((message) => message.role !== 'system'),
system: systemPrompt.compile({
journeyId: journeyId ?? 'none',
selectedStepId: selectedStepId ?? 'none',
selectedBlockId: selectedBlockId ?? 'none'
}),
tools: tools(client, { langfuseTraceId }),
experimental_telemetry: {
isEnabled: true,
functionId: 'ai-chat-stream',
metadata: {
langfuseTraceId,
langfusePrompt: systemPrompt.toJSON(),
userId: decoded.user_id,
sessionId: sessionId ?? `${decoded.user_id}-${decoded.auth_time}`
}
},
// Repair disabled: AI SDK no longer exposes tool.parameters (Zod) on tools;
// only inputSchema (JSONSchema7) is available, and generateObject expects Zod.
experimental_repairToolCall: async ({ error }) => {
if (NoSuchToolError.isInstance(error)) return null
return null // TODO: re-enable when SDK supports repair with current tool types
},
onFinish: async (result) => {
await langfuseExporter.forceFlush()
const trace = langfuse.trace({
id: langfuseTraceId
})
await trace.update({
output: result.text,
tags: ['output-added']
})
}
})

return result.toUIMessageStreamResponse({
headers: {
'Transfer-Encoding': 'chunked',
Connection: 'keep-alive',
'x-trace-id': langfuseTraceId
}
})
}
10 changes: 10 additions & 0 deletions apps/journeys-admin/instrumentation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { registerOTel } from '@vercel/otel'

import { langfuseExporter } from './src/libs/ai/langfuse/server'

export function register() {
registerOTel({
serviceName: 'journeys-admin',
traceExporter: langfuseExporter
})
}
3 changes: 2 additions & 1 deletion apps/journeys-admin/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference types="next/navigation-types/compat/navigation" />
/// <reference path="./.next/types/routes.d.ts" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
12 changes: 12 additions & 0 deletions apps/journeys-admin/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ const nextConfig = {
i18n,
images: {
remotePatterns: [
{
protocol: 'https',
hostname: '**'
},
{ protocol: 'http', hostname: 'localhost' },
{ protocol: 'https', hostname: 'unsplash.com' },
{ protocol: 'https', hostname: 'images.unsplash.com' },
Expand Down Expand Up @@ -107,7 +111,15 @@ const nextConfig = {
]
},
experimental: {
instrumentationHook: true,
reactCompiler: true
},
webpack: (config) => {
config.module.rules.push({
test: /\.md$/,
use: 'raw-loader'
})
return config
}
}
const plugins = [withNx]
Expand Down
Loading
Loading