@smallwebco/tinypivot-mcp 0.2.0 → 0.2.2
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/.claude-plugin/plugin.json +1 -1
- package/dist/app/index.html +28 -28
- package/dist/{chunk-UNQEXGX2.js → chunk-DPIX36MK.js} +2866 -2362
- package/dist/cli.js +160 -11
- package/dist/{excel-FT5GZR62.js → excel-ETNWIKPV.js} +734 -1744
- package/dist/index.d.ts +23 -3
- package/dist/index.js +5 -1
- package/package.json +4 -4
- package/server.json +2 -2
- package/rules/AGENTS.md +0 -8
package/dist/index.d.ts
CHANGED
|
@@ -129,10 +129,24 @@ interface StartCompanionOptions {
|
|
|
129
129
|
*/
|
|
130
130
|
declare function startCompanionServer(options: StartCompanionOptions): Promise<CompanionServerHandle>;
|
|
131
131
|
|
|
132
|
-
declare const TINYPIVOT_CLAUDE_RULE_BLOCK = "<!-- tinypivot:start -->\n## Default Charts & Pivot Tables (TinyPivot MCP)\nWhenever the user asks for a chart (line, bar, stacked bar, area, pie, scatter), a YoY/MoM comparison, a pivot table, or interactive tabular data exploration, ALWAYS use `tinypivot` (`load_data` for in-memory rows or `load_file` for CSV/TSV/JSON files, passing `chartConfig` or `pivotConfig` in a single call) INSTEAD of built-in visualization widgets, HTML/SVG/Chart.js/Recharts artifacts, matplotlib scripts, or large Markdown tables. Do not create temp CSVs for <500 in-memory rows
|
|
133
|
-
declare
|
|
132
|
+
declare const TINYPIVOT_CLAUDE_RULE_BLOCK = "<!-- tinypivot:start -->\n## Default Charts & Pivot Tables (TinyPivot MCP)\nWhenever the user asks for a chart (line, bar, stacked bar, area, pie, scatter), a YoY/MoM comparison, a pivot table, or interactive tabular data exploration, ALWAYS use `tinypivot` (`load_data` for in-memory rows or `load_file` for CSV/TSV/JSON files, passing `chartConfig` or `pivotConfig` in a single call) INSTEAD of built-in visualization widgets, HTML/SVG/Chart.js/Recharts artifacts, matplotlib scripts, or large Markdown tables. Do not create temp CSVs for <500 in-memory rows.\nIn terminal harnesses (pi, Claude Code, OpenCode, Codex CLI), there is NO inline GUI widget: ALWAYS include the returned fenced `text` TinyPivot chart/table card verbatim AND the localhost Companion IDE URL in your VERY FIRST reply\u2014never say \"it is open in TinyPivot\" without printing the card.\n<!-- tinypivot:end -->";
|
|
133
|
+
declare const TINYPIVOT_PI_RULE_BLOCK = "<!-- tinypivot:start -->\n## Default Charts & Pivot Tables (TinyPivot MCP)\nWhenever the user asks for a chart (line, bar, stacked bar, area, pie, scatter), a YoY/MoM comparison, a pivot table, or interactive tabular data exploration, ALWAYS use `tinypivot` (`load_data` for in-memory rows or `load_file` for CSV/TSV/JSON files, passing `chartConfig` or `pivotConfig` in a single call) INSTEAD of built-in visualization widgets, HTML/SVG/Chart.js/Recharts artifacts, matplotlib scripts, or large Markdown tables. Do not create temp CSVs for <500 in-memory rows.\nThe TinyPivot pi extension automatically renders every TinyPivot chart/pivot card in full 24-bit color right in the terminal UI after the tool call\u2014follow up with 2\u20133 concise analytical takeaways and the live Companion IDE URL (no need to repeat a plain monochrome ASCII box unless the user asks). Users can switch themes anytime with `/tinypivot-theme` or `set_visual_theme`.\n<!-- tinypivot:end -->";
|
|
134
|
+
declare function upsertTinyPivotRuleBlock(existing: string, block?: string): string;
|
|
134
135
|
declare function runInitCommand(args: string[]): Promise<void>;
|
|
135
136
|
|
|
137
|
+
/**
|
|
138
|
+
* Generates a self-contained pi coding-agent extension (`~/.pi/agent/extensions/tinypivot.ts`)
|
|
139
|
+
* installed automatically by `tinypivot-mcp init`.
|
|
140
|
+
*
|
|
141
|
+
* Capabilities:
|
|
142
|
+
* - Intercepts TinyPivot MCP tool outputs (including nested codemode calls) on `tool_execution_end`
|
|
143
|
+
* and renders framed charts & pivot tables directly in pi's TUI in full 24-bit ANSI truecolor
|
|
144
|
+
* using TinyPivot's unified theme palettes (zero extra LLM context tokens).
|
|
145
|
+
* - Registers `/tinypivot-theme [theme-id]` inside pi for instant interactive theme switching
|
|
146
|
+
* persisted to `~/.config/tinypivot/preferences.json` and synced to the live Companion IDE.
|
|
147
|
+
*/
|
|
148
|
+
declare function buildPiExtensionSource(): string;
|
|
149
|
+
|
|
136
150
|
interface PostgresConfig {
|
|
137
151
|
connectionString: string;
|
|
138
152
|
allowedTables?: string[];
|
|
@@ -175,6 +189,12 @@ declare function createTinyPivotMcpServer(options?: CreateTinyPivotMcpServerOpti
|
|
|
175
189
|
interface TerminalFormatOptions {
|
|
176
190
|
/** Show subtle tiny-pivot.com card signature (true on Free tier, false on Pro) */
|
|
177
191
|
showBranding?: boolean;
|
|
192
|
+
/** Live local Companion Data IDE URL to embed inside the card footer */
|
|
193
|
+
companionUrl?: string;
|
|
194
|
+
/** Optional 24-bit ANSI truecolor palette for direct TTY CLI output (omit for LLM Markdown) */
|
|
195
|
+
colorTheme?: ChartThemePreset;
|
|
196
|
+
/** Omit Markdown ```text fences (for direct TTY CLI output) */
|
|
197
|
+
raw?: boolean;
|
|
178
198
|
}
|
|
179
199
|
/**
|
|
180
200
|
* Render a screenshot-ready framed Unicode/Braille chart card directly in terminal output
|
|
@@ -189,4 +209,4 @@ declare function isProcessAlive(pid: number): boolean;
|
|
|
189
209
|
declare function resolveCompanionUrl(explicit?: string): Promise<string | null>;
|
|
190
210
|
declare function runTuiCommand(args: string[]): Promise<void>;
|
|
191
211
|
|
|
192
|
-
export { APP_MIME_TYPE, APP_RESOURCE_URI, type ColumnSummary, type CompanionServerHandle, type CreateTinyPivotMcpServerOptions, DEFAULT_MODEL_PRICING, type DatasetMetadata, DatasetStore, MODEL_CATALOG, type ModelPricing, type PostgresConfig, type PostgresQueryResult, type StartCompanionOptions, type StoredDataset, TINYPIVOT_CLAUDE_RULE_BLOCK, TINYPIVOT_MCP_INSTRUCTIONS, type TerminalFormatOptions, clientSupportsMcpAppsUi, createTinyPivotMcpServer, executeReadOnlyPostgresQuery, formatDatasetSummary, formatPivotSummary, formatTerminalChart, generateSampleSalesData, getCompanionSessionFile, inferColumns, isProcessAlive, listPostgresTables, loadAppHtml, parseDelimitedText, resolveCompanionUrl, resolveLicenseKey, resolveModelPricing, runInitCommand, runTuiCommand, startCompanionServer, tokensToUsd, upsertTinyPivotRuleBlock };
|
|
212
|
+
export { APP_MIME_TYPE, APP_RESOURCE_URI, type ColumnSummary, type CompanionServerHandle, type CreateTinyPivotMcpServerOptions, DEFAULT_MODEL_PRICING, type DatasetMetadata, DatasetStore, MODEL_CATALOG, type ModelPricing, type PostgresConfig, type PostgresQueryResult, type StartCompanionOptions, type StoredDataset, TINYPIVOT_CLAUDE_RULE_BLOCK, TINYPIVOT_MCP_INSTRUCTIONS, TINYPIVOT_PI_RULE_BLOCK, type TerminalFormatOptions, buildPiExtensionSource, clientSupportsMcpAppsUi, createTinyPivotMcpServer, executeReadOnlyPostgresQuery, formatDatasetSummary, formatPivotSummary, formatTerminalChart, generateSampleSalesData, getCompanionSessionFile, inferColumns, isProcessAlive, listPostgresTables, loadAppHtml, parseDelimitedText, resolveCompanionUrl, resolveLicenseKey, resolveModelPricing, runInitCommand, runTuiCommand, startCompanionServer, tokensToUsd, upsertTinyPivotRuleBlock };
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,8 @@ import {
|
|
|
6
6
|
MODEL_CATALOG,
|
|
7
7
|
TINYPIVOT_CLAUDE_RULE_BLOCK,
|
|
8
8
|
TINYPIVOT_MCP_INSTRUCTIONS,
|
|
9
|
+
TINYPIVOT_PI_RULE_BLOCK,
|
|
10
|
+
buildPiExtensionSource,
|
|
9
11
|
clientSupportsMcpAppsUi,
|
|
10
12
|
createTinyPivotMcpServer,
|
|
11
13
|
executeReadOnlyPostgresQuery,
|
|
@@ -27,7 +29,7 @@ import {
|
|
|
27
29
|
startCompanionServer,
|
|
28
30
|
tokensToUsd,
|
|
29
31
|
upsertTinyPivotRuleBlock
|
|
30
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-DPIX36MK.js";
|
|
31
33
|
import "./chunk-2ESYSVXG.js";
|
|
32
34
|
export {
|
|
33
35
|
APP_MIME_TYPE,
|
|
@@ -37,6 +39,8 @@ export {
|
|
|
37
39
|
MODEL_CATALOG,
|
|
38
40
|
TINYPIVOT_CLAUDE_RULE_BLOCK,
|
|
39
41
|
TINYPIVOT_MCP_INSTRUCTIONS,
|
|
42
|
+
TINYPIVOT_PI_RULE_BLOCK,
|
|
43
|
+
buildPiExtensionSource,
|
|
40
44
|
clientSupportsMcpAppsUi,
|
|
41
45
|
createTinyPivotMcpServer,
|
|
42
46
|
executeReadOnlyPostgresQuery,
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@smallwebco/tinypivot-mcp",
|
|
3
3
|
"mcpName": "io.github.Small-Web-Co/tinypivot",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "0.2.
|
|
5
|
+
"version": "0.2.2",
|
|
6
6
|
"description": "TinyPivot MCP Server, Interactive MCP App & Claude Plugin — turn CSV, JSON, API/MCP outputs, and queries from any database into interactive charts, pivot tables, terminal cards, live TUI, drill-through, and Excel exports inside AI agents.",
|
|
7
7
|
"author": "Small Web, LLC",
|
|
8
8
|
"license": "MIT",
|
|
@@ -79,9 +79,9 @@
|
|
|
79
79
|
"typescript": "~5.6.2",
|
|
80
80
|
"vite": "^6.4.6",
|
|
81
81
|
"vite-plugin-singlefile": "^2.2.0",
|
|
82
|
-
"@smallwebco/tinypivot-
|
|
83
|
-
"@smallwebco/tinypivot-server": "1.4.
|
|
84
|
-
"@smallwebco/tinypivot-
|
|
82
|
+
"@smallwebco/tinypivot-react": "1.4.2",
|
|
83
|
+
"@smallwebco/tinypivot-server": "1.4.2",
|
|
84
|
+
"@smallwebco/tinypivot-core": "1.4.2"
|
|
85
85
|
},
|
|
86
86
|
"scripts": {
|
|
87
87
|
"build": "pnpm run build:server && pnpm run build:app",
|
package/server.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "io.github.Small-Web-Co/tinypivot",
|
|
4
4
|
"title": "TinyPivot — Interactive Data IDE for AI Agents",
|
|
5
5
|
"description": "Interactive charts, pivot tables, terminal cards, live TUI, and Excel export inside AI agents.",
|
|
6
|
-
"version": "0.2.
|
|
6
|
+
"version": "0.2.2",
|
|
7
7
|
"websiteUrl": "https://tiny-pivot.com",
|
|
8
8
|
"repository": {
|
|
9
9
|
"url": "https://github.com/Small-Web-Co/tinypivot",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
{
|
|
15
15
|
"registryType": "npm",
|
|
16
16
|
"identifier": "@smallwebco/tinypivot-mcp",
|
|
17
|
-
"version": "0.2.
|
|
17
|
+
"version": "0.2.2",
|
|
18
18
|
"transport": {
|
|
19
19
|
"type": "stdio"
|
|
20
20
|
},
|
package/rules/AGENTS.md
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
# TinyPivot — Automatic In-Agent Analytics Rule
|
|
2
|
-
|
|
3
|
-
When the `tinypivot` MCP server is available and the user asks to inspect, summarize, compare, pivot, or chart tabular data (CSV/TSV/JSON/JSONL files, SQL results, or API/MCP responses with more than a few rows):
|
|
4
|
-
|
|
5
|
-
1. **Use TinyPivot automatically** — do not wait for the user to ask for TinyPivot by name.
|
|
6
|
-
2. **Prefer zero-token pass-through (`load_file`)** when pulling data from local files, CLIs, or SQL queries: write the rows directly to a file and call `load_file` with both `pivotConfig` and `chartConfig` in **one single tool call** so only one clean interactive visual card renders and raw rows stay out of LLM context.
|
|
7
|
-
3. **Use `load_data`** only when piping small structured results already returned by another MCP tool.
|
|
8
|
-
4. **Never dump giant Markdown tables** of raw rows when TinyPivot is rendering the interactive Chart, Pivot, and Data Grid; give a concise 2–3 bullet executive takeaway instead.
|