The canonical place to build the snapshot shape consumed by the agent
runtime (buildAppContextSection in base-agent.ts reads exactly this
shape). Any host embedding <mj-conversation-chat-area> outside the
MJ Explorer floating chat overlay should produce its [appContext]
value via this helper so the agent's prompt sees consistent data.
Today MJExplorer's app shell builds the snapshot inline; this helper
centralizes the construction so:
Embedded chats in custom (non-Explorer) apps build a correct snapshot
without copy-pasting the shape from Explorer.
Future schema changes to AppContextSnapshot happen in one place
instead of every embedder.
Defaults applied:
App.Description → ''
ActiveNavItem → { Name: '(none)' } if omitted
OtherNavItems → []
User.Name → ''
User.Roles → []
AdditionalContext → omitted from the result when undefined
Assemble an
AppContextSnapshotfrom loose inputs.The canonical place to build the snapshot shape consumed by the agent runtime (
buildAppContextSectioninbase-agent.tsreads exactly this shape). Any host embedding<mj-conversation-chat-area>outside the MJ Explorer floating chat overlay should produce its[appContext]value via this helper so the agent's prompt sees consistent data.Today MJExplorer's app shell builds the snapshot inline; this helper centralizes the construction so:
AppContextSnapshothappen in one place instead of every embedder.Defaults applied:
App.Description→ ''ActiveNavItem→{ Name: '(none)' }if omittedOtherNavItems→ []User.Name→ ''User.Roles→ []AdditionalContext→ omitted from the result when undefined