=== tlloancy Secrétaire ===
Contributors: tlloancy
Donate link: https://donorbox.org/wordpress-plugins
Tags: paperwork, qualiopi, admin, ai, abilities
Requires at least: 6.4
Tested up to: 7.1
Stable tag: 1.0.4
Requires PHP: 7.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

A home desk for paperwork. The connector writes; you file. Past is the dated archive.

== Description ==

**tlloancy Secrétaire** is a desk inside wp-admin: the **WordPress AI connector** writes a paper, you **file** it, and **Past** keeps the pile — search, print, mail, import. That is the difference with a normal chat: the draft is not lost in a thread. No key is stored in this plugin. If no connector is ready, the paper **templates** still work.

**General** (the default address) is any document you name: CV, cover letter, minutes, invoice, a letter. A **country** adds that place’s drawers (Qualiopi in France, ONSS in Belgium…). Nothing is filed with an authority. You send the paper.

### The house
- **Address** (Settings) is General, or a country. General is paperwork with no administration. A country is not copied from France: Belgium has ONSS, Germany the Rundfunkbeitrag, Québec the SAAQ.
- **Drawers** hold folders. **Papers** (General) is one tile: name the folder, write, file. Country drawers are that address’s pains (Qualiopi only in France; Hacienda only in Spain).
- **Folders** historize who / what / when. A ticket folder can open a linked Justice folder.
- **Import** on Past is the backup: HTML, text, PDF, or a ZIP of papers you already have.

### Training / Qualiopi
Quote, needs analysis, attendance sheet, certificate, quiz, dated **watch proof**, accessibility mentions. You file the RNQ (or another notice) on the drawer; nothing is fetched from the public web.

### WordPress AI
Uses `wp_supports_ai()` / `wp_ai_client_prompt()`. Choose the connector under **Settings → Connectors**. Abilities: `secretaire/list-drawers`, `secretaire/list-folders`, `secretaire/draft-paper`.

Guides: `docs/USER-GUIDE.md` (EN) and `docs/MODE-DEMPLOI.md` (FR).

== External services ==

When a **WordPress AI connector** is active, prompts, folder notes, and any working papers you filed on a drawer are sent to **that** provider (the one you configured). This plugin does not pick a vendor. It does not request third-party websites.

== Installation ==

1. Upload the `tlloancy-secretaire` folder to `/wp-content/plugins/`.
2. Activate **tlloancy Secrétaire**.
3. Open the **tlloancy Secrétaire** menu. On **General**, name a paper and file it — or pick a country for that address’s drawers.
4. Optional: **Settings → Connectors** — install the AI plugin if needed, add a connector, then use **Ask the connector** on a folder.

== Frequently Asked Questions ==

= How is this different from chatting with the AI connector? =
The connector writes. This desk **files** the draft in a dated folder. **Past** is the archive: search, print, mail, import. A chat does not keep that pile.

= What is General? =
No country. One drawer for any paper you name (CV, letter, minutes…). **Import** files you already have. Pick a country in Settings when you need that place’s offices.

= Do I need an AI connector? =
No. Every paper has a template. The connector fills it from your notes.

= Where do I put an API key? =
Not here. **Settings → Connectors**, on the WordPress AI plugin.

= Why did it call a connector I did not check? =
It must not. **Connector Approvals** is the list for this plugin. Only checked cards are used. Unchecked cards (a dead Compatible Endpoint, Ollama, OpenRouter…) are skipped.

= The connector replies with nothing, or takes a minute =
That is a **connector** setting, not tlloancy Secrétaire. Open **Settings → Connectors**, edit the OpenAI-compatible (or Ollama) card, and turn on **Disable thinking**. Context length lives there too. If the draft is still empty, file the **template**.

= Ask finished but File stays grey =
The draft is on the paper; File and Ask must unlock. Update to 1.0.3 if the quill stays on “writing”.

= Can the connector style the paper? =
Yes. The draft may include a `<style>` block for that document (letterhead, table, totals). Scripts, remote fonts, `@import`, and external stylesheets are stripped. Plugin CSS stays in files (`paper.css`) and is printed through WordPress. The brief is still facts; you may mention a look (invoice, letter) if you want.

= Is this legal or tax advice? =
No. Drafts to edit. Deadlines and official texts are yours to check.

= Will other countries appear? =
**General** ships first. Belgium, Switzerland, Germany, Spain, Italy, the United Kingdom, the United States, and Canada (Québec) ship with France. Pick the address under Settings.

= How do I write a quote? =
Open **Training**. Click **Quote**. You land on the folder. **New folder** is only for another session.

= Where was I? =
**Desk** shows the drawer vignettes. The last drawer stays marked. Folders remember the last paper. Opening a paper and going back to the desk stays on the same page.

= Can I import papers or a whole folder? =
Yes. **Past → Import**. HTML, text, PDF, or a **ZIP**. On the desk, a ZIP becomes a folder; loose files become a new folder. Inside a folder, files (and ZIP contents) become papers.

= How do I know what a folder still needs? =
Open the folder. **Past** lists each expected paper as **Filed** or **Missing**. The desk shows **Complete** or the missing names on each folder. File a **rule** on the drawer (latest RNQ for Training, a BOFIP page for Taxes…) so the list follows your text. Without a file, the built-in papers are used.

= How do I send or destroy a filed paper? =
In **Past**: **Send** on a paper mails that sheet (body + PDF). **Send** on a folder (envelope mark) mails the whole chemise — the list in the body, one PDF per filed paper. **Shred** (shredder mark) deletes that one paper or folder. **Fireplace** (hearth mark) burns the whole pile — every paper in the folder, or every folder in the drawer. A hint under each mark says which. Permanent, no trash.

= Is the admin in French? =
The source language is English. Every UI string is gettext (`tlloancy-secretaire`). A complete **French** catalog ships in `languages/`. Set the site language to Français (`fr_FR`). If a leftover `wp-content/languages/plugins/tlloancy-secretaire-fr_FR.*` is mixed English/French, delete those files and reload.

== Changelog ==

= 1.0.4 =
* Ask may lay out the paper with a sanitized `<style>` block (no scripts, no remote CSS). Desk and print keep a paper stylesheet in plugin files.

= 1.0.3 =
* After Ask finishes, the quill stops and File / Ask work again. A late job poll no longer freezes the form on “writing”.

= 1.0.2 =
* Ask the connector only on cards **checked** for this plugin in Connector Approvals. Unchecked providers are never called.
* Fix: Ask actually calls Google. A `method_exists` check skipped the AI client’s magic methods and always fell back to the template.
* Admin menu icon is a 20px silhouette so it stays sharp on the dark menu.

= 1.0.1 =
* Fix: desk CSS and JS load on the admin screens (menu slug is still `secretaire`). Icons stay 24px.
* General address: any paper you name (CV, letter, minutes…). Import stays the backup.
* Display name **tlloancy Secrétaire**. Connector readiness uses the public AI API only.

= 1.0.0 =
* Desk: France drawers, folders, print, connector drafts, abilities.
* Country packs: BE, CH, DE, ES, IT, GB, US, CA (Québec) — each with its own offices and papers.
* English source strings, French translation (`languages/tlloancy-secretaire-fr_FR`).

== Upgrade Notice ==

= 1.0.4 =
Drafts can include document CSS. Scripts and remote stylesheets stay blocked.

= 1.0.3 =
The quill no longer stays busy after the draft is on the paper.

= 1.0.2 =
Drafts use only the connectors you checked for this plugin.

= 1.0.1 =
Desk styles load again. General papers. Name is tlloancy Secrétaire.
