diff --git a/catalog.json b/catalog.json index 2f84de6..e49d4ef 100644 --- a/catalog.json +++ b/catalog.json @@ -643,11 +643,11 @@ { "key": "document-studio", "name": "Document studio", - "version": "0.4.0", + "version": "0.5.0", "subpath": "document-studio", "manifest": "document-studio/module.yaml", - "manifest_sha256": "958f6fca731e508d2e6ff3b9a01e322a0ff37b8ba41f3d223515e41452b5b145", - "tree_sha256": "2bd528a9c12afefb88f5b471893418a24c97c3ddf023a8af00e582c174ae637a", + "manifest_sha256": "faa8b5aacf910dc7d8f6c75b229715bdd0b9e25e18a583770c12a07dade7a739", + "tree_sha256": "40fc3753d7aae6d931aace071fbc08cd0081ff620610f6133fbd3e9634d34cc3", "description": { "en": "Document studio: draft business documents from a brief, render them to PDF from templates and the company profile, review, approve and issue them with a number, and keep every revision in Storage.", "fr": "Studio de documents : rédiger des documents professionnels depuis un brief, les rendre en PDF avec des gabarits et la fiche entreprise, les relire, les approuver et les émettre avec un numéro, en gardant chaque révision dans Storage." diff --git a/document-studio/README.md b/document-studio/README.md index ff688f4..930c302 100644 --- a/document-studio/README.md +++ b/document-studio/README.md @@ -1,9 +1,10 @@ # Document studio Reusable Module that turns a brief into a business document (quote, meeting -minutes, chart dashboard): draft, PDF render from a template and the company profile, review, +minutes, chart dashboard) or an e-mail message (support reply, launch newsletter): draft, render from a +template and the company profile (PDF for a document; html, txt and eml for a message), review, approval and issue with a number. Everything lives in Storage; nothing is sent -outside. +outside, a message included. The Module contains no rendering engine. Rendering goes through the MCP tool `artifact_render_v1` (mode `preview` for drafts, `final` for the issue). Code @@ -17,16 +18,16 @@ messages) is French; `fr` is the only locale in V0. |---|---| | `document-studio-plan` | picks the template from a brief, proposes a title, lists the missing data and the questions to ask. Writes nothing | | `document-studio-draft` | fills the template data (model call, then strict validation) and creates the document record with status `draft`. For a quote, amounts and totals are computed here, in integer cents, from the lines: the model only provides quantities and prices | -| `document-studio-render` | renders the current state (PDF and PNG previews) and adds a revision. `data_patch` merges (shallow) corrections into the data, which is revalidated. An issued or cancelled document no longer renders (`document_locked`) | +| `document-studio-render` | renders the current state (PDF and PNG previews; for a message, the three files html, txt and eml, no preview) and adds a revision. `data_patch` merges (shallow) corrections into the data, which is revalidated. An issued or cancelled document no longer renders (`document_locked`) | | `document-studio-finalize` | `draft` to `approved`. Requires a render of the current revision and `confirmation_manuelle` | -| `document-studio-publish` | requires `approved` and `confirmation_manuelle`. Reserves the next number, renders in `final` mode, stores the issued PDF, moves to `issued` | +| `document-studio-publish` | requires `approved` and `confirmation_manuelle`. Reserves the next number, renders in `final` mode, stores the issued PDF (a message: its html, txt and eml files), moves to `issued`. Nothing is sent | | `document-studio-cancel` | moves to `cancelled` with a reason. An issued number is never reused | -| `document-studio-export` | refuses a cancelled document (`document_cancelled`); otherwise copies the issued PDF (or the latest render, flagged as a draft) to a Storage path outside `/document-studio/`, with its SHA-256. Mail and SFTP are out of V0 | +| `document-studio-export` | refuses a cancelled document (`document_cancelled`); otherwise copies the issued PDF (or the latest render, flagged as a draft) to a Storage path outside `/document-studio/`, with its SHA-256. A message exports its `eml` (default), `html` or `txt` through the optional `format`; `format` on a PDF document is `format_not_applicable`. Mail and SFTP are out of V0 | | `document-studio-new-version` | adds a DOCX version of an existing document from a Storage file (`source_path`, `author`): fingerprints it, compares it with the previous version through the MCP tool `office_compare_v1`, stores the redline (tracked changes) and appends the version to the versions manifest. Refuses a stale `base_version` or `base_manifest_sha256` (`base_version_conflict`) and a cancelled document. Same request again: nothing is written (`replayed`) | | `document-studio-mark-authoritative` | makes one version the authoritative one (`confirmation_manuelle` required, refused before any read otherwise); the previously authoritative version becomes `superseded`. No version file is modified | | `document-studio-profile-save` | validates and stores the company profile and brand (`/document-studio/profile.json`), with manual confirmation | | `document-studio-list` | lists the documents (identifier, title, status, number, revision, latest hash) | -| `document-studio-review-read` | full record of a document and previews of its latest render, for the MiniApp | +| `document-studio-review-read` | full record of a document and previews of its latest render, for the MiniApp. For a message: `text` (the plain text, read back and checked against its SHA-256) and `files` (path, SHA-256 and size of html, txt and eml), never the HTML | | `document-studio-template-read` | lists the templates, or the manifest and data schemas of one template | | `document-share` | publishes the reference of an **issued** document as a record of the native application data broker (`recipe--application_data_v1`, namespace `cib-documents`, key `doc_id`), then grants or removes `read` for one member. Requires `confirmation_manuelle`. The PDF stays in Storage | | `document-read` | reads one shared reference through the broker (with the caller's permissions), or lists the references the caller may read when `doc_id` is empty or absent (`"doc_id": ""` is valid, so the form can be submitted blank) | @@ -34,9 +35,10 @@ messages) is French; `fr` is the only locale in V0. The `document-studio-review` MiniApp has no input component of its own (the MiniApp vocabulary has none): the document identifier (`doc_id`) is typed in the form "Relire un document" of `document-studio-review-read`, which loads -the document. The MiniApp then shows status, revision, number, pages and the +the document. The MiniApp then shows status, revision, number, pages, the title, +the plain text of a message (empty for a PDF document) and the table of renders (revision, mode, hash, path), refreshes it, and triggers a -new render. Approval and issue go through the +new render. It displays no HTML. Approval and issue go through the Workflow forms, with the manual confirmation. ## Sharing with the company @@ -79,13 +81,14 @@ The Module never approves on a person's behalf. - `/document-studio/docs//record.json`: the record (`document-studio.record/v1`): status, number, revision (+1 at every write), data, history, renders (path, SHA-256, previews, provenance), issue. - `/document-studio/docs//r-/`: PDF and previews of one render attempt (12 first characters of the PDF SHA-256, so a losing attempt never overwrites another attempt's file). - `/document-studio/docs//issued/-.pdf`: the issued PDF. +- Message: `r-/document.html`, `document.txt` and `document.eml` for a render (the 12 characters are those of the SHA-256 of the three outputs' fingerprints, so two attempts that differ in any one output never share a folder), and `issued/-.html`, `.txt` and `.eml` for the issue. See "Messages (e-mail)". - `/document-studio/numbers/