Skip to content

[WIP] feat: Add embed widget support to Ozwell AI Assistant - #81

Open
aditya-damerla128 wants to merge 61 commits into
mieweb:mainfrom
aditya-damerla128:script-tag-client-feature
Open

[WIP] feat: Add embed widget support to Ozwell AI Assistant#81
aditya-damerla128 wants to merge 61 commits into
mieweb:mainfrom
aditya-damerla128:script-tag-client-feature

Conversation

@aditya-damerla128

Copy link
Copy Markdown

Summary

Adds production embed widget support to the Ozwell AI Assistant, building on PR #63. Users can now toggle between the native chat interface and an embedded widget loaded from the production server.

What's New (on top of PR #63)

Embed Widget Integration

  • Toggle between "Native Chat" and "Embedded Chat" modes
  • Loads widget from production: https://ozwellai-reference-server.opensource.mieweb.org/embed/*
  • Simple script-tag integration verified and working
  • Automatic iframe cleanup and remounting logic
  • Enhanced error handling and debug logging

Production URLs

  • Switched from localhost to production server URLs
  • EMBED_SCRIPT_URL: Production embed.js
  • EMBED_ENDPOINT: Production chat endpoint
  • EMBED_WIDGET_SRC: Production widget.html

Configuration Fixes

  • Fixed config property: srcwidgetUrl (matches embed script API)
  • Added proper iframe lifecycle management
  • Console logging for debugging embed integration

Changes Since llama-reference-server Branch

Modified Files:

  • client/components/ozwell/OzwellModal.html - Added embed container and toggle UI
  • client/components/ozwell/OzwellModal.js - Embed script loading, iframe management, production URLs
  • README.md - Updated setup instructions

Testing

  • Embed widget loads from production server
  • Toggle between native and embedded modes works
  • Iframe cleanup and remounting verified
  • Script-tag integration tested

Notes

Additional changes in this branch are from resolving merge conflicts with upstream main and creating a new embed client in ozwellai-api.

Introduces OzwellButton and OzwellModal components for AI-powered writing assistance, with context-aware autofill in ticket creation and other inputs. Adds settings page for Ozwell configuration, server methods for session and prompt management, and updates layout and tickets page to support Ozwell features.
Introduces a new 'Paste and Save' button in the Ozwell modal footer when a session URL is present. This feature allows users to copy AI-generated content from the chat, paste it from the clipboard, and save it, with validation to prevent saving console logs or irrelevant content. Includes user instructions and fallback for restricted clipboard access.
Improves the Ozwell modal by providing time tracking-specific prompts, richer context data for AI interactions, and enhanced content monitoring for autofill. TicketsPage now supplies detailed project statistics and activity summaries to support more informative AI-generated content.
Trying to get message content extraction working from Ozwell.
Changed content capture from iframe and postMessage events. Added a catch-all extraction method, more comprehensive DOM selectors, and prioritize captured content for autofill. Refactored closeOzwell logic to use new extraction strategies and fallback messaging.
Merged the copy and save instructions into a single step and removed the Auto Save button from the modal. Updated the save logic to use a direct clipboard check when saving, streamlining the user experience and code.
Replaces iframe-based Ozwell assistant with direct calls to a reference server API for chat and autofill functionality. Updates modal UI, conversation flow, and settings page to support custom server URL and model selection. Adds new server method for reference assistant and improves prompt/context handling throughout.
Rewrote the toggle between modal and side panel layouts for the Ozwell AI Assistant. Adds support for extracting and displaying multiple suggestions from assistant responses, allowing users to select and insert a preferred suggestion. Improves prompt button styling and accessibility, and refactors event handling for layout switching and suggestion selection.
Improves OzwellButton to collect related form field values and passes them to the modal for richer context. Refactors OzwellModal to display and toggle context summary, improves suggestion extraction logic, and updates UI for better usability. Minor layout adjustments in TicketsPage and code cleanup in main.js.
Cleared out the gradient style for one that matches the existing app design scheme
Introduces recent conversation listing and resuming in the modal. Currently restricted to history on a per input box basis. Updates client logic to load, display, and resume previous conversations, and server methods to support saving, listing, and fetching conversation metadata. Enhances user experience by allowing users to continue previous chats and manage conversation context.
Enhances the logic for setting the conversation label by combining the prompt title and a preview of the user's message, with truncation for length. Also fixes indentation and error handling in the content generation function.
Modified the formatConversationTimestamp helper to accept an optional label and updated the template to use it. The tooltip now displays both the formatted timestamp and the conversation label if available.
Updated the create ticket form to use flexbox for input and button alignment, replacing absolute positioning with flex containers for better layout consistency and maintainability.
Introduces a toggle in the Ozwell modal to switch between the native chat interface and a new MCP frame loaded via an iframe. Implements message passing between the modal and the MCP frame for prompt handling, and adds the standalone MCP frame prototype at /ozwell-frame.html.
Introduces a new MCP smoke test script for manual testing of the Ozwell modal frame. Recent chats functionality in OzwellModal is now gated behind a feature flag (ENABLE_RECENT_CHATS), disabling related UI and logic unless enabled. Also updates iframe src to use /ozwell-frame.html.
Added explanatory comments to OzwellModal.js and ozwell-frame.html to clarify that the current MCP bridge implementation is a stub and does not follow the real MCP wire protocol. These notes provide guidance for future integration with the official MCP transport.
Added the 'ozwellai' package (v1.0.0) to dependencies in package.json and package-lock.json to enable new functionality or integration.
- add a tickets page container for the embed iframe
- load the reference server script in dev and mount/configure the widget
- point the iframe at localhost:3000 so it renders the standalone chat client
Replaces the MCP iframe in OzwellModal with a new embedded chat widget, updating related setup and teardown logic. Removes the Ozwell widget from TicketsPage and its initialization code. This change streamlines chat integration and centralizes widget management in OzwellModal.
…dling

Switched Ozwell embed script, endpoint, and widget URLs to use the production reference server. Enhanced logging for embed script loading, error handling, and chat mounting. Improved iframe management to ensure fresh mounts with updated configuration.
Introduces a new 'mcp-server' directory with environment example, documentation, and a Node.js MCP server implementation. The server exposes tools for interacting with TimeHarbor via the MCP protocol, including project listing, ticket creation, and time tracking status, and connects to the Meteor backend using HTTP API calls. Includes setup and testing guides for integration with Claude Desktop.
Introduces a new '/settings' route with authentication check and updates navigation logic to handle settings. Also refines email input pattern handling and fixes missing newlines at end of files.
Provides detailed steps for configuring the optional Ozwell AI writing assistant, including obtaining API credentials, starting the MCP reference server, and enabling Ozwell in the app settings. This helps users set up AI-assisted features if desired.
Deleted the mcp-server directory, including its code, environment example, documentation, and testing guide. Updated README.md to remove references to the MCP server and clarify Ozwell assistant setup instructions.
…s, clean up server methods, and update TicketsPage to remove OzwellButton, switching everything to the chatbot
…real-time form sync feature in ozwell-mcp-tools.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants