mulmoclaude 2.7.0 → 2.8.1
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.
- package/client/assets/Graph-ChAxkn9o.js +1 -0
- package/client/assets/dist-Bij44LdC.js +2 -0
- package/client/assets/echarts-GV3U9sVf.js +1 -0
- package/client/assets/echarts-gl-BXx4On0Y.js +4282 -0
- package/client/assets/echarts-wordcloud-_9uQUAfp.js +1 -0
- package/client/assets/emscripten-module-Q67P5WYC-BU3Hlttz.js +2160 -0
- package/client/assets/ffi-4V2b7xu3.js +1 -0
- package/client/assets/{index-lkpgbKtk.js → index-D6xzCZhP.js} +600 -589
- package/client/assets/index-DzMsXDnj.css +2 -0
- package/client/assets/{install-wxcddUsO.js → install-C1moNcrn.js} +1 -1
- package/client/assets/{marp-DcTywifN.js → marp-Du5Sym5b.js} +1 -1
- package/client/assets/module-ES6BEMUI-CDTIpMiA.js +6 -0
- package/client/index.html +4 -3
- package/package.json +5 -4
- package/server/api/routes/plugins.ts +8 -59
- package/server/build/mcp-server.mjs +609 -608
- package/server/index.ts +1 -0
- package/server/plugins/confined-file-ops.ts +136 -0
- package/server/plugins/runtime.ts +8 -115
- package/server/plugins/spreadsheet-builtin.ts +26 -0
- package/server/plugins/spreadsheet-save-outcome.ts +7 -0
- package/server/utils/files/store-resolvers.ts +1 -1
- package/src/lang/de.ts +0 -20
- package/src/lang/en.ts +0 -20
- package/src/lang/es.ts +0 -20
- package/src/lang/fr.ts +0 -20
- package/src/lang/ja.ts +0 -20
- package/src/lang/ko.ts +0 -20
- package/src/lang/pt-BR.ts +0 -20
- package/src/lang/zh.ts +0 -20
- package/src/plugins/spreadsheet/definition.ts +9 -127
- package/src/plugins/spreadsheet/index.ts +7 -4
- package/src/plugins/spreadsheet/meta.ts +2 -4
- package/client/assets/echarts-gl-Cq76Z6DA.js +0 -4282
- package/client/assets/index-Cz7JLE0k.css +0 -2
- package/server/utils/files/spreadsheet-store.ts +0 -26
- package/src/plugins/spreadsheet/Preview.vue +0 -31
- package/src/plugins/spreadsheet/View.vue +0 -1007
- package/src/plugins/spreadsheet/cellHighlights.ts +0 -78
- package/src/plugins/spreadsheet/engine/calculator.ts +0 -427
- package/src/plugins/spreadsheet/engine/cellBuilder.ts +0 -89
- package/src/plugins/spreadsheet/engine/cellEmpty.ts +0 -26
- package/src/plugins/spreadsheet/engine/cellFormatting.ts +0 -59
- package/src/plugins/spreadsheet/engine/coerce-boolean.ts +0 -26
- package/src/plugins/spreadsheet/engine/condition.ts +0 -182
- package/src/plugins/spreadsheet/engine/date-locale.ts +0 -47
- package/src/plugins/spreadsheet/engine/date-parser.ts +0 -234
- package/src/plugins/spreadsheet/engine/date-utils.ts +0 -73
- package/src/plugins/spreadsheet/engine/datedif.ts +0 -93
- package/src/plugins/spreadsheet/engine/engine.ts +0 -177
- package/src/plugins/spreadsheet/engine/evaluator.ts +0 -494
- package/src/plugins/spreadsheet/engine/financial-math.ts +0 -114
- package/src/plugins/spreadsheet/engine/formatter.ts +0 -158
- package/src/plugins/spreadsheet/engine/formulaError.ts +0 -67
- package/src/plugins/spreadsheet/engine/formulaRefs.ts +0 -202
- package/src/plugins/spreadsheet/engine/functions/date.ts +0 -212
- package/src/plugins/spreadsheet/engine/functions/financial.ts +0 -244
- package/src/plugins/spreadsheet/engine/functions/index.ts +0 -16
- package/src/plugins/spreadsheet/engine/functions/logical.ts +0 -221
- package/src/plugins/spreadsheet/engine/functions/lookup-math.ts +0 -28
- package/src/plugins/spreadsheet/engine/functions/lookup.ts +0 -257
- package/src/plugins/spreadsheet/engine/functions/mathematical.ts +0 -283
- package/src/plugins/spreadsheet/engine/functions/statistical-math.ts +0 -91
- package/src/plugins/spreadsheet/engine/functions/statistical.ts +0 -290
- package/src/plugins/spreadsheet/engine/functions/text.ts +0 -398
- package/src/plugins/spreadsheet/engine/index.ts +0 -34
- package/src/plugins/spreadsheet/engine/jsonCellLocator.ts +0 -111
- package/src/plugins/spreadsheet/engine/math-ops.ts +0 -98
- package/src/plugins/spreadsheet/engine/numericCoercion.ts +0 -61
- package/src/plugins/spreadsheet/engine/parser.ts +0 -40
- package/src/plugins/spreadsheet/engine/registry.ts +0 -201
- package/src/plugins/spreadsheet/engine/responseDecoder.ts +0 -68
- package/src/plugins/spreadsheet/engine/spreadsheet-errors.ts +0 -82
- package/src/plugins/spreadsheet/engine/textFormat.ts +0 -108
- package/src/plugins/spreadsheet/engine/translateFormula.ts +0 -69
- package/src/plugins/spreadsheet/engine/types.ts +0 -81
- package/src/plugins/spreadsheet/keyboardNav.ts +0 -38
|
@@ -1,137 +1,19 @@
|
|
|
1
|
+
import { TOOL_DEFINITION as PACKAGE_TOOL_DEFINITION } from "@gui-chat-plugin/spreadsheet";
|
|
1
2
|
import type { ToolDefinition } from "gui-chat-protocol";
|
|
2
3
|
import { META } from "./meta";
|
|
3
4
|
import type { ResolvedRoute } from "../meta-types";
|
|
4
|
-
import { errorMessage } from "../../utils/errors";
|
|
5
5
|
|
|
6
|
+
// presentSpreadsheet's schema, validation, engine and View live in
|
|
7
|
+
// @gui-chat-plugin/spreadsheet (also consumed by MulmoTerminal). This built-in
|
|
8
|
+
// keeps MulmoClaude's routing META and the prompt, which points the agent at
|
|
9
|
+
// the workspace help file for cell formats and functions.
|
|
6
10
|
export const TOOL_NAME = META.toolName;
|
|
7
|
-
export type SpreadsheetEndpoints = { readonly [K in keyof typeof META.apiRoutes]: ResolvedRoute };
|
|
8
|
-
|
|
9
|
-
/** Mirrors the engine's `StoredCellValue`. Declaring it narrower than what the
|
|
10
|
-
* engine stores and renders is what forced the View to cast its decoded
|
|
11
|
-
* sheets back to this type. */
|
|
12
|
-
export type SpreadsheetCellValue = string | number | boolean;
|
|
13
|
-
|
|
14
|
-
export interface SpreadsheetCell {
|
|
15
|
-
v: SpreadsheetCellValue;
|
|
16
|
-
f?: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/** A cell as a stored workbook actually holds it. The engine's `normalizeData`
|
|
20
|
-
* folds all four forms, and models and hand edits write all four, so a
|
|
21
|
-
* workbook read back off disk cannot promise `{ v }` for every cell. The tool
|
|
22
|
-
* SCHEMA is deliberately stricter — it says what a caller should emit, not
|
|
23
|
-
* what an existing file may contain. */
|
|
24
|
-
export type StorableCell = SpreadsheetCell | { v?: null; f?: string } | SpreadsheetCellValue | null;
|
|
25
11
|
|
|
26
|
-
export
|
|
27
|
-
name: string;
|
|
28
|
-
data: StorableCell[][];
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface SpreadsheetToolData {
|
|
32
|
-
sheets: SpreadsheetSheet[] | string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface SpreadsheetArgs {
|
|
36
|
-
title: string;
|
|
37
|
-
sheets: SpreadsheetSheet[];
|
|
38
|
-
}
|
|
12
|
+
export type SpreadsheetEndpoints = { readonly [K in keyof typeof META.apiRoutes]: ResolvedRoute };
|
|
39
13
|
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
name: TOOL_NAME,
|
|
43
|
-
description: "Display an Excel-like spreadsheet with formulas and calculations.",
|
|
14
|
+
export const TOOL_DEFINITION: ToolDefinition = {
|
|
15
|
+
...PACKAGE_TOOL_DEFINITION,
|
|
44
16
|
prompt: `Use ${TOOL_NAME} when the user asks for a spreadsheet, table with calculations, or what-if analysis. Use formulas and cell references instead of pre-calculated values so the spreadsheet stays interactive. For cell format details and available functions, read \`config/helps/spreadsheet.md\` in the workspace.`,
|
|
45
|
-
parameters: {
|
|
46
|
-
type: "object",
|
|
47
|
-
properties: {
|
|
48
|
-
title: {
|
|
49
|
-
type: "string",
|
|
50
|
-
description: "Title for the spreadsheet",
|
|
51
|
-
},
|
|
52
|
-
sheets: {
|
|
53
|
-
type: "array",
|
|
54
|
-
description: "Sheets to render as spreadsheet tabs. Each sheet includes a name and 2D array of cells (rows x columns).",
|
|
55
|
-
items: {
|
|
56
|
-
type: "object",
|
|
57
|
-
properties: {
|
|
58
|
-
name: {
|
|
59
|
-
type: "string",
|
|
60
|
-
description: "Sheet name (e.g., 'Sales Q1', 'Summary')",
|
|
61
|
-
},
|
|
62
|
-
data: {
|
|
63
|
-
type: "array",
|
|
64
|
-
description:
|
|
65
|
-
'Rows of cells. Each cell is an object with \'v\' (value) and \'f\' (format). Use Excel-style A1 notation in formulas: columns are letters (A, B, C...), rows are 1-based numbers (1, 2, 3...). Values can be text, numbers, dates, or formulas. Examples: [{"v": "Product"}, {"v": 2024, "f": "#,##0"}, {"v": "01/15/2025", "f": "MM/DD/YYYY"}, {"v": "=B2*1.05", "f": "$#,##0.00"}]. Format codes: \'$#,##0.00\' (currency), \'#,##0\' (integer), \'0.00%\' (percent), \'0.00\' (decimal), \'MM/DD/YYYY\' (date), \'DD-MMM-YYYY\' (date), \'YYYY-MM-DD\' (ISO date).',
|
|
66
|
-
items: {
|
|
67
|
-
type: "array",
|
|
68
|
-
description: "Row of cells. Each cell is an object with value and format.",
|
|
69
|
-
items: {
|
|
70
|
-
type: "object",
|
|
71
|
-
description: "Cell object with value and optional format. If value is a string starting with '=', it's treated as a formula.",
|
|
72
|
-
properties: {
|
|
73
|
-
v: {
|
|
74
|
-
oneOf: [{ type: "string" }, { type: "number" }, { type: "boolean" }],
|
|
75
|
-
description:
|
|
76
|
-
"Cell value. Can be text, number, boolean, date, or formula (string starting with '='). Examples: 'Revenue', 1500000, true, '01/15/2025', '=SUM(A1:A10)', '=B2-TODAY()'. Date strings like '01/15/2025' are automatically parsed to date serial numbers.",
|
|
77
|
-
},
|
|
78
|
-
f: {
|
|
79
|
-
type: "string",
|
|
80
|
-
description:
|
|
81
|
-
"Optional format code for displaying the value. Common formats: '$#,##0.00' (currency), '#,##0' (integer), '0.00%' (percent), '0.00' (decimal), 'MM/DD/YYYY' (date), 'DD-MMM-YYYY' (date), 'YYYY-MM-DD' (ISO date)",
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
required: ["v"],
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
required: ["name", "data"],
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
required: ["title", "sheets"],
|
|
94
|
-
},
|
|
95
17
|
};
|
|
96
18
|
|
|
97
|
-
export default
|
|
98
|
-
|
|
99
|
-
export const executeSpreadsheet = async (
|
|
100
|
-
args: SpreadsheetArgs,
|
|
101
|
-
): Promise<{
|
|
102
|
-
message: string;
|
|
103
|
-
title: string;
|
|
104
|
-
data: SpreadsheetToolData;
|
|
105
|
-
instructions: string;
|
|
106
|
-
}> => {
|
|
107
|
-
const { title } = args;
|
|
108
|
-
let { sheets } = args;
|
|
109
|
-
|
|
110
|
-
// Handle case where LLM accidentally stringifies the sheets array
|
|
111
|
-
if (typeof sheets === "string") {
|
|
112
|
-
try {
|
|
113
|
-
sheets = JSON.parse(sheets);
|
|
114
|
-
} catch (error) {
|
|
115
|
-
throw new Error(`Invalid sheets format: sheets must be an array, not a string. Parse error: ${errorMessage(error)}`);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// Validate that sheets are provided
|
|
120
|
-
if (!Array.isArray(sheets) || sheets.length === 0) {
|
|
121
|
-
throw new Error("At least one sheet is required. Sheets must be an array of sheet objects.");
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// Validate each sheet has data
|
|
125
|
-
for (const sheet of sheets) {
|
|
126
|
-
if (!sheet.name || !sheet.data || sheet.data.length === 0) {
|
|
127
|
-
throw new Error(`Invalid sheet: ${sheet.name || "unnamed"}. Each sheet must have a name and data array.`);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
return {
|
|
132
|
-
message: `Created spreadsheet: ${title}`,
|
|
133
|
-
title,
|
|
134
|
-
data: { sheets },
|
|
135
|
-
instructions: "Acknowledge that the spreadsheet has been created and is displayed to the user.",
|
|
136
|
-
};
|
|
137
|
-
};
|
|
19
|
+
export default TOOL_DEFINITION;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import type { PluginRegistration, ToolPlugin } from "../../tools/types";
|
|
2
|
-
import
|
|
2
|
+
import { View, Preview, type SpreadsheetToolData } from "@gui-chat-plugin/spreadsheet/vue";
|
|
3
|
+
// Vite lib mode does not inject the package's stylesheet; the consumer imports it.
|
|
4
|
+
import "@gui-chat-plugin/spreadsheet/style.css";
|
|
5
|
+
import { TOOL_DEFINITION, TOOL_NAME, type SpreadsheetEndpoints } from "./definition";
|
|
3
6
|
import { makeRouteExecute } from "../execute";
|
|
4
7
|
import { wrapWithScope } from "../scope";
|
|
5
|
-
import View from "./View.vue";
|
|
6
|
-
import Preview from "./Preview.vue";
|
|
7
8
|
|
|
9
|
+
// wrapWithScope provides the runtime the package View needs: dispatch for
|
|
10
|
+
// loading and saving the workbook, and the host locale for its strings.
|
|
8
11
|
const spreadsheetPlugin: ToolPlugin<SpreadsheetToolData> = {
|
|
9
|
-
toolDefinition,
|
|
12
|
+
toolDefinition: TOOL_DEFINITION,
|
|
10
13
|
|
|
11
14
|
execute: makeRouteExecute<SpreadsheetEndpoints, SpreadsheetToolData>("spreadsheet", "create", TOOL_NAME),
|
|
12
15
|
|
|
@@ -4,11 +4,9 @@ export const META = definePluginMeta({
|
|
|
4
4
|
toolName: "presentSpreadsheet",
|
|
5
5
|
apiNamespace: "spreadsheet",
|
|
6
6
|
apiRoutes: {
|
|
7
|
-
/** POST /api/spreadsheet — create a new spreadsheet.
|
|
7
|
+
/** POST /api/spreadsheet — create a new spreadsheet. Cell edits are
|
|
8
|
+
* saved through the View's dispatch (server/plugins/spreadsheet-builtin.ts). */
|
|
8
9
|
create: { method: "POST", path: "" },
|
|
9
|
-
/** PUT /api/spreadsheet/update — overwrite an existing
|
|
10
|
-
* spreadsheet. Body carries the workspace-relative path. */
|
|
11
|
-
update: { method: "PUT", path: "/update" },
|
|
12
10
|
},
|
|
13
11
|
mcpDispatch: "create",
|
|
14
12
|
});
|