@univerjs-pro/sheets-mcp 0.10.6-experimental.20250904-44da50e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ export declare const SHEET_MCP_PLUGIN_CONFIG_KEY = "sheet-mcp.config";
2
+ export declare const configSymbol: unique symbol;
3
+ export interface IUniverSheetMCPConfig {
4
+ }
5
+ export declare const defaultPluginConfig: IUniverSheetMCPConfig;
@@ -0,0 +1,2 @@
1
+ export { UniverSheetMCPPlugin as UniverCDClientPlugin } from './plugin';
2
+ export * from './tools';
@@ -0,0 +1,12 @@
1
+ import { IUniverSheetMCPConfig } from './controllers/config.schema';
2
+ import { IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
3
+ export declare class UniverSheetMCPPlugin extends Plugin {
4
+ private readonly _config;
5
+ protected readonly _injector: Injector;
6
+ private readonly _configService;
7
+ static pluginName: string;
8
+ static type: UniverInstanceType;
9
+ constructor(_config: IUniverSheetMCPConfig | undefined, _injector: Injector, _configService: IConfigService);
10
+ onStarting(): Promise<void>;
11
+ onReady(): void;
12
+ }
@@ -0,0 +1,61 @@
1
+ import { IConditionalFormattingRuleConfig, IConditionFormattingRule } from '@univerjs/sheets-conditional-formatting';
2
+ /**
3
+ * MCP parameter structure definition
4
+ * All parameters are flattened and change dynamically according to rule_type/sub_type
5
+ */
6
+ export interface MCPConditionalFormatParams {
7
+ rule_id?: string;
8
+ range?: string;
9
+ operation?: 'create' | 'update';
10
+ stop_if_true?: boolean;
11
+ priority?: number;
12
+ rule_type?: 'highlightCell' | 'dataBar' | 'colorScale';
13
+ min_type?: 'num' | 'min' | 'max' | 'percent' | 'percentile' | 'formula';
14
+ min_value?: number | string;
15
+ max_type?: 'num' | 'min' | 'max' | 'percent' | 'percentile' | 'formula';
16
+ max_value?: number | string;
17
+ positive_color?: string;
18
+ native_color?: string;
19
+ is_show_value?: boolean;
20
+ is_gradient?: boolean;
21
+ is_bottom?: boolean;
22
+ is_percent?: boolean;
23
+ points?: Array<{
24
+ index: number;
25
+ color: string;
26
+ value_type: 'num' | 'min' | 'max' | 'percent' | 'percentile' | 'formula';
27
+ value?: number | string;
28
+ }>;
29
+ sub_type?: 'uniqueValues' | 'duplicateValues' | 'rank' | 'text' | 'timePeriod' | 'number' | 'average' | 'formula';
30
+ operator?: 'beginsWith' | 'endsWith' | 'containsText' | 'notContainsText' | 'equal' | 'notEqual' | 'containsBlanks' | 'notContainsBlanks' | 'containsErrors' | 'notContainsErrors' | 'today' | 'yesterday' | 'tomorrow' | 'last7Days' | 'thisMonth' | 'lastMonth' | 'nextMonth' | 'thisWeek' | 'lastWeek' | 'nextWeek' | 'greaterThan' | 'greaterThanOrEqual' | 'lessThan' | 'lessThanOrEqual' | 'notBetween' | 'between';
31
+ value?: number | string | [number, number];
32
+ formula?: string;
33
+ style?: {
34
+ fgColor?: string;
35
+ bgColor?: string;
36
+ bold?: boolean;
37
+ italic?: boolean;
38
+ underline?: boolean;
39
+ };
40
+ }
41
+ /**
42
+ * Conditional Format Converter: MCP parameter structure ↔ IConditionalFormattingRuleConfig
43
+ */
44
+ export declare class ConditionalFormatConverter {
45
+ /**
46
+ * Convert MCP parameters to internal rule configuration
47
+ */
48
+ static toInternalConfig(params: MCPConditionalFormatParams): IConditionFormattingRule;
49
+ /**
50
+ * Convert internal rule configuration to MCP parameters
51
+ */
52
+ static fromInternalConfig<T extends IConditionalFormattingRuleConfig>(config: IConditionFormattingRule<T>): MCPConditionalFormatParams;
53
+ private static toInternalStyle;
54
+ private static fromInternalStyle;
55
+ private static toHighlightCellConfig;
56
+ private static fromHighlightCellConfig;
57
+ private static toDataBarConfig;
58
+ private static fromDataBarConfig;
59
+ private static toColorScaleConfig;
60
+ private static fromColorScaleConfig;
61
+ }
@@ -0,0 +1,10 @@
1
+ import { IDataValidationRule } from '@univerjs/core';
2
+ import { IMCPDataValidationRule } from '../tools/format-types';
3
+ export declare class DataValidationConverter {
4
+ static toInternalConfig(mcpRule: IMCPDataValidationRule): IDataValidationRule;
5
+ static fromInternalConfig(data: IDataValidationRule): IMCPDataValidationRule;
6
+ private static columnToIndex;
7
+ private static indexToColumn;
8
+ private static generateId;
9
+ private static parseValue;
10
+ }
@@ -0,0 +1,12 @@
1
+ import { ICellData, IUniverInstanceService } from '@univerjs/core';
2
+ import { INumfmtService, SheetInterceptorService } from '@univerjs/sheets';
3
+ export declare class NumFmtMCPService {
4
+ private readonly _sheetInterceptorService;
5
+ private readonly _univerInstanceService;
6
+ private _numfmtService;
7
+ constructor(_sheetInterceptorService: SheetInterceptorService, _univerInstanceService: IUniverInstanceService, _numfmtService: INumfmtService);
8
+ /**
9
+ * 获取单元格真实数值,按数值格式逻辑处理
10
+ */
11
+ getRealValue(unitId: string, sheetId: string, row: number, column: number, cell: ICellData): ICellData;
12
+ }
@@ -0,0 +1,105 @@
1
+ import { ICommandService } from '@univerjs/core';
2
+ import { SheetInterceptorService } from '@univerjs/sheets';
3
+ import { z } from 'zod';
4
+ /**
5
+ * Get UniverAPI instance from globalThis (temporary implementation)
6
+ */
7
+ export declare function getUniverAPI(): any;
8
+ /**
9
+ * Get ICommandService instance from UniverAPI injector
10
+ */
11
+ export declare function getCommandService(): ICommandService;
12
+ /**
13
+ * Get SheetInterceptorService instance from UniverAPI injector
14
+ */
15
+ export declare function getSheetInterceptorService(): SheetInterceptorService;
16
+ /**
17
+ * Parse range string to determine if it's a column range (contains letters) or row range (only numbers)
18
+ * @param rangeStr Range string like "A:C", "1:5", "A1:B2", etc.
19
+ * @returns Object with type and parsed range info
20
+ */
21
+ export declare function parseRangeType(rangeStr: string): {
22
+ type: 'column' | 'row' | 'mixed';
23
+ isValid: boolean;
24
+ };
25
+ /**
26
+ * Convert column letter to number (A=0, B=1, etc.)
27
+ */
28
+ export declare function columnLetterToNumber(letter: string): number;
29
+ /**
30
+ * Helper method to handle JS result with error handling
31
+ */
32
+ export declare function handleJsResult(obj: any, defaultMessage?: string): string;
33
+ /**
34
+ * Helper method to ensure parameter is integer
35
+ */
36
+ export declare function ensureInt(value: string | number, paramName: string): number;
37
+ /**
38
+ * Style object properties for Univer sheets with runtime validation
39
+ */
40
+ export declare const styleDataSchema: z.ZodObject<{
41
+ ff: z.ZodOptional<z.ZodString>;
42
+ fs: z.ZodOptional<z.ZodNumber>;
43
+ it: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>>;
44
+ bl: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>>;
45
+ ul: z.ZodOptional<z.ZodObject<{
46
+ s: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>;
47
+ cl: z.ZodString;
48
+ c: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>>;
49
+ t: z.ZodOptional<z.ZodString>;
50
+ }, z.core.$strip>>;
51
+ st: z.ZodOptional<z.ZodObject<{
52
+ s: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>;
53
+ cl: z.ZodString;
54
+ c: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>>;
55
+ t: z.ZodOptional<z.ZodString>;
56
+ }, z.core.$strip>>;
57
+ ol: z.ZodOptional<z.ZodObject<{
58
+ s: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>;
59
+ cl: z.ZodString;
60
+ c: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>>;
61
+ t: z.ZodOptional<z.ZodString>;
62
+ }, z.core.$strip>>;
63
+ bg: z.ZodOptional<z.ZodObject<{
64
+ rgb: z.ZodString;
65
+ }, z.core.$strip>>;
66
+ bd: z.ZodOptional<z.ZodObject<{
67
+ t: z.ZodOptional<z.ZodObject<{
68
+ s: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>;
69
+ cl: z.ZodString;
70
+ }, z.core.$strip>>;
71
+ b: z.ZodOptional<z.ZodObject<{
72
+ s: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>;
73
+ cl: z.ZodString;
74
+ }, z.core.$strip>>;
75
+ l: z.ZodOptional<z.ZodObject<{
76
+ s: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>;
77
+ cl: z.ZodString;
78
+ }, z.core.$strip>>;
79
+ r: z.ZodOptional<z.ZodObject<{
80
+ s: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>;
81
+ cl: z.ZodString;
82
+ }, z.core.$strip>>;
83
+ }, z.core.$strip>>;
84
+ cl: z.ZodOptional<z.ZodObject<{
85
+ rgb: z.ZodString;
86
+ }, z.core.$strip>>;
87
+ va: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
88
+ tr: z.ZodOptional<z.ZodObject<{
89
+ a: z.ZodNumber;
90
+ }, z.core.$strip>>;
91
+ td: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>>;
92
+ ht: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
93
+ vt: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
94
+ tb: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
95
+ pd: z.ZodOptional<z.ZodObject<{
96
+ t: z.ZodOptional<z.ZodNumber>;
97
+ b: z.ZodOptional<z.ZodNumber>;
98
+ l: z.ZodOptional<z.ZodNumber>;
99
+ r: z.ZodOptional<z.ZodNumber>;
100
+ }, z.core.$strip>>;
101
+ n: z.ZodOptional<z.ZodObject<{
102
+ pattern: z.ZodString;
103
+ }, z.core.$strip>>;
104
+ }, z.core.$loose>;
105
+ export type StyleData = z.infer<typeof styleDataSchema>;
@@ -0,0 +1,115 @@
1
+ import { IMCPTool } from '@univerjs-pro/mcp';
2
+ import { z } from 'zod';
3
+ export declare const ZodConditionalFormatRuleSchema: z.ZodObject<{
4
+ rule_id: z.ZodOptional<z.ZodString>;
5
+ range: z.ZodOptional<z.ZodString>;
6
+ stop_if_true: z.ZodOptional<z.ZodBoolean>;
7
+ priority: z.ZodOptional<z.ZodNumber>;
8
+ rule_type: z.ZodOptional<z.ZodEnum<{
9
+ highlightCell: "highlightCell";
10
+ dataBar: "dataBar";
11
+ colorScale: "colorScale";
12
+ }>>;
13
+ min_type: z.ZodOptional<z.ZodEnum<{
14
+ formula: "formula";
15
+ num: "num";
16
+ min: "min";
17
+ max: "max";
18
+ percent: "percent";
19
+ percentile: "percentile";
20
+ }>>;
21
+ min_value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
22
+ max_type: z.ZodOptional<z.ZodEnum<{
23
+ formula: "formula";
24
+ num: "num";
25
+ min: "min";
26
+ max: "max";
27
+ percent: "percent";
28
+ percentile: "percentile";
29
+ }>>;
30
+ max_value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
31
+ positive_color: z.ZodOptional<z.ZodString>;
32
+ native_color: z.ZodOptional<z.ZodString>;
33
+ is_show_value: z.ZodOptional<z.ZodBoolean>;
34
+ is_gradient: z.ZodOptional<z.ZodBoolean>;
35
+ is_bottom: z.ZodOptional<z.ZodBoolean>;
36
+ is_percent: z.ZodOptional<z.ZodBoolean>;
37
+ points: z.ZodOptional<z.ZodArray<z.ZodObject<{
38
+ index: z.ZodNumber;
39
+ color: z.ZodString;
40
+ value_type: z.ZodEnum<{
41
+ formula: "formula";
42
+ num: "num";
43
+ min: "min";
44
+ max: "max";
45
+ percent: "percent";
46
+ percentile: "percentile";
47
+ }>;
48
+ value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
49
+ }, z.core.$strip>>>;
50
+ sub_type: z.ZodOptional<z.ZodEnum<{
51
+ number: "number";
52
+ text: "text";
53
+ uniqueValues: "uniqueValues";
54
+ duplicateValues: "duplicateValues";
55
+ rank: "rank";
56
+ timePeriod: "timePeriod";
57
+ average: "average";
58
+ formula: "formula";
59
+ }>>;
60
+ operator: z.ZodOptional<z.ZodEnum<{
61
+ endsWith: "endsWith";
62
+ between: "between";
63
+ equal: "equal";
64
+ greaterThan: "greaterThan";
65
+ greaterThanOrEqual: "greaterThanOrEqual";
66
+ lessThan: "lessThan";
67
+ lessThanOrEqual: "lessThanOrEqual";
68
+ notBetween: "notBetween";
69
+ notEqual: "notEqual";
70
+ beginsWith: "beginsWith";
71
+ containsText: "containsText";
72
+ notContainsText: "notContainsText";
73
+ containsBlanks: "containsBlanks";
74
+ notContainsBlanks: "notContainsBlanks";
75
+ containsErrors: "containsErrors";
76
+ notContainsErrors: "notContainsErrors";
77
+ today: "today";
78
+ yesterday: "yesterday";
79
+ tomorrow: "tomorrow";
80
+ last7Days: "last7Days";
81
+ thisMonth: "thisMonth";
82
+ lastMonth: "lastMonth";
83
+ nextMonth: "nextMonth";
84
+ thisWeek: "thisWeek";
85
+ lastWeek: "lastWeek";
86
+ nextWeek: "nextWeek";
87
+ }>>;
88
+ value: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>]>>;
89
+ formula: z.ZodOptional<z.ZodString>;
90
+ style: z.ZodOptional<z.ZodObject<{
91
+ fgColor: z.ZodOptional<z.ZodString>;
92
+ bgColor: z.ZodOptional<z.ZodString>;
93
+ bold: z.ZodOptional<z.ZodBoolean>;
94
+ italic: z.ZodOptional<z.ZodBoolean>;
95
+ underline: z.ZodOptional<z.ZodBoolean>;
96
+ }, z.core.$strip>>;
97
+ }, z.core.$loose>;
98
+ export type ConditionalFormatRule = z.infer<typeof ZodConditionalFormatRuleSchema>;
99
+ /**
100
+ * Add one or more conditional formatting rules to the given sheet
101
+ */
102
+ export declare function addConditionalFormattingRule(sheet_name: string, rules: ConditionalFormatRule[]): Promise<string>;
103
+ /**
104
+ * Set (replace) all conditional formatting rules for the given sheet
105
+ */
106
+ export declare function setConditionalFormattingRule(sheet_name: string, rules: ConditionalFormatRule[]): Promise<string>;
107
+ /**
108
+ * Delete one or more conditional formatting rules by ID
109
+ */
110
+ export declare function deleteConditionalFormattingRule(sheet_name: string, rule_ids: string[]): Promise<string>;
111
+ /**
112
+ * Get all conditional formatting rules for the given sheet
113
+ */
114
+ export declare function getConditionalFormattingRules(sheet_name: string): Promise<string>;
115
+ export declare const conditionalFormattingTools: IMCPTool[];
@@ -0,0 +1,54 @@
1
+ import { IMCPTool } from '@univerjs-pro/mcp';
2
+ import { DataValidationOperator } from '@univerjs/core';
3
+ import { z } from 'zod';
4
+ export declare const dataValidationRuleSchema: z.ZodObject<{
5
+ rule_id: z.ZodOptional<z.ZodString>;
6
+ range_a1: z.ZodString;
7
+ validation_type: z.ZodEnum<{
8
+ list: "list";
9
+ date: "date";
10
+ decimal: "decimal";
11
+ checkbox: "checkbox";
12
+ integer: "integer";
13
+ text_length: "text_length";
14
+ custom_formula: "custom_formula";
15
+ }>;
16
+ operator: z.ZodOptional<z.ZodEnum<typeof DataValidationOperator>>;
17
+ value1: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
18
+ value2: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodNull]>>;
19
+ source: z.ZodOptional<z.ZodString>;
20
+ allow_multiple: z.ZodOptional<z.ZodBoolean>;
21
+ custom_formula: z.ZodOptional<z.ZodString>;
22
+ show_time: z.ZodOptional<z.ZodBoolean>;
23
+ ignore_blank: z.ZodOptional<z.ZodBoolean>;
24
+ show_dropdown: z.ZodOptional<z.ZodBoolean>;
25
+ show_error_message: z.ZodOptional<z.ZodBoolean>;
26
+ error_style: z.ZodOptional<z.ZodEnum<{
27
+ information: "information";
28
+ stop: "stop";
29
+ warning: "warning";
30
+ }>>;
31
+ error_title: z.ZodOptional<z.ZodString>;
32
+ error_message: z.ZodOptional<z.ZodString>;
33
+ show_input_message: z.ZodOptional<z.ZodBoolean>;
34
+ input_title: z.ZodOptional<z.ZodString>;
35
+ input_message: z.ZodOptional<z.ZodString>;
36
+ }, z.core.$loose>;
37
+ export type ZodDataValidationRule = z.infer<typeof dataValidationRuleSchema>;
38
+ /**
39
+ * Add one or more data validation rules to the specified sheet
40
+ */
41
+ export declare function addDataValidationRule(sheet_name: string, rules: ZodDataValidationRule[]): Promise<string>;
42
+ /**
43
+ * Set (replace) data validation rules for the specified sheet
44
+ */
45
+ export declare function setDataValidationRule(sheet_name: string, rules: ZodDataValidationRule[]): Promise<string>;
46
+ /**
47
+ * Delete one or more data validation rules by ID
48
+ */
49
+ export declare function deleteDataValidationRule(sheet_name: string, rule_ids: string[]): Promise<string>;
50
+ /**
51
+ * Get all data validation rules for the specified sheet
52
+ */
53
+ export declare function getDataValidationRules(sheet_name: string): Promise<string>;
54
+ export declare const dataValidationTools: IMCPTool[];
@@ -0,0 +1,10 @@
1
+ import { ISheetFormulaError } from '@univerjs/engine-formula';
2
+ import { IDataValidationError } from '@univerjs/sheets-data-validation/facade';
3
+ /**
4
+ * Get lint errors from formula errors and data validation errors
5
+ */
6
+ export declare function getLintErrors(formulaErrors: ISheetFormulaError[], dataValidationErrors: IDataValidationError[]): string;
7
+ /**
8
+ * Get comprehensive lint errors from workbook
9
+ */
10
+ export declare function getWorkbookLintErrors(): Promise<string>;
@@ -0,0 +1,104 @@
1
+ import { DataValidationOperator } from '@univerjs/core';
2
+ /**
3
+ * MCP Conditional Format Parameters
4
+ * All parameters are flattened and change dynamically based on rule_type/sub_type
5
+ */
6
+ export interface MCPConditionalFormatParams {
7
+ rule_id?: string;
8
+ range?: string;
9
+ operation?: 'create' | 'update';
10
+ stop_if_true?: boolean;
11
+ priority?: number;
12
+ rule_type?: 'highlightCell' | 'dataBar' | 'colorScale';
13
+ min_type?: 'num' | 'min' | 'max' | 'percent' | 'percentile' | 'formula';
14
+ min_value?: number | string;
15
+ max_type?: 'num' | 'min' | 'max' | 'percent' | 'percentile' | 'formula';
16
+ max_value?: number | string;
17
+ positive_color?: string;
18
+ native_color?: string;
19
+ is_show_value?: boolean;
20
+ is_gradient?: boolean;
21
+ is_bottom?: boolean;
22
+ is_percent?: boolean;
23
+ points?: Array<{
24
+ index: number;
25
+ color: string;
26
+ value_type: 'num' | 'min' | 'max' | 'percent' | 'percentile' | 'formula';
27
+ value?: number | string;
28
+ }>;
29
+ sub_type?: 'uniqueValues' | 'duplicateValues' | 'rank' | 'text' | 'timePeriod' | 'number' | 'average' | 'formula';
30
+ operator?: 'beginsWith' | 'endsWith' | 'containsText' | 'notContainsText' | 'equal' | 'notEqual' | 'containsBlanks' | 'notContainsBlanks' | 'containsErrors' | 'notContainsErrors' | 'today' | 'yesterday' | 'tomorrow' | 'last7Days' | 'thisMonth' | 'lastMonth' | 'nextMonth' | 'thisWeek' | 'lastWeek' | 'nextWeek' | 'greaterThan' | 'greaterThanOrEqual' | 'lessThan' | 'lessThanOrEqual' | 'notBetween' | 'between';
31
+ value?: number | string | [number, number];
32
+ formula?: string;
33
+ style?: {
34
+ fgColor?: string;
35
+ bgColor?: string;
36
+ bold?: boolean;
37
+ italic?: boolean;
38
+ underline?: boolean;
39
+ };
40
+ }
41
+ /**
42
+ * MCP Data Validation Rule Interface
43
+ */
44
+ export interface IMCPDataValidationRule {
45
+ /** Rule ID. If not provided when creating, a random string will be used */
46
+ rule_id?: string;
47
+ /** A1 range, multiple ranges separated by commas */
48
+ range_a1: string;
49
+ /** Validation type */
50
+ validation_type: 'list' | 'integer' | 'decimal' | 'date' | 'text_length' | 'custom_formula' | 'checkbox';
51
+ /**
52
+ * Operator for validation. Used in combination with validation_type in ["integer", "decimal", "date", "time", "text_length"], not required.
53
+ * Excel standard enum:
54
+ * Range: "between", "notBetween"
55
+ * Single value: "equal", "notEqual", "greaterThan", "greaterThanOrEqual", "lessThan", "lessThanOrEqual"
56
+ * Note: Ignored for validation_type="list" or "custom_formula".
57
+ * No default value; set only when more complex validation is needed.
58
+ */
59
+ operator?: DataValidationOperator;
60
+ /**
61
+ * First value required by the operator. Required if operator is set.
62
+ * Format depends on validation_type:
63
+ * - integer/decimal: number (e.g. 10)
64
+ * - date: ISO string (e.g. "2023-01-01")
65
+ * - text_length: number (e.g. 5)
66
+ * Renamed from min_value for clarity.
67
+ */
68
+ value1?: number | string;
69
+ /**
70
+ * Second value required by the operator. Required only if operator is "between" or "notBetween".
71
+ * Format same as value1.
72
+ * Must be null or omitted for other operators.
73
+ * Renamed from max_value for clarity.
74
+ */
75
+ value2?: number | string | null;
76
+ /** List source, only valid when validation_type="list". Comma-separated string or cell range */
77
+ source?: string;
78
+ /** Custom formula, only valid when validation_type="custom_formula" */
79
+ custom_formula?: string;
80
+ /** Ignore blank (optional) */
81
+ ignore_blank?: boolean;
82
+ /** Show dropdown (optional) */
83
+ show_dropdown?: boolean;
84
+ /** Allow multiple selection, only valid when validation_type="list". Univer specific property */
85
+ allow_multiple?: boolean;
86
+ /** Show time in date picker, only valid when validation_type="date". Univer specific property */
87
+ show_time?: boolean;
88
+ /** Error handling */
89
+ /** Show error message (optional), default true */
90
+ show_error_message?: boolean;
91
+ /** Error style, default is stop */
92
+ error_style?: 'stop' | 'warning' | 'information';
93
+ /** Error title (optional) */
94
+ error_title?: string;
95
+ /** Error message (optional), default is Invalid input */
96
+ error_message?: string;
97
+ /** Input prompt */
98
+ /** Show input prompt message (optional), default true */
99
+ show_input_message?: boolean;
100
+ /** Input prompt title (optional) */
101
+ input_title?: string;
102
+ /** Input prompt message (optional), default is empty */
103
+ input_message?: string;
104
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Central export file for all MCP tools
3
+ */
4
+ export { conditionalFormattingTools } from './conditional-format-tools';
5
+ export { dataValidationTools } from './data-validation-tools';
6
+ export { rangeOperationTools } from './range-operations';
7
+ export { rowColumnOperationTools } from './row-column-operations';
8
+ export { sheetManagementTools } from './sheet-management';
9
+ export { utilityTools } from './utility-tools';
10
+ export declare const allSheetTools: import('@univerjs-pro/mcp').IMCPTool[];
@@ -0,0 +1,89 @@
1
+ import { IMCPTool } from '@univerjs-pro/mcp';
2
+ import { z } from 'zod';
3
+ export declare const batchRangeDataItemSchema: z.ZodObject<{
4
+ range: z.ZodString;
5
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodAny>, z.ZodRecord<z.ZodString, z.ZodAny>]>;
6
+ }, z.core.$strip>;
7
+ export declare const batchRangeStyleItemSchema: z.ZodObject<{
8
+ range: z.ZodString;
9
+ style: z.ZodObject<{
10
+ ff: z.ZodOptional<z.ZodString>;
11
+ fs: z.ZodOptional<z.ZodNumber>;
12
+ it: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>>;
13
+ bl: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>>;
14
+ ul: z.ZodOptional<z.ZodObject<{
15
+ s: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>;
16
+ cl: z.ZodString;
17
+ c: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>>;
18
+ t: z.ZodOptional<z.ZodString>;
19
+ }, z.core.$strip>>;
20
+ st: z.ZodOptional<z.ZodObject<{
21
+ s: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>;
22
+ cl: z.ZodString;
23
+ c: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>>;
24
+ t: z.ZodOptional<z.ZodString>;
25
+ }, z.core.$strip>>;
26
+ ol: z.ZodOptional<z.ZodObject<{
27
+ s: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>;
28
+ cl: z.ZodString;
29
+ c: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>>;
30
+ t: z.ZodOptional<z.ZodString>;
31
+ }, z.core.$strip>>;
32
+ bg: z.ZodOptional<z.ZodObject<{
33
+ rgb: z.ZodString;
34
+ }, z.core.$strip>>;
35
+ bd: z.ZodOptional<z.ZodObject<{
36
+ t: z.ZodOptional<z.ZodObject<{
37
+ s: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>;
38
+ cl: z.ZodString;
39
+ }, z.core.$strip>>;
40
+ b: z.ZodOptional<z.ZodObject<{
41
+ s: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>;
42
+ cl: z.ZodString;
43
+ }, z.core.$strip>>;
44
+ l: z.ZodOptional<z.ZodObject<{
45
+ s: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>;
46
+ cl: z.ZodString;
47
+ }, z.core.$strip>>;
48
+ r: z.ZodOptional<z.ZodObject<{
49
+ s: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>;
50
+ cl: z.ZodString;
51
+ }, z.core.$strip>>;
52
+ }, z.core.$strip>>;
53
+ cl: z.ZodOptional<z.ZodObject<{
54
+ rgb: z.ZodString;
55
+ }, z.core.$strip>>;
56
+ va: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
57
+ tr: z.ZodOptional<z.ZodObject<{
58
+ a: z.ZodNumber;
59
+ }, z.core.$strip>>;
60
+ td: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>>;
61
+ ht: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
62
+ vt: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
63
+ tb: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
64
+ pd: z.ZodOptional<z.ZodObject<{
65
+ t: z.ZodOptional<z.ZodNumber>;
66
+ b: z.ZodOptional<z.ZodNumber>;
67
+ l: z.ZodOptional<z.ZodNumber>;
68
+ r: z.ZodOptional<z.ZodNumber>;
69
+ }, z.core.$strip>>;
70
+ n: z.ZodOptional<z.ZodObject<{
71
+ pattern: z.ZodString;
72
+ }, z.core.$strip>>;
73
+ }, z.core.$loose>;
74
+ }, z.core.$strip>;
75
+ export type BatchRangeDataItem = z.infer<typeof batchRangeDataItemSchema>;
76
+ export type BatchRangeStyleItem = z.infer<typeof batchRangeStyleItemSchema>;
77
+ /**
78
+ * Batch set value or formula for multiple ranges
79
+ */
80
+ export declare function batchSetRangeData(items: BatchRangeDataItem[]): Promise<string>;
81
+ /**
82
+ * Batch set style for multiple ranges
83
+ */
84
+ export declare function setRangeStyle(items: BatchRangeStyleItem[]): Promise<string>;
85
+ /**
86
+ * Merge a single range
87
+ */
88
+ export declare function setMerge(range_a1: string): Promise<string>;
89
+ export declare const rangeOperationTools: IMCPTool[];
@@ -0,0 +1,51 @@
1
+ import { IMCPTool } from '@univerjs-pro/mcp';
2
+ import { z } from 'zod';
3
+ export declare const insertRowOperationSchema: z.ZodObject<{
4
+ position: z.ZodNumber;
5
+ how_many: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
6
+ where: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
7
+ before: "before";
8
+ after: "after";
9
+ }>>>;
10
+ sheet_name: z.ZodOptional<z.ZodString>;
11
+ }, z.core.$strip>;
12
+ export declare const insertColumnOperationSchema: z.ZodObject<{
13
+ position: z.ZodNumber;
14
+ how_many: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
15
+ where: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
16
+ before: "before";
17
+ after: "after";
18
+ }>>>;
19
+ sheet_name: z.ZodOptional<z.ZodString>;
20
+ }, z.core.$strip>;
21
+ export declare const deleteRowOperationSchema: z.ZodObject<{
22
+ position: z.ZodNumber;
23
+ how_many: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
24
+ sheet_name: z.ZodOptional<z.ZodString>;
25
+ }, z.core.$strip>;
26
+ export declare const deleteColumnOperationSchema: z.ZodObject<{
27
+ position: z.ZodNumber;
28
+ how_many: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
29
+ sheet_name: z.ZodOptional<z.ZodString>;
30
+ }, z.core.$strip>;
31
+ export type InsertRowOperation = z.infer<typeof insertRowOperationSchema>;
32
+ export type InsertColumnOperation = z.infer<typeof insertColumnOperationSchema>;
33
+ export type DeleteRowOperation = z.infer<typeof deleteRowOperationSchema>;
34
+ export type DeleteColumnOperation = z.infer<typeof deleteColumnOperationSchema>;
35
+ /**
36
+ * Insert rows for multiple operations
37
+ */
38
+ export declare function insertRows(operations: InsertRowOperation[]): Promise<Record<string, any>>;
39
+ /**
40
+ * Insert columns for multiple operations
41
+ */
42
+ export declare function insertColumns(operations: InsertColumnOperation[]): Promise<Record<string, any>>;
43
+ /**
44
+ * Delete rows for multiple operations
45
+ */
46
+ export declare function deleteRows(operations: DeleteRowOperation[]): Promise<Record<string, any>>;
47
+ /**
48
+ * Delete columns for multiple operations
49
+ */
50
+ export declare function deleteColumns(operations: DeleteColumnOperation[]): Promise<Record<string, any>>;
51
+ export declare const rowColumnOperationTools: IMCPTool[];