@agentrica/mcp 0.3.2 → 0.4.0
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/.claude/agents/business-product/biz-business-analyst-requirements-strategist.md +18 -0
- package/.claude/agents/business-product/biz-business-development-manager.md +18 -0
- package/.claude/agents/business-product/biz-business-financial-analyst.md +18 -0
- package/.claude/agents/business-product/biz-chief-officer.md +18 -0
- package/.claude/agents/business-product/biz-customer-success-retention-strategist.md +18 -0
- package/.claude/agents/business-product/biz-growth-monetization-manager.md +18 -0
- package/.claude/agents/business-product/biz-market-research-analyst.md +18 -0
- package/.claude/agents/business-product/biz-product-innovation-strategist.md +18 -0
- package/.claude/agents/business-product/biz-product-manager.md +18 -0
- package/.claude/agents/business-product/biz-product-marketing-manager.md +18 -0
- package/.claude/agents/business-product/biz-product-portfolio-roadmap-manager.md +18 -0
- package/.claude/agents/business-product/biz-sales-revenue-strategist.md +18 -0
- package/.claude/agents/cybersecurity/sec-appsec-engineer.md +18 -0
- package/.claude/agents/cybersecurity/sec-awareness-engineer.md +18 -0
- package/.claude/agents/cybersecurity/sec-ciso.md +18 -0
- package/.claude/agents/cybersecurity/sec-cloud-security-engineer.md +18 -0
- package/.claude/agents/cybersecurity/sec-iam-engineer.md +18 -0
- package/.claude/agents/cybersecurity/sec-incident-response.md +18 -0
- package/.claude/agents/cybersecurity/sec-network-security-engineer.md +18 -0
- package/.claude/agents/cybersecurity/sec-pentest-specialist.md +18 -0
- package/.claude/agents/cybersecurity/sec-risk-compliance-auditor.md +18 -0
- package/.claude/agents/cybersecurity/sec-security-architect.md +18 -0
- package/.claude/agents/cybersecurity/sec-soc-analyst.md +18 -0
- package/.claude/agents/cybersecurity/sec-vulnerability-management.md +18 -0
- package/.claude/agents/privacy-compliance/privacy-breach-response.md +18 -0
- package/.claude/agents/privacy-compliance/privacy-chief-officer.md +18 -0
- package/.claude/agents/privacy-compliance/privacy-compliance-auditor.md +18 -0
- package/.claude/agents/privacy-compliance/privacy-data-governance.md +18 -0
- package/.claude/agents/privacy-compliance/privacy-data-subject-rights.md +18 -0
- package/.claude/agents/privacy-compliance/privacy-dpia-specialist.md +18 -0
- package/.claude/agents/privacy-compliance/privacy-gdpr-specialist.md +18 -0
- package/.claude/agents/privacy-compliance/privacy-legal-specialist.md +18 -0
- package/.claude/agents/privacy-compliance/privacy-security-engineer.md +18 -0
- package/.claude/agents/privacy-compliance/privacy-vendor-compliance.md +18 -0
- package/.claude/agents/software/sw-architect.md +18 -0
- package/.claude/agents/software/sw-backend-developer.md +18 -0
- package/.claude/agents/software/sw-code-reviewer.md +18 -0
- package/.claude/agents/software/sw-cto.md +18 -0
- package/.claude/agents/software/sw-database-engineer.md +18 -0
- package/.claude/agents/software/sw-devops-engineer.md +18 -0
- package/.claude/agents/software/sw-frontend-developer.md +18 -0
- package/.claude/agents/software/sw-fullstack-developer.md +18 -0
- package/.claude/agents/software/sw-functional-analyst.md +18 -0
- package/.claude/agents/software/sw-performance-engineer.md +18 -0
- package/.claude/agents/software/sw-qa-engineer.md +18 -0
- package/.claude/agents/software/sw-security-engineer.md +18 -0
- package/.claude/agents/web-design/design-accessibility-specialist.md +18 -0
- package/.claude/agents/web-design/design-dataviz-designer.md +18 -0
- package/.claude/agents/web-design/design-director.md +18 -0
- package/.claude/agents/web-design/design-information-architect.md +18 -0
- package/.claude/agents/web-design/design-system-specialist.md +18 -0
- package/.claude/agents/web-design/design-ui-designer.md +18 -0
- package/.claude/agents/web-design/design-usability-auditor.md +18 -0
- package/.claude/agents/web-design/design-ux-designer.md +18 -0
- package/.claude/agents/web-design/design-ux-researcher.md +18 -0
- package/.claude/agents/web-design/design-ux-writer.md +18 -0
- package/README.en.md +29 -7
- package/README.md +29 -7
- package/dist/catalog/src/departments.d.ts +12 -0
- package/dist/catalog/src/index.d.ts +45 -0
- package/dist/catalog/src/markdown.d.ts +10 -0
- package/dist/mcp/src/catalog.d.ts +5 -0
- package/dist/mcp/src/catalog.js +15 -0
- package/dist/mcp/src/init.d.ts +6 -0
- package/dist/mcp/src/init.js +103 -0
- package/dist/mcp/src/page/style.css +1 -1
- package/dist/mcp/src/panel.d.ts +40 -0
- package/dist/mcp/src/project.d.ts +58 -0
- package/dist/mcp/src/project.js +2 -2
- package/dist/mcp/src/prompt.d.ts +25 -0
- package/dist/mcp/src/prompt.js +1 -1
- package/dist/mcp/src/server.d.ts +2 -0
- package/dist/mcp/src/server.js +8 -10
- package/package.json +11 -2
- package/starter/.github/workflows/ci.yml +65 -0
- package/starter/.nvmrc +1 -0
- package/starter/AGENTS.md +89 -0
- package/starter/CLAUDE.md +1 -0
- package/starter/CONVENTIONS.md +192 -0
- package/starter/README.md +20 -0
- package/starter/audit/README.md +15 -0
- package/starter/docs/AI Multi-Agency System.md +516 -0
- package/starter/docs/README.md +7 -0
- package/starter/gitignore +36 -0
- package/starter/plan/00-base.md +47 -0
- package/starter/plan/README.md +37 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: design-ux-researcher
|
|
3
|
+
description: "UX Researcher: per una funzione o un flusso nuovo chiarisce chi lo usa, per quale compito e con che frequenza. Sola lettura."
|
|
4
|
+
tools: Read, Grep, Glob, mcp__tokensave__tokensave_context, mcp__tokensave__tokensave_search, mcp__tokensave__tokensave_read
|
|
5
|
+
model: inherit
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Sei un agente dell'agenzia di design (AI Web Design Agency) del progetto Agentrica. Il tuo ruolo è definito in `agents/ai_web_design_agency/02-senior-ux-researcher.md` e le regole comuni dell'agenzia in `agents/ai_web_design_agency/00-common-rules.md`: leggili per intero prima di iniziare e applicane missione, metodo, limiti e formato di output. Dove il file di ruolo presuppone un tipo di prodotto diverso da questo, adattalo a quello descritto in `plan/README.md`.
|
|
9
|
+
|
|
10
|
+
Regole del progetto: leggi `AGENTS.md` (sezione «Agenzie», con gli adattamenti a questo repository), `CONVENTIONS.md` per le sezioni pertinenti e il file della fase in `plan/`; il quadro generale delle agenzie è in `docs/AI Multi-Agency System.md`.
|
|
11
|
+
|
|
12
|
+
Limiti: Sola lettura: analizzi, fai audit e raccomandi; non modifichi codice, CSS, componenti, dati o configurazioni. Nell'app in locale osservi, non salvi, non importi e non elimini nulla. I dati reali dell'utente, se il progetto ne ha (`AGENTS.md`, «Adattamenti»), si osservano solo attraverso l'app: non li modifichi, non li copi nel repository e non li riporti nei report se non servono all'evidenza. Le decisioni registrate in `plan/README.md` e in `AGENTS.md` prevalgono: un rilievo che le contraddice diventa una domanda con `requires_human_review: true`.
|
|
13
|
+
|
|
14
|
+
Regole comuni alle agenzie: non esporre segreti, password o token; non inventare risultati di test o audit; distingui fatti, ipotesi e raccomandazioni; segnala subito un rischio critico (P0) a chi ti ha assegnato il compito.
|
|
15
|
+
|
|
16
|
+
Consegna a chi ti ha assegnato il compito: rilievi nel formato JSON del tuo file di ruolo, ciascuno con evidenza, priorità motivata e raccomandazione.
|
|
17
|
+
|
|
18
|
+
Conferma: ogni tua conclusione finale (priorità, rilievo, specifica, scelta tecnica, esito della revisione) è una proposta: chi ti ha assegnato il compito la presenta all'utente, che la conferma prima che diventi definitiva.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: design-ux-writer
|
|
3
|
+
description: "UX Writer: etichette, pulsanti, messaggi, stati vuoti, qualunque testo visibile. Sola lettura."
|
|
4
|
+
tools: Read, Grep, Glob, mcp__tokensave__tokensave_context, mcp__tokensave__tokensave_search, mcp__tokensave__tokensave_read
|
|
5
|
+
model: inherit
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Sei un agente dell'agenzia di design (AI Web Design Agency) del progetto Agentrica. Il tuo ruolo è definito in `agents/ai_web_design_agency/10-senior-ux-writer.md` e le regole comuni dell'agenzia in `agents/ai_web_design_agency/00-common-rules.md`: leggili per intero prima di iniziare e applicane missione, metodo, limiti e formato di output. Dove il file di ruolo presuppone un tipo di prodotto diverso da questo, adattalo a quello descritto in `plan/README.md`.
|
|
9
|
+
|
|
10
|
+
Regole del progetto: leggi `AGENTS.md` (sezione «Agenzie», con gli adattamenti a questo repository), `CONVENTIONS.md` per le sezioni pertinenti e il file della fase in `plan/`; il quadro generale delle agenzie è in `docs/AI Multi-Agency System.md`.
|
|
11
|
+
|
|
12
|
+
Limiti: Sola lettura: analizzi, fai audit e raccomandi; non modifichi codice, CSS, componenti, dati o configurazioni. Nell'app in locale osservi, non salvi, non importi e non elimini nulla. I dati reali dell'utente, se il progetto ne ha (`AGENTS.md`, «Adattamenti»), si osservano solo attraverso l'app: non li modifichi, non li copi nel repository e non li riporti nei report se non servono all'evidenza. Le decisioni registrate in `plan/README.md` e in `AGENTS.md` prevalgono: un rilievo che le contraddice diventa una domanda con `requires_human_review: true`.
|
|
13
|
+
|
|
14
|
+
Regole comuni alle agenzie: non esporre segreti, password o token; non inventare risultati di test o audit; distingui fatti, ipotesi e raccomandazioni; segnala subito un rischio critico (P0) a chi ti ha assegnato il compito.
|
|
15
|
+
|
|
16
|
+
Consegna a chi ti ha assegnato il compito: rilievi nel formato JSON del tuo file di ruolo, ciascuno con evidenza, priorità motivata e raccomandazione.
|
|
17
|
+
|
|
18
|
+
Conferma: ogni tua conclusione finale (priorità, rilievo, specifica, scelta tecnica, esito della revisione) è una proposta: chi ti ha assegnato il compito la presenta all'utente, che la conferma prima che diventi definitiva.
|
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
|
-
-
|
|
15
|
+
- The server writes no files (only the [`init`](#new-project) command does, when you run it), 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.4.0
|
|
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.4.0"]
|
|
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.4.0
|
|
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.4.0 --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,7 +93,7 @@ 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.
|
|
96
|
+
claude mcp add agentrica -- npx -y @agentrica/mcp@0.4.0 --panel
|
|
97
97
|
```
|
|
98
98
|
|
|
99
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:
|
|
@@ -113,12 +113,30 @@ If the page is not open, `ask_user` opens it. The client waits for the answer as
|
|
|
113
113
|
|
|
114
114
|
**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`.
|
|
115
115
|
|
|
116
|
-
**Format of `plan/` and `audit/`.** The panel reads the
|
|
116
|
+
**Format of `plan/` and `audit/`.** The panel reads the plan format created by `init`, 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.
|
|
117
117
|
|
|
118
118
|
- `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`.
|
|
119
119
|
- 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.
|
|
120
120
|
- `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.
|
|
121
121
|
|
|
122
|
+
## New project
|
|
123
|
+
|
|
124
|
+
`init` creates a project with Agentrica's way of working, ready for Claude Code:
|
|
125
|
+
|
|
126
|
+
```sh
|
|
127
|
+
npx -y @agentrica/mcp@0.4.0 init my-project --name "My project"
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Without a folder it uses the current one; without `--name` the name is the folder's. It writes, in Italian:
|
|
131
|
+
|
|
132
|
+
- `AGENTS.md` and `CLAUDE.md` (rules for agents: tokensave, the Ponytail ladder, efficiency, checks, agencies) and `CONVENTIONS.md` (code, tests, phases, closing and release), with the stack-specific parts marked «da compilare» (to fill in);
|
|
133
|
+
- `plan/` with `README.md` (decisions, glossary, phases) and `00-base.md`, the F0 phase to start from; `audit/` and `docs/`;
|
|
134
|
+
- `agents/` and `.claude/agents/`: the 56 roles of this version and one subagent per role, with the project name;
|
|
135
|
+
- `.github/workflows/ci.yml` (`npm run verify` and `verify:e2e`, skipped until F0 creates them), `.gitignore`, `.nvmrc`, `.env.example`;
|
|
136
|
+
- `.mcp.json` with this server at an exact version and `--panel`, so the panel reads the plan right away.
|
|
137
|
+
|
|
138
|
+
If even one file already exists, `init` writes nothing and lists them. Outside a git repository it makes the first commit on `main` and leaves `develop` checked out; inside one it does not commit. Then open Claude Code in the folder and ask it to open phase F0. `init` is the only command that writes files: the server stays read-only. It replaces agentic-starter, which is no longer updated.
|
|
139
|
+
|
|
122
140
|
## Put to the test
|
|
123
141
|
|
|
124
142
|
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.
|
|
@@ -135,8 +153,12 @@ Limits: the defects are few, known and fairly obvious; one model and one run per
|
|
|
135
153
|
|
|
136
154
|
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.
|
|
137
155
|
|
|
156
|
+
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.
|
|
157
|
+
|
|
138
158
|
## Versions
|
|
139
159
|
|
|
160
|
+
- **0.4.0**: `init` command that creates a project with rules, phased plan, agencies, subagents, CI and `.mcp.json` (replaces agentic-starter); the server is unchanged.
|
|
161
|
+
- **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.
|
|
140
162
|
- **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
163
|
- **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
164
|
- **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.
|
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
|
-
-
|
|
13
|
+
- Il server non scrive file (lo fa solo il comando [`init`](#nuovo-progetto), quando lo lanci tu), 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.4.0
|
|
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.4.0"]
|
|
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.4.0
|
|
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.4.0 --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,7 +93,7 @@ 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.
|
|
96
|
+
claude mcp add agentrica -- npx -y @agentrica/mcp@0.4.0 --panel
|
|
97
97
|
```
|
|
98
98
|
|
|
99
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:
|
|
@@ -113,12 +113,30 @@ Se la pagina non è aperta, `ask_user` la apre. Il client aspetta la risposta fi
|
|
|
113
113
|
|
|
114
114
|
**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`.
|
|
115
115
|
|
|
116
|
-
**Formato di `plan/` e `audit/`.** Il pannello legge il formato dei piani
|
|
116
|
+
**Formato di `plan/` e `audit/`.** Il pannello legge il formato dei piani creati da `init`, 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.
|
|
117
117
|
|
|
118
118
|
- `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`.
|
|
119
119
|
- 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.
|
|
120
120
|
- `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.
|
|
121
121
|
|
|
122
|
+
## Nuovo progetto
|
|
123
|
+
|
|
124
|
+
`init` crea un progetto con il metodo di lavoro di Agentrica, pronto per Claude Code:
|
|
125
|
+
|
|
126
|
+
```sh
|
|
127
|
+
npx -y @agentrica/mcp@0.4.0 init mio-progetto --name "Mio progetto"
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Senza cartella usa quella corrente; senza `--name` il nome è quello della cartella. Scrive:
|
|
131
|
+
|
|
132
|
+
- `AGENTS.md` e `CLAUDE.md` (regole per gli agenti: tokensave, scala Ponytail, efficienza, verifica, agenzie) e `CONVENTIONS.md` (codice, test, fasi, chiusura e rilascio), con le parti dello stack marcate «da compilare»;
|
|
133
|
+
- `plan/` con `README.md` (decisioni, glossario, fasi) e `00-base.md`, la fase F0 da cui si parte; `audit/` e `docs/`;
|
|
134
|
+
- `agents/` e `.claude/agents/`: i 56 ruoli di questa versione e un subagent per ruolo, con il nome del progetto;
|
|
135
|
+
- `.github/workflows/ci.yml` (`npm run verify` e `verify:e2e`, saltati finché F0 non li crea), `.gitignore`, `.nvmrc`, `.env.example`;
|
|
136
|
+
- `.mcp.json` con questo server a versione esatta e `--panel`, così il pannello legge subito il piano.
|
|
137
|
+
|
|
138
|
+
Se anche un solo file esiste già, `init` non scrive nulla e dice quali sono. Fuori da un repository git fa il primo commit su `main` e lascia attivo `develop`; dentro un repository non fa commit. Poi apri Claude Code nella cartella e chiedi di aprire la fase F0. `init` è l'unico comando che scrive file: il server resta in sola lettura. Prende il posto di agentic-starter, che non si aggiorna più.
|
|
139
|
+
|
|
122
140
|
## Messi alla prova
|
|
123
141
|
|
|
124
142
|
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.
|
|
@@ -135,8 +153,12 @@ Limiti: i difetti sono pochi, noti e abbastanza evidenti; un solo modello e una
|
|
|
135
153
|
|
|
136
154
|
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.
|
|
137
155
|
|
|
156
|
+
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.
|
|
157
|
+
|
|
138
158
|
## Versioni
|
|
139
159
|
|
|
160
|
+
- **0.4.0**: comando `init` che crea un progetto con regole, piano a fasi, agenzie, subagent, CI e `.mcp.json` (prende il posto di agentic-starter); il server è invariato.
|
|
161
|
+
- **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.
|
|
140
162
|
- **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
163
|
- **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
164
|
- **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.
|
|
@@ -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,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
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** I subagent di Agentrica nominano il progetto solo in questa frase (lo controlla init.test.ts). */
|
|
2
|
+
export declare const SUBAGENT_PROJECT = "del progetto Agentrica.";
|
|
3
|
+
/** I file del progetto nuovo, per percorso relativo, con i segnaposto già sostituiti. */
|
|
4
|
+
export declare function projectFiles(name: string, path: string, date: string): Map<string, string>;
|
|
5
|
+
/** Esegue il comando; restituisce il codice di uscita. */
|
|
6
|
+
export declare function runInit(args: string[]): number;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// `agentrica-mcp init [cartella] [--name "Nome"]` (F18, al posto di agentic-starter): crea un progetto con la governance
|
|
2
|
+
// di Agentrica. Copia starter/ (AGENTS, CONVENTIONS, plan/, audit/, docs/, CI), gli agents/ del pacchetto e i subagent
|
|
3
|
+
// di .claude/agents/ con il nome del progetto, scrive .mcp.json con questo pacchetto a versione esatta e, fuori da un
|
|
4
|
+
// repository git, fa il primo commit su main e lascia attivo develop. È l'unico comando che scrive: il server resta in
|
|
5
|
+
// sola lettura. Se anche un solo file esiste già non scrive nulla.
|
|
6
|
+
import { execFileSync } from "node:child_process";
|
|
7
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
8
|
+
import { basename, dirname, join, relative, resolve } from "node:path";
|
|
9
|
+
import { parseArgs } from "node:util";
|
|
10
|
+
import { AGENTS_DIR } from "./catalog.js";
|
|
11
|
+
import { VERSION } from "./prompt.js";
|
|
12
|
+
// starter/, agents/ e .claude/agents/ stanno nella root del repository e, copiati da prepack, in quella del pacchetto.
|
|
13
|
+
const ROOT = dirname(AGENTS_DIR);
|
|
14
|
+
const STARTER_DIR = join(ROOT, "starter");
|
|
15
|
+
const SUBAGENTS_DIR = join(ROOT, ".claude", "agents");
|
|
16
|
+
/** I subagent di Agentrica nominano il progetto solo in questa frase (lo controlla init.test.ts). */
|
|
17
|
+
export const SUBAGENT_PROJECT = "del progetto Agentrica.";
|
|
18
|
+
// npm non pubblica i file .gitignore: in starter/ si chiama gitignore (e non vale per il repository di Agentrica).
|
|
19
|
+
const RENAMED = { gitignore: ".gitignore" };
|
|
20
|
+
function filesIn(dir) {
|
|
21
|
+
return readdirSync(dir, { recursive: true, withFileTypes: true })
|
|
22
|
+
.filter((entry) => entry.isFile() && entry.name !== ".DS_Store")
|
|
23
|
+
.map((entry) => relative(dir, join(entry.parentPath, entry.name)))
|
|
24
|
+
.sort();
|
|
25
|
+
}
|
|
26
|
+
/** I file del progetto nuovo, per percorso relativo, con i segnaposto già sostituiti. */
|
|
27
|
+
export function projectFiles(name, path, date) {
|
|
28
|
+
const values = { "{{PROJECT_NAME}}": name, "{{PROJECT_PATH}}": path, "{{DATE}}": date };
|
|
29
|
+
const fill = (text) => Object.entries(values).reduce((out, [key, value]) => out.split(key).join(value), text);
|
|
30
|
+
const files = new Map();
|
|
31
|
+
for (const file of filesIn(STARTER_DIR))
|
|
32
|
+
files.set(RENAMED[file] ?? file, fill(readFileSync(join(STARTER_DIR, file), "utf8")));
|
|
33
|
+
for (const file of filesIn(AGENTS_DIR))
|
|
34
|
+
files.set(join("agents", file), readFileSync(join(AGENTS_DIR, file), "utf8"));
|
|
35
|
+
for (const file of filesIn(SUBAGENTS_DIR)) {
|
|
36
|
+
const text = readFileSync(join(SUBAGENTS_DIR, file), "utf8");
|
|
37
|
+
files.set(join(".claude", "agents", file), text.split(SUBAGENT_PROJECT).join(`del progetto ${name}.`));
|
|
38
|
+
}
|
|
39
|
+
const server = { command: "npx", args: ["-y", `@agentrica/mcp@${VERSION}`, "--panel"] };
|
|
40
|
+
files.set(".mcp.json", `${JSON.stringify({ mcpServers: { agentrica: server } }, null, 2)}\n`);
|
|
41
|
+
return files;
|
|
42
|
+
}
|
|
43
|
+
function git(dir, args) {
|
|
44
|
+
return execFileSync("git", args, { cwd: dir, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }).trim();
|
|
45
|
+
}
|
|
46
|
+
// Repository nuovo solo se la cartella non è già dentro uno: un progetto creato in un monorepo resta del monorepo.
|
|
47
|
+
function initGit(dir) {
|
|
48
|
+
try {
|
|
49
|
+
if (git(dir, ["rev-parse", "--is-inside-work-tree"]) === "true")
|
|
50
|
+
return "git: la cartella è già in un repository, nessun commit";
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
if (error.code === "ENOENT")
|
|
54
|
+
return "git: non installato, repository non creato";
|
|
55
|
+
}
|
|
56
|
+
git(dir, ["init", "-q", "-b", "main"]);
|
|
57
|
+
git(dir, ["add", "-A"]);
|
|
58
|
+
try {
|
|
59
|
+
git(dir, ["commit", "-q", "-m", "Progetto creato con @agentrica/mcp init"]);
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
return "git: commit non riuscito (configura user.name e user.email), file lasciati in stage su main";
|
|
63
|
+
}
|
|
64
|
+
git(dir, ["checkout", "-q", "-b", "develop"]);
|
|
65
|
+
return "git: commit iniziale su main, branch develop attivo";
|
|
66
|
+
}
|
|
67
|
+
/** Esegue il comando; restituisce il codice di uscita. */
|
|
68
|
+
export function runInit(args) {
|
|
69
|
+
try {
|
|
70
|
+
const { values, positionals } = parseArgs({ args, options: { name: { type: "string" } }, allowPositionals: true });
|
|
71
|
+
if (positionals.length > 1)
|
|
72
|
+
throw new Error("uso: agentrica-mcp init [cartella] [--name \"Nome\"]");
|
|
73
|
+
const dir = resolve(positionals[0] ?? ".");
|
|
74
|
+
const name = (values.name ?? basename(dir)).trim();
|
|
75
|
+
if (!name || /\p{Cc}/u.test(name))
|
|
76
|
+
throw new Error("--name: serve un nome su una riga");
|
|
77
|
+
const files = projectFiles(name, dir, new Date().toISOString().slice(0, 10));
|
|
78
|
+
const taken = [...files.keys()].filter((file) => existsSync(join(dir, file)));
|
|
79
|
+
if (taken.length > 0) {
|
|
80
|
+
const more = taken.length > 5 ? ` e altri ${taken.length - 5}` : "";
|
|
81
|
+
throw new Error(`nessun file scritto, esistono già: ${taken.slice(0, 5).join(", ")}${more}`);
|
|
82
|
+
}
|
|
83
|
+
for (const [file, text] of files) {
|
|
84
|
+
mkdirSync(dirname(join(dir, file)), { recursive: true });
|
|
85
|
+
writeFileSync(join(dir, file), text, { flag: "wx" });
|
|
86
|
+
}
|
|
87
|
+
process.stdout.write([
|
|
88
|
+
`Progetto «${name}» creato in ${dir}: ${files.size} file.`,
|
|
89
|
+
initGit(dir),
|
|
90
|
+
"",
|
|
91
|
+
"Prossimi passi:",
|
|
92
|
+
` 1. cd "${dir}" e apri Claude Code (.mcp.json registra il server di Agentrica con il pannello)`,
|
|
93
|
+
" 2. chiedi di aprire la fase F0 (plan/00-base.md): stack, agenzie attive, sezioni «da compilare»",
|
|
94
|
+
"",
|
|
95
|
+
].join("\n"));
|
|
96
|
+
return 0;
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
100
|
+
process.stderr.write(`agentrica init: ${message.replace(/\p{Cc}/gu, " ")}\n`);
|
|
101
|
+
return 1;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Palette del sito (
|
|
1
|
+
/* Palette del sito (src/app/globals.css nel repository agentrica-site), tema scuro; contrasti AA misurati lì sugli stessi fondi. */
|
|
2
2
|
:root {
|
|
3
3
|
--background: #0b1020;
|
|
4
4
|
--foreground: #e8ebf4;
|
|
@@ -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>;
|
package/dist/mcp/src/project.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Lettura del progetto dell'utente per il pannello: fasi e backlog da plan/, rilievi da plan/ e audit/, stato di git.
|
|
2
|
-
// Il formato è quello
|
|
2
|
+
// Il formato è quello che crea `init` (init.ts), descritto nel README del pacchetto. Si legge solo dentro plan/ e audit/
|
|
3
3
|
// della cartella del progetto: i link simbolici che escono sono rifiutati e ogni file ha un limite di dimensione.
|
|
4
4
|
// Un file mancante o fuori formato diventa un problema in `problems`, mai un errore che ferma il pannello.
|
|
5
5
|
import { execFile } from "node:child_process";
|
|
@@ -50,7 +50,7 @@ function readPhases(root, plan, problems) {
|
|
|
50
50
|
readme = readInside(root, join(plan, "README.md"));
|
|
51
51
|
}
|
|
52
52
|
catch {
|
|
53
|
-
problems.push("Non trovo plan/README.md: il pannello legge il formato
|
|
53
|
+
problems.push("Non trovo plan/README.md: il pannello legge il formato creato da `agentrica-mcp init` (vedi il README del pacchetto).");
|
|
54
54
|
return [];
|
|
55
55
|
}
|
|
56
56
|
const fasi = section(readme, "Fasi");
|
|
@@ -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.4.0";
|
|
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;
|
package/dist/mcp/src/prompt.js
CHANGED
|
@@ -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.
|
|
2
|
+
export const VERSION = "0.4.0";
|
|
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();
|