office

package module
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

README

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

Documentation

Overview

Package office implements the native PPTX template analyze, scaffold, check, and fill pipeline used by the Casibase PowerPoint tools.

Lower-level OPC ZIP and OOXML package access lives in the ooxml subpackage. Template JSON DTOs live in the model subpackage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Analyze

func Analyze(pkg *ooxml.Package, sourcePPTX string) (*model.Library, error)

func AnalyzeFile

func AnalyzeFile(pptxPath string, limits ooxml.Limits) (*model.Library, error)

func ApplyPlan

func ApplyPlan(pkg *ooxml.Package, plan *model.Plan, options model.ApplyOptions) (*ooxml.Package, *model.CheckReport, error)

func CheckPlan

func CheckPlan(library *model.Library, plan *model.Plan) *model.CheckReport

func FillFile

func FillFile(input, output string, plan *model.Plan, options model.ApplyOptions, limits ooxml.Limits) (*model.CheckReport, error)

func ScaffoldPlan

func ScaffoldPlan(library *model.Library, selectedSlides []int, includeEmpty bool) *model.Plan

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL