Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -643,11 +643,11 @@
{
"key": "document-studio",
"name": "Document studio",
"version": "0.3.0",
"version": "0.4.0",
"subpath": "document-studio",
"manifest": "document-studio/module.yaml",
"manifest_sha256": "f31b391b04ecf28700efb19584a020a2e72ddcb5c7ade5c5b6f6f3113f4562db",
"tree_sha256": "66f0b03609f2dfbb16859747646ae16fb778703f8544b36f318b8e94ae497fc0",
"manifest_sha256": "958f6fca731e508d2e6ff3b9a01e322a0ff37b8ba41f3d223515e41452b5b145",
"tree_sha256": "2bd528a9c12afefb88f5b471893418a24c97c3ddf023a8af00e582c174ae637a",
"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."
Expand Down
39 changes: 31 additions & 8 deletions document-studio/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Document studio

Reusable Module that turns a brief into a business document (quote, meeting
minutes): draft, PDF render from a template and the company profile, review,
minutes, chart dashboard): draft, PDF render from a template and the company profile, review,
approval and issue with a number. Everything lives in Storage; nothing is sent
outside.

Expand Down Expand Up @@ -85,7 +85,7 @@ The Module never approves on a person's behalf.

`doc_id`: `^[a-z0-9][a-z0-9-]{0,47}$`, chosen by the caller or derived from the
title with a short suffix. Number: `<PREFIX>-<year>-<seq>` (`DEV` for the
quote, `CR` for the minutes).
quote, `CR` for the minutes, `TB` for the dashboard).

The company profile is read from the `cib-profile` record of the `profile` Module through
`recipe--application_data_v1` (`operation: read`, `namespace: cib-profile`, `record_key: company-profile`, the call of
Expand All @@ -107,12 +107,13 @@ The same bytes under another author are refused (`version_unchanged`).

## Templates

`examples/templates/quote` and `examples/templates/meeting-minutes` are copies
of the reference templates of the `agentmaurice.template/v1` contract, with the
shared fragments they import. `tooling/document-studio/contract/PIN.json`
records the origin commit of the contract and the hash of every file. One file
differs from the original: `quote/main.typ`, which adds the notice « Ce
document est un devis, ce n'est pas une facture ». The contract check runs with
`examples/templates/quote`, `examples/templates/meeting-minutes` and
`examples/templates/dashboard` are copies of the reference templates of the
`agentmaurice.template/v1` contract, with the shared fragments they import.
`tooling/document-studio/contract/PIN.json` records the origin commit of the
contract and the hash of every file. One file differs from the original:
`quote/main.typ`, which adds the notice « Ce document est un devis, ce n'est
pas une facture ». The contract check runs with
that contract's `template_check.py` (`check <folder>`); the CI of this
repository is offline and does not depend on it.

Expand All @@ -122,6 +123,28 @@ from its pinned contract and refuses them from the caller
(`reserved_file_name`). Their braces are written as escape sequences, because
the Workflow engine would read a double brace in the code as a template action.

### Dashboard template (charts)

The `dashboard` template (number prefix `TB`) draws six charts, one page each,
from `chart/v1` data (`fragments/charts.typ` of the contract, pure vector
Typst, deterministic): `bar` (grouped bars), `line`, `pie`, `gantt`
(phases and tasks over weeks), `org` (organisation chart) and `process`
(process flow with start, step, decision and end). The draft holds one chart
object per property (`bar`, `line`, `pie`, `gantt`, `org`, `process`) plus a
`title` and the `titles` of the six pages; the model only provides the data,
the engine draws it and nothing is computed by the Workflow (the draft schema
is the template input schema). The bounds of `chart/v1` apply (for example 24
categories, 5 series, 10 pie parts, 25 Gantt tasks, 30 organisation nodes); a
violation fails the render.

Dependency: this template needs the MCP `artifact` engine **v0.2.5 or later**,
which embeds `charts.typ`. The Workflow never sends `fragments/`: the engine
writes them from its pinned contract, so a One whose artifact is older than
v0.2.5 fails the render of this template (the quote and the minutes are not
affected). The Module manifest has no field for a minimum MCP version
(`requires.mcp` only lists a name and tools), so the constraint is stated
here only.

Quote data: the draft holds numbers (`quantity`, `unit_price_ht`, `vat_rate`),
never formatted amounts nor totals. At render time the Workflow produces the
strings the template expects (`1 250,00 €`) and the HT, per-rate VAT and TTC
Expand Down
2 changes: 1 addition & 1 deletion document-studio/agents/main/workflows/document-read.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion document-studio/agents/main/workflows/document-share.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions document-studio/agents/main/workflows/document-studio-draft.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions document-studio/agents/main/workflows/document-studio-plan.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

231 changes: 231 additions & 0 deletions document-studio/examples/templates/dashboard/examples/default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
{
"title": "Tableau de bord Activité 2026",
"titles": {
"bar": "Résultat mensuel",
"line": "Tendance",
"pie": "Répartition du chiffre d'affaires",
"gantt": "Plan de projet",
"org": "Organisation",
"process": "Traitement d'une demande"
},
"bar": {
"type": "bar",
"categories": [
"janv.",
"févr.",
"mars",
"avr.",
"mai",
"juin"
],
"series": [
{
"name": "Chiffre d'affaires (k€)",
"values": [
1250.5,
1380,
1520,
1475,
1680,
1904.25
]
},
{
"name": "Résultat (k€)",
"values": [
220,
-150.5,
310,
-80,
405,
520
]
}
]
},
"line": {
"type": "line",
"categories": [
"janv.",
"févr.",
"mars",
"avr.",
"mai",
"juin"
],
"series": [
{
"name": "Visites",
"values": [
12000,
13500,
15000,
14200,
16800,
19000
]
},
{
"name": "Commandes",
"values": [
980,
1040,
1100,
1080,
1210,
1330
]
}
]
},
"pie": {
"type": "pie",
"parts": [
{
"name": "Conseil",
"value": 3800
},
{
"name": "Formation",
"value": 2400
},
{
"name": "Licences",
"value": 1700
},
{
"name": "Intégration",
"value": 1300
},
{
"name": "Support",
"value": 800
}
]
},
"gantt": {
"type": "gantt",
"weeks": 12,
"phases": [
"Cadrage",
"Construction",
"Recette"
],
"tasks": [
{
"name": "Cadrage du besoin",
"start": 0,
"duration": 2,
"phase": 0
},
{
"name": "Ateliers utilisateurs",
"start": 1,
"duration": 3,
"phase": 0
},
{
"name": "Socle technique",
"start": 3,
"duration": 4,
"phase": 1
},
{
"name": "Interfaces principales",
"start": 5,
"duration": 5,
"phase": 1
},
{
"name": "Recette métier",
"start": 9,
"duration": 2,
"phase": 2
},
{
"name": "Mise en production",
"start": 11,
"duration": 1,
"phase": 2
}
]
},
"org": {
"type": "org",
"nodes": [
{
"id": "n1",
"name": "Hélène Marchand",
"title": "Directrice générale",
"parent": ""
},
{
"id": "n2",
"name": "Julien Bœuf",
"title": "Directeur technique",
"parent": "n1"
},
{
"id": "n3",
"name": "Camille Durand",
"title": "Directrice commerciale",
"parent": "n1"
},
{
"id": "n4",
"name": "Inès Garnier",
"title": "Développement",
"parent": "n2"
},
{
"id": "n5",
"name": "Théo Bernard",
"title": "Données",
"parent": "n2"
},
{
"id": "n6",
"name": "Maël Roche",
"title": "Grands comptes",
"parent": "n3"
}
]
},
"process": {
"type": "process",
"steps": [
{
"label": "Demande reçue",
"kind": "start"
},
{
"label": "Qualification",
"kind": "step"
},
{
"label": "Dossier complet ?",
"kind": "decision"
},
{
"label": "Chiffrage",
"kind": "step"
},
{
"label": "Validation interne",
"kind": "step"
},
{
"label": "Envoi du devis",
"kind": "step"
},
{
"label": "Signature client",
"kind": "step"
},
{
"label": "Clôture",
"kind": "end"
}
]
}
}
Loading
Loading