@agentrica/mcp 0.2.1 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +39 -5
- package/README.md +39 -5
- package/agents/ai_business_product_development_agency/00-common-rules.md +1 -0
- package/agents/ai_cybersecurity_agency/00-common-rules.md +1 -0
- package/agents/ai_privacy_compliance_agency/00-common-rules.md +1 -0
- package/agents/ai_software_agency/00-common-rules.md +7 -0
- package/agents/ai_web_design_agency/00-common-rules.md +2 -0
- package/dist/mcp/src/page/app.js +287 -0
- package/dist/mcp/src/page/index.html +44 -0
- package/dist/mcp/src/page/style.css +110 -0
- package/dist/mcp/src/panel.js +220 -0
- package/dist/mcp/src/project.js +192 -0
- package/dist/mcp/src/prompt.js +3 -3
- package/dist/mcp/src/server.js +113 -7
- package/package.json +2 -2
package/README.en.md
CHANGED
|
@@ -12,7 +12,7 @@ The agent files are in Italian. The agent answers in the language you write in.
|
|
|
12
12
|
|
|
13
13
|
- The server runs only locally: the client starts it on your computer and the two talk over stdio. The server has no remote part.
|
|
14
14
|
- The only content it reads is the `agents/` files included in the package, once, at startup. The text that reaches the model is the text of those files: you can read it before using it.
|
|
15
|
-
- It writes no files, opens no network connections, logs nothing, collects and sends no data, and has no telemetry.
|
|
15
|
+
- It writes no files, opens no network connections, logs nothing, collects and sends no data, and has no telemetry. With `--panel` it opens a page on your computer only: see [Local panel](#local-panel).
|
|
16
16
|
- It runs nothing in your project. It only gives instructions to the model: what the model does in the project depends on the client and on the permissions you grant it.
|
|
17
17
|
- **Where the data goes.** The agent's text, the task and the files the model reads in your project go to the model provider through your client, under that provider's terms. Agentrica does not receive them. Leave personal data, secrets and customer data out of the task unless they are needed.
|
|
18
18
|
- The agents are AI: their conclusions are proposals to check. The privacy and security agents do not replace a DPO, a lawyer or a security officer, and their findings are not a compliance certification.
|
|
@@ -24,7 +24,7 @@ You need Node 22 or later, with npm.
|
|
|
24
24
|
**Claude Code**, from your project folder:
|
|
25
25
|
|
|
26
26
|
```sh
|
|
27
|
-
claude mcp add agentrica -- npx -y @agentrica/mcp@0.
|
|
27
|
+
claude mcp add agentrica -- npx -y @agentrica/mcp@0.3.1
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
On first start npx downloads the package from npm. The version stays the one you set until you change it: role updates do not arrive unless you choose them.
|
|
@@ -36,7 +36,7 @@ On first start npx downloads the package from npm. The version stays the one you
|
|
|
36
36
|
"mcpServers": {
|
|
37
37
|
"agentrica": {
|
|
38
38
|
"command": "npx",
|
|
39
|
-
"args": ["-y", "@agentrica/mcp@0.
|
|
39
|
+
"args": ["-y", "@agentrica/mcp@0.3.1"]
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -45,7 +45,7 @@ On first start npx downloads the package from npm. The version stays the one you
|
|
|
45
45
|
**Least privilege (recommended).** Install the package in its own folder and start it with Node's permission model: the server can only read that folder, and Node blocks file writes, network connections and child processes. The server needs none of them, so it works the same; the permissions limit the damage of any future defect.
|
|
46
46
|
|
|
47
47
|
```sh
|
|
48
|
-
npm install -g --ignore-scripts @agentrica/mcp@0.
|
|
48
|
+
npm install -g --ignore-scripts @agentrica/mcp@0.3.1
|
|
49
49
|
npm root -g
|
|
50
50
|
```
|
|
51
51
|
|
|
@@ -72,7 +72,7 @@ Put the task in quotes: Claude Code splits arguments on spaces.
|
|
|
72
72
|
**Squad.** With `--agents` the server loads only the agents you list: agent ids and department codes, comma-separated, case-insensitive. For example the whole software department plus the accessibility agent:
|
|
73
73
|
|
|
74
74
|
```sh
|
|
75
|
-
claude mcp add agentrica -- npx -y @agentrica/mcp@0.
|
|
75
|
+
claude mcp add agentrica -- npx -y @agentrica/mcp@0.3.1 --agents aisa,aiwda-08
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
The command menu shows only the squad's prompts, and `elenca_agenti` and `agente` see only those agents too. Without `--agents` all 56 agents are available. An unknown id or code stops the server with a message naming it, in the client's logs. In Claude Code prompts do not enter the model's context (we checked with `/context`): a squad makes the menu shorter, it does not save tokens.
|
|
@@ -88,6 +88,38 @@ For example: "Use elenca_agenti, pick the right Agentrica agent and check the ac
|
|
|
88
88
|
|
|
89
89
|
Number 01 in each department is the director: it coordinates the specialists and consolidates their findings.
|
|
90
90
|
|
|
91
|
+
## Local panel
|
|
92
|
+
|
|
93
|
+
With `--panel` the server also opens a page on your computer where you follow the project and make the choices the agent asks you for, instead of answering in the terminal:
|
|
94
|
+
|
|
95
|
+
```sh
|
|
96
|
+
claude mcp add agentrica -- npx -y @agentrica/mcp@0.3.1 --panel
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Then ask the agent to open the panel (`open_panel` tool): the page opens in your browser. It shows:
|
|
100
|
+
|
|
101
|
+
- **Da decidere** (to decide): pending choices, with options and reasons; your answer, with an optional note, goes back to the agent;
|
|
102
|
+
- **Agenti in uso** (agents in use): the Agentrica agents called in this session, with the start of the task;
|
|
103
|
+
- **Fasi** (phases): the project phases, the open phase with backlog and acceptance criteria;
|
|
104
|
+
- **Rilievi** (findings): open findings from phases and audits, by priority and department.
|
|
105
|
+
|
|
106
|
+
With the panel the model has two more tools:
|
|
107
|
+
|
|
108
|
+
| Tool | Input | What it does |
|
|
109
|
+
|---|---|---|
|
|
110
|
+
| `open_panel` | none | opens the page in the browser and returns its URL |
|
|
111
|
+
| `ask_user` | `question`, 2–4 `options` (`label`, `description`), optional `header` and `multiple` | shows the choice in the page and returns the answer |
|
|
112
|
+
|
|
113
|
+
If the page is not open, `ask_user` opens it. The client waits for the answer as long as the server sends progress notifications (up to 4 hours; 25 minutes with a client that does not request them), then the agent asks in the terminal. The client's own questions, such as tool permissions, stay in the client.
|
|
114
|
+
|
|
115
|
+
**What changes with `--panel`.** The server opens a random port on `127.0.0.1` only, reads `plan/`, `audit/` and the git status (`git status`) of the project folder, and keeps the last 20 agent calls in memory. It writes no files and sends no data off your computer. The page opens only with the random token in the URL, valid for that session; requests from other sites or with another `Host` are refused. The Node permission model recommended above does not apply with `--panel`, which needs the local network and `git`.
|
|
116
|
+
|
|
117
|
+
**Format of `plan/` and `audit/`.** The panel reads the agentic-starter plan format, in Italian, the same as Agentrica's own [`plan/`](https://github.com/flgisimone/agentrica/tree/main/plan) and [`audit/`](https://github.com/flgisimone/agentrica/tree/main/audit); if something is missing, the page says what.
|
|
118
|
+
|
|
119
|
+
- `plan/README.md` with a `## Fasi` section and a `| Fase | File | Contenuto | Stato |` table, the file as a link (`[14-pannello.md](14-pannello.md)`). The open phase is the first one whose status is neither `completata` nor `sospesa`.
|
|
120
|
+
- In the phase file: `# Title`, a `**Obiettivo**: …` line, `## Backlog` with the `| # | Task | Priorità |` table, `## Criteri di accettazione` and `## Fatto` as lists; a task is done when its id appears in bold under «Fatto» (`- **F14-01** …`). `## Rilievi aperti` is a list, with the priority (`P0`–`P3`) in the text; an item that says «risolto» or «chiuso» (resolved, closed; e.g. «Risolto in F6.») stays in the plan but the panel does not show it.
|
|
121
|
+
- `audit/<folder>/<file>.json` with `agente` (e.g. `"AICA-02 · …"`, which gives the department) and a `rilievi` list of objects with `id`, `titolo`, `priorita` and optional `stato`; a finding whose `stato` says «risolto» or «chiuso» is not shown.
|
|
122
|
+
|
|
91
123
|
## Put to the test
|
|
92
124
|
|
|
93
125
|
Three agents tested on 2026-11-15 against three small projects with planted, documented defects, using `@agentrica/mcp@0.2.0 --agents <id>`, Claude Code for VS Code and Opus 5.5 (medium reasoning). One run per case, counted by hand.
|
|
@@ -106,6 +138,8 @@ The agents' text comes from the `agents/` files of the installed version. To upd
|
|
|
106
138
|
|
|
107
139
|
## Versions
|
|
108
140
|
|
|
141
|
+
- **0.3.1**: the panel hides closed findings and counts new files separately; the `agente` tool only accepts department codes in ids; common rules with a shared severity scale (P0–P3) and a scale for the software department.
|
|
142
|
+
- **0.3.0**: local panel with `--panel`: phases, backlog, findings, agents in use and choices made from the page (`open_panel` and `ask_user` tools). Without `--panel` nothing changes.
|
|
109
143
|
- **0.2.1**: name `io.github.flgisimone/agentrica` for the official MCP registry; agents and behaviour unchanged.
|
|
110
144
|
- **0.2.0**: `--agents` argument to load only a squad of agents or departments; in an empty project, or when what the role must examine is missing, the agent says so and proposes first steps to confirm, without inventing findings.
|
|
111
145
|
- **0.1.0**: first published version. 56 agents in five departments, one prompt per agent and the `elenca_agenti` and `agente` tools.
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ Ogni agente è un ruolo con un metodo e dei limiti dichiarati, per esempio `AISA
|
|
|
10
10
|
|
|
11
11
|
- Il server gira solo in locale: lo avvia il client sul tuo computer e i due comunicano con stdio. Il server non ha una parte remota.
|
|
12
12
|
- Come contenuto legge solo i file di `agents/` inclusi nel pacchetto, una volta all'avvio. Il testo che arriva al modello è quello di quei file: puoi leggerlo prima di usarlo.
|
|
13
|
-
- Non scrive file, non apre connessioni di rete, non registra, non raccoglie e non invia dati, non ha telemetria.
|
|
13
|
+
- Non scrive file, non apre connessioni di rete, non registra, non raccoglie e non invia dati, non ha telemetria. Con `--panel` apre una pagina solo sul tuo computer: vedi [Pannello locale](#pannello-locale).
|
|
14
14
|
- Non esegue niente nel tuo progetto. Dà soltanto istruzioni al modello: quello che il modello fa nel progetto dipende dal client e dai permessi che gli concedi.
|
|
15
15
|
- **Dove vanno i dati.** Il testo dell'agente, il compito e i file che il modello legge nel tuo progetto vanno al fornitore del modello attraverso il tuo client, secondo le condizioni di quel fornitore. Agentrica non li riceve. Nel compito non inserire dati personali, segreti o dati di clienti che non servono.
|
|
16
16
|
- Gli agenti sono IA: le loro conclusioni sono proposte da verificare. Gli agenti di privacy e sicurezza non sostituiscono un DPO, un avvocato o un responsabile della sicurezza, e i loro rilievi non sono una certificazione di conformità.
|
|
@@ -22,7 +22,7 @@ Serve Node 22 o successivo, con npm.
|
|
|
22
22
|
**Claude Code**, dalla cartella del tuo progetto:
|
|
23
23
|
|
|
24
24
|
```sh
|
|
25
|
-
claude mcp add agentrica -- npx -y @agentrica/mcp@0.
|
|
25
|
+
claude mcp add agentrica -- npx -y @agentrica/mcp@0.3.1
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
Al primo avvio npx scarica il pacchetto da npm. La versione resta quella indicata finché non la cambi tu: un aggiornamento dei ruoli non arriva senza che tu lo scelga.
|
|
@@ -34,7 +34,7 @@ Al primo avvio npx scarica il pacchetto da npm. La versione resta quella indicat
|
|
|
34
34
|
"mcpServers": {
|
|
35
35
|
"agentrica": {
|
|
36
36
|
"command": "npx",
|
|
37
|
-
"args": ["-y", "@agentrica/mcp@0.
|
|
37
|
+
"args": ["-y", "@agentrica/mcp@0.3.1"]
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -43,7 +43,7 @@ Al primo avvio npx scarica il pacchetto da npm. La versione resta quella indicat
|
|
|
43
43
|
**Permessi minimi (consigliato).** Installa il pacchetto in una cartella sua e avvialo con il permission model di Node: il server può solo leggere quella cartella, e Node blocca scritture su file, connessioni di rete e processi figli. Il server non ne ha bisogno, quindi funziona uguale; i permessi limitano i danni di un eventuale difetto futuro.
|
|
44
44
|
|
|
45
45
|
```sh
|
|
46
|
-
npm install -g --ignore-scripts @agentrica/mcp@0.
|
|
46
|
+
npm install -g --ignore-scripts @agentrica/mcp@0.3.1
|
|
47
47
|
npm root -g
|
|
48
48
|
```
|
|
49
49
|
|
|
@@ -70,7 +70,7 @@ Metti il compito fra virgolette: Claude Code separa gli argomenti con gli spazi.
|
|
|
70
70
|
**Squadra.** Con `--agents` il server carica solo gli agenti che indichi: id di agenti e sigle di reparti, separati da virgole, senza distinguere maiuscole. Per esempio tutto il reparto software più l'agente dell'accessibilità:
|
|
71
71
|
|
|
72
72
|
```sh
|
|
73
|
-
claude mcp add agentrica -- npx -y @agentrica/mcp@0.
|
|
73
|
+
claude mcp add agentrica -- npx -y @agentrica/mcp@0.3.1 --agents aisa,aiwda-08
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
Nel menu dei comandi restano solo i prompt della squadra, e anche `elenca_agenti` e `agente` vedono solo quelli. Senza `--agents` ci sono tutti i 56 agenti. Un id o una sigla sconosciuti fermano il server con un messaggio che li nomina, nei log del client. In Claude Code i prompt non entrano nel contesto del modello (lo abbiamo verificato con `/context`): la squadra rende il menu più corto, ma non fa risparmiare token.
|
|
@@ -88,6 +88,38 @@ Il numero 01 di ogni reparto è il direttore: coordina gli specialisti e consoli
|
|
|
88
88
|
|
|
89
89
|
I file degli agenti sono in italiano; l'agente risponde nella lingua in cui gli scrivi.
|
|
90
90
|
|
|
91
|
+
## Pannello locale
|
|
92
|
+
|
|
93
|
+
Con `--panel` il server apre anche una pagina sul tuo computer da cui segui il progetto e prendi le scelte che l'agente ti chiede, invece di rispondere nel terminale:
|
|
94
|
+
|
|
95
|
+
```sh
|
|
96
|
+
claude mcp add agentrica -- npx -y @agentrica/mcp@0.3.1 --panel
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Poi chiedi all'agente di aprire il pannello (tool `open_panel`): la pagina si apre nel browser. Mostra:
|
|
100
|
+
|
|
101
|
+
- **Da decidere**: le scelte in attesa, con le opzioni e le motivazioni; la risposta, con una nota facoltativa, torna all'agente;
|
|
102
|
+
- **Agenti in uso**: gli agenti di Agentrica chiamati in questa sessione, con l'inizio del compito;
|
|
103
|
+
- **Fasi**: le fasi del progetto, la fase aperta con backlog e criteri di accettazione;
|
|
104
|
+
- **Rilievi**: i rilievi aperti delle fasi e quelli degli audit, per priorità e reparto.
|
|
105
|
+
|
|
106
|
+
Con il pannello il modello ha due tool in più:
|
|
107
|
+
|
|
108
|
+
| Tool | Input | Cosa fa |
|
|
109
|
+
|---|---|---|
|
|
110
|
+
| `open_panel` | nessuno | apre la pagina nel browser e ne restituisce l'URL |
|
|
111
|
+
| `ask_user` | `question`, 2–4 `options` (`label`, `description`), `header` e `multiple` facoltativi | mostra la scelta nella pagina e restituisce la risposta |
|
|
112
|
+
|
|
113
|
+
Se la pagina non è aperta, `ask_user` la apre. Il client aspetta la risposta finché il server manda notifiche di avanzamento (fino a 4 ore; 25 minuti con un client che non le chiede), poi l'agente chiede nel terminale. Le domande del client, come i permessi dei tool, restano nel client.
|
|
114
|
+
|
|
115
|
+
**Cosa cambia con `--panel`.** Il server apre una porta casuale solo su `127.0.0.1`, legge `plan/`, `audit/` e lo stato di git (`git status`) della cartella del progetto e tiene in memoria le ultime 20 chiamate agli agenti. Non scrive file e non manda dati fuori dal computer. La pagina si apre solo con il token casuale contenuto nell'URL, che vale per quella sessione; le richieste da altri siti o con un altro `Host` sono rifiutate. Il permission model di Node consigliato sopra non si usa con `--panel`, che ha bisogno della rete locale e di `git`.
|
|
116
|
+
|
|
117
|
+
**Formato di `plan/` e `audit/`.** Il pannello legge il formato dei piani di agentic-starter, lo stesso del [`plan/`](https://github.com/flgisimone/agentrica/tree/main/plan) e dell'[`audit/`](https://github.com/flgisimone/agentrica/tree/main/audit) di Agentrica; se qualcosa manca, la pagina dice cosa.
|
|
118
|
+
|
|
119
|
+
- `plan/README.md` con una sezione `## Fasi` e una tabella `| Fase | File | Contenuto | Stato |`, il file come link (`[14-pannello.md](14-pannello.md)`). La fase aperta è la prima con uno stato diverso da `completata` e `sospesa`.
|
|
120
|
+
- Nel file della fase: `# Titolo`, una riga `**Obiettivo**: …`, `## Backlog` con la tabella `| # | Task | Priorità |`, `## Criteri di accettazione` e `## Fatto` come elenchi; un task è fatto quando il suo id compare in grassetto in «Fatto» (`- **F14-01** …`). `## Rilievi aperti` è un elenco, con la priorità (`P0`–`P3`) nel testo; una voce che dice «risolto» o «chiuso» (es. «Risolto in F6.») resta nel piano ma il pannello non la mostra.
|
|
121
|
+
- `audit/<cartella>/<file>.json` con `agente` (es. `"AICA-02 · …"`, da cui il reparto) e un elenco `rilievi` di oggetti con `id`, `titolo`, `priorita` e `stato` facoltativo; un rilievo con uno `stato` che dice «risolto» o «chiuso» non si mostra.
|
|
122
|
+
|
|
91
123
|
## Messi alla prova
|
|
92
124
|
|
|
93
125
|
Tre agenti provati il 2026-11-15 su tre piccoli progetti con difetti piantati e documentati, con `@agentrica/mcp@0.2.0 --agents <id>`, Claude Code per VS Code e Opus 5.5 (ragionamento medio). Un'esecuzione per caso, contata a mano.
|
|
@@ -106,6 +138,8 @@ Il testo degli agenti viene dai file di `agents/` della versione installata. Per
|
|
|
106
138
|
|
|
107
139
|
## Versioni
|
|
108
140
|
|
|
141
|
+
- **0.3.1**: pannello che nasconde i rilievi chiusi e conta a parte i file nuovi; id del tool `agente` limitato alle sigle dei reparti; regole comuni con una scala di gravità condivisa (P0–P3) e una scala per il reparto software.
|
|
142
|
+
- **0.3.0**: pannello locale con `--panel`: fasi, backlog, rilievi, agenti in uso e scelte da prendere dalla pagina (tool `open_panel` e `ask_user`). Senza `--panel` nulla cambia.
|
|
109
143
|
- **0.2.1**: nome `io.github.flgisimone/agentrica` per il registro MCP ufficiale; agenti e comportamento invariati.
|
|
110
144
|
- **0.2.0**: argomento `--agents` per caricare solo una squadra di agenti o reparti; con un progetto vuoto, o senza ciò che il ruolo deve esaminare, l'agente lo dice e propone i primi passi da confermare, senza inventare rilievi.
|
|
111
145
|
- **0.1.0**: prima versione pubblicata. 56 agenti in cinque reparti, un prompt per agente e i tool `elenca_agenti` e `agente`.
|
|
@@ -35,5 +35,6 @@ Le analisi non sostituiscono il giudizio del management né consulenze legali, f
|
|
|
35
35
|
|
|
36
36
|
## Dati del progetto e segnalazioni
|
|
37
37
|
- Non inviare codice, documenti o dati del progetto a servizi esterni (siti, API, modelli, strumenti online) senza l'ok esplicito dell'utente.
|
|
38
|
+
- Priorità comuni a tutti i reparti: P0 critica, P1 alta, P2 media, P3 bassa. Nei rilievi scrivi solo la sigla (es. P2), senza etichette aggiunte; le descrizioni del reparto dicono quando usarle.
|
|
38
39
|
- Un rilievo P0 si segnala subito all'utente, senza aspettare la fine dell'attività.
|
|
39
40
|
- Il Chief, la Software Agency e gli altri reparti citati in queste regole sono agenti di Agentrica, non persone dell'organizzazione dell'utente: decisioni e approvazioni restano all'utente o al responsabile umano che indica.
|
|
@@ -37,5 +37,6 @@ Le analisi non sostituiscono CISO, responsabile IT, DPO, legale o incident respo
|
|
|
37
37
|
|
|
38
38
|
## Dati del progetto e segnalazioni
|
|
39
39
|
- Non inviare codice, documenti o dati del progetto a servizi esterni (siti, API, modelli, strumenti online) senza l'ok esplicito dell'utente.
|
|
40
|
+
- Priorità comuni a tutti i reparti: P0 critica, P1 alta, P2 media, P3 bassa. Nei rilievi scrivi solo la sigla (es. P2), senza etichette aggiunte; le descrizioni del reparto dicono quando usarle.
|
|
40
41
|
- Un rilievo P0 si segnala subito all'utente, senza aspettare la fine dell'attività.
|
|
41
42
|
- Il Chief, la Software Agency e gli altri reparti citati in queste regole sono agenti di Agentrica, non persone dell'organizzazione dell'utente: decisioni e approvazioni restano all'utente o al responsabile umano che indica.
|
|
@@ -22,5 +22,6 @@ Le remediation sono raccomandazioni: l'attuazione spetta alla Software Agency pr
|
|
|
22
22
|
|
|
23
23
|
## Dati del progetto e segnalazioni
|
|
24
24
|
- Non inviare codice, documenti o dati del progetto a servizi esterni (siti, API, modelli, strumenti online) senza l'ok esplicito dell'utente.
|
|
25
|
+
- Priorità comuni a tutti i reparti: P0 critica, P1 alta, P2 media, P3 bassa. Nei rilievi scrivi solo la sigla (es. P2), senza etichette aggiunte; le descrizioni del reparto dicono quando usarle.
|
|
25
26
|
- Un rilievo P0 si segnala subito all'utente, senza aspettare la fine dell'attività.
|
|
26
27
|
- Il Chief, la Software Agency e gli altri reparti citati in queste regole sono agenti di Agentrica, non persone dell'organizzazione dell'utente: decisioni e approvazioni restano all'utente o al responsabile umano che indica.
|
|
@@ -16,7 +16,14 @@
|
|
|
16
16
|
- Nel riepilogo finale indica sintesi, file modificati, test, decisioni tecniche, rischi, limiti e attività residue.
|
|
17
17
|
- Merge, deploy e rilascio in produzione richiedono approvazione umana esplicita.
|
|
18
18
|
|
|
19
|
+
## Priorità
|
|
20
|
+
- `P0`: critica, dati persi o esposti, sicurezza compromessa, build o produzione bloccate.
|
|
21
|
+
- `P1`: alta, funzione principale rotta o regressione senza alternativa.
|
|
22
|
+
- `P2`: media, difetto con alternativa, test mancanti su una parte critica, debito che rallenta.
|
|
23
|
+
- `P3`: bassa, pulizia, stile, miglioramento non urgente.
|
|
24
|
+
|
|
19
25
|
## Dati del progetto e segnalazioni
|
|
20
26
|
- Non inviare codice, documenti o dati del progetto a servizi esterni (siti, API, modelli, strumenti online) senza l'ok esplicito dell'utente.
|
|
27
|
+
- Priorità comuni a tutti i reparti: P0 critica, P1 alta, P2 media, P3 bassa. Nei rilievi scrivi solo la sigla (es. P2), senza etichette aggiunte; le descrizioni del reparto dicono quando usarle.
|
|
21
28
|
- Un rilievo P0 si segnala subito all'utente, senza aspettare la fine dell'attività.
|
|
22
29
|
- Il Chief, la Software Agency e gli altri reparti citati in queste regole sono agenti di Agentrica, non persone dell'organizzazione dell'utente: decisioni e approvazioni restano all'utente o al responsabile umano che indica.
|
|
@@ -22,6 +22,7 @@ Tutti gli agenti lavorano in modalità **audit e consulenza**. Non sono agenti d
|
|
|
22
22
|
- `P1`: alta, compromette in modo significativo attività o comprensione.
|
|
23
23
|
- `P2`: media, crea attrito o inefficienza non bloccante.
|
|
24
24
|
- `P3`: bassa, rifinitura o opportunità di miglioramento.
|
|
25
|
+
- Un criterio WCAG di livello A non soddisfatto che impedisce un compito è almeno P1.
|
|
25
26
|
|
|
26
27
|
## Stati
|
|
27
28
|
`Nuova`, `In revisione`, `Confermata`, `Approvata`, `In lavorazione`, `Risolta`, `Verificata`, `Respinta`.
|
|
@@ -68,5 +69,6 @@ Restituire dati validi e strutturati, senza aggiungere campi inventati quando il
|
|
|
68
69
|
|
|
69
70
|
## Dati del progetto e segnalazioni
|
|
70
71
|
- Non inviare codice, documenti o dati del progetto a servizi esterni (siti, API, modelli, strumenti online) senza l'ok esplicito dell'utente.
|
|
72
|
+
- Priorità comuni a tutti i reparti: P0 critica, P1 alta, P2 media, P3 bassa. Nei rilievi scrivi solo la sigla (es. P2), senza etichette aggiunte; le descrizioni del reparto dicono quando usarle.
|
|
71
73
|
- Un rilievo P0 si segnala subito all'utente, senza aspettare la fine dell'attività.
|
|
72
74
|
- Il Chief, la Software Agency e gli altri reparti citati in queste regole sono agenti di Agentrica, non persone dell'organizzazione dell'utente: decisioni e approvazioni restano all'utente o al responsabile umano che indica.
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
// Pagina del pannello: legge /api/state, si aggiorna con /api/events e manda le risposte a /api/answer.
|
|
2
|
+
// I dati del progetto entrano nel DOM solo come testo (textContent), mai come HTML.
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const DEPARTMENTS = ["AIBPD", "AICA", "AIPCA", "AISA", "AIWDA"];
|
|
6
|
+
const PRIORITIES = ["P0", "P1", "P2", "P3", ""];
|
|
7
|
+
const REFRESH_MS = 10_000;
|
|
8
|
+
const TITLE = "Agentrica · pannello";
|
|
9
|
+
|
|
10
|
+
let state = null;
|
|
11
|
+
let filter = "";
|
|
12
|
+
const $ = (id) => document.getElementById(id);
|
|
13
|
+
|
|
14
|
+
/** Crea un elemento con attributi e figli (stringhe o nodi). */
|
|
15
|
+
function el(tag, attrs = {}, ...children) {
|
|
16
|
+
const node = document.createElement(tag);
|
|
17
|
+
for (const [key, value] of Object.entries(attrs)) {
|
|
18
|
+
if (value === false || value == null) continue;
|
|
19
|
+
if (key === "class") node.className = value;
|
|
20
|
+
else if (key.startsWith("on")) node.addEventListener(key.slice(2), value);
|
|
21
|
+
else node.setAttribute(key, value === true ? "" : value);
|
|
22
|
+
}
|
|
23
|
+
node.append(...children.flat().filter((c) => c != null && c !== false));
|
|
24
|
+
return node;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Testo dei file Markdown: `codice` diventa <code>, link e grassetti restano solo testo. */
|
|
28
|
+
function inline(text) {
|
|
29
|
+
const plain = text.replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1");
|
|
30
|
+
return plain.split("`").map((part, i) => (i % 2 ? el("code", {}, part) : part));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const time = (iso) => new Date(iso).toLocaleTimeString("it-IT", { hour: "2-digit", minute: "2-digit" });
|
|
34
|
+
const empty = (text) => el("p", { class: "empty" }, text);
|
|
35
|
+
|
|
36
|
+
function renderHeader({ project }) {
|
|
37
|
+
const plural = (n, one, many) => `${n} ${n === 1 ? one : many}`;
|
|
38
|
+
const files = project.git
|
|
39
|
+
? [
|
|
40
|
+
project.git.changed > 0 && plural(project.git.changed, "file modificato", "file modificati"),
|
|
41
|
+
project.git.untracked > 0 && plural(project.git.untracked, "nuovo", "nuovi"),
|
|
42
|
+
].filter(Boolean)
|
|
43
|
+
: [];
|
|
44
|
+
const git = project.git ? [` · branch ${project.git.branch}`, ...files].join(" · ") : " · non è un repository git";
|
|
45
|
+
$("project").textContent = project.name + git;
|
|
46
|
+
const problems = $("problems");
|
|
47
|
+
problems.hidden = project.problems.length === 0;
|
|
48
|
+
problems.textContent = project.problems.join("\n");
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Le domande non si ridisegnano a ogni aggiornamento: una scelta a metà resterebbe persa.
|
|
52
|
+
function renderQuestions({ questions }) {
|
|
53
|
+
const box = $("questions");
|
|
54
|
+
const ids = new Set(questions.map((q) => q.id));
|
|
55
|
+
for (const node of [...box.querySelectorAll("[data-question]")]) {
|
|
56
|
+
if (!ids.has(node.dataset.question) && !node.dataset.sent) node.remove();
|
|
57
|
+
}
|
|
58
|
+
for (const question of questions) {
|
|
59
|
+
if (!box.querySelector(`[data-question="${CSS.escape(question.id)}"]`)) box.append(questionCard(question));
|
|
60
|
+
}
|
|
61
|
+
const waiting = questions.length;
|
|
62
|
+
box.querySelector(".empty")?.remove();
|
|
63
|
+
if (!box.querySelector("[data-question]")) {
|
|
64
|
+
box.append(empty("Nessuna scelta in attesa. Quando un agente ha bisogno di te, la domanda compare qui."));
|
|
65
|
+
}
|
|
66
|
+
document.title = waiting ? `(${waiting}) ${TITLE}` : TITLE;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function questionCard(question) {
|
|
70
|
+
const name = `q-${question.id}`;
|
|
71
|
+
const type = question.multiple ? "checkbox" : "radio";
|
|
72
|
+
const error = el("p", { class: "error", role: "alert", hidden: true });
|
|
73
|
+
const note = el("textarea", { name: "note", maxlength: "2000" });
|
|
74
|
+
const options = question.options.map((option) => {
|
|
75
|
+
const recommended = /\s*\((Recommended|Consigliata)\)\s*$/i;
|
|
76
|
+
return el(
|
|
77
|
+
"label",
|
|
78
|
+
{ class: "option" },
|
|
79
|
+
el("input", { type, name, value: option.label }),
|
|
80
|
+
el(
|
|
81
|
+
"span",
|
|
82
|
+
{},
|
|
83
|
+
el("strong", {}, option.label.replace(recommended, ""), recommended.test(option.label) && el("span", { class: "recommended" }, "Consigliata")),
|
|
84
|
+
option.description,
|
|
85
|
+
),
|
|
86
|
+
);
|
|
87
|
+
});
|
|
88
|
+
const form = el(
|
|
89
|
+
"form",
|
|
90
|
+
{ class: "question", "data-question": question.id, onsubmit: (event) => submit(event, question, form, error) },
|
|
91
|
+
question.header && el("span", { class: "tag" }, question.header),
|
|
92
|
+
el("fieldset", {}, el("legend", {}, question.question), options),
|
|
93
|
+
el("label", { class: "note" }, "Nota (facoltativa)", note),
|
|
94
|
+
el("button", { type: "submit", class: "send" }, "Invia risposta"),
|
|
95
|
+
error,
|
|
96
|
+
);
|
|
97
|
+
$("announce").textContent = `Nuova scelta da prendere: ${question.question}`;
|
|
98
|
+
return form;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
async function submit(event, question, form, error) {
|
|
102
|
+
event.preventDefault();
|
|
103
|
+
const choices = [...form.querySelectorAll("input:checked")].map((input) => input.value);
|
|
104
|
+
const note = form.elements.note.value;
|
|
105
|
+
if (choices.length === 0 && note.trim() === "") {
|
|
106
|
+
error.textContent = "Scegli un'opzione o scrivi una nota.";
|
|
107
|
+
error.hidden = false;
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const response = await fetch("/api/answer", {
|
|
111
|
+
method: "POST",
|
|
112
|
+
headers: { "Content-Type": "application/json" },
|
|
113
|
+
body: JSON.stringify({ id: question.id, choices, note }),
|
|
114
|
+
}).catch(() => null);
|
|
115
|
+
if (!response || !response.ok) {
|
|
116
|
+
error.textContent = response ? await response.text() : "Il pannello non risponde: la sessione è ancora aperta?";
|
|
117
|
+
error.hidden = false;
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
form.dataset.sent = "true";
|
|
121
|
+
form.replaceChildren(el("p", { class: "sent", role: "status" }, `Risposta inviata: ${[...choices, note.trim()].filter(Boolean).join(", ")}`));
|
|
122
|
+
setTimeout(() => {
|
|
123
|
+
form.remove();
|
|
124
|
+
if (state) renderQuestions(state);
|
|
125
|
+
}, 5000);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function renderActivity({ activity }) {
|
|
129
|
+
$("activity").replaceChildren(
|
|
130
|
+
activity.length === 0
|
|
131
|
+
? empty("Nessun agente usato in questa sessione.")
|
|
132
|
+
: el(
|
|
133
|
+
"ol",
|
|
134
|
+
{ class: "activity" },
|
|
135
|
+
activity.map((a) =>
|
|
136
|
+
el(
|
|
137
|
+
"li",
|
|
138
|
+
{ "data-dept": a.department },
|
|
139
|
+
el("time", { datetime: a.time, class: "mono" }, time(a.time)),
|
|
140
|
+
el("span", { class: "dot" }, el("strong", {}, a.codeName), ` — ${a.role}`),
|
|
141
|
+
a.task && el("span", { class: "task" }, a.task),
|
|
142
|
+
),
|
|
143
|
+
),
|
|
144
|
+
),
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function table(head, rows) {
|
|
149
|
+
return el(
|
|
150
|
+
"div",
|
|
151
|
+
{ class: "scroll" },
|
|
152
|
+
el("table", {}, el("thead", {}, el("tr", {}, head.map((h) => el("th", { scope: "col" }, h)))), el("tbody", {}, rows)),
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function renderPhases({ project }) {
|
|
157
|
+
const open = project.openPhase;
|
|
158
|
+
$("open-phase").replaceChildren(
|
|
159
|
+
...(open
|
|
160
|
+
? [
|
|
161
|
+
el("h3", {}, inline(open.title), ` — ${open.status}`),
|
|
162
|
+
open.goal && el("p", { class: "goal" }, inline(open.goal)),
|
|
163
|
+
open.tasks.length
|
|
164
|
+
? table(
|
|
165
|
+
["Task", "Descrizione", "Priorità", "Stato"],
|
|
166
|
+
open.tasks.map((t) =>
|
|
167
|
+
el(
|
|
168
|
+
"tr",
|
|
169
|
+
{},
|
|
170
|
+
el("th", { scope: "row", class: "mono" }, t.id),
|
|
171
|
+
el("td", {}, inline(t.task)),
|
|
172
|
+
el("td", {}, t.priority),
|
|
173
|
+
el("td", { class: t.done ? "status-done" : "" }, t.done ? "Fatto" : "Da fare"),
|
|
174
|
+
),
|
|
175
|
+
),
|
|
176
|
+
)
|
|
177
|
+
: empty("Backlog non ancora scritto."),
|
|
178
|
+
open.criteria.length > 0 && el("h3", {}, "Criteri di accettazione"),
|
|
179
|
+
open.criteria.length > 0 && el("ul", { class: "criteria" }, open.criteria.map((c) => el("li", {}, inline(c)))),
|
|
180
|
+
]
|
|
181
|
+
: []),
|
|
182
|
+
);
|
|
183
|
+
// Aperto solo senza una fase in corso: altrimenti la tabella completa spinge giù i rilievi.
|
|
184
|
+
const all = $("phases").querySelector("details");
|
|
185
|
+
const wasOpen = all ? all.open : !open;
|
|
186
|
+
$("phases").replaceChildren(
|
|
187
|
+
project.phases.length === 0
|
|
188
|
+
? empty("Nessuna fase trovata in plan/README.md.")
|
|
189
|
+
: el("details", { open: wasOpen }, el("summary", {}, `Tutte le fasi (${project.phases.length})`), table(
|
|
190
|
+
["Fase", "Contenuto", "Stato"],
|
|
191
|
+
project.phases.map((p) =>
|
|
192
|
+
el(
|
|
193
|
+
"tr",
|
|
194
|
+
{ class: open && p.id === open.id ? "current" : "" },
|
|
195
|
+
el("th", { scope: "row" }, p.id),
|
|
196
|
+
el("td", {}, inline(p.summary)),
|
|
197
|
+
el("td", {}, p.status),
|
|
198
|
+
),
|
|
199
|
+
),
|
|
200
|
+
)),
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// I pulsanti si creano una volta sola: ricrearli a ogni aggiornamento toglierebbe il focus da tastiera.
|
|
205
|
+
function renderFilters() {
|
|
206
|
+
const box = $("filters");
|
|
207
|
+
if (!box.firstChild) {
|
|
208
|
+
box.append(
|
|
209
|
+
...["", ...DEPARTMENTS].map((code) =>
|
|
210
|
+
el("button", { type: "button", "data-code": code, onclick: () => ((filter = code), render()) }, code || "Tutti"),
|
|
211
|
+
),
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
for (const button of box.children) button.setAttribute("aria-pressed", String(button.dataset.code === filter));
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
const LABELS = { P0: "P0 · critica", P1: "P1 · alta", P2: "P2 · media", P3: "P3 · bassa", "": "Senza priorità" };
|
|
218
|
+
|
|
219
|
+
function findingItem(f) {
|
|
220
|
+
return el(
|
|
221
|
+
"li",
|
|
222
|
+
{},
|
|
223
|
+
f.id && el("strong", { class: "mono" }, `${f.id} `),
|
|
224
|
+
inline(f.title),
|
|
225
|
+
el("span", { class: "finding-meta" }, [f.department, f.source, f.status].filter(Boolean).join(" · ")),
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// Un gruppo per priorità, richiudibile: P0 e P1 aperti, gli altri chiusi; si ricorda la scelta dell'utente.
|
|
230
|
+
const opened = { P0: true, P1: true };
|
|
231
|
+
|
|
232
|
+
function renderFindings({ project }) {
|
|
233
|
+
const shown = project.findings.filter((f) => !filter || f.department === filter);
|
|
234
|
+
const fromPhases = (f) => !f.source.endsWith(".json");
|
|
235
|
+
const groups = PRIORITIES.map((priority) => {
|
|
236
|
+
const items = shown.filter((f) => f.priority === priority).sort((a, b) => fromPhases(b) - fromPhases(a));
|
|
237
|
+
if (items.length === 0) return null;
|
|
238
|
+
const details = el(
|
|
239
|
+
"details",
|
|
240
|
+
{ open: Boolean(opened[priority]), ontoggle: () => (opened[priority] = details.open) },
|
|
241
|
+
el("summary", {}, el("span", { class: `prio prio-${priority}` }, LABELS[priority]), ` (${items.length})`),
|
|
242
|
+
el("ul", { class: "findings" }, items.map(findingItem)),
|
|
243
|
+
);
|
|
244
|
+
return details;
|
|
245
|
+
});
|
|
246
|
+
$("findings").replaceChildren(
|
|
247
|
+
...(shown.length ? groups.filter(Boolean) : [empty(filter ? `Nessun rilievo di ${filter}.` : "Nessun rilievo.")]),
|
|
248
|
+
el("p", { class: "hint" }, "In ogni gruppo prima i «Rilievi aperti» dei file di fase, poi i rilievi degli audit con il loro stato. Quelli segnati come risolti o chiusi non compaiono."),
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function render() {
|
|
253
|
+
if (!state) return;
|
|
254
|
+
renderHeader(state);
|
|
255
|
+
renderQuestions(state);
|
|
256
|
+
renderActivity(state);
|
|
257
|
+
renderPhases(state);
|
|
258
|
+
renderFilters();
|
|
259
|
+
renderFindings(state);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
async function refresh() {
|
|
263
|
+
const response = await fetch("/api/state").catch(() => null);
|
|
264
|
+
if (!response || !response.ok) return;
|
|
265
|
+
state = await response.json();
|
|
266
|
+
render();
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
function connect() {
|
|
270
|
+
const link = $("link");
|
|
271
|
+
const events = new EventSource("/api/events");
|
|
272
|
+
events.onopen = () => {
|
|
273
|
+
link.dataset.state = "ok";
|
|
274
|
+
link.textContent = "Sessione collegata";
|
|
275
|
+
refresh();
|
|
276
|
+
};
|
|
277
|
+
events.addEventListener("change", refresh);
|
|
278
|
+
events.onerror = () => {
|
|
279
|
+
link.dataset.state = "off";
|
|
280
|
+
link.textContent = "Collegamento con la sessione interrotto. Riavvia la sessione di Claude Code per riaprire il pannello.";
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
connect();
|
|
285
|
+
refresh();
|
|
286
|
+
setInterval(() => document.visibilityState === "visible" && refresh(), REFRESH_MS);
|
|
287
|
+
document.addEventListener("visibilitychange", () => document.visibilityState === "visible" && refresh());
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="it">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<meta name="color-scheme" content="dark" />
|
|
7
|
+
<title>Agentrica · pannello</title>
|
|
8
|
+
<link rel="stylesheet" href="/style.css" />
|
|
9
|
+
<script src="/app.js" defer></script>
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<header class="top">
|
|
13
|
+
<div class="wrap top-row">
|
|
14
|
+
<h1 class="brand">Agentrica <span aria-hidden="true">·</span> pannello</h1>
|
|
15
|
+
<p class="meta" id="project">Caricamento…</p>
|
|
16
|
+
<p class="link" id="link" role="status">Collegamento in corso…</p>
|
|
17
|
+
</div>
|
|
18
|
+
</header>
|
|
19
|
+
<main class="wrap">
|
|
20
|
+
<p class="problems" id="problems" hidden></p>
|
|
21
|
+
<div class="live">
|
|
22
|
+
<section aria-labelledby="h-decide" class="card">
|
|
23
|
+
<h2 id="h-decide">Da decidere</h2>
|
|
24
|
+
<div id="announce" class="sr-only" aria-live="polite"></div>
|
|
25
|
+
<div id="questions"></div>
|
|
26
|
+
</section>
|
|
27
|
+
<section aria-labelledby="h-agents" class="card">
|
|
28
|
+
<h2 id="h-agents">Agenti in uso</h2>
|
|
29
|
+
<div id="activity"></div>
|
|
30
|
+
</section>
|
|
31
|
+
</div>
|
|
32
|
+
<section aria-labelledby="h-phases" class="card">
|
|
33
|
+
<h2 id="h-phases">Fasi</h2>
|
|
34
|
+
<div id="open-phase"></div>
|
|
35
|
+
<div id="phases"></div>
|
|
36
|
+
</section>
|
|
37
|
+
<section aria-labelledby="h-findings" class="card">
|
|
38
|
+
<h2 id="h-findings">Rilievi</h2>
|
|
39
|
+
<div id="filters" class="filters" role="group" aria-label="Filtra per reparto"></div>
|
|
40
|
+
<div id="findings"></div>
|
|
41
|
+
</section>
|
|
42
|
+
</main>
|
|
43
|
+
</body>
|
|
44
|
+
</html>
|