Documentation
¶
Overview ¶
Package aitableprotocol contains small, stable validations shared by the native AI Table commands and their shortcut adapters.
Index ¶
- Constants
- func DatasourceSourceConfig(payload map[string]any) (string, error)
- func ResolveDashboardRootColumns(payload map[string]any, expectedBaseID, expectedDashboardID string, ...) (int, error)
- func UTF16Length(value string) int
- func ValidateClientToken(value string) error
- func ValidateDashboardPersistentMetadata(flag string, value map[string]any) error
- func ValidateFieldName(value string) error
- func ValidateRootChartLayout(layout map[string]any, totalColumns int) error
Constants ¶
const ( DashboardGridColumnsV1 = 12 DashboardGridColumnsV2 = 48 RootResponsiveLayoutParent = "root-responsive-layout" )
const MaxFieldNameUTF16Length = 150
Variables ¶
This section is empty.
Functions ¶
func DatasourceSourceConfig ¶
DatasourceSourceConfig reads the reviewed get_datasource_config envelope. Keep the original JSON string: decoding and re-encoding an opaque stored config could lose number precision or fields unknown to this CLI version.
func ResolveDashboardRootColumns ¶
func ResolveDashboardRootColumns( payload map[string]any, expectedBaseID, expectedDashboardID string, isAppMode bool, ) (int, error)
ResolveDashboardRootColumns selects the root Dashboard grid using the public MCP protocol. The read response must identify the requested Base/Dashboard before either application-mode context or stored metadata can select a grid. Ordinary Dashboards require the original schemaVersion JSON type to be verified so a numeric 2 cannot be confused with the legacy string "2".
func UTF16Length ¶
UTF16Length matches Java String.length and the Notable Core protocol.
func ValidateClientToken ¶
ValidateClientToken accepts the UUID v4 form used by idempotent record creates.
func ValidateDashboardPersistentMetadata ¶
ValidateDashboardPersistentMetadata rejects read-only protocol evidence from Dashboard/Chart write objects. isAppMode belongs to caller context and schemaVersion belongs to storage metadata; neither may be persisted by CLI adapters or shortcuts.
func ValidateFieldName ¶
ValidateFieldName applies the public AI Table field-name contract.
func ValidateRootChartLayout ¶
ValidateRootChartLayout validates the writable x/y/w/h geometry against a trusted root grid width. Child containers and Tabs have independent column systems that the public Dashboard response does not expose, so they fail closed instead of inheriting the root 12/48-column rule.
Types ¶
This section is empty.