@outsidedata/dolex 8.0.0 → 8.0.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/README.md +18 -34
- package/dist/src/cli/commands/help.js +1 -1
- package/dist/src/cli/commands/visualize.d.ts +1 -1
- package/dist/src/cli/commands/visualize.js +1 -1
- package/dist/src/cli/index.d.ts +3 -2
- package/dist/src/cli/index.js +36 -17
- package/dist/src/mcp/index.js +5 -5
- package/dist/src/mcp/tools/server-privacy.d.ts +2 -2
- package/dist/src/mcp/tools/visualize.d.ts +1 -1
- package/dist/src/mcp/tools/visualize.js +1 -1
- package/dist/src/patterns/selector.d.ts +7 -7
- package/dist/src/patterns/selector.js +7 -7
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -7,35 +7,20 @@
|
|
|
7
7
|
╚═════╝ ╚═════╝ ╚══════╝ ╚══════╝ ╚═╝ ╚═╝
|
|
8
8
|
```
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
# Dolex turns your AI assistant into a data analyst you can trust on your own data.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
A B2B data-analysis product that gives your AI assistant a rigorous analyst's discipline, working on your own files and handing back artifacts you keep.
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Dolex connects to your data, audits it, runs the analysis, and returns real results you own. It runs locally on your CSV files and loads a folder of them as one joinable database. It profiles every column, classifies what each one is, and builds a prioritized analysis plan with ready-to-run queries. Every answer traces back to an inspectable query, and the findings come back as artifacts you keep. Dolex ships as a published npm package with two front ends over one core: an MCP server any AI assistant can call, and a command-line tool your terminals, scripts, and pipelines run directly.
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
## What you get
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
## What It Actually Is
|
|
25
|
-
|
|
26
|
-
Dolex is an MCP server that gives Claude a complete data analysis toolkit. It runs locally inside Claude — you don't need to know how that works, just install it and Claude gains new abilities:
|
|
27
|
-
|
|
28
|
-
**Load a whole folder of CSV files at once** — point it at a directory and Dolex loads every CSV it finds, profiles each one automatically (column types, distributions, stats, sample values), and makes them all queryable. Loose quarterly exports, separate files per region, whatever you have — Dolex handles it.
|
|
29
|
-
|
|
30
|
-
**A built-in query engine** — aggregations (sum, avg, median, stddev, percentiles), time bucketing (group by month/quarter/year), window functions (lag, lead, rank, running totals, percent of total), automatic joins across files, and filters. Handles 500k+ rows. No code generation, no sandboxes — Dolex crunches the numbers directly.
|
|
31
|
-
|
|
32
|
-
**43 handcrafted visualization patterns** — not chart.js defaults. Bump charts for rankings, beeswarms for distributions, Sankey diagrams for flows, ridgeline plots for comparing distributions, connected dot plots for two-metric comparisons, calendar heatmaps for temporal patterns, and 37 more. Each pattern has selection rules that encode real data visualization expertise.
|
|
33
|
-
|
|
34
|
-
**Pattern intelligence** — Dolex doesn't just render charts. It analyzes the shape of your data and your intent, scores all 43 patterns, and recommends the one that actually communicates the insight — not the obvious one.
|
|
35
|
-
|
|
36
|
-
**Auto-analysis planning** — give it a dataset and it generates a structured analysis plan: which columns matter, what relationships to explore, what charts to build, with ready-to-execute queries for each step.
|
|
37
|
-
|
|
38
|
-
**100% local, 100% offline** — your data never leaves your machine. Charts render as self-contained HTML. 33 TopoJSON map files ship with the package. Zero CDN calls, zero external dependencies.
|
|
18
|
+
- **Analysis on your own data.** Dolex runs locally on your CSV files, and a folder of them becomes one database your assistant can join across.
|
|
19
|
+
- **Data you can stand behind.** A built-in audit surfaces type traps, sentinel values, leaked and duplicate columns, and outliers before they reach a conclusion.
|
|
20
|
+
- **Rigor on every result.** Full column profiling and statistics back the analysis, and each finding traces to a query you can inspect.
|
|
21
|
+
- **A real analysis plan.** Dolex classifies your columns and produces a prioritized analysis plan with ready-to-run queries; derived columns persist across sessions.
|
|
22
|
+
- **Artifacts you keep.** Findings render across 43 chart types as self-contained HTML or PNG, with React components, a design system, and the queries behind every result.
|
|
23
|
+
- **One analyst on call everywhere.** The same core serves your chat assistant and your pipelines, with concurrent work running in its own lane.
|
|
39
24
|
|
|
40
25
|
## Install
|
|
41
26
|
|
|
@@ -59,8 +44,7 @@ Add to your config (`~/Library/Application Support/Claude/claude_desktop_config.
|
|
|
59
44
|
{
|
|
60
45
|
"mcpServers": {
|
|
61
46
|
"dolex": {
|
|
62
|
-
"command": "dolex"
|
|
63
|
-
"args": ["mcp"]
|
|
47
|
+
"command": "dolex"
|
|
64
48
|
}
|
|
65
49
|
}
|
|
66
50
|
}
|
|
@@ -69,12 +53,12 @@ Add to your config (`~/Library/Application Support/Claude/claude_desktop_config.
|
|
|
69
53
|
### Claude Code
|
|
70
54
|
|
|
71
55
|
```bash
|
|
72
|
-
claude mcp add dolex -- dolex
|
|
56
|
+
claude mcp add dolex -- dolex
|
|
73
57
|
```
|
|
74
58
|
|
|
75
59
|
### Any MCP Client
|
|
76
60
|
|
|
77
|
-
|
|
61
|
+
Point your client's server command at `dolex`. Launched by an MCP client over stdio, it runs the server. To start it explicitly — or to confirm it boots from a terminal — use the subcommand:
|
|
78
62
|
|
|
79
63
|
```bash
|
|
80
64
|
dolex mcp
|
|
@@ -82,11 +66,11 @@ dolex mcp
|
|
|
82
66
|
|
|
83
67
|
## Command Line
|
|
84
68
|
|
|
85
|
-
|
|
86
|
-
|
|
69
|
+
The same analysis engine, query layer, and 43 chart types are a CLI away — point
|
|
70
|
+
it at a CSV and get a chart, an analysis plan, or a data-quality audit.
|
|
87
71
|
|
|
88
72
|
```bash
|
|
89
|
-
# Chart a CSV — the pattern
|
|
73
|
+
# Chart a CSV — the pattern matches the shape of the data
|
|
90
74
|
dolex visualize sales.csv -i "compare revenue by region"
|
|
91
75
|
|
|
92
76
|
# Query first, then chart; force a type and palette; render a PNG
|
|
@@ -132,9 +116,9 @@ Full reference: [`docs/CLI.md`](https://github.com/outsidedata/dolex/blob/master
|
|
|
132
116
|
|
|
133
117
|
## The Query Engine
|
|
134
118
|
|
|
135
|
-
Point
|
|
119
|
+
Point your assistant at a folder of CSV files and start asking questions. Dolex loads every file and profiles your data — column types, distributions, cardinality, sample values — giving your assistant everything it needs to answer.
|
|
136
120
|
|
|
137
|
-
|
|
121
|
+
The built-in query language covers the analysis your assistant runs:
|
|
138
122
|
|
|
139
123
|
**Aggregations**: `sum`, `avg`, `min`, `max`, `count`, `count_distinct`, `median`, `stddev`, `p25`, `p75`, `percentile`
|
|
140
124
|
|
|
@@ -5,7 +5,7 @@ import * as o from '../output.js';
|
|
|
5
5
|
export function printMainHelp(version) {
|
|
6
6
|
const v = version ? o.c.dim(`v${version}`) : '';
|
|
7
7
|
o.out(`${o.c.bold('dolex')} ${v} — data visualization from the command line
|
|
8
|
-
${o.c.dim('
|
|
8
|
+
${o.c.dim('a data analyst you can trust on your own data — profile, audit, analyze, and chart 43 ways')}
|
|
9
9
|
|
|
10
10
|
${o.c.bold('USAGE')}
|
|
11
11
|
dolex <command> [arguments] [options]
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Data comes from a CSV path / registered source (optionally sliced with
|
|
5
5
|
* `--sql`), an inline JSON array (`--data file.json`), or stdin (`-` /
|
|
6
|
-
* `--stdin`). The
|
|
6
|
+
* `--stdin`). The chart is matched to the shape of the data; `--pattern` forces a specific one.
|
|
7
7
|
*/
|
|
8
8
|
export declare function visualizeCommand(argv: string[]): Promise<number>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Data comes from a CSV path / registered source (optionally sliced with
|
|
5
5
|
* `--sql`), an inline JSON array (`--data file.json`), or stdin (`-` /
|
|
6
|
-
* `--stdin`). The
|
|
6
|
+
* `--stdin`). The chart is matched to the shape of the data; `--pattern` forces a specific one.
|
|
7
7
|
*/
|
|
8
8
|
import { parseArgs, str, bool, num, list } from '../args.js';
|
|
9
9
|
import * as o from '../output.js';
|
package/dist/src/cli/index.d.ts
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Dispatches subcommands. Command modules are dynamically imported so that
|
|
6
6
|
* commands which never touch a CSV avoid loading the SQLite/papaparse optional
|
|
7
|
-
* deps, and so
|
|
8
|
-
*
|
|
7
|
+
* deps, and so the MCP server (whose `main()` runs on import) is loaded only
|
|
8
|
+
* when actually serving — via the `dolex mcp` subcommand, or by a bare `dolex`
|
|
9
|
+
* launched over piped stdio (how MCP clients spawn it).
|
|
9
10
|
*/
|
|
10
11
|
export {};
|
package/dist/src/cli/index.js
CHANGED
|
@@ -4,13 +4,33 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Dispatches subcommands. Command modules are dynamically imported so that
|
|
6
6
|
* commands which never touch a CSV avoid loading the SQLite/papaparse optional
|
|
7
|
-
* deps, and so
|
|
8
|
-
*
|
|
7
|
+
* deps, and so the MCP server (whose `main()` runs on import) is loaded only
|
|
8
|
+
* when actually serving — via the `dolex mcp` subcommand, or by a bare `dolex`
|
|
9
|
+
* launched over piped stdio (how MCP clients spawn it).
|
|
9
10
|
*/
|
|
10
11
|
import { readFileSync, existsSync } from 'fs';
|
|
11
12
|
import { dirname, join } from 'path';
|
|
12
13
|
import { fileURLToPath } from 'url';
|
|
13
14
|
import * as o from './output.js';
|
|
15
|
+
/**
|
|
16
|
+
* Start the MCP stdio server. Importing the module runs its `main()`, which
|
|
17
|
+
* takes over the process and never returns. The MCP SDK is an optional
|
|
18
|
+
* dependency: if it isn't installed, surface an actionable install message
|
|
19
|
+
* instead of crashing with a cryptic module-not-found error.
|
|
20
|
+
*/
|
|
21
|
+
async function startMcpServer() {
|
|
22
|
+
try {
|
|
23
|
+
await import('../mcp/index.js');
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
const { isModuleNotFound, missingDependencyMessage } = await import('../utils/optional-deps.js');
|
|
27
|
+
if (isModuleNotFound(e) && /modelcontextprotocol/i.test(String(e))) {
|
|
28
|
+
o.fail(missingDependencyMessage('mcp'));
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
throw e;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
14
34
|
function readVersion() {
|
|
15
35
|
let dir = dirname(fileURLToPath(import.meta.url));
|
|
16
36
|
for (let i = 0; i < 6; i++) {
|
|
@@ -66,27 +86,26 @@ async function main() {
|
|
|
66
86
|
process.exit(await (await import('./commands/sources.js')).sourcesCommand(rest));
|
|
67
87
|
case 'mcp':
|
|
68
88
|
case 'serve':
|
|
69
|
-
|
|
70
|
-
// The MCP SDK is an optional dependency: if it isn't installed, tell the
|
|
71
|
-
// user exactly what to install instead of crashing with a cryptic error.
|
|
72
|
-
try {
|
|
73
|
-
await import('../mcp/index.js');
|
|
74
|
-
}
|
|
75
|
-
catch (e) {
|
|
76
|
-
const { isModuleNotFound, missingDependencyMessage } = await import('../utils/optional-deps.js');
|
|
77
|
-
if (isModuleNotFound(e) && /modelcontextprotocol/i.test(String(e))) {
|
|
78
|
-
o.fail(missingDependencyMessage('mcp'));
|
|
79
|
-
process.exit(1);
|
|
80
|
-
}
|
|
81
|
-
throw e;
|
|
82
|
-
}
|
|
89
|
+
await startMcpServer();
|
|
83
90
|
return;
|
|
84
91
|
case 'version':
|
|
85
92
|
case '--version':
|
|
86
93
|
case '-v':
|
|
87
94
|
o.out(readVersion() ?? 'unknown');
|
|
88
95
|
process.exit(0);
|
|
89
|
-
case undefined:
|
|
96
|
+
case undefined: {
|
|
97
|
+
// No subcommand. MCP clients spawn the bin with piped stdio (no TTY) and
|
|
98
|
+
// expect the stdio server on the other end, so a bare `dolex` must serve —
|
|
99
|
+
// that keeps every existing `command: "dolex"` config working. A human at
|
|
100
|
+
// an interactive terminal (a TTY) gets help instead.
|
|
101
|
+
if (!process.stdin.isTTY) {
|
|
102
|
+
await startMcpServer();
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const { printMainHelp } = await import('./commands/help.js');
|
|
106
|
+
printMainHelp(readVersion());
|
|
107
|
+
process.exit(0);
|
|
108
|
+
}
|
|
90
109
|
case 'help':
|
|
91
110
|
case '--help':
|
|
92
111
|
case '-h': {
|
package/dist/src/mcp/index.js
CHANGED
|
@@ -76,7 +76,7 @@ const server = new McpServer({
|
|
|
76
76
|
...(serverIcons && { icons: serverIcons }),
|
|
77
77
|
}, {
|
|
78
78
|
instructions: [
|
|
79
|
-
'
|
|
79
|
+
"You are a data analyst working on the user's own CSV files: rigorous column profiling, data-quality auditing, a prioritized analysis plan, and findings rendered across 43 chart types as artifacts they keep.",
|
|
80
80
|
'',
|
|
81
81
|
'WORKFLOW:',
|
|
82
82
|
'• Got a CSV file? → load_csv(name, path) — returns smart summary (column names, types, ranges, categorical values)',
|
|
@@ -96,26 +96,26 @@ const server = new McpServer({
|
|
|
96
96
|
'• describe_data: Full column stats, top values, sample rows. Call only when you need deep exploration.',
|
|
97
97
|
'• analyze_data: Auto-generate analysis plan with ready SQL queries. Execute each step with visualize; present results one at a time.',
|
|
98
98
|
'• query_data: Run SQL query, get rows. Returns resultId for visualize().',
|
|
99
|
-
'• visualize: Chart data. Pass inline data array, resultId from query_data, or sourceId + sql for server-side query.
|
|
99
|
+
'• visualize: Chart data. Pass inline data array, resultId from query_data, or sourceId + sql for server-side query. Matches a chart to the shape of the data. Set title/subtitle here to avoid a refine round-trip.',
|
|
100
100
|
'• refine_visualization: Tweak a chart — sort, limit, filter, palette, highlight, flip, title, format. Each call returns a new specId.',
|
|
101
101
|
'• list_patterns: Browse available chart types. Only needed when the user asks what charts are available or you need a pattern ID.',
|
|
102
102
|
'',
|
|
103
103
|
'Utility tools: list_data, remove_data, server_status (inspect cached data), clear_cache, export_html (get chart HTML by specId), screenshot (render to PNG).',
|
|
104
104
|
'',
|
|
105
105
|
'COLOR: Set palette (categorical/blue/warm/blueRed/etc.) and/or highlight specific values. Use colorField to control which column drives color.',
|
|
106
|
-
'PATTERNS: 43 types
|
|
106
|
+
'PATTERNS: 43 chart types matched to the shape of the data and the question being asked. When user names a specific chart type, pass pattern="<id>" to force it. Use list_patterns to browse.',
|
|
107
107
|
'',
|
|
108
108
|
'ERRORS: If a SQL query fails, check the error message for available columns/tables and retry. If specId is expired, re-run visualize.',
|
|
109
109
|
'',
|
|
110
110
|
'DON\'T use Dolex for: simple arithmetic, explanations of chart types, non-data questions, or file format conversions (CSV export, PowerPoint, etc.).',
|
|
111
|
-
'DO use Dolex when the user asks "what chart should I use" — run visualize
|
|
111
|
+
'DO use Dolex when the user asks "what chart should I use" — run visualize to match a chart to the shape of the data.',
|
|
112
112
|
].join('\n'),
|
|
113
113
|
});
|
|
114
114
|
// ─── REGISTER TOOLS ─────────────────────────────────────────────────────────
|
|
115
115
|
// Inline data visualization tool
|
|
116
116
|
registerAppTool(server, 'visualize', {
|
|
117
117
|
title: 'Visualize Data',
|
|
118
|
-
description: '
|
|
118
|
+
description: 'Produces the analysis as a finished chart. Takes inline data, a cached result, or a registered source, and produces a chart matched to the shape of the data — self-contained HTML the user keeps, with the analysis behind it inspectable. Set title and subtitle here.\n\nData source (provide one):\n• data: inline rows\n• resultId: reuse query_data result\n• sourceId + sql: query a loaded CSV server-side (saves tokens)\n\nReturns specId (for refine calls), the matched chart, and alternatives.\nPresent any notes to the user.',
|
|
119
119
|
inputSchema: visualizeInputSchema.shape,
|
|
120
120
|
_meta: {
|
|
121
121
|
ui: {
|
|
@@ -9,9 +9,9 @@ import type { SourceManager } from '../../connectors/manager.js';
|
|
|
9
9
|
export declare const clearCacheInputSchema: z.ZodObject<{
|
|
10
10
|
scope: z.ZodDefault<z.ZodEnum<["all", "specs", "results"]>>;
|
|
11
11
|
}, "strip", z.ZodTypeAny, {
|
|
12
|
-
scope: "
|
|
12
|
+
scope: "all" | "specs" | "results";
|
|
13
13
|
}, {
|
|
14
|
-
scope?: "
|
|
14
|
+
scope?: "all" | "specs" | "results" | undefined;
|
|
15
15
|
}>;
|
|
16
16
|
interface PrivacyDeps {
|
|
17
17
|
sourceManager: SourceManager;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* MCP Tool: visualize
|
|
3
3
|
* Takes data (inline, cached, or from a loaded CSV via SQL) + intent
|
|
4
|
-
* and
|
|
4
|
+
* and produces a chart matched to the shape of the data.
|
|
5
5
|
*
|
|
6
6
|
* Returns compact text content (specId + metadata, no data) while
|
|
7
7
|
* structuredContent still gets the full pre-rendered chart HTML.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* MCP Tool: visualize
|
|
3
3
|
* Takes data (inline, cached, or from a loaded CSV via SQL) + intent
|
|
4
|
-
* and
|
|
4
|
+
* and produces a chart matched to the shape of the data.
|
|
5
5
|
*
|
|
6
6
|
* Returns compact text content (specId + metadata, no data) while
|
|
7
7
|
* structuredContent still gets the full pre-rendered chart HTML.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Pattern Selection
|
|
2
|
+
* Pattern Selection.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* with reasoning.
|
|
4
|
+
* Analyzes data shape + user intent, scores every registered pattern,
|
|
5
|
+
* and returns ranked recommendations with reasoning.
|
|
7
6
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* Selection rules encode dataviz design expertise, matching the
|
|
8
|
+
* visualization — bar, line, bump chart, beeswarm, slope chart, waffle,
|
|
9
|
+
* and the rest of the library — to the shape of the data and the question
|
|
10
|
+
* being asked.
|
|
11
11
|
*/
|
|
12
12
|
import type { DataColumn, PatternMatchContext, VisualizationRecommendation, PatternCategory } from '../types.js';
|
|
13
13
|
export interface SelectionResult {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Pattern Selection
|
|
2
|
+
* Pattern Selection.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* with reasoning.
|
|
4
|
+
* Analyzes data shape + user intent, scores every registered pattern,
|
|
5
|
+
* and returns ranked recommendations with reasoning.
|
|
7
6
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* Selection rules encode dataviz design expertise, matching the
|
|
8
|
+
* visualization — bar, line, bump chart, beeswarm, slope chart, waffle,
|
|
9
|
+
* and the rest of the library — to the shape of the data and the question
|
|
10
|
+
* being asked.
|
|
11
11
|
*/
|
|
12
12
|
import { registry } from './registry.js';
|
|
13
13
|
import { buildMatchContext, parseIntent } from './utils.js';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@outsidedata/dolex",
|
|
3
|
-
"version": "8.0.
|
|
4
|
-
"description": "AI data analyst
|
|
3
|
+
"version": "8.0.2",
|
|
4
|
+
"description": "Turn your AI assistant into a data analyst you can trust on your own CSV files — column profiling, data-quality auditing, a prioritized analysis plan, and findings rendered across 43 chart types.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"engines": {
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
},
|
|
67
67
|
"scripts": {
|
|
68
68
|
"build:bundles": "tsx scripts/build-render-bundles.ts",
|
|
69
|
-
"build": "npm run build:bundles && tsc",
|
|
69
|
+
"build": "npm run build:bundles && tsc && chmod +x dist/src/cli/index.js",
|
|
70
70
|
"dev": "tsx watch src/mcp/index.ts",
|
|
71
71
|
"start": "node dist/src/cli/index.js mcp",
|
|
72
72
|
"cli": "node dist/src/cli/index.js",
|