Skip to main content

Crate yapi_types

Crate yapi_types 

Source
Expand description

Serde types for pi’s JSON formats: messages, events, session entries, settings, models and extension payloads.

A pi file is handled as a document: an order-preserving serde_json::Value that json writes back byte-identically. pi’s key order depends on the code path that built an object, so the typed structs here are views: they read fields from a document and build new objects in pi’s usual key order.

Modules§

auth
auth.json: stored credentials keyed by provider id.
autocomplete
pi-tui’s autocomplete shapes, as extensions’ providers and command argument completions exchange them; packages/tui/src/autocomplete.ts in pi v1.0.0.
classify
Classifier and image-generation requests and results.
collate
String ordering as JavaScript’s localeCompare gives it for identifiers and file names.
config
pi’s JSON configuration files and how pi lays each one out on disk.
event
Streaming events, in the shape pi’s JSON and RPC modes print them.
extension_event
Events pi delivers to extension handlers, in the shape and key order of pi’s emit sites.
js
JavaScript string and number semantics that pi’s texts depend on: string lengths and slices count UTF-16 code units, and toFixed and Math.round round halves up.
json
JSON output that matches pi’s JSON.stringify.
message
Messages stored in sessions and sent to providers.
model
Catalog models: what a provider serves and how to talk to it.
models
models.json: custom providers, models and overrides.
rpc
RPC mode: commands read from stdin and the responses written to stdout, as in modes/rpc/rpc-types.ts of pi v1.0.0. Events use the JSON mode shapes in crate::event.
session
Lines of a session file: one header, then entries forming a tree.
settings
settings.json, global and project scope.
sync
Locking that outlives a panic.
system_prompt
pi’s system prompt inputs, as before_agent_start hands them to extensions.
time
Timestamps as pi writes them: Unix milliseconds and ISO 8601 UTC with milliseconds, and ids.