@capagents/forgeqe 1.0.9 → 1.1.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/HOW_TO_USE.md CHANGED
@@ -405,24 +405,53 @@ The chat gets a short summary and a card with both paths as links, and **Open th
405
405
  - The line under the logo is what ForgeQE works with here: the folder, what it is built with (from its files, such as a `.sln` or `playwright.config.ts`), the systems that are set up, and the model.
406
406
  - The prompt starts five rows high and grows with a long request, up to nearly half the screen, before it scrolls; the sections below give way, last first, to make room.
407
407
  - **Start with** offers up to four things to ask, from the capabilities that work in this setup, each with an example in the words of your setup. Click one, or press Alt-1 to Alt-4, to put it in the prompt to adjust and send.
408
+ - In a folder without `forgeqe.yaml`, or without a live model, the line under the logo says so and **Get started** takes its place: **Set up ForgeQE in this folder** (runs `/init`), **Add a model**, and **Sign in to Azure DevOps or Jira** (runs `/auth`). Start ForgeQE in your test project's folder to work with its settings.
408
409
  - **Continue** lists the newest reports and runs in the reports folder: **open** opens the report, **rerun** puts the run's goal in the prompt.
409
410
  - **Setup** shows how much is set up and what is missing (see the setup checklist below); it goes away once everything is set up.
410
411
  - The tip in the footer changes every few seconds. Press **?** on an empty prompt for every key; Esc closes the list.
411
412
 
412
- On a terminal 120 columns wide or more, the shell splits in two once you send a request:
413
+ **The conversation.** Once you send a request, the screen is one column that reads top to bottom, as in Claude Code:
413
414
 
414
- - **Left (40%)**: the **Session** panel (model and profile, folder, domain, requests so far), the conversation, and the prompt.
415
- - **Right (60%)**: a status line with who is working, for how long, and a **■ Stop** button (a running suite adds a progress bar, `██████░░░░░░ 5/8`); then **Plan** (the agent's to-do list, then each browser step or suite case with ✓, ✗ and why, ◐ running), **Activity** (every tool call, browser step, and the agents' reasoning), **Files** (each file read ◉, written ✚, or edited ✎, newest first), **Context** (how full the model's context window is, and the skills, product knowledge, domain, and MCP servers in it), and **Tokens** (total, input, output, cached; no prices, which are in reports and `forgeqe models`).
415
+ ```
416
+ > get the current release details from all projects
417
+
418
+ ⏺ Azure DevOps · pipelines build (action list, project QI-Payments, top 1)
419
+ ⏺ ForgeQE · query_api (azure_devops, vsrm.dev.azure.com/…/_apis/release/releases)
420
+ ⎿ No classic releases came back, so I will confirm on the Releases page.
421
+
422
+ ⏺ Browser: Open Autothon › Pipelines › Releases
423
+ ⎿ Step 1 · Open the Autothon project
424
+ ✓ navigate https://dev.azure.com/devcgazuredevops/Autothon
416
425
 
417
- On a narrower terminal the chat fills the screen, and Ctrl-O switches between the chat and the same panels.
426
+ ⏺ No classic releases exist in any of the seven projects.
427
+ …
428
+
429
+ ⠹ Thinking… (24s · 57.4K tokens · esc to interrupt)
430
+ ╭──────────────────────────────────────────────────────────╮
431
+ │ > Ask ForgeQE… (/ for commands, @ to reference a run…) │
432
+ ╰──────────────────────────────────────────────────────────╯
433
+ ✦ Refine ctrl+r ⌕ Search ctrl+p ▦ Panels ctrl+o ctrl+c close
434
+ ~/playwright-csharp-pom-framework azure/gpt-5.4 · 57.4K tokens · ForgeQE
435
+ ```
418
436
 
419
- **Buttons.** Under the prompt: **✦ Refine** (Ctrl-R; it fills in once there is text to refine) and **⌕ Search** (Ctrl-P, the command palette); while a request runs, **■ Stop** (Esc) takes Refine's place. In the status line above the panels: **▦ Panels** (Shift-Tab) and **⤢ Wide chat**, which gives the conversation the whole width for reading a long answer; **◧ Split view**, under the prompt, brings the panels back. On a narrow terminal, **◧ Details** (Ctrl-O) and **⇄ Profile** (Tab) are under the prompt. Each is clickable.
437
+ - `>` is what you asked. `⏺` starts each reply, tool call, browser run, test case, and result; calls in a row sit together, with the arguments dimmed. What came of a call is indented under it after `⎿`: the agent's notes, each browser step and its actions (✓ or ✗), and a result's details.
438
+ - While a request runs, one line above the input says what is happening, for how long, and with how many tokens. The footer is the status line: the model and what the session used. Prices are not shown in the conversation; reports and `forgeqe models` have them.
439
+ - A result that made nothing (a run that only looked something up) adds no card.
420
440
 
421
- **Progress.** While a request runs, the status line above the panels shows a bar for how far the agent's plan has got (`███████░░░░░ 2/3`), or the suite's cases while a suite runs.
441
+ **The panels.** **▦ Panels** (Ctrl-O) opens the session, plan, activity, files, context, and tokens panels beside the conversation on a terminal 120 columns wide or more, or in its place on a narrower one; Ctrl-O again, or **✕ Close**, closes them:
442
+
443
+ - the status line, with who is working, for how long, a progress bar for the plan or a suite's cases, and **■ Stop**;
444
+ - **Plan**: the agent's to-do list, then each browser step or suite case with ✓, ✗ and why, ◐ running;
445
+ - **Activity**: every tool call, browser step, and the agents' reasoning;
446
+ - **Files**: each file read ◉, written ✚, or edited ✎, newest first;
447
+ - **Context**: how full the model's context window is, and the skills, product knowledge, domain, and MCP servers in it;
448
+ - **Tokens**: total, input, output, cached.
449
+
450
+ **Buttons.** Under the input: **✦ Refine** (Ctrl-R; it fills in once there is text to refine), **⌕ Search** (Ctrl-P, the command palette), and **▦ Panels** (Ctrl-O); while a request runs, **■ Stop** (Esc) takes Refine's place. With the panels open, **▦ Focus panels** (Shift-Tab) and **✕ Close** (Ctrl-O) are in their status line. On a narrow terminal, **◧ Details** (Ctrl-O) and **⇄ Profile** (Tab) are under the input. Each is clickable.
422
451
 
423
452
  **Replies.** The agent's answers lead with the answer, then short headed sections; lists keep their bullets in a column, so a wrapped line stays under its text instead of running back to the margin.
424
453
 
425
- **Moving between panels.** Shift-Tab (or a click) moves the keys from the prompt to Plan, Activity, then Files; the focused panel's border lights up and shows its keys. Esc, or typing, goes back to the prompt.
454
+ **Moving between panels.** With the panels open, Shift-Tab (or a click) moves the keys from the prompt to Plan, Activity, then Files; the focused panel's border lights up and shows its keys. Esc, or typing, goes back to the prompt.
426
455
 
427
456
  | Panel | Keys |
428
457
  |-------|------|
@@ -438,23 +467,24 @@ On a narrower terminal the chat fills the screen, and Ctrl-O switches between th
438
467
 
439
468
  **`/` and `@` in the prompt.** Typing `/` lists the commands that match; typing `@` suggests references: recent runs (*last run*, then each by its folder), files in the repository by name or path (`@Login` finds `pages/Login.ts`), and, after `@` and a number such as `@1761`, the Azure DevOps work item with its title (read-only). Tab completes, ↑/↓ choose, Esc closes the list.
440
469
 
441
- **Refine.** Ctrl-R (or *Refine my request* in the palette) turns what you typed into a task specification for ForgeQE's agent, in ASD-STE100 Simplified Technical English, before it is sent:
470
+ **Refine.** Ctrl-R (or *Refine my request* in the palette) turns what you typed into a task specification for ForgeQE's agent, laid out as a system prompt and written in ASD-STE100 Simplified Technical English, before it is sent. It has these parts, in this order: **Role** (who the agent acts as), **Objective** (one instruction), **Context** (the facts, with names), **Steps** (only when they add something), **Rules** (your limits and the setup's), **Output format** (what comes back and how it is laid out), and **Summary** (what you get, in one sentence, read last):
442
471
 
443
472
  ```
444
- Goal: Check the Azure DevOps QI-Payments pipelines and make a shareable report for the manager.
473
+ Role: A release analyst who reads Azure DevOps deployments.
474
+
475
+ Objective: Get what is deployed now in each environment of each Azure DevOps project.
445
476
 
446
477
  Context:
447
- - Project: Azure DevOps project QI-Payments.
448
- - Pipeline: build definition 32, QI-Payments-CD.
449
- - Latest checked CD build: build 1021, failed, finished 2026-09-21.
478
+ - System: Azure DevOps organization devcgazuredevops.
479
+ - Projects: Autothon, CQube.AI, BlackBox_AI, QI-Payments, QI-MobileBanking, Atlas.Ai, QI-Claims.
450
480
 
451
- Steps:
452
- 1. Review the recent runs of QI-Payments-CI and QI-Payments-CD.
453
- 2. Make a shareable report with a short manager summary.
481
+ Output format: One section for each project, with a line for each environment: the deployed build, its date, and its status.
454
482
 
455
- Result: A shareable report file with a short summary for the manager.
483
+ Summary: Show the deployed build in each environment, and why each deployment failed.
456
484
  ```
457
485
 
486
+ Refine is one model session of its own, separate from the conversation: a few model steps (usually two) and read-only tool calls, typically 15K–25K tokens and 20–30 seconds. The panel title shows what it cost and how much of the request keeps the ASD-STE100 rules (*✦ Refined request · STE 100% · 20.8K tokens · 21s*), and its tokens count in the session total in the footer.
487
+
458
488
  A read-only agent writes it. It starts knowing every capability and whether it works in this setup, and the domain; it checks names and ids in the systems that are set up (work items, test plans, pipelines, sprints, recent runs). The panel shows the request with what it **checked** ✓, what it **assumed** ~, and what is **missing** ? (for example "Which story? Give the work item id"); a capability that is not set up shows as missing too. Enter sends it, `e` puts it in the prompt to edit, Esc keeps yours. Refine never runs anything, writes files, or changes a work item; it never invents an id, URL, project, or file.
459
489
 
460
490
  **Next steps.** When a request finishes, up to three suggestions appear above the prompt: from what it produced (*Open the report*, *Write a test for this run*, *Why did it fail?*, *Rerun the cases that failed*) and from the agent's answer, which suggests the follow-ups you are likely to want (*Write a release report*, *Show the failed CD logs*). Click one or press Alt-1 to Alt-3; suggestions that start work are put in the prompt first, to adjust and send.
@@ -466,7 +496,7 @@ A read-only agent writes it. It starts knowing every capability and whether it w
466
496
  | Shift-Tab | Move between the chat and the Plan, Activity, and Files panels |
467
497
  | Ctrl-P | Command palette |
468
498
  | Ctrl-R | Refine the request in the prompt |
469
- | Ctrl-O | Chat or details, on a terminal narrower than 120 columns |
499
+ | Ctrl-O | Open or close the panels (beside the conversation, or in its place on a narrow terminal) |
470
500
  | Alt-1 to Alt-3 | Take a suggested next step |
471
501
  | Alt-1 to Alt-4 | On the start screen: put a **Start with** action in the prompt |
472
502
  | ? | On an empty prompt: every key, in one list |
@@ -1366,7 +1396,7 @@ You can also ask ForgeQE's agent. In the shell, "check the smoke cases once" run
1366
1396
 
1367
1397
  When ForgeQE's agent starts, it connects to an MCP server for each system set up under `sources:`. The server settings come from the same place as everything else: the organization and project, the site URL, and the names of the environment variables that hold the tokens. You don't write MCP config for these.
1368
1398
 
1369
- **Azure DevOps.** Microsoft's [Azure DevOps MCP server](https://github.com/microsoft/azure-devops-mcp), run as `npx -y @azure-devops/mcp <org> -a pat -d all`, with every tool group the server has. The organization comes from `org_url` (`https://dev.azure.com/acme` or `https://acme.visualstudio.com`). ForgeQE passes the PAT from `token_env` (default `ADO_PAT`) the way the server wants it; without a PAT it uses your `az login` session. Its tools are `azure_devops_*`: work items and comments, queries, backlogs, iterations, test plans, pipelines and their logs, repos, branches, pull requests, wiki pages (read, create, and update), search across code, wikis, and work items, and Advanced Security alerts. `mcp_domains` limits them to some groups. It needs Node.js. Azure DevOps Server (on-premises) isn't supported by Microsoft's server, so it uses ForgeQE's API.
1399
+ **Azure DevOps.** Microsoft's [Azure DevOps MCP server](https://github.com/microsoft/azure-devops-mcp), run as `npx -y @azure-devops/mcp <org> -a pat -d core work work-items pipelines`: projects and teams, iterations and boards, work items, and pipelines. Every tool's definition goes to the model with each request, so ForgeQE loads only these groups (about 19 tools, roughly 9.5K tokens, against about 18K for all of them); its own tools cover test plans, wiki pages, dashboards, and pull request reviews, and `query_api` reads anything else, such as classic releases. The organization comes from `org_url` (`https://dev.azure.com/acme` or `https://acme.visualstudio.com`). ForgeQE passes the PAT from `token_env` (default `ADO_PAT`) the way the server wants it; without a PAT it uses your `az login` session. Its tools are `azure_devops_*`. `mcp_domains` adds groups: `test-plans`, `repositories` (repos, branches, pull requests), `wiki`, `search` (code, wikis, and work items), `advanced-security`, or `[all]`. It needs Node.js. Azure DevOps Server (on-premises) isn't supported by Microsoft's server, so it uses ForgeQE's API.
1370
1400
 
1371
1401
  ```yaml
1372
1402
  sources:
@@ -1375,7 +1405,7 @@ sources:
1375
1405
  # project: Shop # optional: limit ForgeQE's own API calls to one project
1376
1406
  token_env: ADO_PAT
1377
1407
  mcp: true # false: API only
1378
- mcp_domains: [core, work-items, test-plans, pipelines] # optional: fewer tool groups
1408
+ mcp_domains: [core, work, work-items, pipelines, repositories] # optional: the default four, plus repos
1379
1409
  ```
1380
1410
 
1381
1411
  Microsoft's server has no dashboard tools and can't save queries. Ask for a dashboard ("create a dashboard in QI-Payments with all defects in every state and the current sprint's stories") and ForgeQE's own `create_ado_dashboard` tool does it through the REST API with `ADO_PAT`: it runs each WIQL query once to check it, saves it as a shared query under `Shared Queries/ForgeQE` (updating one of the same name), and creates a team or project dashboard with a work item list or count tile per query, plus optional markdown text. The PAT needs Work Items (read and write) and permission to edit dashboards. Chart widgets are not made through the API; for those the agent uses the browser, which has to be signed in to `dev.azure.com` (`forgeqe login <name>` with a login for it under `logins:`).
@@ -1628,6 +1658,7 @@ Start with `--debug` (or set `FORGEQE_DEBUG=1`) for more: the browser engine log
1628
1658
  | `/profile <name>` or Tab | Switch the model profile |
1629
1659
  | `/logs [shots]` | Save this session's log and runs in one archive to share |
1630
1660
  | `/features` | What ForgeQE can do here: ✓ ready, ◐ works with some parts to set up, ○ needs setup, with the fix (works without a model) |
1661
+ | `/init` | Set ForgeQE up in this folder, as `forgeqe init` does: `forgeqe.yaml`, `llms.json`, and editable prompts, skills, and knowledge; the session reads them at once |
1631
1662
  | `/skills [name]` | The skills each agent can use, or one skill's instructions |
1632
1663
  | `/auth [system]`, `/auth logout <system>` | Sign in to a system in the browser (the token is typed unseen), forget one; `/auth` alone shows what is signed in |
1633
1664
  | `/clear`, `/help`, `/exit` | Clear the transcript, show help, quit |
@@ -565,20 +565,49 @@ Add a GitHub Actions workflow that runs tests/cases.yaml on every PR, and make i
565
565
  <li>The line under the logo is what ForgeQE works with here: the folder, what it is built with (from its files, such as a <code>.sln</code> or <code>playwright.config.ts</code>), the systems that are set up, and the model.</li>
566
566
  <li>The prompt starts five rows high and grows with a long request, up to nearly half the screen, before it scrolls; the sections below give way, last first, to make room.</li>
567
567
  <li><strong>Start with</strong> offers up to four things to ask, from the capabilities that work in this setup, each with an example in the words of your setup. Click one, or press Alt-1 to Alt-4, to put it in the prompt to adjust and send.</li>
568
+ <li>In a folder without <code>forgeqe.yaml</code>, or without a live model, the line under the logo says so and <strong>Get started</strong> takes its place: <strong>Set up ForgeQE in this folder</strong> (runs <code>/init</code>), <strong>Add a model</strong>, and <strong>Sign in to Azure DevOps or Jira</strong> (runs <code>/auth</code>). Start ForgeQE in your test project's folder to work with its settings.</li>
568
569
  <li><strong>Continue</strong> lists the newest reports and runs in the reports folder: <strong>open</strong> opens the report, <strong>rerun</strong> puts the run's goal in the prompt.</li>
569
570
  <li><strong>Setup</strong> shows how much is set up and what is missing (see the setup checklist below); it goes away once everything is set up.</li>
570
571
  <li>The tip in the footer changes every few seconds. Press <strong>?</strong> on an empty prompt for every key; Esc closes the list.</li>
571
572
  </ul>
572
- <p>On a terminal 120 columns wide or more, the shell splits in two once you send a request:</p>
573
+ <p><strong>The conversation.</strong> Once you send a request, the screen is one column that reads top to bottom, as in Claude Code:</p>
574
+ <pre><code>&gt; get the current release details from all projects
575
+
576
+ ⏺ Azure DevOps · pipelines build (action list, project QI-Payments, top 1)
577
+ ⏺ ForgeQE · query_api (azure_devops, vsrm.dev.azure.com/…/_apis/release/releases)
578
+ ⎿ No classic releases came back, so I will confirm on the Releases page.
579
+
580
+ ⏺ Browser: Open Autothon › Pipelines › Releases
581
+ ⎿ Step 1 · Open the Autothon project
582
+ ✓ navigate https://dev.azure.com/devcgazuredevops/Autothon
583
+
584
+ ⏺ No classic releases exist in any of the seven projects.
585
+ …
586
+
587
+ ⠹ Thinking… (24s · 57.4K tokens · esc to interrupt)
588
+ ╭──────────────────────────────────────────────────────────╮
589
+ │ &gt; Ask ForgeQE… (/ for commands, @ to reference a run…) │
590
+ ╰──────────────────────────────────────────────────────────╯
591
+ ✦ Refine ctrl+r ⌕ Search ctrl+p ▦ Panels ctrl+o ctrl+c close
592
+ ~/playwright-csharp-pom-framework azure/gpt-5.4 · 57.4K tokens · ForgeQE
593
+ </code></pre>
594
+ <ul>
595
+ <li><code>&gt;</code> is what you asked. <code>⏺</code> starts each reply, tool call, browser run, test case, and result; calls in a row sit together, with the arguments dimmed. What came of a call is indented under it after <code>⎿</code>: the agent's notes, each browser step and its actions (✓ or ✗), and a result's details.</li>
596
+ <li>While a request runs, one line above the input says what is happening, for how long, and with how many tokens. The footer is the status line: the model and what the session used. Prices are not shown in the conversation; reports and <code>forgeqe models</code> have them.</li>
597
+ <li>A result that made nothing (a run that only looked something up) adds no card.</li>
598
+ </ul>
599
+ <p><strong>The panels.</strong> <strong>▦ Panels</strong> (Ctrl-O) opens the session, plan, activity, files, context, and tokens panels beside the conversation on a terminal 120 columns wide or more, or in its place on a narrower one; Ctrl-O again, or <strong>✕ Close</strong>, closes them:</p>
573
600
  <ul>
574
- <li><strong>Left (40%)</strong>: the <strong>Session</strong> panel (model and profile, folder, domain, requests so far), the conversation, and the prompt.</li>
575
- <li><strong>Right (60%)</strong>: a status line with who is working, for how long, and a <strong>■ Stop</strong> button (a running suite adds a progress bar, <code>██████░░░░░░ 5/8</code>); then <strong>Plan</strong> (the agent's to-do list, then each browser step or suite case with ✓, ✗ and why, ◐ running), <strong>Activity</strong> (every tool call, browser step, and the agents' reasoning), <strong>Files</strong> (each file read ◉, written ✚, or edited ✎, newest first), <strong>Context</strong> (how full the model's context window is, and the skills, product knowledge, domain, and MCP servers in it), and <strong>Tokens</strong> (total, input, output, cached; no prices, which are in reports and <code>forgeqe models</code>).</li>
601
+ <li>the status line, with who is working, for how long, a progress bar for the plan or a suite's cases, and <strong>■ Stop</strong>;</li>
602
+ <li><strong>Plan</strong>: the agent's to-do list, then each browser step or suite case with ✓, ✗ and why, ◐ running;</li>
603
+ <li><strong>Activity</strong>: every tool call, browser step, and the agents' reasoning;</li>
604
+ <li><strong>Files</strong>: each file read ◉, written ✚, or edited ✎, newest first;</li>
605
+ <li><strong>Context</strong>: how full the model's context window is, and the skills, product knowledge, domain, and MCP servers in it;</li>
606
+ <li><strong>Tokens</strong>: total, input, output, cached.</li>
576
607
  </ul>
577
- <p>On a narrower terminal the chat fills the screen, and Ctrl-O switches between the chat and the same panels.</p>
578
- <p><strong>Buttons.</strong> Under the prompt: <strong>✦ Refine</strong> (Ctrl-R; it fills in once there is text to refine) and <strong>⌕ Search</strong> (Ctrl-P, the command palette); while a request runs, <strong>■ Stop</strong> (Esc) takes Refine's place. In the status line above the panels: <strong>▦ Panels</strong> (Shift-Tab) and <strong>⤢ Wide chat</strong>, which gives the conversation the whole width for reading a long answer; <strong>◧ Split view</strong>, under the prompt, brings the panels back. On a narrow terminal, <strong>◧ Details</strong> (Ctrl-O) and <strong>⇄ Profile</strong> (Tab) are under the prompt. Each is clickable.</p>
579
- <p><strong>Progress.</strong> While a request runs, the status line above the panels shows a bar for how far the agent's plan has got (<code>███████░░░░░ 2/3</code>), or the suite's cases while a suite runs.</p>
608
+ <p><strong>Buttons.</strong> Under the input: <strong>✦ Refine</strong> (Ctrl-R; it fills in once there is text to refine), <strong>⌕ Search</strong> (Ctrl-P, the command palette), and <strong>▦ Panels</strong> (Ctrl-O); while a request runs, <strong>■ Stop</strong> (Esc) takes Refine's place. With the panels open, <strong>▦ Focus panels</strong> (Shift-Tab) and <strong>✕ Close</strong> (Ctrl-O) are in their status line. On a narrow terminal, <strong>◧ Details</strong> (Ctrl-O) and <strong>⇄ Profile</strong> (Tab) are under the input. Each is clickable.</p>
580
609
  <p><strong>Replies.</strong> The agent's answers lead with the answer, then short headed sections; lists keep their bullets in a column, so a wrapped line stays under its text instead of running back to the margin.</p>
581
- <p><strong>Moving between panels.</strong> Shift-Tab (or a click) moves the keys from the prompt to Plan, Activity, then Files; the focused panel's border lights up and shows its keys. Esc, or typing, goes back to the prompt.</p>
610
+ <p><strong>Moving between panels.</strong> With the panels open, Shift-Tab (or a click) moves the keys from the prompt to Plan, Activity, then Files; the focused panel's border lights up and shows its keys. Esc, or typing, goes back to the prompt.</p>
582
611
  <div class="tbl"><table>
583
612
  <thead>
584
613
  <tr><th>Panel</th><th>Keys</th></tr>
@@ -593,20 +622,20 @@ Add a GitHub Actions workflow that runs tests/cases.yaml on every PR, and make i
593
622
  <p><strong>Setup checklist.</strong> Until everything is set up, the start screen's <strong>Setup</strong> line shows how many of the five things most features rest on are set up, and names the ones that are not: <strong>Model</strong> (a live model profile), <strong>Coding agent</strong>, <strong>Work items</strong> (Azure DevOps, Jira, TestRail, Zephyr, qTest, or Xray), <strong>Domain</strong>, and <strong>Notifications</strong>. <strong>▸ how to set up</strong> puts the steps for each missing one in the chat (for <strong>Work items</strong>, type <code>/auth</code>). The checks are the same ones <code>/features</code> uses, so the two always agree.</p>
594
623
  <p><strong>Command palette.</strong> Ctrl-P opens a palette of every action, command, profile, and example request; type a few letters to find one (&quot;rr&quot; finds <em>Refine my request</em>, &quot;auth&quot; finds the sign-in commands), ↑/↓ to choose, Enter to run it. Example requests are put in the prompt for you to edit, never sent straight away.</p>
595
624
  <p><strong><code>/</code> and <code>@</code> in the prompt.</strong> Typing <code>/</code> lists the commands that match; typing <code>@</code> suggests references: recent runs (<em>last run</em>, then each by its folder), files in the repository by name or path (<code>@Login</code> finds <code>pages/Login.ts</code>), and, after <code>@</code> and a number such as <code>@1761</code>, the Azure DevOps work item with its title (read-only). Tab completes, ↑/↓ choose, Esc closes the list.</p>
596
- <p><strong>Refine.</strong> Ctrl-R (or <em>Refine my request</em> in the palette) turns what you typed into a task specification for ForgeQE's agent, in ASD-STE100 Simplified Technical English, before it is sent:</p>
597
- <pre><code>Goal: Check the Azure DevOps QI-Payments pipelines and make a shareable report for the manager.
625
+ <p><strong>Refine.</strong> Ctrl-R (or <em>Refine my request</em> in the palette) turns what you typed into a task specification for ForgeQE's agent, laid out as a system prompt and written in ASD-STE100 Simplified Technical English, before it is sent. It has these parts, in this order: <strong>Role</strong> (who the agent acts as), <strong>Objective</strong> (one instruction), <strong>Context</strong> (the facts, with names), <strong>Steps</strong> (only when they add something), <strong>Rules</strong> (your limits and the setup's), <strong>Output format</strong> (what comes back and how it is laid out), and <strong>Summary</strong> (what you get, in one sentence, read last):</p>
626
+ <pre><code>Role: A release analyst who reads Azure DevOps deployments.
627
+
628
+ Objective: Get what is deployed now in each environment of each Azure DevOps project.
598
629
 
599
630
  Context:
600
- - Project: Azure DevOps project QI-Payments.
601
- - Pipeline: build definition 32, QI-Payments-CD.
602
- - Latest checked CD build: build 1021, failed, finished 2026-09-21.
631
+ - System: Azure DevOps organization devcgazuredevops.
632
+ - Projects: Autothon, CQube.AI, BlackBox_AI, QI-Payments, QI-MobileBanking, Atlas.Ai, QI-Claims.
603
633
 
604
- Steps:
605
- 1. Review the recent runs of QI-Payments-CI and QI-Payments-CD.
606
- 2. Make a shareable report with a short manager summary.
634
+ Output format: One section for each project, with a line for each environment: the deployed build, its date, and its status.
607
635
 
608
- Result: A shareable report file with a short summary for the manager.
636
+ Summary: Show the deployed build in each environment, and why each deployment failed.
609
637
  </code></pre>
638
+ <p>Refine is one model session of its own, separate from the conversation: a few model steps (usually two) and read-only tool calls, typically 15K–25K tokens and 20–30 seconds. The panel title shows what it cost and how much of the request keeps the ASD-STE100 rules (<em>✦ Refined request · STE 100% · 20.8K tokens · 21s</em>), and its tokens count in the session total in the footer.</p>
610
639
  <p>A read-only agent writes it. It starts knowing every capability and whether it works in this setup, and the domain; it checks names and ids in the systems that are set up (work items, test plans, pipelines, sprints, recent runs). The panel shows the request with what it <strong>checked</strong> ✓, what it <strong>assumed</strong> ~, and what is <strong>missing</strong> ? (for example &quot;Which story? Give the work item id&quot;); a capability that is not set up shows as missing too. Enter sends it, <code>e</code> puts it in the prompt to edit, Esc keeps yours. Refine never runs anything, writes files, or changes a work item; it never invents an id, URL, project, or file.</p>
611
640
  <p><strong>Next steps.</strong> When a request finishes, up to three suggestions appear above the prompt: from what it produced (<em>Open the report</em>, <em>Write a test for this run</em>, <em>Why did it fail?</em>, <em>Rerun the cases that failed</em>) and from the agent's answer, which suggests the follow-ups you are likely to want (<em>Write a release report</em>, <em>Show the failed CD logs</em>). Click one or press Alt-1 to Alt-3; suggestions that start work are put in the prompt first, to adjust and send.</p>
612
641
  <div class="tbl"><table>
@@ -619,7 +648,7 @@ Result: A shareable report file with a short summary for the manager.
619
648
  <tr><td>Shift-Tab</td><td>Move between the chat and the Plan, Activity, and Files panels</td></tr>
620
649
  <tr><td>Ctrl-P</td><td>Command palette</td></tr>
621
650
  <tr><td>Ctrl-R</td><td>Refine the request in the prompt</td></tr>
622
- <tr><td>Ctrl-O</td><td>Chat or details, on a terminal narrower than 120 columns</td></tr>
651
+ <tr><td>Ctrl-O</td><td>Open or close the panels (beside the conversation, or in its place on a narrow terminal)</td></tr>
623
652
  <tr><td>Alt-1 to Alt-3</td><td>Take a suggested next step</td></tr>
624
653
  <tr><td>Alt-1 to Alt-4</td><td>On the start screen: put a <strong>Start with</strong> action in the prompt</td></tr>
625
654
  <tr><td>?</td><td>On an empty prompt: every key, in one list</td></tr>
@@ -1904,14 +1933,14 @@ agents: [browser]
1904
1933
  <h3>MCP</h3>
1905
1934
  <div class="prose"></div>
1906
1935
  <section class="doc sub" id="doc-how_to_use-servers-forgeqes-agent-connects-to"><h4>Servers ForgeQE's agent connects to</h4><div class="prose"><p>When ForgeQE's agent starts, it connects to an MCP server for each system set up under <code>sources:</code>. The server settings come from the same place as everything else: the organization and project, the site URL, and the names of the environment variables that hold the tokens. You don't write MCP config for these.</p>
1907
- <p><strong>Azure DevOps.</strong> Microsoft's <a href="https://github.com/microsoft/azure-devops-mcp" rel="noopener">Azure DevOps MCP server</a>, run as <code>npx -y @azure-devops/mcp &lt;org&gt; -a pat -d all</code>, with every tool group the server has. The organization comes from <code>org_url</code> (<code>https://dev.azure.com/acme</code> or <code>https://acme.visualstudio.com</code>). ForgeQE passes the PAT from <code>token_env</code> (default <code>ADO_PAT</code>) the way the server wants it; without a PAT it uses your <code>az login</code> session. Its tools are <code>azure_devops_*</code>: work items and comments, queries, backlogs, iterations, test plans, pipelines and their logs, repos, branches, pull requests, wiki pages (read, create, and update), search across code, wikis, and work items, and Advanced Security alerts. <code>mcp_domains</code> limits them to some groups. It needs Node.js. Azure DevOps Server (on-premises) isn't supported by Microsoft's server, so it uses ForgeQE's API.</p>
1936
+ <p><strong>Azure DevOps.</strong> Microsoft's <a href="https://github.com/microsoft/azure-devops-mcp" rel="noopener">Azure DevOps MCP server</a>, run as <code>npx -y @azure-devops/mcp &lt;org&gt; -a pat -d core work work-items pipelines</code>: projects and teams, iterations and boards, work items, and pipelines. Every tool's definition goes to the model with each request, so ForgeQE loads only these groups (about 19 tools, roughly 9.5K tokens, against about 18K for all of them); its own tools cover test plans, wiki pages, dashboards, and pull request reviews, and <code>query_api</code> reads anything else, such as classic releases. The organization comes from <code>org_url</code> (<code>https://dev.azure.com/acme</code> or <code>https://acme.visualstudio.com</code>). ForgeQE passes the PAT from <code>token_env</code> (default <code>ADO_PAT</code>) the way the server wants it; without a PAT it uses your <code>az login</code> session. Its tools are <code>azure_devops_*</code>. <code>mcp_domains</code> adds groups: <code>test-plans</code>, <code>repositories</code> (repos, branches, pull requests), <code>wiki</code>, <code>search</code> (code, wikis, and work items), <code>advanced-security</code>, or <code>[all]</code>. It needs Node.js. Azure DevOps Server (on-premises) isn't supported by Microsoft's server, so it uses ForgeQE's API.</p>
1908
1937
  <pre><code class="language-yaml">sources:
1909
1938
  azure_devops:
1910
1939
  org_url: https://dev.azure.com/acme # the MCP server takes the organization, not a project
1911
1940
  # project: Shop # optional: limit ForgeQE's own API calls to one project
1912
1941
  token_env: ADO_PAT
1913
1942
  mcp: true # false: API only
1914
- mcp_domains: [core, work-items, test-plans, pipelines] # optional: fewer tool groups
1943
+ mcp_domains: [core, work, work-items, pipelines, repositories] # optional: the default four, plus repos
1915
1944
  </code></pre>
1916
1945
  <p>Microsoft's server has no dashboard tools and can't save queries. Ask for a dashboard (&quot;create a dashboard in QI-Payments with all defects in every state and the current sprint's stories&quot;) and ForgeQE's own <code>create_ado_dashboard</code> tool does it through the REST API with <code>ADO_PAT</code>: it runs each WIQL query once to check it, saves it as a shared query under <code>Shared Queries/ForgeQE</code> (updating one of the same name), and creates a team or project dashboard with a work item list or count tile per query, plus optional markdown text. The PAT needs Work Items (read and write) and permission to edit dashboards. Chart widgets are not made through the API; for those the agent uses the browser, which has to be signed in to <code>dev.azure.com</code> (<code>forgeqe login &lt;name&gt;</code> with a login for it under <code>logins:</code>).</p>
1917
1946
  <p>Microsoft's wiki tools (<code>azure_devops_wiki</code>, <code>azure_devops_wiki_upsert_page</code>) only work in a wiki that already exists. In a project without one they answer &quot;No wiki found&quot;. Ask for a wiki page and ForgeQE's <code>write_ado_wiki_page</code> tool writes it through the REST API instead. If the project has no wiki, the tool creates the project wiki (<code>&lt;Project&gt;.wiki</code>) first, then any missing parent pages (empty), then the page itself. A page that already exists is replaced. Code wikis are written on their published branch. The PAT needs Wiki (read and write). A login added to <code>forgeqe.yaml</code> while ForgeQE is running is picked up the next time the agent lists logins or signs in.</p>
@@ -2114,6 +2143,7 @@ agents: [browser]
2114
2143
  <tr><td><code>/profile &lt;name&gt;</code> or Tab</td><td>Switch the model profile</td></tr>
2115
2144
  <tr><td><code>/logs [shots]</code></td><td>Save this session's log and runs in one archive to share</td></tr>
2116
2145
  <tr><td><code>/features</code></td><td>What ForgeQE can do here: ✓ ready, ◐ works with some parts to set up, ○ needs setup, with the fix (works without a model)</td></tr>
2146
+ <tr><td><code>/init</code></td><td>Set ForgeQE up in this folder, as <code>forgeqe init</code> does: <code>forgeqe.yaml</code>, <code>llms.json</code>, and editable prompts, skills, and knowledge; the session reads them at once</td></tr>
2117
2147
  <tr><td><code>/skills [name]</code></td><td>The skills each agent can use, or one skill's instructions</td></tr>
2118
2148
  <tr><td><code>/auth [system]</code>, <code>/auth logout &lt;system&gt;</code></td><td>Sign in to a system in the browser (the token is typed unseen), forget one; <code>/auth</code> alone shows what is signed in</td></tr>
2119
2149
  <tr><td><code>/clear</code>, <code>/help</code>, <code>/exit</code></td><td>Clear the transcript, show help, quit</td></tr>
@@ -103,7 +103,7 @@ sources:
103
103
  # # project: Shop # optional: limit ForgeQE's own test, sprint, and bug calls to one project. Or ADO_PROJECT. * or all means every project.
104
104
  # token_env: ADO_PAT # PAT with Test Management + Work Items (read & write)
105
105
  # mcp: true # Microsoft's Azure DevOps MCP server (needs npx); false: API only
106
- # # mcp_domains: [core, work, work-items, test-plans, pipelines, repositories, wiki, search, advanced-security] # default: all
106
+ # # mcp_domains: [core, work, work-items, pipelines] # the default; add test-plans, repositories, wiki, search, advanced-security, or use [all]
107
107
  # jira:
108
108
  # url: https://acme.atlassian.net # or JIRA_URL; Server/Data Center URLs work too
109
109
  # email_env: JIRA_EMAIL # Cloud only
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capagents/forgeqe",
3
- "version": "1.0.9",
3
+ "version": "1.1.1",
4
4
  "description": "ForgeQE: a browser agent CLI that runs goals and test cases in Chrome and turns passing runs into tests in your repo",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/prompts/brain.md CHANGED
@@ -12,7 +12,7 @@ Find what the user wants from their message. Then do it with your tools. ForgeQE
12
12
  - A request to write or repair tests, or a CI pipeline task.
13
13
  - A question.
14
14
 
15
- A message can also be a task specification with the parts Goal, Context, Steps, Rules, and Result. Refine in the shell writes this type of message. Do the goal. Use the context as facts. Do the steps in sequence. Obey the rules. Give the result that it asks for.
15
+ A message can also be a task specification with the parts Role, Objective, Context, Steps, Rules, Output format, and Summary. Refine in the shell writes this type of message. Take the role. Do the objective. Use the context as facts. Do the steps in sequence. Obey the rules. Give the answer in the output format.
16
16
 
17
17
  ForgeQE tools (the client adds the forgeqe_ prefix):
18
18
  - browser_run: does one goal in a real browser, and verifies it. Use it for all work that must occur on a website. Set purpose to test for a flow of the application under test. Set purpose to task for all other work, such as finding, linking, or checking work items, or reading data from a tool. A task never becomes an automated test.
@@ -72,8 +72,21 @@ Skills:
72
72
  Azure DevOps, Jira, Xray, and other systems:
73
73
  - To run test cases from these systems, files, or text, always use run_test_cases. It turns each case into a browser goal, writes the reports, and sends the results back.
74
74
  - To look at test cases before they run, use find_test_cases.
75
- - For all other data in those systems, use the MCP tools of the system when its server is connected. This includes bugs, stories, comments, queries, boards, pipeline runs, and pull requests.
76
- - If the server is not connected, or it has no tool for what you need, read with query_api.
75
+ - Read data from these systems in this sequence:
76
+ 1. The MCP tools of the system, when its server is connected. This includes bugs, stories, comments, queries, boards, pipeline runs, and pull requests.
77
+ 2. query_api, when the server is not connected or has no tool for the data.
78
+ 3. The browser, only when both cannot give the data, or when the user asks to see a page.
79
+ - Do not use the browser to read data that an API gives. The browser is slow, and it needs a sign-in that a saved login may not have.
80
+ - Do not call the APIs of these systems from the shell, with curl, Python, PowerShell, or a script. The shell does not have the credentials, and ForgeQE blocks these commands. Use query_api.
81
+ - Azure DevOps classic releases are not in the MCP tools. Read them with query_api and the release host, for example https://vsrm.dev.azure.com/<organization>/<project>/_apis/release/releases?$top=10 or _apis/release/deployments.
82
+ - When the user asks about releases in Azure DevOps, read both: the classic releases, and the runs of the deployment pipelines (the pipelines MCP tools). Say which of them each project uses.
83
+ - For release details, find what is deployed now, not only the last run. Do these steps for each project:
84
+ 1. Read the environments with query_api: <project>/_apis/distributedtask/environments.
85
+ 2. Read the deployments of each environment: <project>/_apis/distributedtask/environments/<id>/environmentdeploymentrecords?top=5&api-version=7.1-preview.1.
86
+ 3. Read the stages of each deployment run: <project>/_apis/build/builds/<id>/timeline. Give each stage with its result.
87
+ 4. When a stage failed, give the cause from the timeline: the failed task, check, or approval, and its message.
88
+ 5. Compare the newest CI build with the build that the environments have. Say when a newer build is not deployed.
89
+ - Keep these cases apart: a project without a deployment pipeline, a pipeline without runs, and a run that failed.
77
90
  - Create or change items only when the user asks. Examples are to file a bug, add a comment, move an issue, or edit a work item. Say what you changed, with its id or key.
78
91
  - The only exception is to save test cases that you wrote from a story (see below).
79
92
  - Azure DevOps dashboards: use create_ado_dashboard, not the browser.
@@ -320,6 +333,7 @@ Rules:
320
333
  - Use bold only for the one word or number that is important in a line, such as a status or a count. Do not make full sentences bold.
321
334
  - Use a table only for two or three short columns.
322
335
  - Keep replies short and specific. Give in full the test cases, tests, and reviews that the user asked for. Keep only your own comments short.
336
+ - A status alone is not an answer. When a result is "failed", empty, or "none found", find the cause with your tools before you reply. Give the cause and the next action that fixes it.
323
337
  - When the user asks for a report, a write-up, or a summary to share, collect the facts with your tools. Examples are "create a release report" and "write up the open defects".
324
338
  - Then save the report with write_report. Reply with three to five lines of summary. The shell shows the paths of the report as links, so do not repeat them.
325
339
  - Do not only paste a long report into the reply.
package/prompts/refine.md CHANGED
@@ -5,33 +5,41 @@ used_by: "the shell's Refine (ctrl+r)"
5
5
  ---
6
6
  You refine a request that the user typed for ForgeQE, a test automation assistant. ForgeQE then sends the refined request to its agent. You do not do the request. You do not change data.
7
7
 
8
- Write the refined request as a short task specification for the agent. Write it in ASD-STE100 Simplified Technical English:
8
+ Write the refined request in ASD-STE100 Simplified Technical English:
9
9
  - Use short sentences: 20 words or fewer in an instruction, 25 words or fewer in a description.
10
10
  - Give one instruction in each sentence. Start an instruction with a verb.
11
11
  - Use the active voice.
12
12
  - Use simple words with one meaning. For example, use "make sure", not "ensure", and "use", not "utilize".
13
13
  - Use the same name for the same thing each time.
14
14
 
15
- Fill in these parts:
16
- - goal: one instruction that says what the agent must do. Start with a verb. Example: "Run the test cases of Azure DevOps test plan 412, suite 77."
17
- - context: the facts that the agent needs. Give the system, the project, the work items, the files, and the runs with their exact names and ids. Give one fact for each line.
15
+ Write the request as a system prompt for the agent. Fill in these parts, in this sequence:
16
+ - role: the role that the agent takes for this task, as one short description. Examples: "A release analyst who reads Azure DevOps deployments." and "A test engineer who runs manual test cases in the browser."
17
+ - objective: one instruction that says what the agent must do. Start with a verb. Name the exact thing to get or do, not a general word. Example: "Run the test cases of Azure DevOps test plan 412, suite 77." Example: "Get what is deployed now in each environment of each project, with the stages and the cause of each failed deployment."
18
+ - context: the facts that the agent needs. Give the system, the project, the work items, the files, and the runs with their exact names. Give one fact for each line.
19
+ - Give names, not internal ids such as GUIDs. Give an id only when it is the name that people use, for example a work item number, a test plan or suite number, or a build number.
20
+ - Put a list of items of the same type on one line, for example "Projects: Autothon, CQube.AI, QI-Payments".
18
21
  - Give only the facts that this task needs. Do not give the working directory or the settings of forgeqe.yaml. The agent already has them.
19
- - steps: the actions, in sequence, when the request has more than one action. Give one action for each step. Leave this empty for a request with one action.
22
+ - steps: the actions, in sequence, when the request has more than one action. Give one action for each step. Each step must add information that the objective does not give, for example which data to read or how to compare it. When the steps only say the objective again, leave steps empty.
20
23
  - rules: the limits that the user gave or that the setup sets. Examples are "Do not send results back to Azure DevOps", "Use 2 browsers at the same time", and "Show the browser". Give only rules that come from the user or from "This session".
21
- - result: what the agent must give back. Examples are a report saved as a file with a short summary, a test file and its run, or a list of test cases with links.
24
+ - output: the output format. Say what the agent gives back and how it is laid out. Examples: "One section for each project, with a line for each environment: the deployed build, its date, and its status." and "A report file, with a summary of three lines in the chat."
25
+ - summary: what the user gets, in one sentence of 15 words or fewer. The agent reads it last. Do not copy the objective. Example: "Show the deployed build in each environment, and why each deployment failed."
22
26
 
23
27
  Rules for your work:
24
28
  - Keep the intent and the scope of the user exactly. Do not add work that the user did not ask for. Do not remove work that the user asked for.
29
+ - Keep each word that changes the result, such as "current", "all", "details", or "failed". For example, "current release" means what is deployed now, not the last run.
25
30
  - Use the names that ForgeQE uses, for example "Azure DevOps project QI-Payments", "test plan 412, suite 77", "story 1761", or "SHOP-12".
26
31
  - Use "This session" and "What ForgeQE can do here" to know the capabilities and the setup.
27
32
  - Describe each action in plain words, for example "run the test cases" or "write a Playwright test". Do not name the tools of ForgeQE or the capability ids.
28
33
  - Change references such as "the last run", "that story", or "the payments plan" into the item that they point to. Do this only when exactly one item fits.
29
34
  - Check facts with your read-only tools. For example, check that a work item, a test plan, a suite, or a run exists, what its name is, and how many cases it has.
30
- - Put each fact that you state in grounded, and say if you checked it.
35
+ - Put each fact of context in grounded, with the same words, and say if you checked it. Do not add facts to grounded that are not in context.
36
+ - A request can mean more than one thing. Then select the meaning that the capabilities of ForgeQE support best, and write the objective for it. Say the meaning that you selected in assumed.
37
+ - Do not ask about a meaning that you selected in assumed. The user sees assumed and can change it.
38
+ - Put a question in missing only when you cannot select a meaning and a wrong selection gives a different result. In the question, give the possible meanings, for example "Classic releases, deployment pipeline runs, or release readiness (GO / NO-GO)?".
31
39
  - Do not invent an id, a URL, a project, or a file.
32
40
  - If you cannot find or check an item, put a short question for the user in missing.
33
41
  - If a capability that the request needs is not set up, put this in missing. Say what the user must set up.
34
42
  - Keep the settings that the user gave, for example the number of browsers, a visible browser, or whether results go back. Do not add other settings.
35
43
  - Write in the language of the user.
36
44
 
37
- Finish with the structured result: goal, context, steps, rules, result, grounded, assumed, and missing.
45
+ Finish with the structured result: role, objective, context, steps, rules, output, summary, grounded, assumed, and missing.
@@ -2,7 +2,7 @@ import { realpathSync } from "node:fs"
2
2
  import path from "node:path"
3
3
 
4
4
  import type { CodeEvent, Usage } from "../types.ts"
5
- import { findOpencode, openSession, type OpencodeSession } from "../code/runtime.ts"
5
+ import { agentBashPermission, findOpencode, openSession, type OpencodeSession } from "../code/runtime.ts"
6
6
  import { privateEnvNames } from "../childEnv.ts"
7
7
  import type { AppConfig } from "../config.ts"
8
8
  import { externalMcp, externalNotes, type ExternalPlan } from "../mcp/external.ts"
@@ -144,7 +144,14 @@ export async function openBrain(opts: BrainOptions): Promise<Brain> {
144
144
  secrets: Object.assign({}, ...external.servers.map((s) => s.secrets)),
145
145
  signal: opts.signal,
146
146
  onEvent,
147
- agent: { name: BRAIN_AGENT, description: "ForgeQE: browser runs, test cases, tests, and CI pipelines", prompt: `${brainPrompt()}\n\nThis session:\n${notes}`, skills: "forgeqe" },
147
+ agent: {
148
+ name: BRAIN_AGENT,
149
+ description: "ForgeQE: browser runs, test cases, tests, and CI pipelines",
150
+ prompt: `${brainPrompt()}\n\nThis session:\n${notes}`,
151
+ skills: "forgeqe",
152
+ // Systems are read through MCP or query_api, never by scripts in the shell that handle tokens themselves.
153
+ permission: { bash: agentBashPermission(privateEnvNames(config)) },
154
+ },
148
155
  skills: loadSkills(config.skills, cwd).skills,
149
156
  schema: BRAIN_SCHEMA,
150
157
  mcp: {
@@ -267,6 +267,18 @@ export const BASH_PERMISSION = {
267
267
  "*gh repo delete*": "deny",
268
268
  }
269
269
 
270
+ /**
271
+ * ForgeQE's agent's shell: everything BASH_PERMISSION allows, except calling Azure DevOps, Jira, Xray, or Confluence
272
+ * APIs directly (their REST paths) or touching a secret by name. Those systems are read with their MCP tools or
273
+ * query_api, which hold the credentials; a script that builds its own auth header from a token is never needed.
274
+ */
275
+ export function agentBashPermission(secretNames: string[]): Record<string, string> {
276
+ const bash: Record<string, string> = { ...BASH_PERMISSION }
277
+ for (const p of ["*_apis/*", "*/rest/api/*", "*/rest/raven/*", "*/wiki/rest/*", "*/wiki/api/v2/*"]) bash[p] = "deny"
278
+ for (const name of secretNames) if (/^[A-Z][A-Z0-9_]{2,}$/.test(name)) bash[`*${name}*`] = "deny"
279
+ return bash
280
+ }
281
+
270
282
  /** Commands that throw away the user's uncommitted work, also when wrapped in another command. */
271
283
  const DISCARD_WORK = ["git clean*", "git reset --hard*", "git stash*", "git restore*", "git checkout -- *", "git checkout .*"].flatMap((c) => [c, `*${c}`])
272
284
 
package/src/commands.ts CHANGED
@@ -10,6 +10,8 @@ export type ShellCommand =
10
10
  | { type: "logs"; shots: boolean }
11
11
  | { type: "skills"; name?: string }
12
12
  | { type: "features" }
13
+ /** forgeqe init in the current folder: forgeqe.yaml, llms.json, and editable prompts, skills, and knowledge. */
14
+ | { type: "init" }
13
15
  /** Sign in to a system (or save a secret by name), forget one, or show which are signed in. */
14
16
  | { type: "auth"; action: "status" | "login" | "logout"; system?: string }
15
17
  | { type: "text"; text: string }
@@ -33,6 +35,7 @@ export const HELP = [
33
35
  " /profile <name> switch LLM profile (or press tab)",
34
36
  " /logs [shots] save this session's log and runs in one archive to share (shots: with screenshots)",
35
37
  " /features what ForgeQE can do, and what each capability still needs here",
38
+ " /init set ForgeQE up in this folder: forgeqe.yaml, llms.json, editable prompts, skills, knowledge",
36
39
  " /skills [name] the skills each agent can use, or one skill's instructions",
37
40
  " /auth [system] sign in to Azure DevOps, GitHub, Jira, Confluence, TestRail, Zephyr, qTest or Xray in the browser",
38
41
  " (/auth alone: what is signed in; /auth logout <system>; /auth <ENV_NAME> saves one secret)",
@@ -43,7 +46,7 @@ export const HELP = [
43
46
  "Select text with the mouse to copy it.",
44
47
  ].join("\n")
45
48
 
46
- const COMMANDS = new Set(["help", "?", "exit", "quit", "q", "clear", "stop", "headed", "details", "verbose", "profile", "p", "logs", "skills", "features", "auth", "signin"])
49
+ const COMMANDS = new Set(["help", "?", "exit", "quit", "q", "clear", "stop", "headed", "details", "verbose", "profile", "p", "logs", "skills", "features", "auth", "signin", "init"])
47
50
 
48
51
  /** Session controls; every other line, including one that starts with a path, goes to the agent as text. */
49
52
  export function parseCommand(raw: string): ShellCommand {
@@ -75,6 +78,8 @@ export function parseCommand(raw: string): ShellCommand {
75
78
  return arg ? { type: "skills", name: arg } : { type: "skills" }
76
79
  case "features":
77
80
  return { type: "features" }
81
+ case "init":
82
+ return { type: "init" }
78
83
  case "auth":
79
84
  case "signin": {
80
85
  const [first, ...rest] = arg.split(/\s+/).filter(Boolean)
@@ -1,7 +1,26 @@
1
1
  import type { AppConfig } from "../config.ts"
2
2
 
3
- /** Azure DevOps MCP tool groups ForgeQE loads unless sources.azure_devops.mcp_domains says otherwise: every group the server has. */
4
- export const ADO_DOMAINS = ["all"]
3
+ /**
4
+ * Azure DevOps MCP tool groups ForgeQE loads unless sources.azure_devops.mcp_domains says otherwise. Every tool's
5
+ * definition goes to the model with each request, so only the groups the agent reads through MCP are loaded (about 19
6
+ * tools, ~9.5K tokens, against ~18K for all): projects and teams, sprints and boards, work items, and pipelines.
7
+ * ForgeQE's own tools cover test plans (run_test_cases), wiki pages, dashboards, and pull request reviews; query_api
8
+ * reads anything else. Add repositories, wiki, test-plans, search, or advanced-security in forgeqe.yaml, or use all.
9
+ */
10
+ export const ADO_DOMAINS = ["core", "work", "work-items", "pipelines"]
11
+
12
+ /** What each Azure DevOps MCP tool group gives the agent, in its words. */
13
+ const ADO_DOMAIN_WORDS: Record<string, string> = {
14
+ core: "projects and teams",
15
+ work: "iterations and boards",
16
+ "work-items": "work items",
17
+ pipelines: "build and pipeline runs",
18
+ repositories: "repos and pull requests",
19
+ wiki: "wiki pages",
20
+ "test-plans": "test plans",
21
+ search: "search across code, wikis and work items",
22
+ "advanced-security": "security alerts",
23
+ }
5
24
  export const ROVO_URL = "https://mcp.atlassian.com/v2/mcp"
6
25
  /** Also the time allowed for the first start, when npx or uvx downloads the server. */
7
26
  const TIMEOUT_MS = 120_000
@@ -67,23 +86,27 @@ export function externalMcp(cfg: AppConfig, which: Which = Bun.which, env: NodeJ
67
86
  else if (!auth) skipped.push({ label, why: `set ${ado.tokenEnv}, or sign in with az login` })
68
87
  else {
69
88
  const signIn = auth === "pat" ? `PAT in ${ado.tokenEnv}` : "Azure CLI sign-in"
89
+ const domains = ado.mcpDomains || ADO_DOMAINS
90
+ const covers = domains.includes("all") ? Object.values(ADO_DOMAIN_WORDS).join(", ") : domains.map((d) => ADO_DOMAIN_WORDS[d] || d).join(", ")
70
91
  servers.push({
71
92
  name: "azure_devops",
72
93
  label,
73
94
  signIn,
74
95
  about:
75
- `Microsoft's Azure DevOps MCP server: organization ${org}${ado.project ? `, project ${ado.project}` : ", every project"} (work items, boards, test plans, pipelines, repos, wiki pages, search across code, wikis and work items, security alerts). ` +
96
+ `Microsoft's Azure DevOps MCP server: organization ${org}${ado.project ? `, project ${ado.project}` : ", every project"} (${covers}). For what its tools do not cover (classic releases, and anything else), read with query_api. ` +
76
97
  (auth === "pat"
77
98
  ? `It signs in with the personal access token in ${ado.tokenEnv}. `
78
99
  : `${ado.tokenEnv} is not set, so it signs in as the Azure CLI's account (az login). When it answers TF400813 or "not authorized", that account has no access to ${org}: say so, and that setting ${ado.tokenEnv} (in .env, or /auth azure_devops with a token) or adding that account to the organization fixes it. `) +
79
100
  "Always pass project to its tools that take one: without it the server asks the client to pick a project, which this session cannot answer, so the call fails. " +
80
- "Its wiki tools only work in a wiki that exists and cannot create one; write wiki pages with ForgeQE's write_ado_wiki_page, which creates the project wiki when there is none. " +
101
+ (domains.includes("all") || domains.includes("wiki")
102
+ ? "Its wiki tools only work in a wiki that exists and cannot create one; write wiki pages with ForgeQE's write_ado_wiki_page, which creates the project wiki when there is none. "
103
+ : "Write wiki pages with ForgeQE's write_ado_wiki_page. ") +
81
104
  (ado.project
82
105
  ? `Use ${ado.project} unless the user names another project.`
83
106
  : "Work item ids are unique in the organization, so getting a work item by id works with any project name (from azure_devops_core_list_projects); its System.TeamProject field says which project it is in, so use that project for follow-up calls on it."),
84
107
  config: {
85
108
  type: "local",
86
- command: ["npx", "-y", "@azure-devops/mcp", org, "-a", auth, "-d", ...(ado.mcpDomains || ADO_DOMAINS)],
109
+ command: ["npx", "-y", "@azure-devops/mcp", org, "-a", auth, "-d", ...domains],
87
110
  ...(pat ? { environment: { PERSONAL_ACCESS_TOKEN: "{env:FORGEQE_ADO_MCP_TOKEN}" } } : {}),
88
111
  enabled: true,
89
112
  timeout: TIMEOUT_MS,
package/src/mcp/server.ts CHANGED
@@ -54,8 +54,18 @@ export function createMcpServer(opts: McpServerOptions) {
54
54
  base.emit?.(e)
55
55
  }
56
56
  : undefined
57
- const out = await tool.run(params.arguments || {}, { ...base, emit, signal: controller.signal })
57
+ const said = (ok: boolean) => {
58
+ if (tool.line && emit) emit({ type: "call", text: tool.line(params.arguments || {}), ok })
59
+ }
60
+ let out: unknown
61
+ try {
62
+ out = await tool.run(params.arguments || {}, { ...base, emit, signal: controller.signal })
63
+ } catch (err) {
64
+ if (!controller.signal.aborted) said(false)
65
+ throw err
66
+ }
58
67
  if (controller.signal.aborted) return finish({ content: [{ type: "text", text: "Stopped by the user." }], isError: true })
68
+ said(true)
59
69
  return finish({ content: [{ type: "text", text: typeof out === "string" ? out : JSON.stringify(out, null, 2) }] })
60
70
  } catch (err) {
61
71
  return finish({ content: [{ type: "text", text: controller.signal.aborted ? "Stopped by the user." : (err as Error).message || String(err) }], isError: true })