inconvo 1.9.0 → 2.0.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/README.md +53 -23
- package/assets/sandbox/Dockerfile +17 -0
- package/assets/sandbox/scripts/inconvo.py +67 -0
- package/assets/sandbox/worker.js +22050 -0
- package/assets/sandbox/wrangler.jsonc +131 -0
- package/bin/inconvo.js +2 -0
- package/demo-db-init.sql +159 -0
- package/dist/commands/configure.d.ts +3 -0
- package/dist/commands/configure.d.ts.map +1 -0
- package/dist/commands/configure.js +8 -0
- package/dist/commands/configure.js.map +1 -0
- package/dist/commands/dev.d.ts +3 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/dev.js +418 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/telemetry.d.ts +3 -0
- package/dist/commands/telemetry.d.ts.map +1 -0
- package/dist/commands/telemetry.js +90 -0
- package/dist/commands/telemetry.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -5
- package/dist/index.js.map +1 -0
- package/dist/process/output.d.ts +21 -0
- package/dist/process/output.d.ts.map +1 -0
- package/dist/process/output.js +35 -0
- package/dist/process/output.js.map +1 -0
- package/dist/seed/demo-data.d.ts +2 -0
- package/dist/seed/demo-data.d.ts.map +1 -0
- package/dist/seed/demo-data.js +286 -0
- package/dist/seed/demo-data.js.map +1 -0
- package/dist/wizard/setup.d.ts +8 -0
- package/dist/wizard/setup.d.ts.map +1 -0
- package/dist/wizard/setup.js +310 -0
- package/dist/wizard/setup.js.map +1 -0
- package/docker-compose.yml +59 -0
- package/package.json +40 -19
- package/dist/commands/add.js +0 -120
- package/dist/lib/install-dependencies.js +0 -38
- package/dist/lib/logger.js +0 -18
- package/dist/lib/paths.js +0 -7
- package/dist/lib/prompt.js +0 -12
- package/dist/lib/thread-injector.js +0 -86
- package/dist/templates/packs.js +0 -19
- package/templates/assistant-ui/src/components/assistant-ui/tools/inconvo-chart.tsx +0 -171
- package/templates/assistant-ui/src/components/assistant-ui/tools/inconvo-data-table.tsx +0 -210
- package/templates/assistant-ui/src/components/assistant-ui/tools/inconvo-hidden-tools.tsx +0 -30
- package/templates/assistant-ui/src/components/assistant-ui/tools/inconvo-tools.tsx +0 -17
- package/templates/assistant-ui/src/components/assistant-ui/tools/message-data-analyst-tool.tsx +0 -205
- package/templates/assistant-ui/src/lib/inconvo/types.ts +0 -132
package/README.md
CHANGED
|
@@ -1,41 +1,71 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Inconvo CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Try out Inconvo without cloning the repository.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Quick Start
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
```bash
|
|
8
|
+
npx inconvo dev
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
This will:
|
|
12
|
+
1. Run the setup wizard (first time only)
|
|
13
|
+
2. Pull Docker images for the dev server
|
|
14
|
+
3. Start the dev server in Docker and the sandbox on your machine
|
|
15
|
+
|
|
16
|
+
Then open http://localhost:26686 to start chatting with your data.
|
|
17
|
+
|
|
18
|
+
## Requirements
|
|
19
|
+
|
|
20
|
+
- Docker (Docker Desktop or Docker daemon running)
|
|
21
|
+
- Node.js 18+ (only for running `npx`)
|
|
22
|
+
|
|
23
|
+
## Commands
|
|
24
|
+
|
|
25
|
+
### `inconvo dev`
|
|
26
|
+
|
|
27
|
+
Start the Inconvo development environment.
|
|
8
28
|
|
|
9
29
|
```bash
|
|
10
|
-
npx inconvo
|
|
30
|
+
npx inconvo dev
|
|
11
31
|
```
|
|
12
32
|
|
|
13
33
|
Options:
|
|
34
|
+
- `--version <version>` - Use a specific release version
|
|
35
|
+
|
|
36
|
+
### `inconvo configure`
|
|
37
|
+
|
|
38
|
+
Re-run the configuration wizard to update your settings.
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npx inconvo configure
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Configuration
|
|
45
|
+
|
|
46
|
+
On first run, the CLI will prompt you for:
|
|
47
|
+
|
|
48
|
+
- **Database connection** - PostgreSQL, MySQL, or SQL Server
|
|
49
|
+
- **OpenAI API key** - For the LLM
|
|
14
50
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
- `--overwrite` – replace any files that already exist without prompting
|
|
18
|
-
- `--yes` – answer "yes" to interactive prompts
|
|
19
|
-
- `--skip-install` – copy files only and skip dependency installation
|
|
51
|
+
Configuration is stored in `~/.inconvo/config.env`.
|
|
52
|
+
The CLI stores the dev-server SQLite database at `~/.inconvo/data/inconvo.db`.
|
|
20
53
|
|
|
21
|
-
|
|
54
|
+
> **Note**: When developing locally from a cloned repo, the dev-server uses `.inconvo.env` in the `apps/dev-server/` directory instead. These are separate configurations.
|
|
22
55
|
|
|
23
|
-
|
|
56
|
+
## For Development
|
|
24
57
|
|
|
25
|
-
|
|
58
|
+
If you want to contribute or develop locally, clone the repository instead:
|
|
26
59
|
|
|
27
60
|
```bash
|
|
28
|
-
|
|
29
|
-
|
|
61
|
+
git clone https://github.com/inconvoai/inconvo.git
|
|
62
|
+
cd inconvo
|
|
63
|
+
pnpm install
|
|
64
|
+
pnpm dev
|
|
30
65
|
```
|
|
31
66
|
|
|
32
|
-
|
|
67
|
+
See the main repository README for development instructions.
|
|
33
68
|
|
|
34
|
-
##
|
|
69
|
+
## License
|
|
35
70
|
|
|
36
|
-
|
|
37
|
-
2. Follow conventional commit syntax (`feat:`, `fix:`, `chore:`…) when merging into `main`. Semantic Release reads those messages to determine the next version.
|
|
38
|
-
3. Every push to `main` (or a manual *workflow_dispatch*) runs `.github/workflows/release.yml`, which installs dependencies, builds, and executes `npx semantic-release`. When it finds a release-worthy change it will:
|
|
39
|
-
- publish the package to npm with provenance,
|
|
40
|
-
- update the GitHub release notes.
|
|
41
|
-
4. Verify with `npx inconvo@latest --help` after the workflow reports success.
|
|
71
|
+
MIT
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
FROM docker.io/cloudflare/sandbox:0.7.0-python
|
|
2
|
+
|
|
3
|
+
# On a Mac with Apple Silicon, you might need to specify the platform:
|
|
4
|
+
# FROM --platform=linux/arm64 docker.io/cloudflare/sandbox:0.4.3
|
|
5
|
+
|
|
6
|
+
# Install altair for chart generation (outputs Vega-Lite specs)
|
|
7
|
+
RUN --mount=type=cache,target=/root/.cache/pip \
|
|
8
|
+
pip3 install --no-cache-dir \
|
|
9
|
+
altair==6.0.0 \
|
|
10
|
+
jsonschema==4.24.1
|
|
11
|
+
|
|
12
|
+
# Precompile Python bytecode to speed up imports (~10-20% faster)
|
|
13
|
+
RUN python3 -m compileall -q /usr/lib/python3* /usr/local/lib/python3* 2>/dev/null || true
|
|
14
|
+
|
|
15
|
+
# Pre-install inconvo helper module so `from inconvo import ...` works
|
|
16
|
+
COPY scripts/inconvo.py /workspace/inconvo.py
|
|
17
|
+
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"""Inconvo response helpers for sandbox code execution."""
|
|
2
|
+
import json
|
|
3
|
+
|
|
4
|
+
def text(message: str) -> None:
|
|
5
|
+
"""Output a text response.
|
|
6
|
+
|
|
7
|
+
Args:
|
|
8
|
+
message: The message to display to the user
|
|
9
|
+
"""
|
|
10
|
+
print(json.dumps({"type": "text", "message": message}))
|
|
11
|
+
|
|
12
|
+
def table(df, message: str, columns: list = None) -> None:
|
|
13
|
+
"""Output a table response from a DataFrame.
|
|
14
|
+
|
|
15
|
+
Args:
|
|
16
|
+
df: pandas DataFrame containing the data
|
|
17
|
+
message: Explanation for the user
|
|
18
|
+
columns: Optional list of columns to include (default: all)
|
|
19
|
+
"""
|
|
20
|
+
if columns:
|
|
21
|
+
df = df[columns]
|
|
22
|
+
|
|
23
|
+
# Convert all values to strings for consistent JSON output
|
|
24
|
+
body = []
|
|
25
|
+
for row in df.values.tolist():
|
|
26
|
+
body.append([str(v) if v is not None else "" for v in row])
|
|
27
|
+
|
|
28
|
+
print(json.dumps({
|
|
29
|
+
"type": "table",
|
|
30
|
+
"message": message,
|
|
31
|
+
"table": {
|
|
32
|
+
"head": [str(c) for c in df.columns.tolist()],
|
|
33
|
+
"body": body
|
|
34
|
+
}
|
|
35
|
+
}))
|
|
36
|
+
|
|
37
|
+
def chart(alt_chart, message: str) -> None:
|
|
38
|
+
"""Output a chart response. MUST pass an Altair Chart object, NOT a dict.
|
|
39
|
+
|
|
40
|
+
Args:
|
|
41
|
+
alt_chart: Altair Chart object created with alt.Chart(df).mark_*().encode(...)
|
|
42
|
+
message: Explanation highlighting key insights
|
|
43
|
+
|
|
44
|
+
Example:
|
|
45
|
+
import altair as alt
|
|
46
|
+
c = alt.Chart(df).mark_bar().encode(x='category:N', y='value:Q')
|
|
47
|
+
chart(c, "Sales by category")
|
|
48
|
+
"""
|
|
49
|
+
import altair as alt
|
|
50
|
+
alt.data_transformers.enable('default', max_rows=None)
|
|
51
|
+
spec = alt_chart.to_dict()
|
|
52
|
+
|
|
53
|
+
# Remove $schema if present
|
|
54
|
+
spec.pop('$schema', None)
|
|
55
|
+
|
|
56
|
+
# Convert named datasets to inline data.values
|
|
57
|
+
if 'datasets' in spec and 'data' in spec:
|
|
58
|
+
data_name = spec['data'].get('name')
|
|
59
|
+
if data_name and data_name in spec['datasets']:
|
|
60
|
+
spec['data'] = {'values': spec['datasets'][data_name]}
|
|
61
|
+
del spec['datasets']
|
|
62
|
+
|
|
63
|
+
print(json.dumps({
|
|
64
|
+
"type": "chart",
|
|
65
|
+
"message": message,
|
|
66
|
+
"spec": spec
|
|
67
|
+
}))
|