Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ changes accumulate. Track in-flight protocol changes via PRs touching

- `SessionSummary._meta` optional provider metadata field for lightweight
session-list presentation hints.
- `JsonPrimitive` type alias (`string | number | boolean | null`) in `types/common/state.ts`.

### Changed

- `ConfigPropertySchema.enum` now accepts `JsonPrimitive[]` instead of `string[]`, allowing numeric, boolean, and null enum values.

## [0.5.0] — Unreleased

Expand Down
5 changes: 5 additions & 0 deletions clients/go/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ tag whose matching `## [X.Y.Z]` heading is missing from this file.
- `SessionSummary.Meta` (wire `_meta`) optional provider metadata field for
lightweight session-list presentation hints.

### Changed

- `ConfigPropertySchema.Enum` field is now `[]json.RawMessage` instead of `[]string`,
allowing numeric, boolean, and null enum values.

## [0.4.0] — 2026-06-19

Implements AHP 0.4.0.
Expand Down
8 changes: 4 additions & 4 deletions clients/go/ahptypes/state.generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,8 @@ type ConfigPropertySchema struct {
Description *string `json:"description,omitempty"`
// JSON Schema: default value
Default *json.RawMessage `json:"default,omitempty"`
// JSON Schema: allowed values (typically used with `string` type)
Enum []string `json:"enum,omitempty"`
// JSON Schema: allowed values. May be primitives of any JSON type.
Enum []json.RawMessage `json:"enum,omitempty"`
// Display extension: human-readable label per enum value (parallel array)
EnumLabels []string `json:"enumLabels,omitempty"`
// Display extension: description per enum value (parallel array)
Expand Down Expand Up @@ -916,8 +916,8 @@ type SessionConfigPropertySchema struct {
Description *string `json:"description,omitempty"`
// JSON Schema: default value
Default *json.RawMessage `json:"default,omitempty"`
// JSON Schema: allowed values (typically used with `string` type)
Enum []string `json:"enum,omitempty"`
// JSON Schema: allowed values. May be primitives of any JSON type.
Enum []json.RawMessage `json:"enum,omitempty"`
// Display extension: human-readable label per enum value (parallel array)
EnumLabels []string `json:"enumLabels,omitempty"`
// Display extension: description per enum value (parallel array)
Expand Down
5 changes: 5 additions & 0 deletions clients/kotlin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ versions (`*-SNAPSHOT`) are explicitly rejected by the publish pipeline; bump
- `SessionSummary.meta` (`_meta` on the wire) optional provider metadata field
for lightweight session-list presentation hints.

### Changed

- `ConfigPropertySchema.enum` field is now `List<JsonElement>?` instead of
`List<String>?`, allowing numeric, boolean, and null enum values.

## [0.4.0] — 2026-06-19

Implements AHP 0.4.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -877,9 +877,9 @@ data class SessionConfigPropertySchema(
*/
val default: JsonElement? = null,
/**
* JSON Schema: allowed values (typically used with `string` type)
* JSON Schema: allowed values. May be primitives of any JSON type.
*/
val enum: List<String>? = null,
val enum: List<JsonElement>? = null,
/**
* Display extension: human-readable label per enum value (parallel array)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -957,9 +957,9 @@ data class ConfigPropertySchema(
*/
val default: JsonElement? = null,
/**
* JSON Schema: allowed values (typically used with `string` type)
* JSON Schema: allowed values. May be primitives of any JSON type.
*/
val enum: List<String>? = null,
val enum: List<JsonElement>? = null,
/**
* Display extension: human-readable label per enum value (parallel array)
*/
Expand Down
2 changes: 2 additions & 0 deletions clients/rust/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ matching `## [X.Y.Z]` heading is missing from this file.
instead of `native-tls`, dropping the OpenSSL link on Linux while still
validating against the OS trust store. To keep the previous behaviour, depend
on `ahp-ws` with `default-features = false, features = ["native-tls"]`.
- `ConfigPropertySchema.enum` field is now `Option<Vec<AnyValue>>` instead of
`Option<Vec<String>>`, allowing numeric, boolean, and null enum values.

## [0.4.0] — 2026-06-19

Expand Down
8 changes: 4 additions & 4 deletions clients/rust/crates/ahp-types/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -819,9 +819,9 @@ pub struct ConfigPropertySchema {
/// JSON Schema: default value
#[serde(default, skip_serializing_if = "Option::is_none")]
pub default: Option<AnyValue>,
/// JSON Schema: allowed values (typically used with `string` type)
/// JSON Schema: allowed values. May be primitives of any JSON type.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub r#enum: Option<Vec<String>>,
pub r#enum: Option<Vec<AnyValue>>,
/// Display extension: human-readable label per enum value (parallel array)
#[serde(default, skip_serializing_if = "Option::is_none")]
pub enum_labels: Option<Vec<String>>,
Expand Down Expand Up @@ -1209,9 +1209,9 @@ pub struct SessionConfigPropertySchema {
/// JSON Schema: default value
#[serde(default, skip_serializing_if = "Option::is_none")]
pub default: Option<AnyValue>,
/// JSON Schema: allowed values (typically used with `string` type)
/// JSON Schema: allowed values. May be primitives of any JSON type.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub r#enum: Option<Vec<String>>,
pub r#enum: Option<Vec<AnyValue>>,
/// Display extension: human-readable label per enum value (parallel array)
#[serde(default, skip_serializing_if = "Option::is_none")]
pub enum_labels: Option<Vec<String>>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -977,8 +977,8 @@ public struct SessionConfigPropertySchema: Codable, Sendable {
public var description: String?
/// JSON Schema: default value
public var `default`: AnyCodable?
/// JSON Schema: allowed values (typically used with `string` type)
public var `enum`: [String]?
/// JSON Schema: allowed values. May be primitives of any JSON type.
public var `enum`: [AnyCodable]?
/// Display extension: human-readable label per enum value (parallel array)
public var enumLabels: [String]?
/// Display extension: description per enum value (parallel array)
Expand Down Expand Up @@ -1023,7 +1023,7 @@ public struct SessionConfigPropertySchema: Codable, Sendable {
title: String,
description: String? = nil,
`default`: AnyCodable? = nil,
`enum`: [String]? = nil,
`enum`: [AnyCodable]? = nil,
enumLabels: [String]? = nil,
enumDescriptions: [String]? = nil,
readOnly: Bool? = nil,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -677,8 +677,8 @@ public final class ConfigPropertySchema: Codable, @unchecked Sendable {
public var description: String?
/// JSON Schema: default value
public var `default`: AnyCodable?
/// JSON Schema: allowed values (typically used with `string` type)
public var `enum`: [String]?
/// JSON Schema: allowed values. May be primitives of any JSON type.
public var `enum`: [AnyCodable]?
/// Display extension: human-readable label per enum value (parallel array)
public var enumLabels: [String]?
/// Display extension: description per enum value (parallel array)
Expand Down Expand Up @@ -714,7 +714,7 @@ public final class ConfigPropertySchema: Codable, @unchecked Sendable {
title: String,
description: String? = nil,
`default`: AnyCodable? = nil,
`enum`: [String]? = nil,
`enum`: [AnyCodable]? = nil,
enumLabels: [String]? = nil,
enumDescriptions: [String]? = nil,
readOnly: Bool? = nil,
Expand Down
5 changes: 5 additions & 0 deletions clients/swift/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ the tag matches the version pinned in [`VERSION`](VERSION).
- `SessionSummary.meta` (`_meta` on the wire) optional provider metadata field
for lightweight session-list presentation hints.

### Changed

- `ConfigPropertySchema.enum` field is now `[AnyCodable]?` instead of
`[String]?`, allowing numeric, boolean, and null enum values.

## [0.4.0] — 2026-06-19

Implements AHP 0.4.0.
Expand Down
6 changes: 6 additions & 0 deletions clients/typescript/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ hotfix escape hatch.

- `SessionSummary._meta` optional provider metadata field for lightweight
session-list presentation hints.
- Exported `JsonPrimitive` type alias (`string | number | boolean | null`).

### Changed

- `ConfigPropertySchema.enum` field is now `JsonPrimitive[]` instead of
`string[]`, allowing numeric, boolean, and null enum values.

### Fixed

Expand Down
23 changes: 19 additions & 4 deletions schema/actions.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2044,9 +2044,9 @@
"enum": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/$defs/JsonPrimitive"
},
"description": "JSON Schema: allowed values (typically used with `string` type)"
"description": "JSON Schema: allowed values. May be primitives of any JSON type."
},
"enumLabels": {
"type": "array",
Expand Down Expand Up @@ -2753,9 +2753,9 @@
"enum": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/$defs/JsonPrimitive"
},
"description": "JSON Schema: allowed values (typically used with `string` type)"
"description": "JSON Schema: allowed values. May be primitives of any JSON type."
},
"enumLabels": {
"type": "array",
Expand Down Expand Up @@ -5992,6 +5992,21 @@
],
"description": "A string that may optionally be rendered as Markdown.\n\n- A plain `string` is rendered as-is (no Markdown processing).\n- An object with `{ markdown: string }` is rendered with Markdown formatting."
},
"JsonPrimitive": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{}
],
"description": "A primitive JSON value: a string, number, boolean, or `null`."
},
"ChildCustomizationType": {
"oneOf": [
{},
Expand Down
8 changes: 4 additions & 4 deletions schema/commands.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1382,9 +1382,9 @@
"enum": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/$defs/JsonPrimitive"
},
"description": "JSON Schema: allowed values (typically used with `string` type)"
"description": "JSON Schema: allowed values. May be primitives of any JSON type."
},
"enumLabels": {
"type": "array",
Expand Down Expand Up @@ -2091,9 +2091,9 @@
"enum": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/$defs/JsonPrimitive"
},
"description": "JSON Schema: allowed values (typically used with `string` type)"
"description": "JSON Schema: allowed values. May be primitives of any JSON type."
},
"enumLabels": {
"type": "array",
Expand Down
8 changes: 4 additions & 4 deletions schema/errors.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@
"enum": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/$defs/JsonPrimitive"
},
"description": "JSON Schema: allowed values (typically used with `string` type)"
"description": "JSON Schema: allowed values. May be primitives of any JSON type."
},
"enumLabels": {
"type": "array",
Expand Down Expand Up @@ -943,9 +943,9 @@
"enum": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/$defs/JsonPrimitive"
},
"description": "JSON Schema: allowed values (typically used with `string` type)"
"description": "JSON Schema: allowed values. May be primitives of any JSON type."
},
"enumLabels": {
"type": "array",
Expand Down
8 changes: 4 additions & 4 deletions schema/notifications.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,9 @@
"enum": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/$defs/JsonPrimitive"
},
"description": "JSON Schema: allowed values (typically used with `string` type)"
"description": "JSON Schema: allowed values. May be primitives of any JSON type."
},
"enumLabels": {
"type": "array",
Expand Down Expand Up @@ -1077,9 +1077,9 @@
"enum": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/$defs/JsonPrimitive"
},
"description": "JSON Schema: allowed values (typically used with `string` type)"
"description": "JSON Schema: allowed values. May be primitives of any JSON type."
},
"enumLabels": {
"type": "array",
Expand Down
23 changes: 19 additions & 4 deletions schema/state.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@
"enum": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/$defs/JsonPrimitive"
},
"description": "JSON Schema: allowed values (typically used with `string` type)"
"description": "JSON Schema: allowed values. May be primitives of any JSON type."
},
"enumLabels": {
"type": "array",
Expand Down Expand Up @@ -854,9 +854,9 @@
"enum": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/$defs/JsonPrimitive"
},
"description": "JSON Schema: allowed values (typically used with `string` type)"
"description": "JSON Schema: allowed values. May be primitives of any JSON type."
},
"enumLabels": {
"type": "array",
Expand Down Expand Up @@ -4093,6 +4093,21 @@
],
"description": "A string that may optionally be rendered as Markdown.\n\n- A plain `string` is rendered as-is (no Markdown processing).\n- An object with `{ markdown: string }` is rendered with Markdown formatting."
},
"JsonPrimitive": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{}
],
"description": "A primitive JSON value: a string, number, boolean, or `null`."
},
"ChildCustomizationType": {
"oneOf": [
{},
Expand Down
5 changes: 5 additions & 0 deletions scripts/generate-go.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ function mapType(tsType: string): string {
if (tsType === 'object') return 'json.RawMessage';
if (tsType === 'true' || tsType === 'false') return 'bool';

// A primitive JSON value (`string | number | boolean | null`) has no single
// Go counterpart — represent it as an arbitrary JSON value.
if (tsType === 'JsonPrimitive') return 'json.RawMessage';

if (tsType === 'URI') return 'URI';
if (tsType === 'StringOrMarkdown') return 'StringOrMarkdown';

Expand Down Expand Up @@ -1849,6 +1853,7 @@ function checkExhaustiveness(project: Project): void {

const knownSpecial = new Set<string>([
'URI',
'JsonPrimitive',
'BaseParams',
'StringOrMarkdown',
'ToolCallState',
Expand Down
4 changes: 4 additions & 0 deletions scripts/generate-kotlin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ function mapType(tsType: string): string {
if (tsType === 'boolean') return 'Boolean';
if (tsType === 'unknown') return 'JsonElement';
if (tsType === 'object') return 'JsonElement';
// A primitive JSON value (`string | number | boolean | null`) maps to a
// generic JSON element.
if (tsType === 'JsonPrimitive') return 'JsonElement';
if (tsType === 'true' || tsType === 'false') return 'Boolean';

// Type aliases
Expand Down Expand Up @@ -1832,6 +1835,7 @@ function checkExhaustiveness(project: Project): void {

const knownSpecial = new Set<string>([
'URI', // type alias for string
'JsonPrimitive', // primitive JSON value alias; mapped to JsonElement
'BaseParams', // marker base interface; flattened into each command params struct
// PingParams shape is `interface PingParams extends BaseParams { channel: 'ahp-root://' }`
// (i.e. a `BaseParams` with `channel` narrowed to a string literal). We don't
Expand Down
5 changes: 5 additions & 0 deletions scripts/generate-rust.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ function mapType(tsType: string, propName?: string, containerName?: string): str
if (tsType === 'object') return 'AnyValue';
if (tsType === 'true' || tsType === 'false') return 'bool';

// A primitive JSON value (`string | number | boolean | null`) has no single
// Rust counterpart — represent it as an arbitrary JSON value.
if (tsType === 'JsonPrimitive') return 'AnyValue';

if (tsType === 'URI') return 'Uri';
if (tsType === 'StringOrMarkdown') return 'StringOrMarkdown';

Expand Down Expand Up @@ -1717,6 +1721,7 @@ function checkExhaustiveness(project: Project): void {

const knownSpecial = new Set<string>([
'URI',
'JsonPrimitive',
'BaseParams',
'StringOrMarkdown',
'ToolCallState',
Expand Down
Loading
Loading