@gui-chat-plugin/spreadsheet 0.1.0

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,36 @@
1
+ /**
2
+ * Formula Evaluator
3
+ *
4
+ * Evaluates spreadsheet formulas including functions, cell references, and arithmetic
5
+ */
6
+ import type { CellValue } from "./types";
7
+ /**
8
+ * Evaluation context for formulas
9
+ */
10
+ export interface EvaluatorContext {
11
+ getCellValue: (ref: string) => CellValue;
12
+ getRangeValues: (range: string) => CellValue[];
13
+ getRangeValuesRaw?: (range: string) => CellValue[];
14
+ evaluateFormula: (formula: string) => CellValue;
15
+ }
16
+ /**
17
+ * Parse function arguments, handling nested functions and quoted strings
18
+ *
19
+ * @param argsStr - String containing function arguments
20
+ * @returns Array of argument strings
21
+ */
22
+ export declare function parseFunctionArgs(argsStr: string): string[];
23
+ /**
24
+ * Evaluate a formula string
25
+ *
26
+ * Supports:
27
+ * - Function calls: SUM(A1:A10), ROUND(B2, 2)
28
+ * - Cell references: A1, B2, Sheet1!A1
29
+ * - Arithmetic: 2+3, A1*B1, (A1+B1)/2
30
+ * - Nested expressions: ROUND(SUM(A1:A10)/COUNT(A1:A10), 2)
31
+ *
32
+ * @param formula - Formula string (without leading =)
33
+ * @param context - Evaluation context with cell/range accessors
34
+ * @returns Evaluated result (number or string)
35
+ */
36
+ export declare function evaluateFormula(formula: string, context: EvaluatorContext): CellValue;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Number Formatting Utilities
3
+ *
4
+ * Handles Excel-style format codes for currency, percentages, decimals, dates, etc.
5
+ */
6
+ /**
7
+ * Format a number according to Excel format code
8
+ *
9
+ * Supported formats:
10
+ * - Currency: $#,##0.00, $#,##0
11
+ * - Percentage: 0.00%, 0.0%
12
+ * - Integer with commas: #,##0
13
+ * - Decimal: 0.00, 0.000
14
+ * - Dates: MM/DD/YYYY, DD-MMM-YYYY, etc.
15
+ *
16
+ * @param value - The numeric value to format
17
+ * @param format - The Excel format code
18
+ * @returns Formatted string representation
19
+ */
20
+ export declare function formatNumber(value: number, format: string): string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Date and Time Functions
3
+ * Excel stores dates as sequential serial numbers so they can be used in calculations.
4
+ * January 1, 1900 is serial number 1.
5
+ */
6
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Financial Functions
3
+ */
4
+ export {};
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Spreadsheet Functions Index
3
+ *
4
+ * Imports all function categories to register them with the function registry.
5
+ * Import this file to load all available spreadsheet functions.
6
+ */
7
+ import "./statistical";
8
+ import "./mathematical";
9
+ import "./logical";
10
+ import "./text";
11
+ import "./financial";
12
+ import "./lookup";
13
+ import "./date";
14
+ export { functionRegistry } from "../registry";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Logical Functions
3
+ */
4
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Lookup and Reference Functions
3
+ */
4
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Mathematical Functions
3
+ */
4
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Statistical Functions
3
+ */
4
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Text Functions
3
+ */
4
+ export {};
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Spreadsheet Engine
3
+ *
4
+ * Framework-agnostic spreadsheet calculation engine
5
+ */
6
+ export * from "./types";
7
+ export * from "./parser";
8
+ export * from "./formatter";
9
+ export * from "./evaluator";
10
+ export * from "./calculator";
11
+ export * from "./registry";
12
+ import "./functions";
13
+ export { SpreadsheetEngine } from "./engine";
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Cell and Range Reference Parsing
3
+ *
4
+ * Handles Excel A1 notation parsing and conversion
5
+ */
6
+ import type { CellRef, RangeRef } from "./types";
7
+ /**
8
+ * Convert Excel column letters to 0-based index
9
+ * A=0, B=1, ..., Z=25, AA=26, etc.
10
+ *
11
+ * @param col - Column letters (e.g., "A", "Z", "AA")
12
+ * @returns 0-based column index
13
+ */
14
+ export declare function columnToIndex(col: string): number;
15
+ /**
16
+ * Convert 0-based index to Excel column letters
17
+ * 0=A, 1=B, ..., 25=Z, 26=AA, etc.
18
+ *
19
+ * @param index - 0-based column index
20
+ * @returns Column letters (e.g., "A", "Z", "AA")
21
+ */
22
+ export declare function indexToColumn(index: number): string;
23
+ /**
24
+ * Parse a cell reference to its components
25
+ * Supports: A1, $A$1, $A1, A$1, Sheet1!A1, 'My Sheet'!A1
26
+ *
27
+ * @param ref - Cell reference string
28
+ * @returns Parsed cell reference object
29
+ */
30
+ export declare function parseCellRef(ref: string): CellRef;
31
+ /**
32
+ * Parse a range reference to its components
33
+ * Supports: A1:B10, $A$1:$B$10, Sheet1!A1:B10
34
+ *
35
+ * @param range - Range reference string
36
+ * @returns Parsed range reference object
37
+ */
38
+ export declare function parseRangeRef(range: string): RangeRef;
39
+ /**
40
+ * Convert a cell reference object back to A1 notation
41
+ *
42
+ * @param ref - Cell reference object
43
+ * @returns A1 notation string
44
+ */
45
+ export declare function cellRefToA1(ref: CellRef): string;
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Spreadsheet Function Registry
3
+ *
4
+ * This module provides a registry system for spreadsheet functions,
5
+ * allowing modular organization and easy extension of formula capabilities.
6
+ */
7
+ import type { CellValue } from "./types";
8
+ export type { CellValue };
9
+ export type CellGetter = (ref: string) => CellValue;
10
+ export type RangeGetter = (range: string) => CellValue[];
11
+ export type RawRangeGetter = (range: string) => CellValue[];
12
+ export interface FunctionContext {
13
+ getCellValue: CellGetter;
14
+ getRangeValues: RangeGetter;
15
+ getRangeValuesRaw?: RawRangeGetter;
16
+ evaluateFormula: (formula: string) => CellValue;
17
+ }
18
+ export type FunctionHandler = (args: string[], context: FunctionContext) => CellValue;
19
+ export interface FunctionDefinition {
20
+ name: string;
21
+ handler: FunctionHandler;
22
+ minArgs?: number;
23
+ maxArgs?: number;
24
+ description?: string;
25
+ examples?: string[];
26
+ category?: string;
27
+ }
28
+ declare class FunctionRegistry {
29
+ private functions;
30
+ register(def: FunctionDefinition): void;
31
+ get(name: string): FunctionDefinition | undefined;
32
+ hasFunction(name: string): boolean;
33
+ getAllFunctions(): FunctionDefinition[];
34
+ getFunctionsByCategory(): Map<string, FunctionDefinition[]>;
35
+ }
36
+ export declare const functionRegistry: FunctionRegistry;
37
+ /**
38
+ * Helper function to convert a value to a number
39
+ */
40
+ export declare function toNumber(value: CellValue): number;
41
+ /**
42
+ * Helper function to convert a value to a string
43
+ */
44
+ export declare function toString(value: CellValue): string;
45
+ /**
46
+ * Helper to parse criteria for conditional functions like COUNTIF, SUMIF
47
+ * Returns a comparison function that tests if a value matches the criteria
48
+ */
49
+ export declare function parseCriteria(criteria: string): (value: CellValue) => boolean;
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Spreadsheet Engine Type Definitions
3
+ */
4
+ export type CellValue = number | string | boolean;
5
+ export interface SpreadsheetCell {
6
+ v: CellValue;
7
+ f?: string;
8
+ }
9
+ export interface SheetData {
10
+ name: string;
11
+ data: SpreadsheetCell[][];
12
+ }
13
+ export interface CalculatedSheet {
14
+ name: string;
15
+ data: CellValue[][];
16
+ formulas: FormulaInfo[];
17
+ errors: CalculationError[];
18
+ }
19
+ export interface CellRef {
20
+ row: number;
21
+ col: number;
22
+ sheet?: string;
23
+ absolute?: {
24
+ row: boolean;
25
+ col: boolean;
26
+ };
27
+ }
28
+ export interface RangeRef {
29
+ start: CellRef;
30
+ end: CellRef;
31
+ }
32
+ export interface EvaluationContext {
33
+ currentSheet: string;
34
+ sheets: Map<string, SpreadsheetCell[][]>;
35
+ calculatedValues?: Map<string, CellValue>;
36
+ }
37
+ export interface FormulaInfo {
38
+ cell: CellRef;
39
+ formula: string;
40
+ dependencies: CellRef[];
41
+ result: CellValue;
42
+ }
43
+ export interface CalculationError {
44
+ cell: CellRef;
45
+ formula: string;
46
+ error: string;
47
+ type: "circular" | "invalid_ref" | "div_zero" | "syntax" | "unknown";
48
+ }
49
+ export interface EngineOptions {
50
+ maxIterations?: number;
51
+ enableCrossSheetRefs?: boolean;
52
+ strictMode?: boolean;
53
+ }
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./core.cjs");exports.SYSTEM_PROMPT=e.SYSTEM_PROMPT;exports.TOOL_DEFINITION=e.TOOL_DEFINITION;exports.TOOL_NAME=e.TOOL_NAME;exports.executeSpreadsheet=e.executeSpreadsheet;exports.pluginCore=e.pluginCore;exports.samples=e.samples;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Spreadsheet Plugin
3
+ *
4
+ * Main entry point - re-exports core module.
5
+ * For Vue components, import from "@anthropic/guichat-plugin-spreadsheet/vue"
6
+ */
7
+ export * from "./core";
package/dist/index.js ADDED
@@ -0,0 +1,9 @@
1
+ import { SYSTEM_PROMPT as T, TOOL_DEFINITION as p, TOOL_NAME as r, executeSpreadsheet as o, pluginCore as s, samples as t } from "./core.js";
2
+ export {
3
+ T as SYSTEM_PROMPT,
4
+ p as TOOL_DEFINITION,
5
+ r as TOOL_NAME,
6
+ o as executeSpreadsheet,
7
+ s as pluginCore,
8
+ t as samples
9
+ };
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-green-50:oklch(98.2% .018 155.826);--color-green-100:oklch(96.2% .044 156.743);--color-green-200:oklch(92.5% .084 155.995);--color-green-300:oklch(87.1% .15 154.449);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-green-900:oklch(39.3% .095 152.535);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-800:oklch(27.8% .033 256.848);--color-white:#fff;--spacing:.25rem;--container-4xl:56rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--font-weight-medium:500;--radius-md:.375rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing)*1)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-5{margin-bottom:calc(var(--spacing)*5)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.contents{display:contents}.flex{display:flex}.table{display:table}.h-\[600px\]{height:600px}.max-h-64{max-height:calc(var(--spacing)*64)}.min-h-full{min-height:100%}.max-w-4xl{max-width:var(--container-4xl)}.max-w-\[200px\]{max-width:200px}.flex-shrink{flex-shrink:1}.border-collapse{border-collapse:collapse}.cursor-pointer{cursor:pointer}.resize{resize:both}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.gap-2{gap:calc(var(--spacing)*2)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-gray-200{border-color:var(--color-gray-200)}.border-green-200{border-color:var(--color-green-200)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-green-50{background-color:var(--color-green-50)}.bg-green-100{background-color:var(--color-green-100)}.bg-white{background-color:var(--color-white)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-8{padding:calc(var(--spacing)*8)}.px-4{padding-inline:calc(var(--spacing)*4)}.py-2{padding-block:calc(var(--spacing)*2)}.text-center{text-align:center}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-800{color:var(--color-gray-800)}.text-green-600{color:var(--color-green-600)}.text-green-700{color:var(--color-green-700)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media(hover:hover){.hover\:border-green-300:hover{border-color:var(--color-green-300)}.hover\:bg-green-200:hover{background-color:var(--color-green-200)}}@media(prefers-color-scheme:dark){.dark\:bg-green-900{background-color:var(--color-green-900)}.dark\:text-gray-200{color:var(--color-gray-200)}.dark\:text-gray-400{color:var(--color-gray-400)}.dark\:text-green-300{color:var(--color-green-300)}}}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}.spreadsheet-container[data-v-46c4c1c7]{width:100%;height:100%;display:flex;flex-direction:column;background:#fff}.spreadsheet-content-wrapper[data-v-46c4c1c7]{flex:1;overflow-y:auto;min-height:0}.header[data-v-46c4c1c7]{display:flex;align-items:center;justify-content:space-between;margin-bottom:1em}.title[data-v-46c4c1c7]{font-size:2em;margin:0;font-weight:700}.button-group[data-v-46c4c1c7]{display:flex;gap:.5em}.download-btn[data-v-46c4c1c7]{padding:.5em 1em;color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:.9em;display:flex;align-items:center;gap:.5em;transition:background-color .2s}.excel-btn[data-v-46c4c1c7]{background-color:#217346}.excel-btn[data-v-46c4c1c7]:hover{background-color:#1e6a3f}.excel-btn[data-v-46c4c1c7]:active{background-color:#1a5c36}.download-btn .material-icons[data-v-46c4c1c7]{font-size:1.2em}.sheet-tabs[data-v-46c4c1c7]{display:flex;gap:.25em;margin-bottom:1em;border-bottom:2px solid #e0e0e0}.sheet-tab[data-v-46c4c1c7]{padding:.5em 1em;background:#f5f5f5;border:none;border-top-left-radius:4px;border-top-right-radius:4px;cursor:pointer;font-size:.9em;color:#666;transition:background-color .2s}.sheet-tab[data-v-46c4c1c7]:hover{background:#e8e8e8}.sheet-tab.active[data-v-46c4c1c7]{background:#fff;color:#333;font-weight:500;border-bottom:2px solid white;margin-bottom:-2px}.table-container[data-v-46c4c1c7]{overflow-x:auto;background:#fff}.table-container[data-v-46c4c1c7] table{border-collapse:collapse;width:100%;font-family:Segoe UI,Arial,sans-serif;font-size:.9em}.table-container[data-v-46c4c1c7] td,.table-container[data-v-46c4c1c7] th{border:1px solid #d0d0d0;padding:.5em .75em;text-align:left}.table-container[data-v-46c4c1c7] th{background-color:#f5f5f5;font-weight:600;color:#333}.table-container[data-v-46c4c1c7] tr:nth-child(2n){background-color:#fafafa}.table-container[data-v-46c4c1c7] tr:hover{background-color:#f0f0f0}.table-container[data-v-46c4c1c7] .cell-editing{background-color:#e8f5e9!important;outline:2px solid #217346!important;outline-offset:-2px}.table-container[data-v-46c4c1c7] .cell-referenced{background-color:#fff3e0!important;outline:2px solid #ff9800!important;outline-offset:-2px}.error[data-v-46c4c1c7]{padding:1em;background:#ffebee;color:#c62828;border-radius:4px;margin:1em 0}.spreadsheet-source[data-v-46c4c1c7]{padding:.5rem;background:#f5f5f5;border-top:1px solid #e0e0e0;font-family:monospace;font-size:.85rem;flex-shrink:0}.spreadsheet-source summary[data-v-46c4c1c7]{cursor:pointer;-webkit-user-select:none;user-select:none;padding:.5rem;background:#e8e8e8;border-radius:4px;font-weight:500;color:#333}.spreadsheet-source[open] summary[data-v-46c4c1c7]{margin-bottom:.5rem}.spreadsheet-source summary[data-v-46c4c1c7]:hover{background:#d8d8d8}.spreadsheet-editor[data-v-46c4c1c7]{width:100%;height:40vh;padding:1rem;background:#fff;border:1px solid #ccc;border-radius:4px;color:#333;font-family:Courier New,monospace;font-size:.9rem;resize:vertical;margin-bottom:.5rem;line-height:1.5}.spreadsheet-editor[data-v-46c4c1c7]:focus{outline:none;border-color:#217346;box-shadow:0 0 0 2px #2173461a}.apply-btn[data-v-46c4c1c7]{padding:.5rem 1rem;background:#217346;color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:.9rem;transition:background .2s;font-weight:500}.apply-btn[data-v-46c4c1c7]:hover{background:#1e6a3f}.apply-btn[data-v-46c4c1c7]:active{background:#1a5c36}.apply-btn[data-v-46c4c1c7]:disabled{background:#ccc;color:#666;cursor:not-allowed;opacity:.6}.apply-btn[data-v-46c4c1c7]:disabled:hover{background:#ccc}.mini-editor-panel[data-v-46c4c1c7]{background:#f8f8f8;border-top:1px solid #d0d0d0;flex-shrink:0}.mini-editor-content[data-v-46c4c1c7]{display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem}.cell-ref[data-v-46c4c1c7]{font-family:monospace;font-weight:600;color:#217346;font-size:.85rem;min-width:2rem}.radio-group[data-v-46c4c1c7]{display:flex;gap:.75rem;border-right:1px solid #d0d0d0;padding-right:.75rem}.radio-option[data-v-46c4c1c7]{display:flex;align-items:center;gap:.25rem;cursor:pointer;font-size:.85rem;color:#555}.radio-option input[type=radio][data-v-46c4c1c7]{cursor:pointer;width:.9rem;height:.9rem}.form-input[data-v-46c4c1c7]{flex:1;padding:.4rem .6rem;border:1px solid #ccc;border-radius:3px;font-size:.85rem;font-family:inherit;transition:border-color .2s;min-width:120px}.form-input[data-v-46c4c1c7]:focus{outline:none;border-color:#217346;box-shadow:0 0 0 2px #2173461a}.form-input[data-v-46c4c1c7]::placeholder{color:#999;font-size:.8rem}.save-btn[data-v-46c4c1c7],.cancel-btn[data-v-46c4c1c7]{padding:.4rem .8rem;border:none;border-radius:3px;cursor:pointer;font-size:.85rem;font-weight:500;transition:background .2s}.save-btn[data-v-46c4c1c7]{background:#217346;color:#fff}.save-btn[data-v-46c4c1c7]:hover{background:#1e6a3f}.cancel-btn[data-v-46c4c1c7]{background:transparent;color:#666;padding:.4rem;font-size:1.2rem;line-height:1}.cancel-btn[data-v-46c4c1c7]:hover{color:#333;background:#e0e0e0}
@@ -0,0 +1,8 @@
1
+ import type { ToolResult } from "gui-chat-protocol";
2
+ import type { SpreadsheetToolData } from "../core/types";
3
+ type __VLS_Props = {
4
+ result: ToolResult<SpreadsheetToolData>;
5
+ };
6
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import type { ToolResult } from "gui-chat-protocol";
2
+ import type { SpreadsheetToolData } from "../core/types";
3
+ import "../engine/functions";
4
+ type __VLS_Props = {
5
+ selectedResult: ToolResult<SpreadsheetToolData>;
6
+ };
7
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
+ updateResult: (result: ToolResult<unknown, unknown>) => any;
9
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
10
+ onUpdateResult?: ((result: ToolResult<unknown, unknown>) => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Spreadsheet Plugin - Vue Implementation
3
+ *
4
+ * Full Vue plugin with UI components.
5
+ * Import from "@anthropic/guichat-plugin-spreadsheet/vue"
6
+ */
7
+ import "../style.css";
8
+ import type { ToolPlugin } from "gui-chat-protocol/vue";
9
+ import type { SpreadsheetToolData, SpreadsheetArgs } from "../core/types";
10
+ import View from "./View.vue";
11
+ import Preview from "./Preview.vue";
12
+ /**
13
+ * Spreadsheet plugin instance with Vue components
14
+ */
15
+ export declare const plugin: ToolPlugin<SpreadsheetToolData, never, SpreadsheetArgs>;
16
+ export type { SpreadsheetCell, SpreadsheetSheet, SpreadsheetToolData, SpreadsheetArgs, } from "../core/types";
17
+ export { TOOL_NAME, TOOL_DEFINITION, SYSTEM_PROMPT, executeSpreadsheet, pluginCore, } from "../core/plugin";
18
+ export { samples } from "../core/samples";
19
+ export { View, Preview };
20
+ declare const _default: {
21
+ plugin: ToolPlugin<SpreadsheetToolData, never, SpreadsheetArgs, import("gui-chat-protocol/vue").InputHandler, Record<string, unknown>>;
22
+ };
23
+ export default _default;