d365fo-mcp 1.24.0 → 1.25.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/.github/copilot-instructions.md +9 -0
- package/README.md +243 -56
- package/dist/bridge/bridgeAdapter.d.ts +6 -1
- package/dist/bridge/bridgeAdapter.js +31 -13
- package/dist/cli/commands/session.d.ts +10 -0
- package/dist/cli/commands/session.js +97 -15
- package/dist/cli/index.js +3 -1
- package/dist/cli/session/analyze.d.ts +47 -4
- package/dist/cli/session/analyze.js +136 -32
- package/dist/cli/session/claudeCodeLog.d.ts +4 -0
- package/dist/cli/session/claudeCodeLog.js +228 -0
- package/dist/cli/session/copilotChatLog.js +1 -0
- package/dist/cli/session/sessionLog.d.ts +39 -5
- package/dist/cli/session/sessionLog.js +11 -7
- package/dist/config/settings.js +41 -0
- package/dist/metadata/binaryModelImport.d.ts +24 -1
- package/dist/metadata/binaryModelImport.js +54 -5
- package/dist/metadata/modelDescriptor.d.ts +9 -2
- package/dist/metadata/modelDescriptor.js +20 -16
- package/dist/metadata/modelInventory.d.ts +169 -0
- package/dist/metadata/modelInventory.js +494 -0
- package/dist/metadata/symbolIndex.d.ts +5 -0
- package/dist/metadata/symbolIndex.js +43 -1
- package/dist/prompts/systemInstructions.js +10 -1
- package/dist/scripts/build-database.js +93 -3
- package/dist/scripts/build-fts.js +93 -3
- package/dist/scripts/extract-metadata.js +34 -0
- package/dist/scripts/startupIndexWorker.js +91 -3
- package/dist/server/toolSchemas/buildD365foProject.js +1 -1
- package/dist/server/toolSchemas/getObjectInfo.d.ts +1 -1
- package/dist/server/toolSchemas/getObjectInfo.js +1 -1
- package/dist/server/toolSchemas/index.d.ts +1 -1
- package/dist/server/toolSchemas/labels.js +2 -2
- package/dist/server/toolSchemas/runBpCheck.js +3 -3
- package/dist/server/toolSchemas/runSystestClass.js +2 -2
- package/dist/tools/analysis/entityXmlRules.d.ts +12 -0
- package/dist/tools/analysis/entityXmlRules.js +98 -0
- package/dist/tools/analysis/testClassContext.d.ts +37 -0
- package/dist/tools/analysis/testClassContext.js +64 -0
- package/dist/tools/analysis/validateXpp.d.ts +6 -1
- package/dist/tools/analysis/validateXpp.js +24 -1
- package/dist/tools/d365foFile.js +14 -0
- package/dist/tools/knowledge/findCocExtensions.js +33 -2
- package/dist/tools/knowledge/xppKnowledge.js +66 -5
- package/dist/tools/labels.d.ts +1 -1
- package/dist/tools/labels.js +6 -3
- package/dist/tools/readers/classInfo.js +7 -3
- package/dist/tools/readers/edtInfo.js +30 -7
- package/dist/tools/readers/enumInfo.js +22 -4
- package/dist/tools/readers/getWorkspaceInfo.js +18 -0
- package/dist/tools/readers/modelInfo.d.ts +29 -0
- package/dist/tools/readers/modelInfo.js +184 -0
- package/dist/tools/readers/objectInfoRegistry.d.ts +1 -1
- package/dist/tools/readers/objectInfoRegistry.js +4 -1
- package/dist/tools/readers/objectXml.d.ts +9 -1
- package/dist/tools/readers/objectXml.js +37 -4
- package/dist/tools/readers/tableInfo.js +70 -5
- package/dist/tools/sdlc/bpChangedSince.d.ts +36 -0
- package/dist/tools/sdlc/bpChangedSince.js +132 -0
- package/dist/tools/sdlc/buildProject.d.ts +24 -0
- package/dist/tools/sdlc/buildProject.js +27 -3
- package/dist/tools/sdlc/runBpCheck.d.ts +5 -0
- package/dist/tools/sdlc/runBpCheck.js +91 -8
- package/dist/tools/sdlc/sysTestRunner.d.ts +13 -1
- package/dist/tools/sdlc/sysTestRunner.js +198 -53
- package/dist/tools/sdlc/trace/contract.js +2 -1
- package/dist/tools/sdlc/udeDeploy.d.ts +4 -1
- package/dist/tools/sdlc/udeDeploy.js +17 -2
- package/dist/tools/sdlc/udeEnvironmentStatus.d.ts +17 -0
- package/dist/tools/sdlc/udeEnvironmentStatus.js +118 -0
- package/dist/tools/sdlc/udeSyncScope.d.ts +15 -0
- package/dist/tools/sdlc/udeSyncScope.js +108 -0
- package/dist/tools/sdlc/udeSysTest.d.ts +50 -0
- package/dist/tools/sdlc/udeSysTest.js +52 -3
- package/dist/tools/sdlc/undoLastModification.js +19 -2
- package/dist/tools/smart/codeGen.js +70 -34
- package/dist/tools/smart/generateSmartReport.d.ts +6 -0
- package/dist/tools/smart/generateSmartReport.js +6 -2
- package/dist/tools/specs/d365foFileOpSpecs.d.ts +1 -0
- package/dist/tools/specs/d365foFileOpSpecs.js +111 -39
- package/dist/tools/specs/labelsOpSpecs.js +14 -5
- package/dist/tools/specs/opSpecs.js +60 -2
- package/dist/tools/write/createD365File.js +9 -2
- package/dist/tools/write/createLabel.js +9 -0
- package/dist/tools/write/createProject.js +5 -2
- package/dist/tools/write/dataEntityOps.d.ts +12 -0
- package/dist/tools/write/dataEntityOps.js +67 -3
- package/dist/tools/write/deleteLabel.d.ts +36 -0
- package/dist/tools/write/deleteLabel.js +344 -0
- package/dist/tools/write/directXmlWriters.d.ts +35 -2
- package/dist/tools/write/directXmlWriters.js +135 -26
- package/dist/tools/write/inlineWriteVerification.js +5 -0
- package/dist/tools/write/modelLifecycle.d.ts +68 -0
- package/dist/tools/write/modelLifecycle.js +769 -0
- package/dist/tools/write/modifyD365File.d.ts +10 -0
- package/dist/tools/write/modifyD365File.js +49 -21
- package/dist/tools/write/preserveMetadataElements.d.ts +12 -6
- package/dist/tools/write/preserveMetadataElements.js +20 -14
- package/dist/tools/write/projectAction.js +62 -5
- package/dist/tools/write/reportDesignXml.d.ts +21 -3
- package/dist/tools/write/reportDesignXml.js +4 -4
- package/dist/tools/write/reportRdlXml.d.ts +65 -0
- package/dist/tools/write/reportRdlXml.js +587 -0
- package/dist/tools/write/serializerOmittedDefaults.d.ts +37 -0
- package/dist/tools/write/serializerOmittedDefaults.js +74 -0
- package/dist/tools/write/tagsApply.d.ts +73 -0
- package/dist/tools/write/tagsApply.js +253 -0
- package/dist/tools/xml/createTablePropertyHonesty.js +2 -0
- package/dist/tools/xml/dataEntityViewEdit.d.ts +20 -0
- package/dist/tools/xml/dataEntityViewEdit.js +122 -0
- package/dist/tools/xml/dataEntityXml.js +34 -4
- package/dist/tools/xml/entityUnmappedField.d.ts +65 -0
- package/dist/tools/xml/entityUnmappedField.js +140 -0
- package/dist/tools/xml/tableFieldRemoval.d.ts +2 -0
- package/dist/tools/xml/tableFieldRemoval.js +1 -1
- package/dist/tools/xml/tagsEdit.d.ts +53 -0
- package/dist/tools/xml/tagsEdit.js +420 -0
- package/dist/utils/axTablePropertyOrder.js +2 -0
- package/dist/utils/configManager.d.ts +8 -0
- package/dist/utils/configManager.js +18 -0
- package/dist/utils/customModelStore.d.ts +30 -0
- package/dist/utils/customModelStore.js +62 -0
- package/dist/utils/dataverseAuth.d.ts +3 -0
- package/dist/utils/dataverseAuth.js +33 -11
- package/dist/utils/dataverseTokenCache.d.ts +28 -0
- package/dist/utils/dataverseTokenCache.js +144 -0
- package/dist/utils/envListSetting.d.ts +52 -0
- package/dist/utils/envListSetting.js +118 -0
- package/dist/utils/formControlPropertyXml.js +20 -5
- package/dist/utils/integerText.d.ts +12 -0
- package/dist/utils/integerText.js +24 -0
- package/dist/utils/loadEnv.d.ts +12 -1
- package/dist/utils/loadEnv.js +15 -1
- package/dist/utils/objectFileLookup.d.ts +16 -0
- package/dist/utils/objectFileLookup.js +33 -0
- package/dist/utils/payloadBudget.d.ts +12 -0
- package/dist/utils/payloadBudget.js +25 -0
- package/dist/utils/toolProgressMessage.js +4 -0
- package/dist/utils/warningBaseline.d.ts +60 -0
- package/dist/utils/warningBaseline.js +92 -0
- package/dist/workspace/createdArtifactLedger.d.ts +5 -0
- package/dist/workspace/projectFile.d.ts +36 -2
- package/dist/workspace/projectFile.js +239 -338
- package/dist/workspace/projectMembership.d.ts +21 -0
- package/dist/workspace/projectMembership.js +40 -0
- package/dist/workspace/rnrprojText.d.ts +57 -0
- package/dist/workspace/rnrprojText.js +236 -0
- package/package.json +1 -1
|
@@ -57,6 +57,8 @@ PowerShell / any terminal command **WILL HANG** in VS 2022 / VS 2026 MCP integra
|
|
|
57
57
|
2. **`d365fo_file` (action=create/modify) applies immediately** (no dry-run / preview). Describe the change in chat and wait for explicit user confirmation ("apply", "ok", "yes") before calling. Revert with `d365fo_file(action="undo")` (or pass `createBackup=true` to keep a `.bak`).
|
|
58
58
|
3. **Never** use `replace_string_in_file`, `edit_file`, `apply_patch`, or any built-in file-write tool on `.xml` or `.xpp` files — **not even as a fallback** when `d365fo_file(action="modify")` fails. These bypass `IMetadataProvider` and corrupt VS 2022's in-memory model. If `d365fo_file(action="modify")` errors, STOP and report the error verbatim.
|
|
59
59
|
|
|
60
|
+
4. **Tags (free-text label, e.g. a ticket key or a project name):** never hand-edit `<Tags>`. `properties.tags` on create, `tags` on add-*/modify-field/modify-enum-value, `modify-property propertyPath="Tags"` on an existing object (`tagsMode`=add|remove, empty value removes). `D365FO_DEFAULT_TAG` in the instance `.env` is applied to creates/adds without `tags`; `tags=""` opts out for one call.
|
|
61
|
+
|
|
60
62
|
### Build automation
|
|
61
63
|
|
|
62
64
|
4. Never run `build_d365fo_project()` automatically — only on explicit user request ("build", "compile", "check errors"). On UDE, a request to run a test whose code changed since the last deployment counts: tests run against deployed code, so build with `deploy: true` first. Say so before a full sync (`dbSync: true`).
|
|
@@ -83,6 +85,13 @@ PowerShell / any terminal command **WILL HANG** in VS 2022 / VS 2026 MCP integra
|
|
|
83
85
|
11. **The post-write diff must be additive or narrowly targeted** — verify via `get_workspace_info(changes=true)` (or re-read with `get_object_info`) that no unrelated XML nodes (`<DataSources>`, `<Controls>`, methods, pattern metadata) disappeared. If they did, the edit failed: `d365fo_file(action="undo")`.
|
|
84
86
|
12. **An example form named by the user is a pattern contract** — keep its pattern family and required scaffolding (datasources, ActionPane/Tab/grid/QuickFilter); missing pattern elements are a failed generation even if the XML is well-formed.
|
|
85
87
|
|
|
88
|
+
### Scope discipline
|
|
89
|
+
|
|
90
|
+
- **Surface ambiguity, do not pick silently.** If the request has several plausible readings (which object, which extension mechanism, which model), name them and ask; state any assumption you do make.
|
|
91
|
+
- **Smallest change that does what was asked.** No extra fields, methods, parameters, classes or abstractions "for later". Match the style of the surrounding X++.
|
|
92
|
+
- **Touch only what the request needs.** Do not reformat, rename or "improve" adjacent code. Unrelated problems you notice (dead code, BP warnings in other objects) — mention them, do not fix them unasked. Clean up only what your own change made unused.
|
|
93
|
+
- **Define "done" before writing.** Say how it will be verified (`validate_code` clean, build clean, `run_systest_class` for the new behaviour) and check it before reporting success; if a check was skipped or failed, say so.
|
|
94
|
+
|
|
86
95
|
### Spending tool calls
|
|
87
96
|
|
|
88
97
|
13. **Issue independent read-only calls together, in one step.** Every tool call re-reads the whole conversation, so a turn costs the round trip, not the tool. `get_object_info`, `search`, `labels`, `get_knowledge`, `object_patterns` and `find_references` have no side effects and never need to wait for each other — five lookups are one step, not five.
|
package/README.md
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
1
3
|
# D365 F&O MCP Server
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
### Grounded AI development for Dynamics 365 Finance & Operations
|
|
4
6
|
|
|
5
|
-
**22
|
|
7
|
+
**22 MCP tools that know every X++ class, table, form, EDT and label in *your* D365FO codebase —<br/>
|
|
8
|
+
so GitHub Copilot and Claude Code write X++ that compiles.**
|
|
6
9
|
|
|
7
10
|
[](https://www.npmjs.com/package/d365fo-mcp)
|
|
8
|
-
[](
|
|
11
|
+
[](LICENSE)
|
|
9
12
|
[](https://nodejs.org/)
|
|
10
13
|
[](https://www.typescriptlang.org/)
|
|
11
14
|
[](docs/TESTING.md)
|
|
@@ -13,117 +16,301 @@
|
|
|
13
16
|
[](eval/COVERAGE.md) [](eval/COVERAGE.md)
|
|
14
17
|
<!-- coverage-badge:end -->
|
|
15
18
|
|
|
16
|
-
*Grounded AI development for Dynamics 365 Finance & Operations — works with GitHub Copilot and Claude Code*
|
|
17
|
-
|
|
18
19
|
[](https://insiders.vscode.dev/redirect/mcp/install?name=d365fo&inputs=%5B%7B%22type%22%3A%22promptString%22%2C%22id%22%3A%22d365fo_server_url%22%2C%22description%22%3A%22D365FO%20MCP%20server%20URL%20(e.g.%20https%3A%2F%2Fyour-server.azurewebsites.net%2Fmcp%2F)%22%7D%5D&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22%24%7Binput%3Ad365fo_server_url%7D%22%7D)
|
|
19
20
|
[](https://insiders.vscode.dev/redirect/mcp/install?name=d365fo&quality=insiders&inputs=%5B%7B%22type%22%3A%22promptString%22%2C%22id%22%3A%22d365fo_server_url%22%2C%22description%22%3A%22D365FO%20MCP%20server%20URL%20(e.g.%20https%3A%2F%2Fyour-server.azurewebsites.net%2Fmcp%2F)%22%7D%5D&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22%24%7Binput%3Ad365fo_server_url%7D%22%7D)
|
|
20
21
|
[](https://cursor.com/install-mcp?name=d365fo&config=eyJ1cmwiOiJodHRwczovL3lvdXItc2VydmVyLmF6dXJld2Vic2l0ZXMubmV0L21jcC8ifQ%3D%3D)
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
<sub>The install buttons connect an editor to a server that is already deployed — no server yet? Start with the [Quick start](#-quick-start).</sub>
|
|
24
|
+
|
|
25
|
+
[**Quick start**](#-quick-start) ·
|
|
26
|
+
[**How it works**](#-how-it-works) ·
|
|
27
|
+
[**What to ask**](#-what-to-ask) ·
|
|
28
|
+
[**Tools**](#-the-22-tools) ·
|
|
29
|
+
[**Docs**](#-documentation) ·
|
|
30
|
+
[**Changelog**](CHANGELOG.md)
|
|
23
31
|
|
|
24
32
|
</div>
|
|
25
33
|
|
|
26
34
|
---
|
|
27
35
|
|
|
28
|
-
## Why
|
|
29
|
-
|
|
30
|
-
AI assistants excel at C#, Python, and JavaScript. X++ is different: your D365FO codebase is private, deeply customized, and invisible to every model — so AI confidently generates code that doesn't compile.
|
|
36
|
+
## 💡 Why
|
|
31
37
|
|
|
32
|
-
|
|
38
|
+
AI assistants are excellent at C#, Python and JavaScript. X++ is different: your D365FO codebase is
|
|
39
|
+
private, deeply customized and invisible to every model — so the AI confidently writes code against
|
|
40
|
+
methods, fields and labels that do not exist, and it does not compile.
|
|
33
41
|
|
|
34
|
-
|
|
42
|
+
This server pre-indexes your whole D365FO installation — **580 000+ symbols** across standard, ISV
|
|
43
|
+
and custom models, plus **20M+ label rows** — and puts it behind MCP tools. Every signature, every
|
|
44
|
+
existing CoC wrapper, every label and every form pattern is checked against *your* metadata
|
|
45
|
+
**before** the AI writes a line, and a write that cannot be proven is refused.
|
|
35
46
|
|
|
36
|
-
|
|
|
37
|
-
|
|
38
|
-
| Method signatures | Guessed → compile errors | Exact, from your codebase |
|
|
39
|
-
| Existing CoC wrappers | Manual AOT search | `extension_info(mode="coc")` in < 50 ms |
|
|
40
|
-
| New forms | Hand-written XML, broken patterns | Cloned from reference
|
|
41
|
-
| Labels | Hardcoded strings |
|
|
42
|
-
| Security chains | Hours of manual tracing | Role → Duty → Privilege → Entry
|
|
43
|
-
| Generated code | Hallucinated fields and types | Every reference proven against the index, gated before write |
|
|
47
|
+
| | Without this server | With this server |
|
|
48
|
+
|---|---|---|
|
|
49
|
+
| **Method signatures** | Guessed → compile errors | Exact, read from your codebase |
|
|
50
|
+
| **Existing CoC wrappers** | Manual AOT search | `extension_info(mode="coc")` in < 50 ms |
|
|
51
|
+
| **New forms** | Hand-written XML, broken patterns | Cloned from a reference form, validated against the platform's pattern rules |
|
|
52
|
+
| **Labels** | Hardcoded strings | The right existing `@SYS` / `@Module` label, found instantly |
|
|
53
|
+
| **Security chains** | Hours of manual tracing | Role → Duty → Privilege → Entry point in one call |
|
|
54
|
+
| **Generated code** | Hallucinated fields and types | Every reference proven against the index, gated before write |
|
|
44
55
|
|
|
45
56
|
---
|
|
46
57
|
|
|
47
|
-
##
|
|
58
|
+
## 🧭 How it works
|
|
48
59
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
| 🛡️ **Grounded generation** | Fail-closed gates: `prepare` issues grounding tokens, `validate_code(mode="references")` proves every identifier, `validate_code(mode="syntax")` enforces best practices — hallucinated code never reaches disk |
|
|
53
|
-
| 🧩 **Form pattern engine** | Complete catalog of Microsoft form patterns and sub-patterns: recommends the right pattern, clones reference forms with datasource re-binding, **deterministically expands** patterns that have no reference form, **auto-repairs** a form's missing required controls, validates structure and blocks invalid writes |
|
|
54
|
-
| ✍️ **Safe metadata writes** | C# bridge uses Microsoft's own `IMetadataProvider` wherever it can express the object; the few types and ops it cannot go through structured XML writers with ambiguity guards — never blind string replacement. Automatic `.rnrproj` registration, one-call undo |
|
|
55
|
-
| 🏗️ **SDLC integration** | MSBuild compilation with structured diagnostics, DB sync, xppbp best practices, SysTestRunner — all from chat. Optional `restartAos: true` refreshes the matching local IIS/IIS Express runtime after a successful build and requested sync. [Runtime restart](docs/AOS_RUNTIME_RESTART.md) |
|
|
56
|
-
| 🗄️ **Optional AxDB SQL** | Off by default and not even published until configured: `axdb_sql` runs read-only, parameterized queries against AxDB on the development VM, so the agent can check what the code actually persisted. Windows authentication; one SELECT checked on the parsed T-SQL tree, inside a transaction that is always rolled back; no result cache. [Setup](docs/AXDB_SQL.md) |
|
|
57
|
-
| ⏱️ **Optional performance trace** | Off by default and not published until enabled: `trace_d365fo` captures the AOS's ETW events (X++ method enter/exit, SQL latency) on the development VM while the agent — or you — reproduce a slow scenario, and analyses the capture: where the time goes per method, which statements run thousands of times from one caller. No timer code added to the application; parameter values never returned. [Setup and accuracy](docs/TRACE.md) |
|
|
58
|
-
| 📐 **X++ knowledge base** | Queryable rules: select grammar, CoC authoring, financial dimensions, the posting engine (`LedgerVoucher`), number sequences, `SysExtension`, Electronic Reporting, AX2012→D365FO migration — prevents deprecated APIs |
|
|
60
|
+
<p align="center">
|
|
61
|
+
<img src="docs/img/architecture.svg" alt="Architecture: the AI agent calls the d365fo-mcp server over MCP; reads are served from SQLite symbol and label indexes, writes pass four grounding gates and go through the C# metadata bridge into the D365FO development VM, whose metadata is indexed at build time." width="100%"/>
|
|
62
|
+
</p>
|
|
59
63
|
|
|
60
|
-
|
|
64
|
+
1. **Index** — the server extracts your AOT metadata once into two SQLite databases (symbols and
|
|
65
|
+
labels, FTS5 search in < 10 ms). On a D365FO VM the **C# metadata bridge** adds live reads
|
|
66
|
+
through Microsoft's own `IMetadataProvider` and compiler-resolved cross-references from
|
|
67
|
+
`DYNAMICSXREFDB`.
|
|
68
|
+
2. **Ground** — before the agent writes anything, `prepare` hands it the real signatures, existing
|
|
69
|
+
extensions, naming rules and a short-lived **grounding token** for the target object.
|
|
70
|
+
3. **Gate** — `validate_code` proves every type, field, method and label in the generated code and
|
|
71
|
+
checks the best-practice rules; forms are also checked against the platform's pattern rules.
|
|
72
|
+
Writes are **fail-closed**: anything unproven is blocked and the agent gets structured fixes.
|
|
73
|
+
4. **Build** — the write lands through the bridge (or a validated XML writer where the provider
|
|
74
|
+
cannot express the object), is added to your `.rnrproj`, and can be compiled, BP-checked,
|
|
75
|
+
synced and unit-tested from the same chat.
|
|
61
76
|
|
|
62
|
-
|
|
77
|
+
A typical change, end to end:
|
|
63
78
|
|
|
64
79
|
```mermaid
|
|
65
80
|
flowchart LR
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
81
|
+
ask(["💬 Your prompt"]) --> prep["<b>prepare</b><br/>signatures · existing CoC<br/>grounding token"]
|
|
82
|
+
prep --> gen["Agent writes X++"]
|
|
83
|
+
gen --> val{"<b>validate_code</b><br/>references + BP"}
|
|
84
|
+
val -- "unproven identifier<br/>or BP error" --> gen
|
|
85
|
+
val -- "all proven" --> write["<b>d365fo_file</b><br/>write + .rnrproj"]
|
|
86
|
+
write --> build["<b>build_d365fo_project</b><br/>xppc · BP · DB sync"]
|
|
87
|
+
build -- "compile error" --> gen
|
|
88
|
+
build -- "green" --> done(["✅ Ready for review"])
|
|
89
|
+
|
|
90
|
+
classDef gate fill:#bc4c00,stroke:#bc4c00,color:#ffffff
|
|
91
|
+
classDef ok fill:#1a7f37,stroke:#1a7f37,color:#ffffff
|
|
92
|
+
class val gate
|
|
93
|
+
class done ok
|
|
71
94
|
```
|
|
72
95
|
|
|
73
|
-
|
|
96
|
+
<details>
|
|
97
|
+
<summary><b>Form development pipeline</b> — patterns are rules, not suggestions</summary>
|
|
98
|
+
|
|
99
|
+
<br/>
|
|
100
|
+
|
|
101
|
+
Forms are the hardest artifact to generate correctly: each pattern dictates required containers,
|
|
102
|
+
their order and the allowed sub-patterns. The form pattern engine turns that into a guided
|
|
103
|
+
pipeline, grounded in pattern statistics mined from your own environment:
|
|
104
|
+
|
|
105
|
+
```mermaid
|
|
106
|
+
flowchart LR
|
|
107
|
+
A["<b>object_patterns</b><br/>analyze · recommend"] --> B["<b>object_patterns</b><br/>spec"]
|
|
108
|
+
B --> C["<b>generate_object</b><br/>scaffold · cloneFrom"]
|
|
109
|
+
C --> D{"<b>object_patterns</b><br/>validate"}
|
|
110
|
+
D -- "violations" --> C
|
|
111
|
+
D -- "clean" --> E["<b>d365fo_file</b><br/>create + .rnrproj"]
|
|
112
|
+
|
|
113
|
+
classDef gate fill:#bc4c00,stroke:#bc4c00,color:#ffffff
|
|
114
|
+
class D gate
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Violations the compiler would reject (wrong order, missing container, disallowed control)
|
|
118
|
+
**block the write**; recommendations only warn. Patterns without a reference form are expanded
|
|
119
|
+
deterministically, and a form's missing required controls can be repaired automatically.
|
|
120
|
+
|
|
121
|
+
</details>
|
|
74
122
|
|
|
75
123
|
---
|
|
76
124
|
|
|
77
|
-
## Quick
|
|
125
|
+
## 🚀 Quick start
|
|
78
126
|
|
|
79
|
-
>
|
|
127
|
+
> [!IMPORTANT]
|
|
128
|
+
> From D365FO platform update **10.0.49 (PU74)**, **Visual Studio 2026** is the supported IDE for
|
|
129
|
+
> X++ development — Microsoft no longer supports VS 2022 there. Earlier platform versions still use
|
|
130
|
+
> VS 2022 ≥ 17.14. [Details](https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/fin-ops/get-started/whats-new-platform-updates-10-0-49)
|
|
80
131
|
|
|
81
|
-
|
|
132
|
+
### 🖥️ Install on your D365FO VM — the usual case
|
|
133
|
+
|
|
134
|
+
One line in PowerShell installs Node.js if it is missing, installs the server from npm and runs the
|
|
135
|
+
setup wizard, which asks where the index should live and builds the C# bridge for you:
|
|
82
136
|
|
|
83
137
|
```powershell
|
|
84
138
|
irm https://raw.githubusercontent.com/dynamics365ninja/d365fo-mcp-server/main/install.ps1 | iex
|
|
85
139
|
```
|
|
86
140
|
|
|
87
|
-
Already have Node.js 24+?
|
|
141
|
+
Already have Node.js 24+? Skip the bootstrap:
|
|
88
142
|
|
|
89
143
|
```powershell
|
|
90
144
|
npm install -g d365fo-mcp
|
|
91
145
|
d365fo-mcp setup
|
|
92
146
|
```
|
|
93
147
|
|
|
94
|
-
Re-running either is safe. An installation made before the npm package existed is a git checkout
|
|
148
|
+
Re-running either is safe. An installation made before the npm package existed is a git checkout;
|
|
149
|
+
both commands leave it where it is and update it in place.
|
|
150
|
+
|
|
151
|
+
### 🔌 Connect to a server your team already runs
|
|
95
152
|
|
|
96
|
-
|
|
153
|
+
Nothing to install — point your editor at it (or use the install buttons at the top):
|
|
97
154
|
|
|
98
155
|
```powershell
|
|
99
156
|
npx d365fo-mcp connect https://your-server.azurewebsites.net
|
|
100
157
|
```
|
|
101
158
|
|
|
102
|
-
|
|
159
|
+
### ☁️ Deploy one shared server for the whole team
|
|
160
|
+
|
|
161
|
+
The metadata index lives in Blob Storage and downloads automatically on startup.
|
|
162
|
+
|
|
163
|
+
[](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fdynamics365ninja%2Fd365fo-mcp-server%2Frefs%2Fheads%2Fmain%2Finfrastructure%2Fazuredeploy.json)
|
|
164
|
+
|
|
165
|
+
Full guide, including the Azure DevOps pipelines that keep the index fresh:
|
|
166
|
+
[docs/SETUP_AZURE.md](docs/SETUP_AZURE.md).
|
|
167
|
+
|
|
168
|
+
> [!TIP]
|
|
169
|
+
> Every path ends with the **instruction file** (`CLAUDE.md` / `copilot-instructions.md`) that
|
|
170
|
+
> teaches the agent the grounding workflow, and a one-minute check that grounding really works.
|
|
171
|
+
> Both are in **[docs/QUICK_START.md](docs/QUICK_START.md)** — don't skip them.
|
|
172
|
+
|
|
173
|
+
<details>
|
|
174
|
+
<summary><b>Which deployment fits?</b> — local, shared or hybrid</summary>
|
|
175
|
+
|
|
176
|
+
<br/>
|
|
177
|
+
|
|
178
|
+
```mermaid
|
|
179
|
+
flowchart LR
|
|
180
|
+
agent(["🤖 Copilot · Claude Code"])
|
|
181
|
+
|
|
182
|
+
subgraph cloud["☁️ Azure · shared, read-only"]
|
|
183
|
+
app["App Service<br/>search · knowledge · patterns"]
|
|
184
|
+
blob[("Blob Storage<br/>prebuilt index")]
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
subgraph vm["🖥️ Your D365FO VM"]
|
|
188
|
+
local["Local server<br/>full or write-only"]
|
|
189
|
+
bridge["C# bridge"]
|
|
190
|
+
pld[("PackagesLocalDirectory")]
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
pipe["Azure DevOps<br/>extract → build → upload"] --> blob
|
|
194
|
+
blob -- "download on startup" --> app
|
|
195
|
+
agent -- "search & read" --> app
|
|
196
|
+
agent -- "write · build · test" --> local
|
|
197
|
+
local --> bridge --> pld
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
| Mode | Where | What it does |
|
|
201
|
+
|---|---|---|
|
|
202
|
+
| **Full** | your D365FO VM | Everything — search, generation, writes, build, tests. The simplest setup. |
|
|
203
|
+
| **Read-only** | Azure App Service | Shared index for the whole team; no writes, nothing installed on developer machines. |
|
|
204
|
+
| **Hybrid** | Azure + a local write-only companion | The team shares one index in Azure; each developer's VM only writes, builds and tests. |
|
|
205
|
+
|
|
206
|
+
Scenarios A–F in detail: [docs/SETUP.md](docs/SETUP.md) · server modes and tool profiles:
|
|
207
|
+
[docs/MCP_CONFIG.md](docs/MCP_CONFIG.md).
|
|
208
|
+
|
|
209
|
+
</details>
|
|
103
210
|
|
|
104
211
|
---
|
|
105
212
|
|
|
106
|
-
##
|
|
213
|
+
## 💬 What to ask
|
|
107
214
|
|
|
108
|
-
|
|
215
|
+
You never name tools — the agent picks them. Ask the way you would ask a colleague who knows the
|
|
216
|
+
codebase:
|
|
109
217
|
|
|
110
|
-
|
|
218
|
+
| You ask | The server |
|
|
219
|
+
|---|---|
|
|
220
|
+
| *"Add a CoC wrapper to `SalesLine.validateWrite` that blocks negative quantities"* | Reads the exact signature, lists existing wrappers, proves every reference, writes the extension class |
|
|
221
|
+
| *"Create a table `ContosoRentEquipmentTable` with a SimpleList form and labels in en-US and de"* | Checks names for collisions, reuses EDTs, picks the form pattern, creates labels, adds everything to the project |
|
|
222
|
+
| *"Who has access to the `VendPaymTerms` form?"* | Walks Role → Duty → Privilege → Entry point, including OLS policies |
|
|
223
|
+
| *"Is there a label for 'payment terms'?"* | Full-text search over every label file and language, custom models first |
|
|
224
|
+
| *"Where is `CustTable::find` called from?"* | Compiler-resolved cross-references from `DYNAMICSXREFDB` — every caller and reference type |
|
|
225
|
+
| *"Build the project, run BP and the SysTests"* | MSBuild with structured xppc diagnostics, xppbp, SysTestRunner — all from chat |
|
|
226
|
+
|
|
227
|
+
More real tool chains: [docs/USAGE_EXAMPLES.md](docs/USAGE_EXAMPLES.md).
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## ✨ Capabilities
|
|
232
|
+
|
|
233
|
+
| | |
|
|
234
|
+
|---|---|
|
|
235
|
+
| 🔍 **Full-codebase intelligence** | Classes, tables, forms, EDTs, enums, security artifacts and 20M+ labels, indexed with FTS5 — search in < 10 ms. On a D365FO VM, live metadata and compiler cross-references through the C# bridge. |
|
|
236
|
+
| 🛡️ **Grounded generation** | Fail-closed gates: `prepare` issues grounding tokens, `validate_code` proves every identifier and enforces best-practice rules — hallucinated code never reaches disk. |
|
|
237
|
+
| 🧩 **Form pattern engine** | The full catalog of Microsoft form patterns and sub-patterns: recommends a pattern, clones reference forms with datasource re-binding, expands patterns that have no reference form, repairs missing required controls and blocks invalid writes. |
|
|
238
|
+
| ✍️ **Safe metadata writes** | Through Microsoft's own `IMetadataProvider` wherever it can express the object; structured XML writers with ambiguity guards for the rest — never blind string replacement. Automatic `.rnrproj` registration and one-call undo. |
|
|
239
|
+
| 🏷️ **Tags on writes** | `<Tags>` on created objects and added elements (`tags` argument or `D365FO_DEFAULT_TAG`), set or cleared on existing objects with `modify-property propertyPath="Tags"`. |
|
|
240
|
+
| 🏗️ **SDLC from chat** | MSBuild with structured diagnostics, DB sync, xppbp, SysTestRunner. Optional `restartAos: true` refreshes the local AOS after a build — [runtime restart](docs/AOS_RUNTIME_RESTART.md). |
|
|
241
|
+
| 📐 **X++ knowledge base** | Queryable rules for select grammar, CoC authoring, financial dimensions, `LedgerVoucher` posting, number sequences, `SysExtension`, Electronic Reporting and AX 2012 → D365FO migration — keeps deprecated APIs out. |
|
|
242
|
+
|
|
243
|
+
**Opt-in tools** — off by default and not even published until you configure them:
|
|
244
|
+
|
|
245
|
+
| | |
|
|
246
|
+
|---|---|
|
|
247
|
+
| 🗄️ **`axdb_sql`** | Read-only, parameterized queries against AxDB on the development VM, so the agent can check what the code actually persisted. Windows authentication, one SELECT validated on the parsed T-SQL tree, always rolled back. [Setup](docs/AXDB_SQL.md) |
|
|
248
|
+
| ⏱️ **`trace_d365fo`** | Captures the AOS's ETW events while a slow scenario is reproduced and shows where the time goes — per X++ method, and which SQL statements run thousands of times from one caller. No timer code added. [Setup and accuracy](docs/TRACE.md) |
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## 🧰 The 22 tools
|
|
111
253
|
|
|
112
|
-
|
|
254
|
+
Several tools are unified behind a discriminator (`mode`, `action`, `domain`, `objectType`), so the
|
|
255
|
+
agent chooses from fewer, broader tools.
|
|
256
|
+
|
|
257
|
+
| Area | Tools |
|
|
258
|
+
|---|---|
|
|
259
|
+
| 🔍 **Discover** | `search` · `get_object_info` · `find_references` · `labels` |
|
|
260
|
+
| 🧠 **Understand** | `get_knowledge` · `analyze_code` · `extension_info` · `security_info` · `object_patterns` |
|
|
261
|
+
| 🛡️ **Ground & validate** | `prepare` · `validate_code` · `validate_object_naming` |
|
|
262
|
+
| ✍️ **Generate & write** | `generate_object` · `d365fo_file` · `update_symbol_index` |
|
|
263
|
+
| 🏗️ **Build & verify** | `build_d365fo_project` · `run_bp_check` · `run_systest_class` · `verify_d365fo_project` · `get_workspace_info` |
|
|
264
|
+
| 🧪 **Opt-in diagnostics** | `axdb_sql` · `trace_d365fo` |
|
|
265
|
+
|
|
266
|
+
Workspaces that already run other MCP servers can set `MCP_TOOL_PROFILE=core` to publish only the
|
|
267
|
+
17-tool create-and-build loop. Every tool, parameter and example prompt:
|
|
268
|
+
**[docs/MCP_TOOLS.md](docs/MCP_TOOLS.md)**.
|
|
113
269
|
|
|
114
270
|
---
|
|
115
271
|
|
|
116
|
-
##
|
|
272
|
+
## 🧪 How we keep it honest
|
|
273
|
+
|
|
274
|
+
Gates prove a *single* write is grounded. A self-improving **eval loop** checks that the server as a
|
|
275
|
+
whole keeps getting better at producing X++ that compiles, is BP-clean and matches the intended
|
|
276
|
+
metadata — on a real D365FO VM, against captured golden metadata and SysTest oracles.
|
|
277
|
+
|
|
278
|
+
```mermaid
|
|
279
|
+
flowchart LR
|
|
280
|
+
impl["<b>Implementer agent</b><br/>runs eval cases on a VM<br/>through the grounded tools"] -- "run records" --> corpus[("Corpus")]
|
|
281
|
+
corpus -- "clustered failures" --> imp["<b>Improver agent</b><br/>reproduce → fix → PR"]
|
|
282
|
+
imp -- "human review & merge" --> srv["<b>d365fo-mcp</b><br/>tools · knowledge · validators"]
|
|
283
|
+
srv -. "next run tests the fix" .-> impl
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
The coverage badges at the top count a topic only when the knowledge base teaches it, an eval case
|
|
287
|
+
with a captured golden proves it, and the tool path can build it — see
|
|
288
|
+
[eval/COVERAGE.md](eval/COVERAGE.md) and [docs/AGENT_EVAL_LOOP.md](docs/AGENT_EVAL_LOOP.md). The loop
|
|
289
|
+
opens pull requests; humans review and merge them.
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## 📚 Documentation
|
|
294
|
+
|
|
295
|
+
The full map, grouped by audience: **[docs/README.md](docs/README.md)**.
|
|
117
296
|
|
|
118
297
|
| Getting started | Reference | Operations |
|
|
119
|
-
|
|
120
|
-
| [Quick
|
|
298
|
+
|---|---|---|
|
|
299
|
+
| [Quick start](docs/QUICK_START.md) — connect or install | [All 22 tools](docs/MCP_TOOLS.md) | [Azure deployment](docs/SETUP_AZURE.md) |
|
|
121
300
|
| [Setup scenarios A–F](docs/SETUP.md) | [`.mcp.json` reference](docs/MCP_CONFIG.md) | [DevOps pipelines](docs/SETUP_AZURE.md#azure-devops-pipelines) |
|
|
122
|
-
| [Claude Code setup](docs/SETUP.md#claude-code-cli) | [Configuration](docs/CONFIGURATION.md) | [
|
|
123
|
-
| [Usage examples](docs/USAGE_EXAMPLES.md) — real tool chains | [Architecture](docs/ARCHITECTURE.md) | [
|
|
301
|
+
| [Claude Code setup](docs/SETUP.md#claude-code-cli) | [Configuration](docs/CONFIGURATION.md) | [Custom / ISV models](docs/CUSTOM_EXTENSIONS.md) |
|
|
302
|
+
| [Usage examples](docs/USAGE_EXAMPLES.md) — real tool chains | [Architecture](docs/ARCHITECTURE.md) | [Testing](docs/TESTING.md) |
|
|
124
303
|
| [Changelog](CHANGELOG.md) | [Knowledge authoring](docs/KNOWLEDGE_AUTHORING.md) | [Coverage](eval/COVERAGE.md) — what the badge counts |
|
|
125
304
|
| [Backlog](docs/BACKLOG.md) — deferred work | [New tool checklist](docs/NEW_TOOL_CHECKLIST.md) | [Eval loop](docs/AGENT_EVAL_LOOP.md) — the self-improvement harness |
|
|
126
305
|
|
|
127
|
-
##
|
|
306
|
+
## 🤝 Contributing & security
|
|
307
|
+
|
|
308
|
+
Issues and pull requests are welcome — read [CLAUDE.md](CLAUDE.md) for the repository conventions
|
|
309
|
+
(every user-visible change gets a [CHANGELOG](CHANGELOG.md) entry) and
|
|
310
|
+
[docs/NEW_TOOL_CHECKLIST.md](docs/NEW_TOOL_CHECKLIST.md) before adding a tool. Please report
|
|
311
|
+
vulnerabilities privately as described in [SECURITY.md](SECURITY.md).
|
|
312
|
+
|
|
313
|
+
## 📄 License
|
|
128
314
|
|
|
129
|
-
MIT
|
|
315
|
+
Released under the [MIT License](LICENSE). By submitting a pull request you agree that your
|
|
316
|
+
contribution is licensed under the same MIT License.
|
|
@@ -589,7 +589,12 @@ declare function memberLine(m: {
|
|
|
589
589
|
signature?: string;
|
|
590
590
|
}): string;
|
|
591
591
|
declare function formatCompletion(r: BridgeCompletionResult, prefix?: string): string;
|
|
592
|
-
export declare function tryBridgeCocExtensions(bridge: XrefSource | undefined, baseClassName: string, methodName?: string
|
|
592
|
+
export declare function tryBridgeCocExtensions(bridge: XrefSource | undefined, baseClassName: string, methodName?: string,
|
|
593
|
+
/**
|
|
594
|
+
* Which of these extension classes belong to a binary ISV model, as lower-cased names. The
|
|
595
|
+
* cross-reference data cannot tell; the caller asks the symbol index. Omitted: none marked.
|
|
596
|
+
*/
|
|
597
|
+
binaryIsvClasses?: (classNames: string[]) => ReadonlySet<string>): Promise<ToolResult | null>;
|
|
593
598
|
export declare function tryBridgeEventHandlers(bridge: XrefSource | undefined, targetName: string, eventName?: string, handlerType?: string): Promise<ToolResult | null>;
|
|
594
599
|
export declare function tryBridgeApiUsageCallers(bridge: XrefSource | undefined, apiName: string, limit?: number): Promise<ToolResult | null>;
|
|
595
600
|
/**
|
|
@@ -27,10 +27,11 @@ import { debugLog } from '../utils/logger.js';
|
|
|
27
27
|
import { xppMethodSourceForXml } from '../utils/xppFormat.js';
|
|
28
28
|
import { ensureXppDocComment, ensureBlankLineBeforeClosingBrace } from '../utils/xppDocGen.js';
|
|
29
29
|
import { parseXppDeclaration, parseXppClassHeader } from '../metadata/xppDeclaration.js';
|
|
30
|
+
import { BINARY_ISV_LIST_FOOTNOTE, BINARY_ISV_NOTE } from '../metadata/binaryModelImport.js';
|
|
30
31
|
import { rankCustomFirst, isExactNameMatch } from '../utils/exactMatchRanking.js';
|
|
31
32
|
import { COMPACT_METHODS_HINT, fullBodyHint } from '../utils/methodBodyHint.js';
|
|
32
33
|
import { subscriberAccessLevelValue } from '../utils/subscriberAccessLevel.js';
|
|
33
|
-
import { pageFields, fieldsHeading, fieldsFooter, createControlBudget, chargeControl, chargeSkippedSubtree, controlsFooter, } from '../utils/payloadBudget.js';
|
|
34
|
+
import { pageFields, fieldsHeading, fieldsFooter, createControlBudget, chargeControl, chargeSkippedSubtree, controlsFooter, methodOffsetPastEndNote, methodRangeText, } from '../utils/payloadBudget.js';
|
|
34
35
|
import { xrefSourceLabel, isSqliteXref } from '../xref/xrefSource.js';
|
|
35
36
|
import { XREF_SQLITE_COUNT_CAP } from '../xref/sqliteXrefProvider.js';
|
|
36
37
|
// TABLE
|
|
@@ -154,9 +155,10 @@ function formatTable(t, methodOffset, fieldsOffset = 0, fieldFilter, render = {}
|
|
|
154
155
|
const hasMore = page.offset + page.limit < total;
|
|
155
156
|
out += `\n## Methods (${total} total`;
|
|
156
157
|
if (total > page.limit) {
|
|
157
|
-
out +=
|
|
158
|
+
out += methodRangeText(page.offset, total, page.limit);
|
|
158
159
|
}
|
|
159
160
|
out += `)\n\n`;
|
|
161
|
+
out += methodOffsetPastEndNote(page.offset, total, page.limit);
|
|
160
162
|
for (const m of visible) {
|
|
161
163
|
if (page.includeSource) {
|
|
162
164
|
out += `### ${m.name}\n\n`;
|
|
@@ -265,9 +267,10 @@ function formatClass(cls, compact, methodOffset) {
|
|
|
265
267
|
const hasMore = methodOffset + CLASS_METHOD_PAGE_SIZE < total;
|
|
266
268
|
out += `## Methods (${total} total`;
|
|
267
269
|
if (total > CLASS_METHOD_PAGE_SIZE) {
|
|
268
|
-
out +=
|
|
270
|
+
out += methodRangeText(methodOffset, total, CLASS_METHOD_PAGE_SIZE);
|
|
269
271
|
}
|
|
270
272
|
out += `)\n\n`;
|
|
273
|
+
out += methodOffsetPastEndNote(methodOffset, total, CLASS_METHOD_PAGE_SIZE);
|
|
271
274
|
for (const m of visible) {
|
|
272
275
|
if (compact) {
|
|
273
276
|
out += `- \`${methodSignatureLine(m.name, m.source)}\`\n`;
|
|
@@ -2697,21 +2700,34 @@ function formatCompletion(r, prefix) {
|
|
|
2697
2700
|
return out;
|
|
2698
2701
|
}
|
|
2699
2702
|
// FIND COC EXTENSIONS via XREF (Phase 6)
|
|
2700
|
-
export async function tryBridgeCocExtensions(bridge, baseClassName, methodName
|
|
2703
|
+
export async function tryBridgeCocExtensions(bridge, baseClassName, methodName,
|
|
2704
|
+
/**
|
|
2705
|
+
* Which of these extension classes belong to a binary ISV model, as lower-cased names. The
|
|
2706
|
+
* cross-reference data cannot tell; the caller asks the symbol index. Omitted: none marked.
|
|
2707
|
+
*/
|
|
2708
|
+
binaryIsvClasses) {
|
|
2701
2709
|
if (!bridge?.isReady || !bridge.xrefAvailable)
|
|
2702
2710
|
return null;
|
|
2703
2711
|
try {
|
|
2704
2712
|
const result = await bridge.findExtensionClasses(baseClassName);
|
|
2705
2713
|
if (!result)
|
|
2706
2714
|
return null;
|
|
2707
|
-
|
|
2715
|
+
const binary = binaryIsvClasses?.(result.extensions.map(e => e.className)) ?? new Set();
|
|
2716
|
+
return { content: [{ type: 'text', text: formatCocExtensions(result, methodName, xrefSourceLabel(bridge), binary) }] };
|
|
2708
2717
|
}
|
|
2709
2718
|
catch (e) {
|
|
2710
2719
|
recordBridgeFailure(`findExtensionClasses(${baseClassName})`, e);
|
|
2711
2720
|
return null;
|
|
2712
2721
|
}
|
|
2713
2722
|
}
|
|
2714
|
-
function formatCocExtensions(r, methodNameFilter, source) {
|
|
2723
|
+
function formatCocExtensions(r, methodNameFilter, source, binaryIsv) {
|
|
2724
|
+
const out = formatCocExtensionList(r, methodNameFilter, source, binaryIsv);
|
|
2725
|
+
// Every class the list counts is printed in one of its sections, so one marked class
|
|
2726
|
+
// anywhere in the result means one marked line above.
|
|
2727
|
+
const marked = r.extensions.some(e => binaryIsv.has(e.className.toLowerCase()));
|
|
2728
|
+
return marked ? `${out}${BINARY_ISV_LIST_FOOTNOTE}\n` : out;
|
|
2729
|
+
}
|
|
2730
|
+
function formatCocExtensionList(r, methodNameFilter, source, binaryIsv) {
|
|
2715
2731
|
let out = `CoC Extensions of: ${r.baseClassName}\n`;
|
|
2716
2732
|
out += `_Source: ${source}_\n\n`;
|
|
2717
2733
|
if (r.count === 0) {
|
|
@@ -2731,7 +2747,7 @@ function formatCocExtensions(r, methodNameFilter, source) {
|
|
|
2731
2747
|
const unique = [...byClassName.values()];
|
|
2732
2748
|
if (!methodNameFilter) {
|
|
2733
2749
|
out += `Found ${unique.length} extension class(es):\n\n`;
|
|
2734
|
-
return out + formatCocGroups(unique);
|
|
2750
|
+
return out + formatCocGroups(unique, binaryIsv);
|
|
2735
2751
|
}
|
|
2736
2752
|
// With a method filter, "Found N … wrapping m" counts only the classes whose wrap list names
|
|
2737
2753
|
// m. It used to count every class with an EMPTY list as well — a leftover from when the list
|
|
@@ -2753,18 +2769,18 @@ function formatCocExtensions(r, methodNameFilter, source) {
|
|
|
2753
2769
|
others.push(ext);
|
|
2754
2770
|
}
|
|
2755
2771
|
out += `Found ${wrappers.length} extension class(es) wrapping "${methodNameFilter}":\n\n`;
|
|
2756
|
-
out += formatCocGroups(wrappers);
|
|
2772
|
+
out += formatCocGroups(wrappers, binaryIsv);
|
|
2757
2773
|
if (others.length > 0) {
|
|
2758
2774
|
out += `Other extension classes of ${r.baseClassName} (no wrap of "${methodNameFilter}" recorded): ${others.length}\n\n`;
|
|
2759
|
-
out += formatCocGroups(others);
|
|
2775
|
+
out += formatCocGroups(others, binaryIsv);
|
|
2760
2776
|
}
|
|
2761
2777
|
if (unknown.length > 0) {
|
|
2762
2778
|
out += `Extension classes of ${r.baseClassName}, wraps unknown (the source sent no wrap list): ${unknown.length}\n\n`;
|
|
2763
|
-
out += formatCocGroups(unknown);
|
|
2779
|
+
out += formatCocGroups(unknown, binaryIsv);
|
|
2764
2780
|
}
|
|
2765
2781
|
return out;
|
|
2766
2782
|
}
|
|
2767
|
-
function formatCocGroups(extensions) {
|
|
2783
|
+
function formatCocGroups(extensions, binaryIsv) {
|
|
2768
2784
|
let out = '';
|
|
2769
2785
|
// Grouped by the element each class actually extends, never pooled into one list. A name can
|
|
2770
2786
|
// denote several objects at once — "SalesTable" is a table (14 extensions) AND a form (17),
|
|
@@ -2786,8 +2802,10 @@ function formatCocGroups(extensions) {
|
|
|
2786
2802
|
out += `### ${describeXrefElement(element)} — ${exts.length}\n\n`;
|
|
2787
2803
|
for (const ext of exts) {
|
|
2788
2804
|
out += `- **${ext.className}**`;
|
|
2789
|
-
|
|
2790
|
-
|
|
2805
|
+
const binary = binaryIsv.has(ext.className.toLowerCase());
|
|
2806
|
+
if (ext.module || binary) {
|
|
2807
|
+
out += ` (${[ext.module, binary ? BINARY_ISV_NOTE : ''].filter(Boolean).join(', ')})`;
|
|
2808
|
+
}
|
|
2791
2809
|
if (ext.wrappedMethods && ext.wrappedMethods.length > 0) {
|
|
2792
2810
|
// Deliberately no `Uses 'next' keyword: ✓` line on THIS path, unlike the index /
|
|
2793
2811
|
// filesystem path in findCocExtensions.ts. That one earns it — fsExtensionScanner
|
|
@@ -1,9 +1,19 @@
|
|
|
1
|
+
import { type CostRates } from '../session/analyze.js';
|
|
1
2
|
interface SessionOptions {
|
|
2
3
|
json?: boolean;
|
|
3
4
|
format?: string;
|
|
4
5
|
/** How many rows of the per-tool table to print. */
|
|
5
6
|
top?: string;
|
|
7
|
+
/** '<cached>,<uncached>,<cacheWrite>,<output>' per Mtok. */
|
|
8
|
+
rates?: string;
|
|
9
|
+
/** Commander sets false for --no-subagents. */
|
|
10
|
+
subagents?: boolean;
|
|
6
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Parse --rates. Strict on purpose: a silently misread rate is a confident
|
|
14
|
+
* wrong cost, and with four positional numbers a missing one shifts the rest.
|
|
15
|
+
*/
|
|
16
|
+
export declare function parseRates(raw: string): CostRates;
|
|
7
17
|
export declare function sessionCommand(logPath: string | undefined, opts?: SessionOptions): Promise<void>;
|
|
8
18
|
export {};
|
|
9
19
|
//# sourceMappingURL=session.d.ts.map
|