aitableprotocol

package
v1.0.64-beta.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 10 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
View Source
const RecordFilterOperators = "" /* 133-byte string literal not displayed */
View Source
const RecordFiltersHelp = `记录筛选 JSON:{"operator":"and|or","operands":[{"operator":"gt","operands":["<fieldId>",5]}]};子条件也支持 {"fieldId":"<fieldId>","operator":"gt","value":5}。操作符:` + RecordFilterOperators + `;exist/un_exist 只传 fieldId;日期使用日期字符串或整数毫秒数,不接受 View relative/exact Scheme`

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 IsSQLSheetKeyOperation added in v1.0.63

func IsSQLSheetKeyOperation(product, tool string) bool

IsSQLSheetKeyOperation identifies credential-management calls by product and tool.

func ParseRecordFilters

func ParseRecordFilters(raw string) (map[string]any, error)

ParseRecordFilters validates both public spellings before constructing the wire filter. An invalid selector must never widen a bulk write.

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 SQLSheetKeyCallError added in v1.0.63

func SQLSheetKeyCallError(tool string, err error) error

SQLSheetKeyCallError preserves known local failures and safe business codes.

func SQLSheetKeyFailure added in v1.0.63

func SQLSheetKeyFailure(tool, code string) error

SQLSheetKeyFailure projects known error codes to messages safe for output and audit.

func SQLSheetKeyProfileError added in v1.0.63

func SQLSheetKeyProfileError() error

SQLSheetKeyProfileError reports the single-identity command contract.

func SQLSheetKeyResponseError added in v1.0.63

func SQLSheetKeyResponseError(tool string, body map[string]any, isError bool) error

SQLSheetKeyResponseError classifies the business envelope before runtime audit is emitted. Successful gateway responses may represent an absent business error as null or {}.

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