aitableprotocol

package
v1.0.63-beta.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package aitableprotocol contains small, stable validations shared by the native AI Table commands and their shortcut adapters.

Index

Constants

View Source
const (
	DashboardGridColumnsV1     = 12
	DashboardGridColumnsV2     = 48
	RootResponsiveLayoutParent = "root-responsive-layout"
)
View Source
const MaxFieldNameUTF16Length = 150

Variables

This section is empty.

Functions

func DatasourceSourceConfig

func DatasourceSourceConfig(payload map[string]any) (string, error)

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

func UTF16Length(value string) int

UTF16Length matches Java String.length and the Notable Core protocol.

func ValidateClientToken

func ValidateClientToken(value string) error

ValidateClientToken accepts the UUID v4 form used by idempotent record creates.

func ValidateDashboardPersistentMetadata

func ValidateDashboardPersistentMetadata(flag string, value map[string]any) error

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

func ValidateFieldName(value string) error

ValidateFieldName applies the public AI Table field-name contract.

func ValidateRootChartLayout

func ValidateRootChartLayout(layout map[string]any, totalColumns int) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL