-
Notifications
You must be signed in to change notification settings - Fork 0
Packages
A Zinc package is an installed capability. It can ship prompts, files, graphs, scripts, and external tools.
Packages are explicit. Installing a package can patch the local loop graph, but the resulting graph still shows which prompts and tools were added.
Official optional packages live in darkhorseprojects/zinc-packages. Core Zinc installs no optional packages by default.
Package metadata lives in zinc.pkg.yaml:
name: hello
version: "0.1.0"
description: Tiny Zinc package example.
assets:
prompts:
hello_prompt: prompts/hello.md
scripts:
check:
linux: scripts/check
macos: scripts/check
windows: scripts/check.cmd
install:
model:
input:
- prompt:hello_prompt
tools:
- hello_processThe install.model patch declares what should be added to the selected model resource:
install:
model:
input:
- prompt:guide
- file:manual
tools:
- package_toolPrompts are not loaded by name alone. Tools are not callable by name alone. They must appear in the graph model resource.
Local package installs write generated package resources to:
.zinc/generated/packages.circuitry.yaml
The local loop graph imports that generated file and references package resources through the packages namespace:
imports:
packages: "/path/to/project/.zinc/generated/packages.circuitry.yaml"
resources:
assistant:
model:
input:
- packages.example_promptOfficial packages use this layout:
.zinc/packages/<name>/ installed package code and assets
.zinc/config/packages/<name>.yaml user/project package config
.zinc/runtime/packages/<name>/ package working runtime
Package authors should follow the same convention.
Use .zinc/packages/<name> for source files shipped by the package:
zinc.pkg.yamlprompts/tools/scripts/graphs/assets/- vendored third-party source and attribution
Use .zinc/config/packages/<name>.yaml for user choices.
Use .zinc/runtime/packages/<name> for venvs, compiled helpers, setup-created files, and downloaded working files.
Packages should be self-contained capabilities. A package can vendor code, include scripts, and create the runtime it needs.
Self-contained does not mean storing everything inside the installed package directory. Installed package directories should be replaceable. Runtime files belong in .zinc/runtime/packages/<name> and user choices belong in .zinc/config/packages/<name>.yaml.
GitHub shorthand:
github:<owner>/<repo>/<package-path>#<tag-or-branch>
Example:
zn pkg add --local github:owner/repo/packages/example#v1.0.0Local development path:
zn pkg add --local --replace /path/to/packageScripts are package maintenance commands:
zn pkg exec example setup
zn pkg exec example checkA good package has a check script when setup depends on local capabilities.
Package tool handlers are external only:
processhttpmcp
Graph execution stays built into Zinc through run_graph rather than being a package handler.
- Keep the manifest small and readable.
- Make setup/check scripts cross-platform when possible.
- Put normal user choices in config files, not environment variables.
- Keep runtime artifacts out of installed package directories.
- Include attribution for vendored third-party work.
- Make tool success honest and narrow.