@smallwebco/tinypivot-mcp 0.5.0 → 0.6.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.
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +1 -3
- package/dist/app/index.html +89 -89
- package/dist/{chunk-E6DYPT62.js → chunk-2DF4I43A.js} +667 -497
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +33 -50
- package/dist/index.js +1 -1
- package/package.json +4 -4
- package/server.json +2 -2
package/dist/cli.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
import { DataGridViewMode, PivotConfig, ChartConfig
|
|
1
|
+
import { ChartThemePreset, DataGridViewMode, PivotConfig, ChartConfig } from '@smallwebco/tinypivot-core';
|
|
2
2
|
import * as _duckdb_node_api from '@duckdb/node-api';
|
|
3
3
|
import { DuckDBConnection } from '@duckdb/node-api';
|
|
4
4
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
5
5
|
|
|
6
|
+
interface TerminalFormatOptions {
|
|
7
|
+
/** Show subtle tiny-pivot.com card signature (true on Free tier, false on Pro) */
|
|
8
|
+
showBranding?: boolean;
|
|
9
|
+
/** Live local Studio URL to embed inside the card footer */
|
|
10
|
+
companionUrl?: string;
|
|
11
|
+
/** Optional 24-bit ANSI truecolor palette for direct TTY CLI output (omit for LLM Markdown) */
|
|
12
|
+
colorTheme?: ChartThemePreset;
|
|
13
|
+
/** Omit Markdown ```text fences (for direct TTY CLI output) */
|
|
14
|
+
raw?: boolean;
|
|
15
|
+
/** Remind the model, in a terminal, to show the card to the user. Off when cards are not reprinted. */
|
|
16
|
+
reprintNote?: boolean;
|
|
17
|
+
/** The host shows TinyPivot's own view in the chat, so the model is told not to repeat the card. */
|
|
18
|
+
shownInWidget?: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
6
21
|
interface ModelPricing {
|
|
7
22
|
id: string;
|
|
8
23
|
name: string;
|
|
@@ -216,8 +231,6 @@ interface StudioNote {
|
|
|
216
231
|
id: string;
|
|
217
232
|
at: string;
|
|
218
233
|
text: string;
|
|
219
|
-
/** A note asks the agent to do something; a question is from the AI Analyst and expects an answer. */
|
|
220
|
-
kind: 'note' | 'question';
|
|
221
234
|
stepId?: string;
|
|
222
235
|
attachment?: NoteAttachment;
|
|
223
236
|
/** `live` when it went straight into the agent's conversation, `queued` when it waits for the next reply. */
|
|
@@ -239,43 +252,31 @@ interface StudioSnapshot {
|
|
|
239
252
|
name?: string;
|
|
240
253
|
live: string[];
|
|
241
254
|
busy: boolean;
|
|
255
|
+
hint?: string;
|
|
242
256
|
};
|
|
243
257
|
}
|
|
244
258
|
|
|
245
259
|
/**
|
|
246
|
-
* How the Studio reaches the user's own agent.
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
* next TinyPivot reply. The bridge keeps whichever ways are connected and waits for answers.
|
|
260
|
+
* How the Studio reaches the user's own agent live. pi's extension and Claude Code's channels
|
|
261
|
+
* put a message straight into the conversation; every other agent gets Studio messages with its
|
|
262
|
+
* next TinyPivot reply. The bridge keeps whichever ways are connected right now.
|
|
250
263
|
*/
|
|
251
|
-
interface ChatTurn {
|
|
252
|
-
role: 'user' | 'assistant';
|
|
253
|
-
content: string;
|
|
254
|
-
}
|
|
255
264
|
interface AgentConnector {
|
|
256
265
|
/** Shown to the user, e.g. "pi" or "Claude Code channel". */
|
|
257
266
|
name: string;
|
|
258
267
|
/** Puts a message into the agent's conversation now. Returns false when it could not. */
|
|
259
|
-
push
|
|
260
|
-
/** Answers with the agent's own model, outside the conversation (MCP sampling). */
|
|
261
|
-
complete?: (turns: ChatTurn[]) => Promise<string>;
|
|
268
|
+
push: (note: StudioNote, text: string) => boolean;
|
|
262
269
|
}
|
|
263
270
|
declare class AgentBridge {
|
|
264
271
|
private readonly onChange;
|
|
265
272
|
private readonly connectors;
|
|
266
|
-
private readonly waiters;
|
|
267
273
|
constructor(onChange: () => void);
|
|
268
274
|
/** Adds a way to reach the agent; the returned function removes it. */
|
|
269
275
|
connect(connector: AgentConnector): () => void;
|
|
270
276
|
/** Names of the ways that reach the agent right now. */
|
|
271
277
|
live(): string[];
|
|
272
|
-
/** Delivers into the conversation through the first connector that
|
|
278
|
+
/** Delivers into the conversation through the first connector that takes it. */
|
|
273
279
|
push(note: StudioNote, text: string): string | undefined;
|
|
274
|
-
completer(): AgentConnector['complete'];
|
|
275
|
-
/** Resolves with the agent's answer to `id`, or undefined after `ms`. */
|
|
276
|
-
waitForReply(id: string, ms: number): Promise<string | undefined>;
|
|
277
|
-
/** Hands an answer to whoever waits for `re`, or to the oldest waiter when `re` is unknown. */
|
|
278
|
-
answer(text: string, re?: string): boolean;
|
|
279
280
|
}
|
|
280
281
|
|
|
281
282
|
type DuckDbModule = typeof _duckdb_node_api;
|
|
@@ -333,10 +334,11 @@ declare class Studio {
|
|
|
333
334
|
private readonly pullsByDataset;
|
|
334
335
|
private readonly listeners;
|
|
335
336
|
private changeQueued;
|
|
336
|
-
/** Ways to reach the user's agent
|
|
337
|
+
/** Ways to reach the user's agent live; without one, notes wait for its next TinyPivot reply. */
|
|
337
338
|
readonly agent: AgentBridge;
|
|
338
339
|
private agentName?;
|
|
339
340
|
private agentBusy;
|
|
341
|
+
private agentHint?;
|
|
340
342
|
constructor(store: DatasetStore, options?: {
|
|
341
343
|
history?: HistoryStore;
|
|
342
344
|
duck?: DuckDbRunner;
|
|
@@ -345,6 +347,8 @@ declare class Studio {
|
|
|
345
347
|
subscribe(listener: () => void): () => void;
|
|
346
348
|
private changed;
|
|
347
349
|
snapshot(sessionKey?: string): StudioSnapshot;
|
|
350
|
+
/** What would let this agent receive Studio messages live, shown while it cannot. */
|
|
351
|
+
setAgentHint(hint: string | undefined): void;
|
|
348
352
|
/** Whether the agent is in the middle of a turn, as its extension reports it. */
|
|
349
353
|
setAgentBusy(busy: boolean): void;
|
|
350
354
|
/** The MCP client's name, e.g. `claude-code`, shown in the Studio. */
|
|
@@ -390,7 +394,6 @@ declare class Studio {
|
|
|
390
394
|
addNote(text: string, options?: {
|
|
391
395
|
stepId?: string;
|
|
392
396
|
attachment?: NoteAttachment;
|
|
393
|
-
kind?: StudioNote['kind'];
|
|
394
397
|
}): StudioNote;
|
|
395
398
|
/**
|
|
396
399
|
* How a message reads to the agent: the text, the step it is about, and any attached data.
|
|
@@ -399,17 +402,8 @@ declare class Studio {
|
|
|
399
402
|
describeNote(note: StudioNote, { withSource }?: {
|
|
400
403
|
withSource?: boolean | undefined;
|
|
401
404
|
}): string;
|
|
402
|
-
/**
|
|
403
|
-
|
|
404
|
-
* offers sampling, otherwise through its conversation, waiting for the reply.
|
|
405
|
-
*/
|
|
406
|
-
ask(question: string, options?: {
|
|
407
|
-
turns?: ChatTurn[];
|
|
408
|
-
attachment?: NoteAttachment;
|
|
409
|
-
waitMs?: number;
|
|
410
|
-
}): Promise<string>;
|
|
411
|
-
/** The agent's answer to a Studio message: recorded in the trace and handed to whoever waits for it. */
|
|
412
|
-
reply(text: string, re?: string): TraceStep;
|
|
405
|
+
/** The agent's answer to a Studio message, recorded in the trace where the user reads it. */
|
|
406
|
+
reply(text: string): TraceStep;
|
|
413
407
|
/** Drops a queued note the user no longer wants sent. */
|
|
414
408
|
removeNote(id: string): boolean;
|
|
415
409
|
pendingNotes(): StudioNote[];
|
|
@@ -441,8 +435,8 @@ interface StartCompanionOptions {
|
|
|
441
435
|
*/
|
|
442
436
|
declare function startCompanionServer(options: StartCompanionOptions): Promise<CompanionServerHandle>;
|
|
443
437
|
|
|
444
|
-
declare const TINYPIVOT_CLAUDE_RULE_BLOCK = "<!-- tinypivot:start -->\n## Charts & pivot tables (TinyPivot MCP)\
|
|
445
|
-
declare const TINYPIVOT_PI_RULE_BLOCK = "<!-- tinypivot:start -->\n## Charts & pivot tables (TinyPivot MCP)\
|
|
438
|
+
declare const TINYPIVOT_CLAUDE_RULE_BLOCK = "<!-- tinypivot:start -->\n## Charts & pivot tables (TinyPivot MCP)\nWhenever an answer shows figures (a ranking, a breakdown by category, a comparison, a trend, a chart or a pivot), present them with the `tinypivot` MCP server instead of a Markdown table or a chart you draw yourself. In a terminal, show its `text` card verbatim with the Studio link.\n<!-- tinypivot:end -->";
|
|
439
|
+
declare const TINYPIVOT_PI_RULE_BLOCK = "<!-- tinypivot:start -->\n## Charts & pivot tables (TinyPivot MCP)\nWhenever an answer shows figures (a ranking, a breakdown by category, a comparison, a trend, a chart or a pivot), present them with the `tinypivot` MCP server instead of a Markdown table or a chart you draw yourself. The TinyPivot pi extension already shows each card, so reply with the takeaways and the Studio link. `/tinypivot-theme` switches themes.\n<!-- tinypivot:end -->";
|
|
446
440
|
declare function upsertTinyPivotRuleBlock(existing: string, block?: string): string;
|
|
447
441
|
declare function runInitCommand(args: string[]): Promise<void>;
|
|
448
442
|
|
|
@@ -510,25 +504,14 @@ declare function createTinyPivotMcpServer(options?: CreateTinyPivotMcpServerOpti
|
|
|
510
504
|
store: DatasetStore;
|
|
511
505
|
};
|
|
512
506
|
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
/** Live local Studio URL to embed inside the card footer */
|
|
517
|
-
companionUrl?: string;
|
|
518
|
-
/** Optional 24-bit ANSI truecolor palette for direct TTY CLI output (omit for LLM Markdown) */
|
|
519
|
-
colorTheme?: ChartThemePreset;
|
|
520
|
-
/** Omit Markdown ```text fences (for direct TTY CLI output) */
|
|
521
|
-
raw?: boolean;
|
|
522
|
-
/** Remind the model, in a terminal, to show the card to the user. Off when cards are not reprinted. */
|
|
523
|
-
reprintNote?: boolean;
|
|
524
|
-
}
|
|
507
|
+
declare function formatDatasetSummary(dataset: StoredDataset, companionUrl?: string, options?: TerminalFormatOptions): string;
|
|
508
|
+
declare function formatPivotSummary(dataset: StoredDataset, config: PivotConfig, companionUrl?: string, options?: TerminalFormatOptions): string;
|
|
509
|
+
|
|
525
510
|
/**
|
|
526
511
|
* Render a screenshot-ready framed Unicode/Braille chart card directly in terminal output
|
|
527
512
|
* so CLI harnesses (Claude Code, OpenCode, pi, Codex, Ghostty) get an immediate, shareable visual.
|
|
528
513
|
*/
|
|
529
514
|
declare function formatTerminalChart(dataset: StoredDataset, chartConfig?: Partial<ChartConfig>, options?: TerminalFormatOptions): string;
|
|
530
|
-
declare function formatDatasetSummary(dataset: StoredDataset, companionUrl?: string, options?: TerminalFormatOptions): string;
|
|
531
|
-
declare function formatPivotSummary(dataset: StoredDataset, config: PivotConfig, companionUrl?: string, options?: TerminalFormatOptions): string;
|
|
532
515
|
|
|
533
516
|
declare function getCompanionSessionFile(): string;
|
|
534
517
|
declare function isProcessAlive(pid: number): boolean;
|
package/dist/index.js
CHANGED
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.
|
|
5
|
+
"version": "0.6.0",
|
|
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",
|
|
@@ -80,9 +80,9 @@
|
|
|
80
80
|
"typescript": "~5.6.2",
|
|
81
81
|
"vite": "^6.4.6",
|
|
82
82
|
"vite-plugin-singlefile": "^2.2.0",
|
|
83
|
-
"@smallwebco/tinypivot-
|
|
84
|
-
"@smallwebco/tinypivot-
|
|
85
|
-
"@smallwebco/tinypivot-server": "1.4.
|
|
83
|
+
"@smallwebco/tinypivot-core": "1.4.7",
|
|
84
|
+
"@smallwebco/tinypivot-react": "1.4.7",
|
|
85
|
+
"@smallwebco/tinypivot-server": "1.4.7"
|
|
86
86
|
},
|
|
87
87
|
"scripts": {
|
|
88
88
|
"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 — Data Analysis Studio for AI Agents",
|
|
5
5
|
"description": "Interactive charts, pivot tables, terminal cards, live TUI, and Excel export inside AI agents.",
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.6.0",
|
|
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.
|
|
17
|
+
"version": "0.6.0",
|
|
18
18
|
"transport": {
|
|
19
19
|
"type": "stdio"
|
|
20
20
|
},
|