Skip to content

Repository files navigation

office-tool-use

Standalone Go library for bounded OOXML/PPTX package handling and PowerPoint template operations

Extracted from OpenAgent's PowerPoint tool layer


Build Release Go Reference Go Report License


What is this?

office-tool-use is the native Go implementation behind OpenAgent's PowerPoint template tools, pulled out into its own dependency-light package. It opens a .pptx as a bounded OPC/ZIP package, analyzes its slides into a JSON-friendly model, lets a caller scaffold and validate a fill plan, and applies that plan back into a new .pptx — covering text, tables, images, charts, notes, transitions, and SmartArt.

It has no dependency on the OpenAgent server, MCP layer, or any LLM/agent code — it's a pure library that any Go application can import directly.

Layout

Install

go get github.com/the-open-agent/office-tool-use

Usage

import (
    office "github.com/the-open-agent/office-tool-use"
    "github.com/the-open-agent/office-tool-use/model"
    "github.com/the-open-agent/office-tool-use/ooxml"
)

// 1. Analyze an existing .pptx into a library of slides/placeholders.
library, err := office.AnalyzeFile("input.pptx", ooxml.DefaultLimits())

// 2. Scaffold an empty fill plan for the slides you want to populate.
plan := office.ScaffoldPlan(library, []int{0, 1, 2}, false)

// ... populate plan.Slides[i] with text/table/image/chart content ...

// 3. Validate the filled plan against the library.
report := office.CheckPlan(library, plan)

// 4. Apply the plan to produce the output .pptx.
report, err = office.FillFile("input.pptx", "output.pptx", plan, model.ApplyOptions{}, ooxml.DefaultLimits())

Quick Check

go test ./...

License

Apache License 2.0

Releases

Packages

Contributors

Languages