=== Agent Chat & Voice ===
Contributors: (SaaS operator)
Requires at least: 6.0
Tested up to: 6.7
Stable tag: 1.1.0
License: Proprietary - for use with your Chat + Voice SaaS console

Site-wide AI chat + voice widget for WordPress, powered by your standalone
Chat + Voice SaaS console. All brain settings (knowledgebase, questions,
banned phrases, corrections) live in the SaaS console; this plugin handles
install/display on WordPress and syncing this site's content into the agent
knowledgebase.

== Features ==

* Settings page (Settings > Agent Chat & Voice): SaaS base URL, connect key,
  agent public key, enable/disable the site-wide widget, excluded page slugs,
  bubble position (left or right), and weekly auto-sync on/off.
* Test connection: calls POST {base}/api/wp/bind with the connect key and
  reports the real result - success (bound, or already bound), a rejected
  connect key (HTTP 403), or any other failure - never a fake success.
* Content sync: "Bind site + Sync content" first binds the site with
  POST {base}/api/wp/bind, then collects published pages and posts and sends
  them with POST {base}/api/wp/sync. The last-sync time, status, synced item
  count, and any error are stored and shown on the settings page.
* WooCommerce sync: when WooCommerce is active, published products are also
  synced, including each product's price and short description.
* Weekly auto-sync: when enabled, WordPress cron runs the same bind + sync
  once a week. The schedule is created on activation (if enabled) and when
  the setting is turned on, and is cleared on deactivation.
* Site-wide widget: loads the SaaS widget script in the footer on every page
  except excluded slugs, passing the agent public key and the configured
  bubble position (data attributes and side style). The connect key is a
  secret and is never printed on the front end - only the public key is.
* Inline chat shortcode: [agent_chat] renders a real, working inline chat
  box (message log, input, Send button, and a Talk voice button). It talks
  to the same SaaS endpoints as the site-wide widget
  (POST /api/widget/chat and POST /api/widget/voice-session) using the agent
  public key, and shows a graceful fallback message when voice is
  unavailable or the browser does not support it.
* Gutenberg block: "Agent Chat" block (Widgets category) with a clear
  placeholder in the editor; it is a dynamic block - the front end is
  rendered by PHP through the [agent_chat] shortcode.

== Installation ==

1. In your SaaS console, open Install > WordPress and copy the connect key
   and the agent public key.
2. Upload and activate this plugin in WordPress.
3. Go to Settings > Agent Chat & Voice, paste the SaaS base URL, connect
   key, and agent public key, then Save settings.
4. Click "Test connection" to verify the connect key, then
   "Bind site + Sync content" to send this site's content to the agent
   knowledgebase.

== Uninstall ==

Uninstalling the plugin deletes all of its options (including the connect
key and the last-sync record) and clears its weekly cron schedule. Content
already synced into the SaaS knowledgebase is managed from the SaaS console.
