KosmoKrator

rendering

PlantUML Lua API for KosmoKrator Agents

Agent-facing Lua documentation and function reference for the PlantUML KosmoKrator integration.

1 functions 0 read 1 write No credentials auth

Lua Namespace

Agents call this integration through app.integrations.plantuml.*. Use lua_read_doc("integrations.plantuml") inside KosmoKrator to discover the same reference at runtime.

Agent-Facing Lua Docs

This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.

PlantUML — Lua API Reference

render_plantuml

Render PlantUML diagram syntax (class, sequence, activity, component, state, use case, and more) to a PNG image.

Parameters

NameTypeRequiredDescription
syntaxstringyesPlantUML diagram syntax. Should be wrapped in @startuml/@enduml (auto-wrapped if missing).
titlestringnoDiagram title used as alt text (default: "Diagram").

Examples

Render a class diagram

local result = app.integrations.plantuml.render_plantuml({
  syntax = "@startuml\nclass Animal {\n  +name: string\n  +speak(): void\n}\nclass Dog extends Animal {\n  +fetch(): void\n}\n@enduml",
  title = "Class Diagram"
})

Render a sequence diagram

local result = app.integrations.plantuml.render_plantuml({
  syntax = "@startuml\nAlice -> Bob: Hello\nBob --> Alice: Hi there!\n@enduml",
  title = "Sequence Diagram"
})

Render a component diagram

local result = app.integrations.plantuml.render_plantuml({
  syntax = "@startuml\n[Web App] --> [API Gateway]\n[API Gateway] --> [Auth Service]\n[API Gateway] --> [Database]\n@enduml",
  title = "Architecture"
})
Raw agent markdown
# PlantUML — Lua API Reference

## render_plantuml

Render PlantUML diagram syntax (class, sequence, activity, component, state, use case, and more) to a PNG image.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `syntax` | string | yes | PlantUML diagram syntax. Should be wrapped in `@startuml`/`@enduml` (auto-wrapped if missing). |
| `title` | string | no | Diagram title used as alt text (default: `"Diagram"`). |

### Examples

#### Render a class diagram

```lua
local result = app.integrations.plantuml.render_plantuml({
  syntax = "@startuml\nclass Animal {\n  +name: string\n  +speak(): void\n}\nclass Dog extends Animal {\n  +fetch(): void\n}\n@enduml",
  title = "Class Diagram"
})
```

#### Render a sequence diagram

```lua
local result = app.integrations.plantuml.render_plantuml({
  syntax = "@startuml\nAlice -> Bob: Hello\nBob --> Alice: Hi there!\n@enduml",
  title = "Sequence Diagram"
})
```

#### Render a component diagram

```lua
local result = app.integrations.plantuml.render_plantuml({
  syntax = "@startuml\n[Web App] --> [API Gateway]\n[API Gateway] --> [Auth Service]\n[API Gateway] --> [Database]\n@enduml",
  title = "Architecture"
})
```

Metadata-Derived Lua Example

local result = app.integrations.plantuml.render_plantuml({
  syntax = "example_syntax",
  title = "example_title"
})
print(result)

Functions

render_plantuml

Render a PlantUML diagram to a PNG image. Pass valid PlantUML syntax and get back a markdown image embed. Supported diagram types: class, sequence, activity, component, state, use case, object, deployment, timing, network (nwdiag), wireframe (salt), Gantt, mindmap, WBS, JSON, YAML, ERD. Example syntax: ``` @startuml Alice -> Bob: Authentication Request Bob --> Alice: Authentication Response Alice -> Bob: Another request Bob --> Alice: Another response @enduml ``` Tips: - Always wrap syntax in @startuml / @enduml - Use `->` for solid arrows, `-->` for dashed arrows - Use `class ClassName { }` blocks for class diagrams - Use `(*) -->` for activity diagram start - Use `[Component]` for component diagrams - Use `state "Name" as s1` for state diagrams

Operation
Write write
Full name
plantuml.render_plantuml
ParameterTypeRequiredDescription
syntax string yes PlantUML diagram syntax. Should be wrapped in @startuml/@enduml (auto-wrapped if missing).
title string no Diagram title used as alt text (default: "Diagram").