diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md
index 3ace5dd79..096d245a0 100644
--- a/packages/coding-agent/CHANGELOG.md
+++ b/packages/coding-agent/CHANGELOG.md
@@ -4,7 +4,7 @@
### Breaking Changes
-- Moved the published theme JSON Schema to `schemas/theme.schema.json` and made theme loading reject unknown top-level properties and unknown properties under `colors` or `export`. Update existing theme `$schema` references to the new path, define reusable custom colors under `vars`, and remove unsupported metadata.
+- Published generated configuration schemas for models, settings, keybindings, and themes at `https://pi.dev/schemas/*.schema.json`. The theme schema moved to `https://pi.dev/schemas/theme.schema.json`; themes loaded during startup now receive the same schema validation as later reloads. Update theme `$schema` references, define reusable colors under `vars`, and remove unsupported metadata.
### Changed
diff --git a/packages/coding-agent/docs/keybindings.md b/packages/coding-agent/docs/keybindings.md
index cfc5e4320..77838b629 100644
--- a/packages/coding-agent/docs/keybindings.md
+++ b/packages/coding-agent/docs/keybindings.md
@@ -12,6 +12,7 @@ Map each action identifier to one key or a list of keys:
```json
{
+ "$schema": "https://pi.dev/schemas/keybindings.schema.json",
"app.session.new": "ctrl+shift+n",
"app.session.tree": ["ctrl+shift+t", "alt+shift+t"]
}
diff --git a/packages/coding-agent/docs/models.md b/packages/coding-agent/docs/models.md
index be39ce8a7..fbb01966e 100644
--- a/packages/coding-agent/docs/models.md
+++ b/packages/coding-agent/docs/models.md
@@ -48,6 +48,7 @@ Use [`models.json`](configuration.md#agent-directory) when an endpoint speaks an
```json
{
+ "$schema": "https://pi.dev/schemas/models.schema.json",
"providers": {
"ollama": {
"baseUrl": "http://localhost:11434/v1",
diff --git a/packages/coding-agent/docs/settings.md b/packages/coding-agent/docs/settings.md
index b36f1b3c5..485c27ba3 100644
--- a/packages/coding-agent/docs/settings.md
+++ b/packages/coding-agent/docs/settings.md
@@ -2,6 +2,8 @@
This reference lists user-configurable settings, their types, defaults, and purposes. Project settings override agent-directory settings. Resource lists are combined. See [Configuration](configuration.md) for file locations and trust behavior.
+Add `"$schema": "https://pi.dev/schemas/settings.schema.json"` to `settings.json` for editor validation and completion.
+
## Model and thinking
diff --git a/packages/coding-agent/docs/themes.md b/packages/coding-agent/docs/themes.md
index d8ed389cd..6989a01f9 100644
--- a/packages/coding-agent/docs/themes.md
+++ b/packages/coding-agent/docs/themes.md
@@ -58,7 +58,7 @@ See [CLI resources](cli.md#resources) for the command-line option.
## Create a custom theme
-Copy one of the [built-in themes](https://github.com/earendil-works/pi/tree/main/packages/coding-agent/src/modes/interactive/theme) or create a new JSON file conforming to the [schema](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/schemas/theme.schema.json). The built-in themes use OKHSL colors, with variables for colors that several roles share, so you can adjust a hue, saturation, or lightness directly.
+Copy one of the [built-in themes](https://github.com/earendil-works/pi/tree/main/packages/coding-agent/src/modes/interactive/theme) or create a new JSON file conforming to the [schema](https://pi.dev/schemas/theme.schema.json). The built-in themes use OKHSL colors, with variables for colors that several roles share, so you can adjust a hue, saturation, or lightness directly.
1. Save the file as `/themes/my-theme.json`. The agent directory defaults to `~/.pi/agent`.
2. Set its `name` to `my-theme`.
@@ -95,7 +95,7 @@ Terminal default colors render as the terminal's own colors. Where Pi needs a co
Pi resolves chained variable references. A missing variable or circular reference makes the theme invalid. Pi uses truecolor when available, gamut-maps OKLCH to sRGB, and approximates colors for 256-color terminals. HTML exports convert OKHSL values to hexadecimal because CSS does not support them. If colors differ from their source values, check your terminal's truecolor detection and contrast settings. See [Configure Your Terminal](terminal-setup.md#override-detected-capabilities).
-Use the [theme JSON schema](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/schemas/theme.schema.json) for the exact properties, required colors, and accepted value types.
+Use the [theme JSON schema](https://pi.dev/schemas/theme.schema.json) for the exact properties, required colors, and accepted value types.
Pi reports invalid theme files during startup and `/reload`.
diff --git a/packages/coding-agent/examples/extensions/dynamic-resources/dynamic.json b/packages/coding-agent/examples/extensions/dynamic-resources/dynamic.json
index 6adaa5fca..686c50a7c 100644
--- a/packages/coding-agent/examples/extensions/dynamic-resources/dynamic.json
+++ b/packages/coding-agent/examples/extensions/dynamic-resources/dynamic.json
@@ -1,5 +1,5 @@
{
- "$schema": "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/schemas/theme.schema.json",
+ "$schema": "https://pi.dev/schemas/theme.schema.json",
"name": "dynamic-resources",
"vars": {
"cyan": "#00d7ff",
diff --git a/packages/coding-agent/schemas/keybindings.schema.json b/packages/coding-agent/schemas/keybindings.schema.json
index e3743f3c0..aa3b3e9be 100644
--- a/packages/coding-agent/schemas/keybindings.schema.json
+++ b/packages/coding-agent/schemas/keybindings.schema.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/schemas/keybindings.schema.json",
+ "$id": "https://pi.dev/schemas/keybindings.schema.json",
"$comment": "This file is generated from TypeScript source. Do not edit it manually; run npm run generate:schemas.",
"type": "object",
"properties": {
diff --git a/packages/coding-agent/schemas/models.schema.json b/packages/coding-agent/schemas/models.schema.json
index cb2b0c9c0..40e27fa3e 100644
--- a/packages/coding-agent/schemas/models.schema.json
+++ b/packages/coding-agent/schemas/models.schema.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/schemas/models.schema.json",
+ "$id": "https://pi.dev/schemas/models.schema.json",
"$comment": "This file is generated from TypeScript source. Do not edit it manually; run npm run generate:schemas.",
"type": "object",
"required": [
diff --git a/packages/coding-agent/schemas/settings.schema.json b/packages/coding-agent/schemas/settings.schema.json
index 3f3b2c368..81cfc5fb1 100644
--- a/packages/coding-agent/schemas/settings.schema.json
+++ b/packages/coding-agent/schemas/settings.schema.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/schemas/settings.schema.json",
+ "$id": "https://pi.dev/schemas/settings.schema.json",
"$comment": "This file is generated from TypeScript source. Do not edit it manually; run npm run generate:schemas.",
"type": "object",
"properties": {
diff --git a/packages/coding-agent/schemas/theme.schema.json b/packages/coding-agent/schemas/theme.schema.json
index c816447df..95350a58d 100644
--- a/packages/coding-agent/schemas/theme.schema.json
+++ b/packages/coding-agent/schemas/theme.schema.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/schemas/theme.schema.json",
+ "$id": "https://pi.dev/schemas/theme.schema.json",
"$comment": "This file is generated from TypeScript source. Do not edit it manually; run npm run generate:schemas.",
"type": "object",
"required": [
diff --git a/packages/coding-agent/scripts/generate-schemas.ts b/packages/coding-agent/scripts/generate-schemas.ts
index 672773cd1..d9642ca09 100644
--- a/packages/coding-agent/scripts/generate-schemas.ts
+++ b/packages/coding-agent/scripts/generate-schemas.ts
@@ -18,20 +18,20 @@ import { SettingsSchema } from "../src/core/settings-schema.ts";
import { ColorValueSchema, ThemeJsonSchema } from "../src/modes/interactive/theme/theme-schema.ts";
const packageDirectory = fileURLToPath(new URL("..", import.meta.url));
-const schemaBaseUrl = "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent";
+const schemaBaseUrl = "https://pi.dev/schemas";
const schemaDraft = "https://json-schema.org/draft/2020-12/schema";
const generatedComment =
"This file is generated from TypeScript source. Do not edit it manually; run npm run generate:schemas.";
interface SchemaArtifact {
- path: `schemas/${string}.schema.json`;
+ filename: `${string}.schema.json`;
schema: TSchema;
definitions?: Readonly>;
}
const schemaArtifacts: readonly SchemaArtifact[] = [
{
- path: "schemas/models.schema.json",
+ filename: "models.schema.json",
schema: ModelsConfigSchema,
definitions: {
ModelCost: ModelCostSchema,
@@ -42,17 +42,17 @@ const schemaArtifacts: readonly SchemaArtifact[] = [
},
},
{
- path: "schemas/settings.schema.json",
+ filename: "settings.schema.json",
schema: SettingsSchema,
definitions: { ModelThinkingLevel: ModelThinkingLevelSchema },
},
{
- path: "schemas/keybindings.schema.json",
+ filename: "keybindings.schema.json",
schema: KeybindingsSchema,
definitions: { KeybindingValue: KeybindingValueSchema },
},
{
- path: "schemas/theme.schema.json",
+ filename: "theme.schema.json",
schema: ThemeJsonSchema,
definitions: { ColorValue: ColorValueSchema },
},
@@ -131,7 +131,7 @@ function serializeSchema(artifact: SchemaArtifact): string {
return `${JSON.stringify(
{
$schema: schemaDraft,
- $id: `${schemaBaseUrl}/${artifact.path}`,
+ $id: `${schemaBaseUrl}/${artifact.filename}`,
$comment: generatedComment,
...schema,
},
@@ -144,7 +144,7 @@ export function renderConfigSchemas(): ReadonlyMap {
const rendered = new Map();
for (const artifact of schemaArtifacts) {
const content = serializeSchema(artifact);
- rendered.set(artifact.path, content);
+ rendered.set(`schemas/${artifact.filename}`, content);
}
return rendered;
}
diff --git a/packages/coding-agent/src/modes/interactive/theme/dark.json b/packages/coding-agent/src/modes/interactive/theme/dark.json
index e81c31768..0a82c289d 100644
--- a/packages/coding-agent/src/modes/interactive/theme/dark.json
+++ b/packages/coding-agent/src/modes/interactive/theme/dark.json
@@ -1,5 +1,5 @@
{
- "$schema": "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/schemas/theme.schema.json",
+ "$schema": "https://pi.dev/schemas/theme.schema.json",
"name": "dark",
"appearance": "dark",
"vars": {
diff --git a/packages/coding-agent/src/modes/interactive/theme/light.json b/packages/coding-agent/src/modes/interactive/theme/light.json
index faf6e65c8..3d870c051 100644
--- a/packages/coding-agent/src/modes/interactive/theme/light.json
+++ b/packages/coding-agent/src/modes/interactive/theme/light.json
@@ -1,5 +1,5 @@
{
- "$schema": "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/schemas/theme.schema.json",
+ "$schema": "https://pi.dev/schemas/theme.schema.json",
"name": "light",
"appearance": "light",
"vars": {
diff --git a/packages/coding-agent/test/config-schemas.test.ts b/packages/coding-agent/test/config-schemas.test.ts
index ed6230204..6d87d21dc 100644
--- a/packages/coding-agent/test/config-schemas.test.ts
+++ b/packages/coding-agent/test/config-schemas.test.ts
@@ -10,7 +10,7 @@ import { SettingsManager } from "../src/core/settings-manager.ts";
import { SettingsSchema } from "../src/core/settings-schema.ts";
import { validateThemeJson } from "../src/modes/interactive/theme/theme-schema.ts";
-const schemaBaseUrl = "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/schemas";
+const schemaBaseUrl = "https://pi.dev/schemas";
const temporaryDirectories: string[] = [];
afterEach(() => {