Graphene.OfficeSupportTool 1.26.8.25

dotnet add package Graphene.OfficeSupportTool --version 1.26.8.25
                    
NuGet\Install-Package Graphene.OfficeSupportTool -Version 1.26.8.25
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Graphene.OfficeSupportTool" Version="1.26.8.25" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Graphene.OfficeSupportTool" Version="1.26.8.25" />
                    
Directory.Packages.props
<PackageReference Include="Graphene.OfficeSupportTool" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Graphene.OfficeSupportTool --version 1.26.8.25
                    
#r "nuget: Graphene.OfficeSupportTool, 1.26.8.25"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Graphene.OfficeSupportTool@1.26.8.25
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Graphene.OfficeSupportTool&version=1.26.8.25
                    
Install as a Cake Addin
#tool nuget:?package=Graphene.OfficeSupportTool&version=1.26.8.25
                    
Install as a Cake Tool

OfficeSupportTool

Office document (DOCX) agent tool for AIOrchestrator. The LLM fills a per-type HTML template with the requested content, the HTML is converted to a real .docx with HtmlToOpenXml, and the source HTML is stored inside the DOCX as hidden metadata (custom XML part) so the document can be updated later.

Templates live in Assets/*.html (one per document type: invoice, balance sheet, contract, SOP, …). When a requested type has no template, the LLM generates a new one following Assets/DESIGN-GUIDELINES.md (layout + category colors) and Assets/ESSENTIAL-GUIDELINES.md (strict HTML rules), in English and with the same {{ placeholder_name }} format, and saves it alongside the others for future reuse.

Methods

Method Purpose
create_document Creates a new DOCX from the template matching the requested type (optional draft, context text/file, image files, output path).
update_document Applies requested changes to an existing DOCX (reads the HTML from the embedded metadata, regenerates the document; the new content becomes a new version in the workspace git repo).
update_template Modifies an existing template (feasibility-gated, keeps the template rules: English, category colors, {{ placeholder_name }} format, design guidelines); the updated template is reused by create_document.

Usage

Loads as a plugin (see AGENT_TOOLS_GUIDE.md): drop the dll + xml into the host's Tools/ folder, or let the host build it via its BuildToolPlugins target. The tool is auto-updatable from NuGet (Graphene.OfficeSupportTool).

create_document

create_document(type, note, draft?, contextText?, contextFile?, imageFiles?, saveFullNameFile?, outputTwoLetterLanguage?)
  • type (required): document type, e.g. "balance sheet" (maps to balance-sheet.html). Matching is case-insensitive and ignores -/space differences. Known template types are listed in the tool definition; types not in the list are accepted too — a new template is generated by the LLM following the design guidelines.
  • note (required): descriptive notes about the document to create (practical suggestions/tips).
  • draft (optional, default false): when true the material check is skipped and an incomplete document can be generated even if the context lacks data to fill the template.
  • contextText / contextFile (optional): essential material for the document (company data, parties, values, tables…). One of the two is expected unless draft is used. The material check evaluates the context against the template field by field; when it is rejected, the error lists the missing fields deterministically as Document fields: <comma-separated field names> (extracted from the template's {{ placeholder_name }} placeholders) plus the draft hint.
  • imageFiles (optional): workspace images embedded into the document (Unix-style paths). Each image is shown to the LLM via the unified FileManager.GetFilesInfo block: path + size + Classification: + YOLO Metadata: JSON (created and embedded permanently in the image when absent).
  • saveFullNameFile (optional): output path/name (.docx, Unix-style). Default: /documents/document_yyyyMMdd_HHmmss.docx in the workspace.
  • outputTwoLetterLanguage (optional): two-letter language code; if omitted it is detected from the context.

update_document

update_document(filePath, changes, contextText?, imageFiles?)

Reads the source HTML from the DOCX metadata, has the LLM apply changes faithfully to the template, converts back to DOCX and re-embeds the new HTML. The new content becomes a new version in the workspace git repo — rollback via GitTool.restore (the tool does not keep the file open).

update_template

update_template(type, changes)

Modifies the template matching type (same case/-/space-insensitive matching as create_document; available types are listed via [[available_templates]]). Flow: the template existence is checked deterministically (unknown types are rejected with an error), then an LLM gate validates whether the requested changes are feasible and make sense for that template (JSON verdict; infeasible changes return an error with a brief explanation), and only then the LLM applies the changes and the result is validated (HTML5 + template rules) before being saved for reuse. The updated template keeps the same rules as created templates — English language, the category colors (the design set matching the document's primary purpose), the {{ placeholder_name }} placeholder format and the design guidelines.

Testing / Harness

The OfficeSupportTool.Harness console project drives the tool end-to-end against a live LLM provider, plus an offline deterministic self-test:

dotnet run --project OfficeSupportTool.Harness -- --selftest        # offline: no LLM needed
dotnet run --project OfficeSupportTool.Harness -- --provider NAME   # LLM campaign (T1–T8)
  • --selftest: deterministic checks (type normalization, placeholder field extraction, HTML→DOCX round-trip, metadata, nested-comment/bare-svg/table-background detection, template category-color conformity, versioning semantics).
  • --provider NAME (default DeepSeekBridge, fallback Ollama_Qwen): runs the behavioral LLM campaign — create (incl. overwrite versioning), update, template generation + conformity inspection, images, material-gate rejection (with the deterministic Document fields: list), foreign DOCX, template update (incl. the feasibility-gate rejection) + reuse, and the create→update→rollback flow at agent level.
  • Results are appended to %TEMP%\officesupporttool_test_results.txt with a final DONE marker; the agent's tool-call trace is logged per test. The workspace lives in %TEMP% (the repo sits under OneDrive, where test files would be cloud-synced on every write).

Packaging

Date-based auto versioning (1.yy.MM.dd) and CI publish to NuGet on every push to master — see .github/workflows/publish.yml and the plugin creation guide in AGENT_TOOLS_GUIDE.md.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.26.8.25 0 8/25/2026
1.26.8.18 155 8/18/2026