zot/examples/extensions/weather
patriceckhart fa7d8d8be5 refactor: split source into packages/{provider,core,tui,agent}
Single Go module, four top-level packages under packages/. Import
paths become github.com/patriceckhart/zot/packages/<name>; downstream
consumers can depend on individual packages without pulling the rest.

Layout:
  packages/provider/     LLM clients + catalog
  packages/provider/auth/ credential store + OAuth + login server
  packages/core/         agent loop, sessions, cost
  packages/tui/          terminal toolkit + chat view
  packages/agent/        CLI wiring, system prompt
    extensions/ extproto/ modes/ tools/ skills/ swarm/
    sdk/  (was pkg/zotcore, package renamed zotcore -> sdk)
    ext/  (was pkg/zotext, package renamed zotext -> ext)

internal/ and pkg/ removed. The internal/assets logo moved into
packages/provider/auth/assets.

Public Go SDK identifiers renamed:
  pkg/zotcore (package zotcore) -> packages/agent/sdk (package sdk)
  pkg/zotext  (package zotext)  -> packages/agent/ext (package ext)

This breaks Go-based extensions and embedders; the JSON wire protocol
for extensions and RPC is unchanged, so non-Go extensions, already-
built extension binaries, and zot rpc consumers are unaffected.

Docs, examples, and the built-in write-zot-extension skill updated
for the new paths and identifiers. Shadow-bug fixes in code samples
(ext := ext.New -> e := ext.New).
2026-05-27 09:07:15 +02:00
..
extension.json feat(extensions): phase 2 — extension-defined tools 2026-04-19 14:46:32 +02:00
main.go refactor: split source into packages/{provider,core,tui,agent} 2026-05-27 09:07:15 +02:00
README.md feat(extensions): phase 2 — extension-defined tools 2026-04-19 14:46:32 +02:00

weather — example zot extension (Go, tool-providing)

Demonstrates the tool registration half of the extension protocol (phase 2). The extension exposes a weather(city) tool that the LLM can invoke; the result is fake-but-deterministic so repeated calls for the same city return the same thing.

Build

cd examples/extensions/weather
go build -o weather .

Install

zot ext install .

Copies the directory (manifest + binary) into $ZOT_HOME/extensions/weather/. zot picks it up the next time you launch the TUI and registers the tool with the agent.

Use

In zot, ask:

  • "What's the weather in Berlin?"
  • "Compare the weather in Tokyo and Reykjavik."

The model decides on its own to call the weather tool because the description tells it what the tool is for. You don't need to invoke anything by hand.

Add the leading slash to your /help table

The tool also shows up in the system prompt's tool list because zot folds extension tools into the agent's registry at startup.

See also

  • examples/extensions/hello — slash-command extension (Go SDK)
  • examples/extensions/clock — slash-command extension (Node, no SDK)
  • docs/extensions.md — full protocol reference