@yeyuan98/opencode-bioresearcher-plugin 1.5.0 → 1.5.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/README.md +50 -50
- package/dist/index.js +6 -6
- package/dist/skills/bioresearcher-tests/README.md +90 -0
- package/dist/skills/bioresearcher-tests/SKILL.md +255 -0
- package/dist/skills/bioresearcher-tests/pyproject.toml +6 -0
- package/dist/skills/bioresearcher-tests/resources/json_samples/in_markdown.md.gz +0 -0
- package/dist/skills/bioresearcher-tests/resources/json_samples/nested_object.json.gz +0 -0
- package/dist/skills/bioresearcher-tests/resources/json_samples/schema_draft7.json.gz +0 -0
- package/dist/skills/bioresearcher-tests/resources/json_samples/simple_array.json.gz +0 -0
- package/dist/skills/bioresearcher-tests/resources/json_samples/simple_object.json.gz +0 -0
- package/dist/skills/bioresearcher-tests/resources/obo_sample.obo.gz +0 -0
- package/dist/skills/bioresearcher-tests/resources/pubmed_sample.xml.gz +0 -0
- package/dist/skills/bioresearcher-tests/resources/table_sample.xlsx.gz +0 -0
- package/dist/skills/bioresearcher-tests/test_cases/json_tests.md +137 -0
- package/dist/skills/bioresearcher-tests/test_cases/misc_tests.md +141 -0
- package/dist/skills/bioresearcher-tests/test_cases/parser_tests.md +80 -0
- package/dist/skills/bioresearcher-tests/test_cases/skill_tests.md +59 -0
- package/dist/skills/bioresearcher-tests/test_cases/table_tests.md +194 -0
- package/dist/skills/bioresearcher-tests/test_runner.py +607 -0
- package/dist/skills/env-jsonc-setup/SKILL.md +206 -206
- package/dist/skills/long-table-summary/SKILL.md +224 -153
- package/dist/skills/long-table-summary/combine_outputs.py +55 -9
- package/dist/skills/long-table-summary/generate_prompts.py +9 -0
- package/dist/skills/pubmed-weekly/pubmed_weekly.py +130 -29
- package/dist/{db-tools → tools/db}/backends/mysql/translator.js +23 -23
- package/dist/{db-tools → tools/db}/tools.js +34 -34
- package/dist/{misc-tools → tools/misc}/json-validate.js +4 -5
- package/dist/{skill-tools → tools/skill}/registry.js +1 -1
- package/package.json +1 -1
- package/dist/db-tools/executor.d.ts +0 -13
- package/dist/db-tools/executor.js +0 -54
- package/dist/db-tools/pool.d.ts +0 -8
- package/dist/db-tools/pool.js +0 -49
- package/dist/db-tools/tools/index.d.ts +0 -27
- package/dist/db-tools/tools/index.js +0 -191
- package/dist/db-tools/types.d.ts +0 -94
- package/dist/db-tools/types.js +0 -40
- package/dist/misc-tools/json-tools.d.ts +0 -33
- package/dist/misc-tools/json-tools.js +0 -187
- package/dist/skill/frontmatter.d.ts +0 -2
- package/dist/skill/frontmatter.js +0 -65
- package/dist/skill/index.d.ts +0 -3
- package/dist/skill/index.js +0 -2
- package/dist/skill/registry.d.ts +0 -11
- package/dist/skill/registry.js +0 -64
- package/dist/skill/tool.d.ts +0 -9
- package/dist/skill/tool.js +0 -115
- package/dist/skill/types.d.ts +0 -22
- package/dist/skill/types.js +0 -7
- /package/dist/{db-tools → tools/db}/backends/index.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/backends/index.js +0 -0
- /package/dist/{db-tools → tools/db}/backends/mongodb/backend.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/backends/mongodb/backend.js +0 -0
- /package/dist/{db-tools → tools/db}/backends/mongodb/connection.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/backends/mongodb/connection.js +0 -0
- /package/dist/{db-tools → tools/db}/backends/mongodb/index.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/backends/mongodb/index.js +0 -0
- /package/dist/{db-tools → tools/db}/backends/mongodb/translator.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/backends/mongodb/translator.js +0 -0
- /package/dist/{db-tools → tools/db}/backends/mysql/backend.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/backends/mysql/backend.js +0 -0
- /package/dist/{db-tools → tools/db}/backends/mysql/connection.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/backends/mysql/connection.js +0 -0
- /package/dist/{db-tools → tools/db}/backends/mysql/index.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/backends/mysql/index.js +0 -0
- /package/dist/{db-tools → tools/db}/backends/mysql/translator.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/core/base.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/core/base.js +0 -0
- /package/dist/{db-tools → tools/db}/core/config-loader.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/core/config-loader.js +0 -0
- /package/dist/{db-tools → tools/db}/core/index.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/core/index.js +0 -0
- /package/dist/{db-tools → tools/db}/core/jsonc-parser.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/core/jsonc-parser.js +0 -0
- /package/dist/{db-tools → tools/db}/core/validator.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/core/validator.js +0 -0
- /package/dist/{db-tools → tools/db}/index.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/index.js +0 -0
- /package/dist/{db-tools → tools/db}/interface/backend.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/interface/backend.js +0 -0
- /package/dist/{db-tools → tools/db}/interface/connection.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/interface/connection.js +0 -0
- /package/dist/{db-tools → tools/db}/interface/index.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/interface/index.js +0 -0
- /package/dist/{db-tools → tools/db}/interface/query.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/interface/query.js +0 -0
- /package/dist/{db-tools → tools/db}/interface/schema.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/interface/schema.js +0 -0
- /package/dist/{db-tools → tools/db}/tools.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/utils.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/utils.js +0 -0
- /package/dist/{misc-tools → tools/misc}/calculator.d.ts +0 -0
- /package/dist/{misc-tools → tools/misc}/calculator.js +0 -0
- /package/dist/{misc-tools → tools/misc}/index.d.ts +0 -0
- /package/dist/{misc-tools → tools/misc}/index.js +0 -0
- /package/dist/{misc-tools → tools/misc}/json-extract.d.ts +0 -0
- /package/dist/{misc-tools → tools/misc}/json-extract.js +0 -0
- /package/dist/{misc-tools → tools/misc}/json-infer.d.ts +0 -0
- /package/dist/{misc-tools → tools/misc}/json-infer.js +0 -0
- /package/dist/{misc-tools → tools/misc}/json-validate.d.ts +0 -0
- /package/dist/{misc-tools → tools/misc}/timer.d.ts +0 -0
- /package/dist/{misc-tools → tools/misc}/timer.js +0 -0
- /package/dist/{parser-tools → tools/parser}/obo/index.d.ts +0 -0
- /package/dist/{parser-tools → tools/parser}/obo/index.js +0 -0
- /package/dist/{parser-tools → tools/parser}/obo/obo.d.ts +0 -0
- /package/dist/{parser-tools → tools/parser}/obo/obo.js +0 -0
- /package/dist/{parser-tools → tools/parser}/obo/types.d.ts +0 -0
- /package/dist/{parser-tools → tools/parser}/obo/types.js +0 -0
- /package/dist/{parser-tools → tools/parser}/obo/utils.d.ts +0 -0
- /package/dist/{parser-tools → tools/parser}/obo/utils.js +0 -0
- /package/dist/{parser-tools → tools/parser}/pubmed/index.d.ts +0 -0
- /package/dist/{parser-tools → tools/parser}/pubmed/index.js +0 -0
- /package/dist/{parser-tools → tools/parser}/pubmed/pubmed.d.ts +0 -0
- /package/dist/{parser-tools → tools/parser}/pubmed/pubmed.js +0 -0
- /package/dist/{parser-tools → tools/parser}/pubmed/types.d.ts +0 -0
- /package/dist/{parser-tools → tools/parser}/pubmed/types.js +0 -0
- /package/dist/{parser-tools → tools/parser}/pubmed/utils.d.ts +0 -0
- /package/dist/{parser-tools → tools/parser}/pubmed/utils.js +0 -0
- /package/dist/{skill-tools → tools/skill}/frontmatter.d.ts +0 -0
- /package/dist/{skill-tools → tools/skill}/frontmatter.js +0 -0
- /package/dist/{skill-tools → tools/skill}/index.d.ts +0 -0
- /package/dist/{skill-tools → tools/skill}/index.js +0 -0
- /package/dist/{skill-tools → tools/skill}/registry.d.ts +0 -0
- /package/dist/{skill-tools → tools/skill}/tool.d.ts +0 -0
- /package/dist/{skill-tools → tools/skill}/tool.js +0 -0
- /package/dist/{skill-tools → tools/skill}/types.d.ts +0 -0
- /package/dist/{skill-tools → tools/skill}/types.js +0 -0
- /package/dist/{table-tools → tools/table}/index.d.ts +0 -0
- /package/dist/{table-tools → tools/table}/index.js +0 -0
- /package/dist/{table-tools → tools/table}/tools.d.ts +0 -0
- /package/dist/{table-tools → tools/table}/tools.js +0 -0
- /package/dist/{table-tools → tools/table}/utils.d.ts +0 -0
- /package/dist/{table-tools → tools/table}/utils.js +0 -0
|
@@ -1,206 +1,206 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: env-jsonc-setup
|
|
3
|
-
description: Setup env.jsonc configuration file for db-tools module - guides user through creating database connection config with interactive questions
|
|
4
|
-
allowedTools:
|
|
5
|
-
- Question
|
|
6
|
-
- Write
|
|
7
|
-
- Read
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# Database Configuration Setup
|
|
11
|
-
|
|
12
|
-
This skill guides users through creating an `env.jsonc` file for configuring db-tools module.
|
|
13
|
-
|
|
14
|
-
## Overview
|
|
15
|
-
|
|
16
|
-
The `env.jsonc` file contains database connection settings for db-tools. This skill:
|
|
17
|
-
1. Collects database preferences (type, host, port, credentials)
|
|
18
|
-
2. Generates a properly formatted `env.jsonc` file with comments
|
|
19
|
-
3. Places it in the current working directory
|
|
20
|
-
|
|
21
|
-
## Workflow
|
|
22
|
-
|
|
23
|
-
Follow these steps EXACTLY as described.
|
|
24
|
-
|
|
25
|
-
### Step 1: Determine Database Type
|
|
26
|
-
|
|
27
|
-
Use the question tool to ask the user which database type they want to configure:
|
|
28
|
-
|
|
29
|
-
Options:
|
|
30
|
-
- **MySQL** (Recommended for local development, SQL databases)
|
|
31
|
-
- **MongoDB** (For NoSQL databases, MongoDB Atlas)
|
|
32
|
-
|
|
33
|
-
### Step 2: Ask Connection Details
|
|
34
|
-
|
|
35
|
-
Based on the database type selected, use the question tool to gather connection details.
|
|
36
|
-
|
|
37
|
-
#### For MySQL:
|
|
38
|
-
Ask for:
|
|
39
|
-
1. **Host** (default: "localhost")
|
|
40
|
-
2. **Port** (default: 3306)
|
|
41
|
-
3. **Database name** (required)
|
|
42
|
-
4. **Username** (required)
|
|
43
|
-
5. **Password** (optional, can be empty)
|
|
44
|
-
6. **Connection timeout** (default: 10000 ms)
|
|
45
|
-
|
|
46
|
-
#### For MongoDB:
|
|
47
|
-
Ask for:
|
|
48
|
-
1. **Connection method**:
|
|
49
|
-
- Individual parameters (host, port, username, password)
|
|
50
|
-
- Connection URI (recommended for Atlas)
|
|
51
|
-
|
|
52
|
-
If "Individual parameters":
|
|
53
|
-
- **Host** (default: "localhost")
|
|
54
|
-
- **Port** (default: 27017)
|
|
55
|
-
- **Database name** (required)
|
|
56
|
-
- **Username** (optional)
|
|
57
|
-
- **Password** (optional)
|
|
58
|
-
- **Connection timeout** (default: 10000 ms)
|
|
59
|
-
|
|
60
|
-
If "Connection URI":
|
|
61
|
-
- **MongoDB URI** (required, e.g., `mongodb+srv://user:pass@cluster.mongodb.net/db`)
|
|
62
|
-
- **Database name** (required)
|
|
63
|
-
- **Connection timeout** (default: 10000 ms)
|
|
64
|
-
|
|
65
|
-
### Step 3: Check if env.jsonc Already Exists
|
|
66
|
-
|
|
67
|
-
Check if `env.jsonc` exists in the working directory:
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
test -f "env.jsonc" && echo "exists" || echo "not exists"
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
If the file exists:
|
|
74
|
-
- Use the question tool to ask: "env.jsonc already exists. Overwrite?"
|
|
75
|
-
- Options: "Yes, overwrite", "No, keep existing"
|
|
76
|
-
|
|
77
|
-
If user selects "No", skip to Step 5 and report that no changes were made.
|
|
78
|
-
|
|
79
|
-
If user selects "Yes" or file doesn't exist, continue to Step 4.
|
|
80
|
-
|
|
81
|
-
### Step 4: Generate and Write env.jsonc
|
|
82
|
-
|
|
83
|
-
Create the `env.jsonc` file based on user's answers using the Write tool.
|
|
84
|
-
|
|
85
|
-
#### Template for MySQL:
|
|
86
|
-
|
|
87
|
-
```jsonc
|
|
88
|
-
{
|
|
89
|
-
"db-tools": {
|
|
90
|
-
"type": "mysql",
|
|
91
|
-
"host": "<HOST>",
|
|
92
|
-
"port": <PORT>,
|
|
93
|
-
"database": "<DATABASE>",
|
|
94
|
-
"username": "<USERNAME>",
|
|
95
|
-
"password": "<PASSWORD>",
|
|
96
|
-
"connectionTimeout": <TIMEOUT>
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
Replace placeholders with user-provided values. If `password` is empty, use `""`.
|
|
102
|
-
|
|
103
|
-
#### Template for MongoDB (Individual Parameters):
|
|
104
|
-
|
|
105
|
-
```jsonc
|
|
106
|
-
{
|
|
107
|
-
"db-tools": {
|
|
108
|
-
"type": "mongodb",
|
|
109
|
-
"host": "<HOST>",
|
|
110
|
-
"port": <PORT>,
|
|
111
|
-
"database": "<DATABASE>",
|
|
112
|
-
"username": "<USERNAME>",
|
|
113
|
-
"password": "<PASSWORD>",
|
|
114
|
-
"connectionTimeout": <TIMEOUT>
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
Replace placeholders with user-provided values. If `username` or `password` is empty, use `""`.
|
|
120
|
-
|
|
121
|
-
#### Template for MongoDB (Connection URI):
|
|
122
|
-
|
|
123
|
-
```jsonc
|
|
124
|
-
{
|
|
125
|
-
"db-tools": {
|
|
126
|
-
"type": "mongodb",
|
|
127
|
-
"uri": "<MONGODB_URI>",
|
|
128
|
-
"database": "<DATABASE>",
|
|
129
|
-
"connectionTimeout": <TIMEOUT>
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
Replace placeholders with user-provided values.
|
|
135
|
-
|
|
136
|
-
Use the Write tool to create `env.jsonc` with the generated content in the working directory.
|
|
137
|
-
|
|
138
|
-
### Step 5: Provide Usage Instructions
|
|
139
|
-
|
|
140
|
-
After the file is created, provide the user with:
|
|
141
|
-
|
|
142
|
-
1. **Configuration location**: `env.jsonc` in current working directory
|
|
143
|
-
2. **Database type**: The type configured
|
|
144
|
-
3. **Quick test command** (optional suggestion):
|
|
145
|
-
|
|
146
|
-
For testing connection:
|
|
147
|
-
- "Try using dbListTables tool to verify the connection works"
|
|
148
|
-
- "The configuration will be automatically loaded on first db-tools usage"
|
|
149
|
-
|
|
150
|
-
## Important Notes
|
|
151
|
-
|
|
152
|
-
- The `env.jsonc` file uses JSONC format (JSON with comments)
|
|
153
|
-
- Sensitive information like passwords are stored in plain text
|
|
154
|
-
- Add `env.jsonc` to `.gitignore` to avoid committing credentials
|
|
155
|
-
- The configuration is automatically loaded by db-tools on first tool use
|
|
156
|
-
- Comments in the file help document different use cases
|
|
157
|
-
|
|
158
|
-
## Error Handling
|
|
159
|
-
|
|
160
|
-
If at any point the user provides invalid input:
|
|
161
|
-
- Ask again with the same question
|
|
162
|
-
- Provide helpful hints (e.g., "Port must be a number between 1-65535")
|
|
163
|
-
|
|
164
|
-
## Examples
|
|
165
|
-
|
|
166
|
-
### MySQL Local Development:
|
|
167
|
-
```jsonc
|
|
168
|
-
{
|
|
169
|
-
"db-tools": {
|
|
170
|
-
"type": "mysql",
|
|
171
|
-
"host": "localhost",
|
|
172
|
-
"port": 3306,
|
|
173
|
-
"database": "devdb",
|
|
174
|
-
"username": "root",
|
|
175
|
-
"password": "",
|
|
176
|
-
"connectionTimeout": 10000
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
### MongoDB Local:
|
|
182
|
-
```jsonc
|
|
183
|
-
{
|
|
184
|
-
"db-tools": {
|
|
185
|
-
"type": "mongodb",
|
|
186
|
-
"host": "localhost",
|
|
187
|
-
"port": 27017,
|
|
188
|
-
"database": "mydb",
|
|
189
|
-
"username": "admin",
|
|
190
|
-
"password": "secret",
|
|
191
|
-
"connectionTimeout": 10000
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
### MongoDB Atlas:
|
|
197
|
-
```jsonc
|
|
198
|
-
{
|
|
199
|
-
"db-tools": {
|
|
200
|
-
"type": "mongodb",
|
|
201
|
-
"uri": "mongodb+srv://user:pass@cluster0.mongodb.net/proddb?authSource=admin",
|
|
202
|
-
"database": "proddb",
|
|
203
|
-
"connectionTimeout": 10000
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
```
|
|
1
|
+
---
|
|
2
|
+
name: env-jsonc-setup
|
|
3
|
+
description: Setup env.jsonc configuration file for db-tools module - guides user through creating database connection config with interactive questions
|
|
4
|
+
allowedTools:
|
|
5
|
+
- Question
|
|
6
|
+
- Write
|
|
7
|
+
- Read
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Database Configuration Setup
|
|
11
|
+
|
|
12
|
+
This skill guides users through creating an `env.jsonc` file for configuring db-tools module.
|
|
13
|
+
|
|
14
|
+
## Overview
|
|
15
|
+
|
|
16
|
+
The `env.jsonc` file contains database connection settings for db-tools. This skill:
|
|
17
|
+
1. Collects database preferences (type, host, port, credentials)
|
|
18
|
+
2. Generates a properly formatted `env.jsonc` file with comments
|
|
19
|
+
3. Places it in the current working directory
|
|
20
|
+
|
|
21
|
+
## Workflow
|
|
22
|
+
|
|
23
|
+
Follow these steps EXACTLY as described.
|
|
24
|
+
|
|
25
|
+
### Step 1: Determine Database Type
|
|
26
|
+
|
|
27
|
+
Use the question tool to ask the user which database type they want to configure:
|
|
28
|
+
|
|
29
|
+
Options:
|
|
30
|
+
- **MySQL** (Recommended for local development, SQL databases)
|
|
31
|
+
- **MongoDB** (For NoSQL databases, MongoDB Atlas)
|
|
32
|
+
|
|
33
|
+
### Step 2: Ask Connection Details
|
|
34
|
+
|
|
35
|
+
Based on the database type selected, use the question tool to gather connection details.
|
|
36
|
+
|
|
37
|
+
#### For MySQL:
|
|
38
|
+
Ask for:
|
|
39
|
+
1. **Host** (default: "localhost")
|
|
40
|
+
2. **Port** (default: 3306)
|
|
41
|
+
3. **Database name** (required)
|
|
42
|
+
4. **Username** (required)
|
|
43
|
+
5. **Password** (optional, can be empty)
|
|
44
|
+
6. **Connection timeout** (default: 10000 ms)
|
|
45
|
+
|
|
46
|
+
#### For MongoDB:
|
|
47
|
+
Ask for:
|
|
48
|
+
1. **Connection method**:
|
|
49
|
+
- Individual parameters (host, port, username, password)
|
|
50
|
+
- Connection URI (recommended for Atlas)
|
|
51
|
+
|
|
52
|
+
If "Individual parameters":
|
|
53
|
+
- **Host** (default: "localhost")
|
|
54
|
+
- **Port** (default: 27017)
|
|
55
|
+
- **Database name** (required)
|
|
56
|
+
- **Username** (optional)
|
|
57
|
+
- **Password** (optional)
|
|
58
|
+
- **Connection timeout** (default: 10000 ms)
|
|
59
|
+
|
|
60
|
+
If "Connection URI":
|
|
61
|
+
- **MongoDB URI** (required, e.g., `mongodb+srv://user:pass@cluster.mongodb.net/db`)
|
|
62
|
+
- **Database name** (required)
|
|
63
|
+
- **Connection timeout** (default: 10000 ms)
|
|
64
|
+
|
|
65
|
+
### Step 3: Check if env.jsonc Already Exists
|
|
66
|
+
|
|
67
|
+
Check if `env.jsonc` exists in the working directory:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
test -f "env.jsonc" && echo "exists" || echo "not exists"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
If the file exists:
|
|
74
|
+
- Use the question tool to ask: "env.jsonc already exists. Overwrite?"
|
|
75
|
+
- Options: "Yes, overwrite", "No, keep existing"
|
|
76
|
+
|
|
77
|
+
If user selects "No", skip to Step 5 and report that no changes were made.
|
|
78
|
+
|
|
79
|
+
If user selects "Yes" or file doesn't exist, continue to Step 4.
|
|
80
|
+
|
|
81
|
+
### Step 4: Generate and Write env.jsonc
|
|
82
|
+
|
|
83
|
+
Create the `env.jsonc` file based on user's answers using the Write tool.
|
|
84
|
+
|
|
85
|
+
#### Template for MySQL:
|
|
86
|
+
|
|
87
|
+
```jsonc
|
|
88
|
+
{
|
|
89
|
+
"db-tools": {
|
|
90
|
+
"type": "mysql",
|
|
91
|
+
"host": "<HOST>",
|
|
92
|
+
"port": <PORT>,
|
|
93
|
+
"database": "<DATABASE>",
|
|
94
|
+
"username": "<USERNAME>",
|
|
95
|
+
"password": "<PASSWORD>",
|
|
96
|
+
"connectionTimeout": <TIMEOUT>
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Replace placeholders with user-provided values. If `password` is empty, use `""`.
|
|
102
|
+
|
|
103
|
+
#### Template for MongoDB (Individual Parameters):
|
|
104
|
+
|
|
105
|
+
```jsonc
|
|
106
|
+
{
|
|
107
|
+
"db-tools": {
|
|
108
|
+
"type": "mongodb",
|
|
109
|
+
"host": "<HOST>",
|
|
110
|
+
"port": <PORT>,
|
|
111
|
+
"database": "<DATABASE>",
|
|
112
|
+
"username": "<USERNAME>",
|
|
113
|
+
"password": "<PASSWORD>",
|
|
114
|
+
"connectionTimeout": <TIMEOUT>
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Replace placeholders with user-provided values. If `username` or `password` is empty, use `""`.
|
|
120
|
+
|
|
121
|
+
#### Template for MongoDB (Connection URI):
|
|
122
|
+
|
|
123
|
+
```jsonc
|
|
124
|
+
{
|
|
125
|
+
"db-tools": {
|
|
126
|
+
"type": "mongodb",
|
|
127
|
+
"uri": "<MONGODB_URI>",
|
|
128
|
+
"database": "<DATABASE>",
|
|
129
|
+
"connectionTimeout": <TIMEOUT>
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Replace placeholders with user-provided values.
|
|
135
|
+
|
|
136
|
+
Use the Write tool to create `env.jsonc` with the generated content in the working directory.
|
|
137
|
+
|
|
138
|
+
### Step 5: Provide Usage Instructions
|
|
139
|
+
|
|
140
|
+
After the file is created, provide the user with:
|
|
141
|
+
|
|
142
|
+
1. **Configuration location**: `env.jsonc` in current working directory
|
|
143
|
+
2. **Database type**: The type configured
|
|
144
|
+
3. **Quick test command** (optional suggestion):
|
|
145
|
+
|
|
146
|
+
For testing connection:
|
|
147
|
+
- "Try using dbListTables tool to verify the connection works"
|
|
148
|
+
- "The configuration will be automatically loaded on first db-tools usage"
|
|
149
|
+
|
|
150
|
+
## Important Notes
|
|
151
|
+
|
|
152
|
+
- The `env.jsonc` file uses JSONC format (JSON with comments)
|
|
153
|
+
- Sensitive information like passwords are stored in plain text
|
|
154
|
+
- Add `env.jsonc` to `.gitignore` to avoid committing credentials
|
|
155
|
+
- The configuration is automatically loaded by db-tools on first tool use
|
|
156
|
+
- Comments in the file help document different use cases
|
|
157
|
+
|
|
158
|
+
## Error Handling
|
|
159
|
+
|
|
160
|
+
If at any point the user provides invalid input:
|
|
161
|
+
- Ask again with the same question
|
|
162
|
+
- Provide helpful hints (e.g., "Port must be a number between 1-65535")
|
|
163
|
+
|
|
164
|
+
## Examples
|
|
165
|
+
|
|
166
|
+
### MySQL Local Development:
|
|
167
|
+
```jsonc
|
|
168
|
+
{
|
|
169
|
+
"db-tools": {
|
|
170
|
+
"type": "mysql",
|
|
171
|
+
"host": "localhost",
|
|
172
|
+
"port": 3306,
|
|
173
|
+
"database": "devdb",
|
|
174
|
+
"username": "root",
|
|
175
|
+
"password": "",
|
|
176
|
+
"connectionTimeout": 10000
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### MongoDB Local:
|
|
182
|
+
```jsonc
|
|
183
|
+
{
|
|
184
|
+
"db-tools": {
|
|
185
|
+
"type": "mongodb",
|
|
186
|
+
"host": "localhost",
|
|
187
|
+
"port": 27017,
|
|
188
|
+
"database": "mydb",
|
|
189
|
+
"username": "admin",
|
|
190
|
+
"password": "secret",
|
|
191
|
+
"connectionTimeout": 10000
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### MongoDB Atlas:
|
|
197
|
+
```jsonc
|
|
198
|
+
{
|
|
199
|
+
"db-tools": {
|
|
200
|
+
"type": "mongodb",
|
|
201
|
+
"uri": "mongodb+srv://user:pass@cluster0.mongodb.net/proddb?authSource=admin",
|
|
202
|
+
"database": "proddb",
|
|
203
|
+
"connectionTimeout": 10000
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
```
|