@agentrica/mcp 0.3.1 → 0.3.3

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 CHANGED
@@ -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.3.1
27
+ claude mcp add agentrica -- npx -y @agentrica/mcp@0.3.3
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.3.1"]
39
+ "args": ["-y", "@agentrica/mcp@0.3.3"]
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.3.1
48
+ npm install -g --ignore-scripts @agentrica/mcp@0.3.3
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.3.1 --agents aisa,aiwda-08
75
+ claude mcp add agentrica -- npx -y @agentrica/mcp@0.3.3 --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.
@@ -93,14 +93,13 @@ Number 01 in each department is the director: it coordinates the specialists and
93
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
94
 
95
95
  ```sh
96
- claude mcp add agentrica -- npx -y @agentrica/mcp@0.3.1 --panel
96
+ claude mcp add agentrica -- npx -y @agentrica/mcp@0.3.3 --panel
97
97
  ```
98
98
 
99
- Then ask the agent to open the panel (`open_panel` tool): the page opens in your browser. It shows:
99
+ Then ask the agent to open the panel (`open_panel` tool): the page opens in your browser. It has three pages, with a menu at the top counting pending choices and findings:
100
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;
101
+ - **Sessione** (session): pending choices (*Da decidere*, to decide), with options and reasons, whose answer, with an optional note, goes back to the agent; next to them, the Agentrica agents called in this session (*Agenti in uso*, agents in use), with the start of the task;
102
+ - **Piano** (plan): the open phase with backlog and acceptance criteria, and all project phases;
104
103
  - **Rilievi** (findings): open findings from phases and audits, by priority and department.
105
104
 
106
105
  With the panel the model has two more tools:
@@ -136,8 +135,12 @@ Limits: the defects are few, known and fairly obvious; one model and one run per
136
135
 
137
136
  The agents' text comes from the `agents/` files of the installed version. To update, change the version in the command (or reinstall with `npm install -g`) and restart the client. Ids and code names do not change.
138
137
 
138
+ The same catalog can be read from code, without starting the server: `import { loadCatalog } from "@agentrica/mcp/catalog"` returns departments and agents (with the `Department` and `Agent` types) from the package's `agents/`. The Agentrica site uses it.
139
+
139
140
  ## Versions
140
141
 
142
+ - **0.3.3**: `@agentrica/mcp/catalog` export to read departments and agents from code (used by the site, now in a separate repository); agents and server behaviour unchanged.
143
+ - **0.3.2**: the panel has three pages (Sessione, Piano, Rilievi) with a menu counting pending choices and findings; agents and server behaviour unchanged.
141
144
  - **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
145
  - **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.
143
146
  - **0.2.1**: name `io.github.flgisimone/agentrica` for the official MCP registry; agents and behaviour unchanged.
package/README.md CHANGED
@@ -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.3.1
25
+ claude mcp add agentrica -- npx -y @agentrica/mcp@0.3.3
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.3.1"]
37
+ "args": ["-y", "@agentrica/mcp@0.3.3"]
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.3.1
46
+ npm install -g --ignore-scripts @agentrica/mcp@0.3.3
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.3.1 --agents aisa,aiwda-08
73
+ claude mcp add agentrica -- npx -y @agentrica/mcp@0.3.3 --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.
@@ -93,14 +93,13 @@ I file degli agenti sono in italiano; l'agente risponde nella lingua in cui gli
93
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
94
 
95
95
  ```sh
96
- claude mcp add agentrica -- npx -y @agentrica/mcp@0.3.1 --panel
96
+ claude mcp add agentrica -- npx -y @agentrica/mcp@0.3.3 --panel
97
97
  ```
98
98
 
99
- Poi chiedi all'agente di aprire il pannello (tool `open_panel`): la pagina si apre nel browser. Mostra:
99
+ Poi chiedi all'agente di aprire il pannello (tool `open_panel`): la pagina si apre nel browser. Ha tre pagine, con il menu in alto che conta le scelte in attesa e i rilievi:
100
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;
101
+ - **Sessione**: le scelte da prendere (*Da decidere*), con le opzioni e le motivazioni, la cui risposta, con una nota facoltativa, torna all'agente; accanto, gli agenti di Agentrica chiamati in questa sessione (*Agenti in uso*), con l'inizio del compito;
102
+ - **Piano**: la fase in corso con backlog e criteri di accettazione, e tutte le fasi del progetto;
104
103
  - **Rilievi**: i rilievi aperti delle fasi e quelli degli audit, per priorità e reparto.
105
104
 
106
105
  Con il pannello il modello ha due tool in più:
@@ -136,8 +135,12 @@ Limiti: i difetti sono pochi, noti e abbastanza evidenti; un solo modello e una
136
135
 
137
136
  Il testo degli agenti viene dai file di `agents/` della versione installata. Per aggiornare cambia la versione nel comando (o reinstalla con `npm install -g`) e riavvia il client. Gli id e i nomi in codice non cambiano.
138
137
 
138
+ Lo stesso catalogo si legge anche da codice, senza avviare il server: `import { loadCatalog } from "@agentrica/mcp/catalog"` restituisce reparti e agenti (con i tipi `Department` e `Agent`) dagli `agents/` del pacchetto. È ciò che usa il sito di Agentrica.
139
+
139
140
  ## Versioni
140
141
 
142
+ - **0.3.3**: export `@agentrica/mcp/catalog` per leggere reparti e agenti da codice (lo usa il sito, ora in un repository a parte); agenti e comportamento del server invariati.
143
+ - **0.3.2**: pannello in tre pagine (Sessione, Piano, Rilievi) con menu e contatori delle scelte in attesa e dei rilievi; agenti e comportamento del server invariati.
141
144
  - **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
145
  - **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.
143
146
  - **0.2.1**: nome `io.github.flgisimone/agentrica` per il registro MCP ufficiale; agenti e comportamento invariati.
@@ -0,0 +1,12 @@
1
+ export type DepartmentCode = "AIBPD" | "AICA" | "AIPCA" | "AISA" | "AIWDA";
2
+ export interface DepartmentInfo {
3
+ code: DepartmentCode;
4
+ name: string;
5
+ /** Cartella in agents/. */
6
+ folder: string;
7
+ /** Cosa fa il reparto, in una riga. */
8
+ summary: string;
9
+ /** Una stella per file di ruolo: l'indice 0 è il file 01, cioè il direttore. */
10
+ stars: readonly string[];
11
+ }
12
+ export declare const DEPARTMENTS: readonly DepartmentInfo[];
@@ -0,0 +1,45 @@
1
+ import { type DepartmentCode, type DepartmentInfo } from "./departments.ts";
2
+ import { type Section } from "./markdown.ts";
3
+ export { DEPARTMENTS, type DepartmentCode, type DepartmentInfo } from "./departments.ts";
4
+ export type { Section } from "./markdown.ts";
5
+ export interface Agent {
6
+ /** Es. «AISA-02». */
7
+ id: string;
8
+ /** Es. «ALTAIR». */
9
+ star: string;
10
+ /** Numero del file di ruolo: 1 è il direttore. */
11
+ number: number;
12
+ /** Nome del file senza numero ed estensione, es. «senior-software-architect». */
13
+ slug: string;
14
+ department: DepartmentCode;
15
+ /** Titolo del ruolo, dal «# …» del file. */
16
+ role: string;
17
+ intro: string;
18
+ sections: Section[];
19
+ /** Percorso del file rispetto alla root del repository. */
20
+ source: string;
21
+ }
22
+ export interface Department extends Omit<DepartmentInfo, "stars"> {
23
+ /** Sigla in minuscolo, per l'indirizzo della pagina: es. «aisa». */
24
+ slug: string;
25
+ /** Introduzione del README. */
26
+ mission: string;
27
+ /** «## Flusso di lavoro» del README, in Markdown. */
28
+ workflow: string;
29
+ /** «## Collaborazione con le altre agenzie» del README, in Markdown. */
30
+ collaboration: string;
31
+ /** 00-common-rules.md: introduzione e sezioni. */
32
+ rules: {
33
+ intro: string;
34
+ sections: Section[];
35
+ };
36
+ agents: Agent[];
37
+ director: Agent;
38
+ }
39
+ /**
40
+ * Cerca la cartella agents/ risalendo da `from`.
41
+ * Serve dentro il repository (sito, test, sviluppo). Il server MCP non la usa: passa a loadCatalog una cartella
42
+ * fissa, perché la cartella corrente è il progetto dell'utente (packages/mcp/src/server.ts).
43
+ */
44
+ export declare function findAgentsDir(from?: string): string;
45
+ export declare function loadCatalog(agentsDir?: string): Department[];
@@ -0,0 +1,10 @@
1
+ export interface Section {
2
+ heading: string;
3
+ body: string;
4
+ }
5
+ export interface ParsedRole {
6
+ title: string;
7
+ intro: string;
8
+ sections: Section[];
9
+ }
10
+ export declare function parseRole(markdown: string): ParsedRole;
@@ -0,0 +1,5 @@
1
+ import { type Department } from "../../catalog/src/index.ts";
2
+ export { DEPARTMENTS, type Agent, type Department, type DepartmentCode, type DepartmentInfo, type Section } from "../../catalog/src/index.ts";
3
+ export declare const AGENTS_DIR: string;
4
+ /** Reparti e agenti dagli agents/ del pacchetto. */
5
+ export declare function loadCatalog(): Department[];
@@ -0,0 +1,15 @@
1
+ // Export pubblico «@agentrica/mcp/catalog»: il catalogo letto dagli agents/ di questo pacchetto. Lo usa il sito, che vive
2
+ // in un repository privato (F17) e installa il pacchetto a versione esatta. Non importa l'SDK né zod.
3
+ import { join } from "node:path";
4
+ import { loadCatalog as loadFrom } from "../../catalog/src/index.js";
5
+ export { DEPARTMENTS } from "../../catalog/src/index.js";
6
+ // agents/ è in un punto fisso rispetto a questo file, senza risalire le cartelle: la cartella corrente è il progetto
7
+ // dell'utente e non deve poter fornire un'altra agents/. Tre livelli sopra c'è agents/ sia da un clone
8
+ // (packages/mcp/src → la root del repository) sia nel pacchetto (dist/mcp/src → la root del pacchetto, dove prepack
9
+ // copia agents/). Il catalogo è importato per percorso relativo, così tsc lo compila dentro dist e il pacchetto non
10
+ // dipende da @agentrica/catalog.
11
+ export const AGENTS_DIR = join(import.meta.dirname, "..", "..", "..", "agents");
12
+ /** Reparti e agenti dagli agents/ del pacchetto. */
13
+ export function loadCatalog() {
14
+ return loadFrom(AGENTS_DIR);
15
+ }
@@ -160,6 +160,7 @@ function renderPhases({ project }) {
160
160
  ? [
161
161
  el("h3", {}, inline(open.title), ` — ${open.status}`),
162
162
  open.goal && el("p", { class: "goal" }, inline(open.goal)),
163
+ el("h3", {}, "Backlog"),
163
164
  open.tasks.length
164
165
  ? table(
165
166
  ["Task", "Descrizione", "Priorità", "Stato"],
@@ -178,15 +179,12 @@ function renderPhases({ project }) {
178
179
  open.criteria.length > 0 && el("h3", {}, "Criteri di accettazione"),
179
180
  open.criteria.length > 0 && el("ul", { class: "criteria" }, open.criteria.map((c) => el("li", {}, inline(c)))),
180
181
  ]
181
- : []),
182
+ : [empty("Nessuna fase in corso: tutte le fasi sono completate, sospese o da aprire.")]),
182
183
  );
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
184
  $("phases").replaceChildren(
187
185
  project.phases.length === 0
188
186
  ? empty("Nessuna fase trovata in plan/README.md.")
189
- : el("details", { open: wasOpen }, el("summary", {}, `Tutte le fasi (${project.phases.length})`), table(
187
+ : table(
190
188
  ["Fase", "Contenuto", "Stato"],
191
189
  project.phases.map((p) =>
192
190
  el(
@@ -197,7 +195,7 @@ function renderPhases({ project }) {
197
195
  el("td", {}, p.status),
198
196
  ),
199
197
  ),
200
- )),
198
+ ),
201
199
  );
202
200
  }
203
201
 
@@ -249,9 +247,34 @@ function renderFindings({ project }) {
249
247
  );
250
248
  }
251
249
 
250
+ function renderCounts({ project, questions }) {
251
+ const waiting = questions.length;
252
+ const findings = project.findings.length;
253
+ $("count-sessione").textContent = waiting ? String(waiting) : "";
254
+ $("count-rilievi").textContent = String(findings);
255
+ // Il solo numero non dice cosa conta: il nome completo è per i lettori di schermo.
256
+ $("count-sessione").parentElement.setAttribute("aria-label", waiting ? `Sessione, ${waiting} da decidere` : "Sessione");
257
+ $("count-rilievi").parentElement.setAttribute("aria-label", `Rilievi, ${findings} aperti`);
258
+ }
259
+
260
+ // Una vista per volta, scelta dall'hash: avanti e indietro del browser funzionano senza toccare il server.
261
+ const VIEWS = ["sessione", "piano", "rilievi"];
262
+
263
+ function showView(moveFocus) {
264
+ const name = location.hash.slice(1);
265
+ const current = VIEWS.includes(name) ? name : VIEWS[0];
266
+ for (const view of document.querySelectorAll(".view")) view.hidden = view.dataset.view !== current;
267
+ for (const tab of document.querySelectorAll(".tabs a")) {
268
+ if (tab.dataset.view === current) tab.setAttribute("aria-current", "page");
269
+ else tab.removeAttribute("aria-current");
270
+ }
271
+ if (moveFocus) document.querySelector(`#view-${current} h1`).focus();
272
+ }
273
+
252
274
  function render() {
253
275
  if (!state) return;
254
276
  renderHeader(state);
277
+ renderCounts(state);
255
278
  renderQuestions(state);
256
279
  renderActivity(state);
257
280
  renderPhases(state);
@@ -281,6 +304,8 @@ function connect() {
281
304
  };
282
305
  }
283
306
 
307
+ window.addEventListener("hashchange", () => showView(true));
308
+ showView(false);
284
309
  connect();
285
310
  refresh();
286
311
  setInterval(() => document.visibilityState === "visible" && refresh(), REFRESH_MS);
@@ -11,34 +11,54 @@
11
11
  <body>
12
12
  <header class="top">
13
13
  <div class="wrap top-row">
14
- <h1 class="brand">Agentrica <span aria-hidden="true">·</span> pannello</h1>
14
+ <p class="brand">Agentrica <span aria-hidden="true">·</span> pannello</p>
15
15
  <p class="meta" id="project">Caricamento…</p>
16
16
  <p class="link" id="link" role="status">Collegamento in corso…</p>
17
17
  </div>
18
+ <nav class="wrap tabs" aria-label="Sezioni del pannello">
19
+ <a href="#sessione" data-view="sessione">Sessione <span class="count" id="count-sessione"></span></a>
20
+ <a href="#piano" data-view="piano">Piano</a>
21
+ <a href="#rilievi" data-view="rilievi">Rilievi <span class="count" id="count-rilievi"></span></a>
22
+ </nav>
18
23
  </header>
24
+ <div id="announce" class="sr-only" aria-live="polite"></div>
19
25
  <main class="wrap">
20
26
  <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>
27
+
28
+ <div id="view-sessione" class="view" data-view="sessione">
29
+ <h1 class="sr-only" tabindex="-1">Sessione</h1>
30
+ <div class="live">
31
+ <section aria-labelledby="h-decide" class="card">
32
+ <h2 id="h-decide">Da decidere</h2>
33
+ <div id="questions"></div>
34
+ </section>
35
+ <section aria-labelledby="h-agents" class="card">
36
+ <h2 id="h-agents">Agenti in uso</h2>
37
+ <div id="activity"></div>
38
+ </section>
39
+ </div>
40
+ </div>
41
+
42
+ <div id="view-piano" class="view" data-view="piano" hidden>
43
+ <h1 class="sr-only" tabindex="-1">Piano</h1>
44
+ <section aria-labelledby="h-open" class="card">
45
+ <h2 id="h-open">Fase in corso</h2>
46
+ <div id="open-phase"></div>
47
+ </section>
48
+ <section aria-labelledby="h-phases" class="card">
49
+ <h2 id="h-phases">Tutte le fasi</h2>
50
+ <div id="phases"></div>
26
51
  </section>
27
- <section aria-labelledby="h-agents" class="card">
28
- <h2 id="h-agents">Agenti in uso</h2>
29
- <div id="activity"></div>
52
+ </div>
53
+
54
+ <div id="view-rilievi" class="view" data-view="rilievi" hidden>
55
+ <h1 class="sr-only" tabindex="-1">Rilievi</h1>
56
+ <section aria-labelledby="h-findings" class="card">
57
+ <h2 id="h-findings">Rilievi aperti</h2>
58
+ <div id="filters" class="filters" role="group" aria-label="Filtra per reparto"></div>
59
+ <div id="findings"></div>
30
60
  </section>
31
61
  </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
62
  </main>
43
63
  </body>
44
64
  </html>
@@ -41,7 +41,7 @@ code { background: var(--secondary); border-radius: 4px; padding: 0 0.25em; }
41
41
  .wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
42
42
 
43
43
  .top { border-bottom: 1px solid var(--border); background: var(--card); }
44
- .top-row { display: flex; flex-wrap: wrap; gap: 4px 24px; align-items: baseline; padding-block: 12px; }
44
+ .top-row { display: flex; flex-wrap: wrap; gap: 4px 24px; align-items: baseline; padding-block: 12px 4px; }
45
45
  .top p { margin: 0; }
46
46
  .brand { font-size: 1rem; font-weight: 700; margin: 0; }
47
47
  .meta, .link { color: var(--muted-foreground); }
@@ -49,7 +49,17 @@ code { background: var(--secondary); border-radius: 4px; padding: 0 0.25em; }
49
49
  .link[data-state="ok"]::before { content: "● "; color: var(--aiwda); }
50
50
  .link[data-state="off"] { color: var(--destructive); }
51
51
 
52
- main { display: grid; gap: 16px; padding-block: 16px 48px; }
52
+ .tabs { display: flex; gap: 4px; overflow-x: auto; }
53
+ .tabs a { color: var(--muted-foreground); text-decoration: none; padding: 10px 14px 8px; border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 600; }
54
+ .tabs a:hover { color: var(--foreground); }
55
+ .tabs a[aria-current="page"] { color: var(--foreground); border-bottom-color: var(--aisa); }
56
+ .count:not(:empty) { display: inline-block; min-width: 1.6em; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--secondary); color: var(--foreground); font-size: 0.8rem; text-align: center; }
57
+ #count-sessione:not(:empty) { background: var(--aibpd); color: var(--background); }
58
+
59
+ main.wrap { display: grid; gap: 16px; padding-block: 16px 48px; }
60
+ .view { display: grid; gap: 16px; }
61
+ .view[hidden] { display: none; }
62
+ h1:focus { outline: none; }
53
63
  .live { display: grid; gap: 16px; }
54
64
  @media (min-width: 960px) { .live { grid-template-columns: 3fr 2fr; align-items: start; } }
55
65
 
@@ -89,6 +99,7 @@ th, td { text-align: left; padding: 6px 10px 6px 0; border-top: 1px solid var(--
89
99
  thead th { border-top: 0; color: var(--muted-foreground); font-weight: 600; font-size: 0.9rem; }
90
100
  tr.current td { color: var(--foreground); font-weight: 600; }
91
101
  .status-done { color: var(--aiwda); }
102
+ th.mono, td:last-child { white-space: nowrap; }
92
103
  .goal { margin: 0 0 8px; }
93
104
  ul.criteria { margin: 0; padding-left: 1.2em; }
94
105
 
@@ -0,0 +1,40 @@
1
+ export interface Choice {
2
+ label: string;
3
+ description: string;
4
+ }
5
+ export interface QuestionInput {
6
+ header: string;
7
+ question: string;
8
+ options: Choice[];
9
+ multiple: boolean;
10
+ }
11
+ export interface Question extends QuestionInput {
12
+ id: string;
13
+ askedAt: string;
14
+ }
15
+ export interface Answer {
16
+ choices: string[];
17
+ note: string;
18
+ }
19
+ export interface Activity {
20
+ time: string;
21
+ id: string;
22
+ codeName: string;
23
+ role: string;
24
+ department: string;
25
+ task: string;
26
+ }
27
+ export interface Panel {
28
+ /** URL con il token: apre la sessione del browser. */
29
+ url: string;
30
+ /** Mostra la domanda nella pagina e aspetta la risposta; con `signal` interrotto la domanda sparisce. */
31
+ ask(question: QuestionInput, signal: AbortSignal): Promise<Answer>;
32
+ record(activity: Omit<Activity, "time">): void;
33
+ hasViewers(): boolean;
34
+ close(): Promise<void>;
35
+ }
36
+ /** Controlla una risposta della pagina contro la domanda: etichette esistenti, una sola se la scelta è singola. */
37
+ export declare function parseAnswer(question: QuestionInput, body: unknown): Answer | null;
38
+ /** Apre l'URL nel browser predefinito; se non riesce (es. sessione remota) l'URL resta nella risposta del tool. */
39
+ export declare function openBrowser(url: string): void;
40
+ export declare function startPanel(root: string, pageDir?: string): Promise<Panel>;
@@ -0,0 +1,58 @@
1
+ export interface Phase {
2
+ id: string;
3
+ file: string | null;
4
+ summary: string;
5
+ status: string;
6
+ }
7
+ export interface Task {
8
+ id: string;
9
+ task: string;
10
+ priority: string;
11
+ done: boolean;
12
+ }
13
+ export interface OpenPhase {
14
+ id: string;
15
+ title: string;
16
+ goal: string;
17
+ status: string;
18
+ tasks: Task[];
19
+ criteria: string[];
20
+ }
21
+ export interface Finding {
22
+ id: string;
23
+ title: string;
24
+ /** «P0»…«P3», oppure "" se il testo non la dice. */
25
+ priority: string;
26
+ department: string | null;
27
+ /** La fase («F13») o l'audit con il file («2026-11-15-mcp/sec-release.json»). */
28
+ source: string;
29
+ status: string | null;
30
+ }
31
+ export interface GitState {
32
+ branch: string;
33
+ /** File tracciati con modifiche. */
34
+ changed: number;
35
+ /** File nuovi non ancora aggiunti a git. */
36
+ untracked: number;
37
+ }
38
+ export interface Project {
39
+ name: string;
40
+ git: GitState | null;
41
+ phases: Phase[];
42
+ openPhase: OpenPhase | null;
43
+ findings: Finding[];
44
+ problems: string[];
45
+ }
46
+ /** true se il testo dice che il rilievo è risolto o chiuso (README del pacchetto, «Formato»). */
47
+ export declare const isClosedFinding: (text: string) => boolean;
48
+ /** Le righe di una sezione «## Titolo», fino alla sezione successiva dello stesso livello. */
49
+ export declare function section(markdown: string, heading: string): string[] | null;
50
+ /** Le righe di dati della prima tabella Markdown fra `lines`, senza intestazione e separatore. */
51
+ export declare function tableRows(lines: readonly string[]): string[][];
52
+ /** Gli elementi di primo livello di un elenco puntato. */
53
+ export declare function bullets(lines: readonly string[]): string[];
54
+ /** Branch e numero di file modificati; null se la cartella non è un repository git o git non c'è. */
55
+ export declare function readGit(root: string): Promise<GitState | null>;
56
+ /** Legge plan/ e audit/ di `root` (la cartella del progetto, già risolta con realpath). */
57
+ export declare function readPlan(root: string): Omit<Project, "git">;
58
+ export declare function readProject(root: string): Promise<Project>;
@@ -0,0 +1,25 @@
1
+ import type { Agent, Department } from "../../catalog/src/index.ts";
2
+ /** Versione del server, uguale a quella di package.json (lo controlla prompt.test.ts). */
3
+ export declare const VERSION = "0.3.3";
4
+ /**
5
+ * Un reparto della squadra di --agents. Non ha `director`: con un reparto filtrato il direttore può essere fuori
6
+ * squadra, così il tipo impedisce di usarlo senza controllare (rilievo di F12).
7
+ */
8
+ export type SquadDepartment = Omit<Department, "director">;
9
+ export interface Found {
10
+ department: SquadDepartment;
11
+ agent: Agent;
12
+ }
13
+ /** Cerca un agente per id, senza distinguere maiuscole e minuscole («aisa-02» o «AISA-02»). */
14
+ export declare function findAgent(catalog: readonly SquadDepartment[], id: string): Found | undefined;
15
+ /** «AISA-02 · ALTAIR». */
16
+ export declare function codeName(agent: Agent): string;
17
+ /** Una riga per agente, per l'elenco dei prompt e il tool elenca_agenti. */
18
+ export declare function agentSummary({ department, agent }: Found): string;
19
+ /**
20
+ * La squadra di --agents: id di agenti e sigle di reparti separati da virgole, senza distinguere maiuscole
21
+ * («aisa,aiwda-08»). Restituisce il catalogo ridotto alla squadra, nell'ordine del catalogo e senza doppioni;
22
+ * senza elenco, tutto il catalogo. Un nome sconosciuto o un elenco vuoto è un errore che lo nomina.
23
+ */
24
+ export declare function selectSquad(catalog: readonly Department[], spec?: string): SquadDepartment[];
25
+ export declare function agentText({ department, agent }: Found, task?: string): string;
@@ -1,5 +1,5 @@
1
1
  /** Versione del server, uguale a quella di package.json (lo controlla prompt.test.ts). */
2
- export const VERSION = "0.3.1";
2
+ export const VERSION = "0.3.3";
3
3
  /** Cerca un agente per id, senza distinguere maiuscole e minuscole («aisa-02» o «AISA-02»). */
4
4
  export function findAgent(catalog, id) {
5
5
  const wanted = id.toUpperCase();
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -5,20 +5,13 @@
5
5
  // Con --panel (F14) apre anche il pannello locale su 127.0.0.1 (panel.ts), che legge plan/, audit/ e lo stato di git
6
6
  // della cartella corrente e aggiunge i tool open_panel e ask_user; le chiamate agli agenti restano solo in memoria.
7
7
  import { realpathSync } from "node:fs";
8
- import { join } from "node:path";
9
8
  import { parseArgs } from "node:util";
10
- import { loadCatalog } from "../../catalog/src/index.js";
9
+ import { AGENTS_DIR, loadCatalog } from "./catalog.js";
11
10
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
12
11
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
13
12
  import { z } from "zod";
14
13
  import { openBrowser, startPanel } from "./panel.js";
15
14
  import { agentSummary, agentText, codeName, findAgent, selectSquad, VERSION } from "./prompt.js";
16
- // agents/ è in un punto fisso rispetto a questo file, senza risalire le cartelle: la cartella corrente è il progetto
17
- // dell'utente e non deve poter fornire un'altra agents/. Tre livelli sopra c'è agents/ sia da un clone
18
- // (packages/mcp/src → la root del repository) sia nel pacchetto (dist/mcp/src → la root del pacchetto, dove prepack
19
- // copia agents/). Il catalogo è importato per percorso relativo, così tsc lo compila dentro dist e il pacchetto non
20
- // dipende da @agentrica/catalog.
21
- const AGENTS_DIR = join(import.meta.dirname, "..", "..", "..", "agents");
22
15
  // Un errore all'avvio ferma il server con una riga sola su stderr, che il client mostra nei log. Il messaggio può
23
16
  // contenere argomenti della configurazione del client: i caratteri di controllo (a capo, escape) diventano \uXXXX.
24
17
  function fail(message) {
@@ -39,7 +32,7 @@ catch (error) {
39
32
  }
40
33
  let full;
41
34
  try {
42
- full = loadCatalog(AGENTS_DIR);
35
+ full = loadCatalog();
43
36
  }
44
37
  catch (error) {
45
38
  // Senza catalogo completo il server non parte: niente contenuti parziali.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentrica/mcp",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "mcpName": "io.github.flgisimone/agentrica",
5
5
  "description": "I 56 agenti IA di Agentrica come server MCP locale (stdio): un prompt per agente e due tool in sola lettura.",
6
6
  "license": "MIT",
@@ -12,6 +12,13 @@
12
12
  },
13
13
  "keywords": ["mcp", "model-context-protocol", "agents", "claude"],
14
14
  "type": "module",
15
+ "exports": {
16
+ "./catalog": {
17
+ "types": "./dist/mcp/src/catalog.d.ts",
18
+ "default": "./dist/mcp/src/catalog.js"
19
+ },
20
+ "./package.json": "./package.json"
21
+ },
15
22
  "bin": {
16
23
  "agentrica-mcp": "dist/mcp/src/server.js"
17
24
  },