@superglue/cli 1.1.31 → 1.1.32
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 +10 -5
- package/dist/cli.js +288 -204
- package/dist/skills/superglue/SKILL.md +26 -25
- package/dist/skills/superglue/references/mongodb.md +136 -0
- package/dist/skills/superglue/references/superglue-info.md +19 -6
- package/package.json +1 -1
- package/skills/superglue/SKILL.md +26 -25
- package/skills/superglue/references/mongodb.md +136 -0
- package/skills/superglue/references/superglue-info.md +19 -6
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# MongoDB
|
|
2
|
+
|
|
3
|
+
## Step Configuration
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
{
|
|
7
|
+
type: "request",
|
|
8
|
+
systemId: "my_mongo",
|
|
9
|
+
url: "mongodb://<<my_mongo_username>>:<<my_mongo_password>>@<<my_mongo_host>>:<<my_mongo_port>>/<<my_mongo_database>>?authSource=admin",
|
|
10
|
+
body: '{"collection": "users", "operation": "find", "filter": {"status": "active"}, "options": {"limit": 50, "sort": {"createdAt": -1}}}'
|
|
11
|
+
}
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Configure the connection URL based on which credentials are stored in the system — use `sg system find` to check `storedCredentials` and reference them accordingly.
|
|
15
|
+
|
|
16
|
+
`method`, `headers`, `queryParams`, and `pagination` are HTTP-only fields — omit them for MongoDB steps.
|
|
17
|
+
|
|
18
|
+
### Fields
|
|
19
|
+
|
|
20
|
+
| Field | Required | Notes |
|
|
21
|
+
| ---------- | -------- | -------------------------------------------------------------- |
|
|
22
|
+
| `url` | yes | Connection string with `<<credential>>` placeholders |
|
|
23
|
+
| `body` | yes | JSON: single operation object or array of operations |
|
|
24
|
+
| `systemId` | no | Links system credentials for `<<systemId_credKey>>` resolution |
|
|
25
|
+
|
|
26
|
+
### URL Format
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
mongodb://user:password@host:port/database?authSource=admin
|
|
30
|
+
mongodb+srv://user:password@cluster.example.mongodb.net/database (SRV seedlist, e.g. Atlas)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
- `mongodb://` for a standard host:port connection.
|
|
34
|
+
- `mongodb+srv://` for DNS SRV seedlists (MongoDB Atlas). The driver resolves the seedlist and enables TLS automatically; do not add a port.
|
|
35
|
+
- The default database comes from the URL path; override per operation with a `database` field in the body.
|
|
36
|
+
- Common query params: `authSource` (auth database, usually `admin` for root users), `replicaSet`, `tls`, `retryWrites`.
|
|
37
|
+
- Special characters in the username or password are URL-encoded automatically before the driver parses the string.
|
|
38
|
+
|
|
39
|
+
### Body Format
|
|
40
|
+
|
|
41
|
+
JSON string with `operation` (required) and `collection` (required for all operations except `listCollections`). Bodies are parsed as MongoDB Extended JSON, so `{ "$oid": "..." }` becomes an `ObjectId` and `{ "$date": "..." }` becomes a `Date`:
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"collection": "orders",
|
|
46
|
+
"operation": "find",
|
|
47
|
+
"filter": { "_id": { "$oid": "652c1f77bcf86cd799439011" } }
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
For several operations in one step, pass an array (executed in order, results returned as an array):
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
[
|
|
55
|
+
{ "collection": "orders", "operation": "countDocuments", "filter": { "status": "paid" } },
|
|
56
|
+
{
|
|
57
|
+
"collection": "orders",
|
|
58
|
+
"operation": "find",
|
|
59
|
+
"filter": { "status": "paid" },
|
|
60
|
+
"options": { "limit": 10 }
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Supported Operations
|
|
66
|
+
|
|
67
|
+
| Operation | Required fields | Returns |
|
|
68
|
+
| ------------------------------------------------------------- | ------------------------------------------------- | ---------------------------------------------- |
|
|
69
|
+
| `find` | `collection` | array of documents |
|
|
70
|
+
| `findOne` | `collection` | a document or `null` |
|
|
71
|
+
| `aggregate` | `collection`, `pipeline` | array of documents |
|
|
72
|
+
| `countDocuments` | `collection` | number |
|
|
73
|
+
| `estimatedDocumentCount` | `collection` | number |
|
|
74
|
+
| `distinct` | `collection`, `field` | array of values |
|
|
75
|
+
| `listCollections` | — | array of collection info |
|
|
76
|
+
| `insertOne` | `collection`, `document` | `{ acknowledged, insertedId }` |
|
|
77
|
+
| `insertMany` | `collection`, `documents` | `{ acknowledged, insertedCount, insertedIds }` |
|
|
78
|
+
| `updateOne` / `updateMany` | `collection`, `filter`, `update` | `{ matchedCount, modifiedCount, upsertedId }` |
|
|
79
|
+
| `replaceOne` | `collection`, `filter`, `replacement` | update result |
|
|
80
|
+
| `deleteOne` / `deleteMany` | `collection`, `filter` | `{ acknowledged, deletedCount }` |
|
|
81
|
+
| `findOneAndUpdate` / `findOneAndReplace` / `findOneAndDelete` | `collection`, `filter` (+ `update`/`replacement`) | the affected document |
|
|
82
|
+
| `bulkWrite` | `collection`, `operations` | bulk write result |
|
|
83
|
+
|
|
84
|
+
`filter`, `pipeline`, `document`, `update`, `replacement`, and driver `options` (e.g. `limit`, `skip`, `sort`, `projection`, `upsert`) are passed straight through to the driver.
|
|
85
|
+
|
|
86
|
+
Dynamic values with variables:
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"collection": "users",
|
|
91
|
+
"operation": "find",
|
|
92
|
+
"filter": { "orgId": "<<(sourceData) => sourceData.orgId>>" }
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Authentication
|
|
97
|
+
|
|
98
|
+
Credentials are embedded directly in the connection URL using `<<systemId_credentialKey>>` placeholders. Nothing is injected automatically. Root/admin users almost always need `?authSource=admin`.
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
mongodb://<<my_mongo_username>>:<<my_mongo_password>>@<<my_mongo_host>>:<<my_mongo_port>>/<<my_mongo_database>>?authSource=admin
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## MongoDB Runtime Details
|
|
105
|
+
|
|
106
|
+
### Return Values
|
|
107
|
+
|
|
108
|
+
Documents are returned as Extended JSON (relaxed): an `ObjectId` becomes `{ "$oid": "..." }` and a `Date` becomes `{ "$date": "..." }`. Query those values back with the same form. A single operation returns its result directly; an array of operations returns an array of results in order.
|
|
109
|
+
|
|
110
|
+
### Connection Management
|
|
111
|
+
|
|
112
|
+
- Clients are reused per connection string within a run and closed after completion.
|
|
113
|
+
- TLS is automatic for `mongodb+srv://` and when the connection string sets `tls=true`.
|
|
114
|
+
- Connection timeout defaults to 30 seconds; operation/socket timeout follows the system/protocol timeout.
|
|
115
|
+
|
|
116
|
+
### Retry Behavior
|
|
117
|
+
|
|
118
|
+
Default retries come from server config. On final failure, the error includes the failing operation name.
|
|
119
|
+
|
|
120
|
+
## Common Pitfalls
|
|
121
|
+
|
|
122
|
+
- Omitting `?authSource=admin` when authenticating as a root user — auth fails with "Authentication failed".
|
|
123
|
+
- Adding a port to a `mongodb+srv://` URL — SRV connection strings must not include a port.
|
|
124
|
+
- Passing an `_id` as a plain string when the document stores an `ObjectId` — wrap it as `{ "$oid": "..." }` so it matches.
|
|
125
|
+
- Putting `limit`/`sort`/`projection` at the top level — they belong inside `options`.
|
|
126
|
+
- Accessing the step result directly instead of via `.data` — MongoDB results follow the same envelope as all steps: `sourceData.stepId.data`.
|
|
127
|
+
|
|
128
|
+
## Error Recovery
|
|
129
|
+
|
|
130
|
+
When a MongoDB step fails:
|
|
131
|
+
|
|
132
|
+
1. **Read the error message** — superglue includes the operation name in the error. Check for unknown operations, missing required fields (`filter`, `update`, `pipeline`), or malformed Extended JSON.
|
|
133
|
+
2. **Verify connection credentials** — use `sg system find` to confirm `storedCredentials` keys match the placeholders in your URL. Test with a `listCollections` operation via `sg system call`.
|
|
134
|
+
3. **Check auth source** — "Authentication failed" usually means a missing or wrong `authSource`. Root users authenticate against `admin`.
|
|
135
|
+
4. **Check connectivity** — connection refused or server-selection timeouts mean the host is unreachable, the SRV record can't resolve, or an IP allowlist (Atlas) is blocking you. `mongodb+srv://` requires outbound DNS.
|
|
136
|
+
5. **Check the operation shape** — read operations (`find`, `countDocuments`, `distinct`) never mutate; write operations require their specific fields. `aggregate` is read-only unless its pipeline contains a `$out` or `$merge` stage, which writes results back to a collection. Confirm `filter`/`update`/`pipeline` are objects/arrays, not strings.
|
|
@@ -16,9 +16,17 @@ If the user is asking general questions (not building):
|
|
|
16
16
|
- Product/features → https://docs.superglue.cloud/getting-started/introduction
|
|
17
17
|
- Open-source/code → https://github.com/superglue-ai/superglue
|
|
18
18
|
|
|
19
|
+
## Cloud Usage Tiers
|
|
20
|
+
|
|
21
|
+
- Cloud tiers are **Trial**, **Pro**, **Team**, and **Enterprise**; billing-enabled apps expose upgrades through the in-app **Upgrade Plan** button, not a separate Billing page.
|
|
22
|
+
- **Trial** includes 1M input tokens and 100 runs lifetime; **Pro** is €59/$69 per month with 3M input tokens/user/month and 3,000 runs/user/month.
|
|
23
|
+
- **Team** is €99/$119 per seat/month with 5M input tokens/user/month and 5,000 runs/user/month; Team includes organization management, activity tracking, and custom MCP servers.
|
|
24
|
+
- **Enterprise** is custom-priced with unlimited usage limits by default, enterprise access controls, and self-hosting/on-prem options.
|
|
25
|
+
- These cloud tier details do not apply to self-hosted or enterprise deployment setups.
|
|
26
|
+
|
|
19
27
|
## Authentication
|
|
20
28
|
|
|
21
|
-
API, SDK,
|
|
29
|
+
API, SDK, and webhook usage require an **API key**. The CLI should use browser OAuth via `sg login`; headless/API-key CLI auth is available through environment variables, flags, or `config.json` for CI and legacy automation. MCP clients can use OAuth when supported, or API keys for non-interactive setup. Self-hosted deployments also need the API/MCP endpoint URL. There are no workspace IDs, project IDs, or other identifiers.
|
|
22
30
|
|
|
23
31
|
MCP authentication is separate from API/SDK/CLI setup. For MCP OAuth, dynamic client registration, Langdock setup, and named server permissions, use the MCP documentation.
|
|
24
32
|
|
|
@@ -44,6 +52,10 @@ OAuth flows require a callback URL: `{appEndpoint}/api/auth/callback`
|
|
|
44
52
|
|
|
45
53
|
On superglue Cloud, the app endpoint is `https://app.superglue.cloud`. Self-hosted and enterprise deployments use their own app URL. If a user doesn't know their endpoints, they can check the browser URL bar for the app endpoint and deployment configuration for the API endpoint.
|
|
46
54
|
|
|
55
|
+
### Cloud Networking
|
|
56
|
+
|
|
57
|
+
If a customer's system requires IP allowlisting for firewall rules, security groups, or vendor access controls, superglue Cloud outbound requests come from `34.234.12.178` and `18.198.191.215`. These IPs apply to superglue Cloud only; self-hosted and enterprise deployments use deployment-specific networking.
|
|
58
|
+
|
|
47
59
|
## Web App UI Layout
|
|
48
60
|
|
|
49
61
|
Use this section as the source of truth for high-level web app navigation. Do not invent UI locations that are not listed here.
|
|
@@ -53,7 +65,7 @@ The persistent left sidebar contains these top-level items:
|
|
|
53
65
|
- **Agent** (`/`) — primary AI chat assistant for building and debugging tools and systems.
|
|
54
66
|
- **Tools** (`/tools`, detail at `/tools/{toolId}`) — saved tools; opens the tool playground for editing, testing, and running.
|
|
55
67
|
- **Systems** (`/systems`, detail at `/systems/{systemId}`) — connected external systems with credentials and documentation.
|
|
56
|
-
- **
|
|
68
|
+
- **Credentials** (`/credentials`) — manage the credentials you own for each system, and the credentials shared with you. Admins and members open it inside the normal app shell from the sidebar. API keys are not managed here.
|
|
57
69
|
- **Runs** (`/runs`, detail at `/runs/{runId}`) — execution history for full, draft, and single-step tool runs. Runs is a top-level sidebar item, not a Control Panel sub-item.
|
|
58
70
|
- **Control Panel** (`/admin`) — expandable group for organization and account administration:
|
|
59
71
|
- **Overview** (`/admin`) — dashboard summary, including failed-run and schedule summaries.
|
|
@@ -63,9 +75,9 @@ The persistent left sidebar contains these top-level items:
|
|
|
63
75
|
- **Organization** (`/organization`) — visible on paid tiers as a standalone page without tabs. It shows members, invitations, role assignment, and member-management actions; management actions are admin-gated.
|
|
64
76
|
- **MCP Servers** (`/admin?view=mcp-servers`) — manage and export named MCP server endpoints. Use the MCP documentation for behavior, permissions, and client setup.
|
|
65
77
|
|
|
66
|
-
Below the navigation, the sidebar shows the current organization menu. Opening it shows the signed-in user email and menu items for **API Keys** (`/api-keys`), **Settings** (`/settings`, admin-only), **Switch organization**, and **Sign Out**.
|
|
78
|
+
Below the navigation, the sidebar shows the current organization menu. Opening it shows the signed-in user email and menu items for **API Keys** (`/api-keys`), **Settings** (`/settings`, admin-only), **Switch organization**, and **Sign Out**. When billing is enabled, the sidebar also shows **Upgrade Plan** for non-enterprise organizations; it opens the in-app upgrade flow. There is no separate in-app Billing page.
|
|
67
79
|
|
|
68
|
-
**API Keys** (`/api-keys`) is a standalone page with a simple own-key editor for superglue API keys used by API, SDK, CLI, webhook, and non-OAuth MCP clients. Org users can create, copy, and delete their own keys.
|
|
80
|
+
**API Keys** (`/api-keys`) is a standalone page with a simple own-key editor for superglue API keys used by API, SDK, CLI headless/API-key auth, webhook, and non-OAuth MCP clients. Org users can create, copy, and delete their own keys.
|
|
69
81
|
|
|
70
82
|
**Settings** (`/settings`) is an admin-only standalone page with distinct sections:
|
|
71
83
|
|
|
@@ -98,7 +110,8 @@ Steps are routed to execution strategies by protocol (first match wins):
|
|
|
98
110
|
3. PostgreSQL → URL starts with `postgres://` or `postgresql://`
|
|
99
111
|
4. MSSQL/Azure SQL → URL starts with `mssql://` or `sqlserver://`
|
|
100
112
|
5. Redis → URL starts with `redis://` or `rediss://`
|
|
101
|
-
6.
|
|
102
|
-
7.
|
|
113
|
+
6. MongoDB → URL starts with `mongodb://` or `mongodb+srv://`
|
|
114
|
+
7. FTP/SFTP → URL starts with `ftp://`, `ftps://`, or `sftp://`
|
|
115
|
+
8. SMB → URL starts with `smb://`
|
|
103
116
|
|
|
104
117
|
All user-provided JS (data selectors, transforms, stop conditions) runs in an isolated Deno sandbox.
|