=== Nomad Pipeline Audio to Draft ===
Contributors: veleno
Tags: ai, audio, content, editor, gutenberg
Requires at least: 7.0
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 0.1.6
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Generate a structured post draft from an audio file directly in the WordPress block editor.

== Description ==

Nomad Pipeline Audio to Draft helps editors turn audio notes into post drafts.

Draft generation requires at least one configured WordPress AI connector. If no connector is available, the plugin can stay active but generation requests will return provider errors.

Free version includes:

* Audio selection from Media Library
* Supported file types: MP3, OGG, WAV, M4A, AAC, FLAC
* Draft generation from audio (AI pipeline)
* Language, tone, and target length defaults
* Proper noun hints
* Insert mode: append or replace
* Auto-apply generated title
* Editor flow updates the current post
* WordPress 7.1 lifecycle support with anti-abuse rate limiting for ability runs
* Ability invocation telemetry hook support (safe metadata only)
* Usage counters in editor sidebar (daily/monthly calls and token totals)
* Usage analytics section in plugin settings (daily/monthly calls and token totals)
* Clear total-token labels (`token`, `estimated tokens`, `unknown tokens`)

How it works:

1. Open a post in the block editor.
2. Open the Nomad Pipeline Audio to Draft sidebar.
3. Select an audio file from Media Library.
4. Click "Generate draft from audio".

The plugin generates content blocks and inserts them into the current post.

External services and data handling:

* To generate a draft, the plugin sends the selected audio payload and selected editorial options to the configured WordPress AI connector.
* Data processing, retention, and model behavior are managed by the active connector/provider, not by this plugin.
* This plugin does not add its own analytics tracker or advertising pixel.
* Site owners should review the privacy policy and terms of the selected AI connector/provider before production use.

== Installation ==

1. Upload the plugin folder to /wp-content/plugins/ or install from Plugins.
2. Activate "Nomad Pipeline Audio to Draft".
3. Go to Settings > Nomad Pipeline Audio to Draft and save your defaults.
4. Open any post in the block editor and use the Nomad Pipeline Audio to Draft sidebar.

== Frequently Asked Questions ==

= Does it create a new post? =

In the editor flow, it updates the current post.
If the ability is invoked externally (outside the editor flow), the plugin creates a new post draft.


= Why do I see AI provider errors? =

Check that WordPress AI connectors are correctly configured and available.


= Is the plugin compatible with WordPress 7.1? =

Yes. Version 0.1.6 confirms WordPress 7.1 compatibility for the free editor workflow.

== Screenshots ==

1. Settings page with Free editorial defaults (language, tone, target length, insertion mode).
2. Gutenberg sidebar with selected audio and Generate draft action.
3. Current post updated with generated Gutenberg blocks (heading, paragraphs, list).
4. Media Library modal used to pick the audio file before generation.
5. Error message shown in the sidebar when no AI connector is configured/available.

== Changelog ==

= 0.1.6 =
* Documentation refresh for the WordPress 7.1 release.
* Added explicit WordPress 7.1 compatibility FAQ entry.
* Aligned local README and FAQ docs with the current compatibility statement.

= 0.1.5 =
* Removed prompt/completion token columns from usage analytics.
* Removed question-mark token notes from editor and settings.
* Token totals now use plain labels: `token`, `estimated tokens`, or `unknown tokens`.

= 0.1.4 =
* Removed connector-level usage table from settings to avoid displaying uncertain connector attribution.
* Replaced passive token marker with clickable info icon (?) showing token calculation details.
* Prompt/completion tokens now display as not available when provider split metrics are unavailable.

= 0.1.3 =
* Free: added current-month usage breakdown by connector in plugin settings.
* Free: added tooltip marker (`?`) on token totals when source is `estimated` or `unknown`.
* Added connector metadata in stored usage for completed runs.
* Added per-window token source classification (`today` and `current month`).
* Added filter to tune fallback token estimate: `npatd_estimated_tokens_per_model_call`.

= 0.1.2 =
* Free: added usage counters in the editor sidebar (today/month calls and tokens).
* Free: added usage analytics section in plugin settings with today/month totals.
* Added usage stats REST endpoint: `/wp-json/nomad-pipeline-audio-to-draft/v1/usage-stats`.
* Added token source labeling (`actual`, `estimated`, `unknown`) based on connector usage availability.
* Hardened audio input/path validation to prevent `file_exists()` warnings from malformed attachment path values.

= 0.1.1 =
* WordPress 7.1 compatibility update (`Tested up to: 7.1`).
* Free: added anti-abuse protection using `wp_pre_execute_ability` before ability execution.
* Free: added invocation telemetry using `wp_ability_invoked` for run accounting and monitoring.
* Privacy-by-default telemetry: only safe metadata is recorded (no raw input payload logging).
* Added configurable rate-limit thresholds via filters:
	* `npatd_rate_limit_max_requests`
	* `npatd_rate_limit_window_seconds`
* Added explicit HTTP `429` response for burst traffic above the configured limit.

= 0.1.0 =
* Initial public Free release.
* Audio-to-draft pipeline with Gutenberg integration.

== Upgrade Notice ==

= 0.1.6 =
Documentation and FAQ update confirming WordPress 7.1 compatibility.

= 0.1.5 =
Simplifies token analytics display to plain total-token labels and removes prompt/completion columns.

= 0.1.4 =
Clarifies token analytics with clickable calculation info and removes uncertain connector-level breakdown.

= 0.1.3 =
Adds monthly usage breakdown by connector and a tooltip marker for non-actual token totals.

= 0.1.2 =
Adds usage analytics (sidebar + settings) and hardens audio path validation.

= 0.1.1 =
WordPress 7.1 compatibility update with Free anti-abuse protections and safe invocation telemetry.

= 0.1.0 =
Initial release.
