@descix/cli 1.0.0 → 1.0.3
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/LICENSE.md +671 -0
- package/README.md +43 -4
- package/agent-assets/guides/README.md +2 -2
- package/agent-assets/guides/dynamic-site-pattern.md +29 -14
- package/agent-assets/guides/knowledge-only-pattern.md +5 -5
- package/agent-assets/guides/microservice-pattern.md +48 -4
- package/agent-assets/guides/static-site-pattern.md +8 -0
- package/agent-assets/instructions/app-asset-validation.md +5 -5
- package/agent-assets/instructions/onboarding-flow.md +4 -4
- package/agent-assets/instructions/standard-folder-structure.md +20 -11
- package/agent-assets/reference/app-creation.md +42 -20
- package/agent-assets/reference/architecture.md +24 -22
- package/agent-assets/reference/local-dev.md +230 -67
- package/agent-assets/reference/mcp-integration.md +9 -9
- package/agent-assets/reference/platform-api-consumer.md +244 -0
- package/agent-assets/reference/workspace-config.md +7 -7
- package/agent-assets/rules/descix_mcp.template.mdc +8 -8
- package/bin/descix.js +2559 -1435
- package/bin/kb-deny-lint.mjs +91 -0
- package/bin/mcp-server.js +175 -91
- package/lib/agent-files.js +37 -25
- package/lib/api-client.js +223 -56
- package/lib/auth-guard.js +13 -3
- package/lib/chat-session.js +187 -0
- package/lib/cli-version.js +59 -0
- package/lib/commands/airdrop.js +251 -0
- package/lib/commands/auth.js +254 -72
- package/lib/commands/briefer/errors.js +88 -0
- package/lib/commands/briefer/index.js +319 -0
- package/lib/commands/briefer/sources/canonical-sources.js +129 -0
- package/lib/commands/briefer/sources/entitlements.js +209 -0
- package/lib/commands/briefer/sources/environments.js +205 -0
- package/lib/commands/briefer/sources/identifiers.js +214 -0
- package/lib/commands/briefer/sources/microservice-deploy.js +267 -0
- package/lib/commands/briefer/sources/routing.js +275 -0
- package/lib/commands/briefer/sources/what-is-not.js +223 -0
- package/lib/commands/briefer/stitcher.js +134 -0
- package/lib/commands/briefer/util/source-reader.js +502 -0
- package/lib/commands/config.js +210 -90
- package/lib/commands/corpus.js +978 -0
- package/lib/commands/credits.js +122 -0
- package/lib/commands/health.js +627 -0
- package/lib/commands/kb-list-render.js +32 -0
- package/lib/commands/kb.js +190 -413
- package/lib/commands/mcp.js +5 -5
- package/lib/commands/microservice-restart.js +359 -0
- package/lib/commands/model-config.js +313 -0
- package/lib/commands/retired-kb-sync.js +134 -0
- package/lib/commands/serve.js +26 -1
- package/lib/commands/status.js +23 -51
- package/lib/commands/update.js +36 -107
- package/lib/core/Chunker.js +491 -17
- package/lib/core/CorpusDenyLint.js +326 -0
- package/lib/core/CorpusWalker.js +357 -0
- package/lib/core/Hydrator.js +75 -29
- package/lib/core/ManifestLoader.js +533 -0
- package/lib/core/SiteWalker.js +218 -0
- package/lib/core/Syncer.js +163 -11
- package/lib/diagnostic-log.js +41 -0
- package/lib/environment-report.js +100 -0
- package/lib/global-config.js +4 -1
- package/lib/oauth-client.js +164 -0
- package/lib/origin.js +143 -0
- package/lib/service-api-client.js +95 -0
- package/lib/wallet-environment.js +49 -0
- package/lib/wallet-file.js +16 -2
- package/lib/wizard/setup.js +10 -9
- package/lib/workspace-config.js +380 -235
- package/lib/workspace-identity.js +92 -0
- package/lib/workspace-utils.js +41 -61
- package/package.json +29 -9
- package/templates/agent-claude.md +157 -9
- package/templates/agent-cline.md +68 -8
- package/templates/agent-copilot.md +68 -8
- package/templates/agent-cursor.md +68 -8
- package/templates/alignment-schema.json +20 -0
- package/templates/cloud-brain-hook.sh +20 -0
- package/templates/drive/README.md +1 -1
- package/templates/drive_templates/README.md +2 -2
- package/templates/scaffolds/README.md +6 -10
- package/templates/scaffolds/microservice/SERVICE_README_sdk.md +30 -0
- package/templates/scaffolds/microservice/app.js +51 -10
- package/templates/scaffolds/microservice/app.yaml +2 -2
- package/templates/scaffolds/microservice/defaults-config-dev.json +4 -0
- package/templates/scaffolds/microservice/dev-overrides.example.json +5 -0
- package/templates/scaffolds/microservice/manifest.json +0 -1
- package/templates/scaffolds/microservice/package.json +3 -3
- package/templates/scaffolds/microservice/scripts/register.js +56 -41
- package/templates/scaffolds/microservice/services/mcpClient.js +55 -65
- package/templates/scaffolds/microservice/services/utils.js +20 -238
- package/templates/scaffolds/microservice/templates/SERVICE_README_TEMPLATE.md +24 -0
- package/SERVICE_README_sdk.md +0 -399
- package/descix-cli-1.0.0.tgz +0 -0
- package/lib/commands/app-wizard.js +0 -627
- package/lib/commands/folder.js +0 -291
- package/lib/core/PathContext.js +0 -335
- package/templates/scaffolds/microservice/dev-overrides.json.example +0 -5
- package/templates/scaffolds/site/DeSciXAppSDK.js +0 -62
- package/templates/scaffolds/site/README.md +0 -51
- package/templates/scaffolds/site/app.js +0 -22
- package/templates/scaffolds/site/index.html +0 -42
- package/templates/scaffolds/site/styles.css +0 -123
- package/test-hydration.js +0 -150
package/SERVICE_README_sdk.md
DELETED
|
@@ -1,399 +0,0 @@
|
|
|
1
|
-
# DeSciX SDK - CLI and MCP Tools
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
The DeSciX SDK provides command-line tools and MCP (Model Context Protocol) integration for building applications on the DeSciX platform. The SDK enables developers to authenticate, manage workspaces, create apps, and leverage AI-assisted development through Cursor IDE integration.
|
|
6
|
-
|
|
7
|
-
**Key capabilities:**
|
|
8
|
-
- CLI commands for all platform operations
|
|
9
|
-
- MCP server for Cursor IDE integration
|
|
10
|
-
- Intelligent tool discovery via `tell_me_how`
|
|
11
|
-
- Entitlements-driven workspace setup
|
|
12
|
-
- Git-aware project initialization
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## Installation
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
# Global install (recommended)
|
|
20
|
-
npm install -g @descix/cli
|
|
21
|
-
|
|
22
|
-
# Or via npm link during development
|
|
23
|
-
cd DeSciX_Core/descix-cli
|
|
24
|
-
npm link
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## CLI Commands
|
|
30
|
-
|
|
31
|
-
### descix setup
|
|
32
|
-
|
|
33
|
-
**Description:** One-time workspace configuration wizard
|
|
34
|
-
**Use when:** First time setting up DeSciX in a new workspace or Cursor project
|
|
35
|
-
**What it does:**
|
|
36
|
-
1. Prompts for API endpoint (production/local/custom)
|
|
37
|
-
2. Runs device authentication (opens browser)
|
|
38
|
-
3. Creates `.cursor/mcp.json` for MCP server
|
|
39
|
-
4. Creates `.cursor/rules/descix_mcp.mdc` for AI agent instructions
|
|
40
|
-
5. Creates `.descix/workspace.json` with initial configuration
|
|
41
|
-
|
|
42
|
-
**Example:**
|
|
43
|
-
```bash
|
|
44
|
-
cd ~/Projects/MyApp
|
|
45
|
-
descix setup
|
|
46
|
-
# Follow the prompts
|
|
47
|
-
# Restart Cursor after completion
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
### descix login
|
|
53
|
-
|
|
54
|
-
**Description:** Authenticate with the DeSciX platform
|
|
55
|
-
**Use when:** Session expired or first-time authentication
|
|
56
|
-
**Options:**
|
|
57
|
-
- `--device` (default): Opens browser for Powch authentication
|
|
58
|
-
- `--wallet`: Direct wallet signature authentication
|
|
59
|
-
|
|
60
|
-
**Example:**
|
|
61
|
-
```bash
|
|
62
|
-
descix login
|
|
63
|
-
# Opens browser, complete authentication
|
|
64
|
-
# Credentials saved to .descix/wallet.json
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
---
|
|
68
|
-
|
|
69
|
-
### descix whoami
|
|
70
|
-
|
|
71
|
-
**Description:** Display current authentication status
|
|
72
|
-
**Use when:** Checking if you're logged in and what account you're using
|
|
73
|
-
|
|
74
|
-
**Example:**
|
|
75
|
-
```bash
|
|
76
|
-
descix whoami
|
|
77
|
-
# Output:
|
|
78
|
-
# User: sam@descix.net
|
|
79
|
-
# Wallet: 0xe71b412d...
|
|
80
|
-
# Session: Valid
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
---
|
|
84
|
-
|
|
85
|
-
### descix tell-me-how
|
|
86
|
-
|
|
87
|
-
**Description:** Discover platform tools using natural language
|
|
88
|
-
**Use when:** You don't know which command to use for a task
|
|
89
|
-
|
|
90
|
-
**Options:**
|
|
91
|
-
- `--scope project`: Search within current workspace apps
|
|
92
|
-
- `--scope entitlements`: Search apps you have access to (default)
|
|
93
|
-
- `--scope discovery`: Search all platform tools
|
|
94
|
-
- `--json`: Output raw JSON response
|
|
95
|
-
|
|
96
|
-
**Examples:**
|
|
97
|
-
```bash
|
|
98
|
-
# Find how to create an app
|
|
99
|
-
descix tell-me-how "How do I create a new app?"
|
|
100
|
-
|
|
101
|
-
# Search within current project
|
|
102
|
-
descix tell-me-how --scope project "How do I sync my knowledge base?"
|
|
103
|
-
|
|
104
|
-
# Discover all available tools
|
|
105
|
-
descix tell-me-how --scope discovery "What AI training tools exist?"
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
---
|
|
109
|
-
|
|
110
|
-
### descix app create
|
|
111
|
-
|
|
112
|
-
**Description:** Create or hydrate an app using the interactive wizard
|
|
113
|
-
**Use when:** Starting a new project or hydrating an existing app
|
|
114
|
-
**Options:**
|
|
115
|
-
- `-c, --community <id>`: Community ID
|
|
116
|
-
- `-a, --app <name>`: App name
|
|
117
|
-
- `--wizard`: Interactive wizard mode
|
|
118
|
-
- `--quick`: Skip optional prompts
|
|
119
|
-
|
|
120
|
-
**Note:** New apps should primarily be provisioned via the PWA. This command can hydrate a local workspace from an existing app or create a skeleton if permitted.
|
|
121
|
-
|
|
122
|
-
**Example:**
|
|
123
|
-
```bash
|
|
124
|
-
# Interactive wizard
|
|
125
|
-
descix app create --wizard
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
|
|
130
|
-
### descix kb
|
|
131
|
-
|
|
132
|
-
**Description:** Manage Knowledge Base content (Git Mode)
|
|
133
|
-
**Use when:** Processing KB documents locally
|
|
134
|
-
|
|
135
|
-
**Subcommands:**
|
|
136
|
-
- `pull`: Download source documents from Drive to `kb/src/`
|
|
137
|
-
- `chunk`: Process source files into chunks in `kb/chunks/`
|
|
138
|
-
- `sync`: Push chunks to the platform (Pinecone)
|
|
139
|
-
- `build`: Run the full pipeline (Pull -> Chunk -> Sync)
|
|
140
|
-
|
|
141
|
-
**Example:**
|
|
142
|
-
```bash
|
|
143
|
-
# Full build pipeline
|
|
144
|
-
descix kb build -c descix -a myapp
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
---
|
|
148
|
-
|
|
149
|
-
### descix microservice vectorize
|
|
150
|
-
|
|
151
|
-
**Description:** Vectorize a SERVICE_README for tell_me_how discovery
|
|
152
|
-
**Use when:** Adding or updating service documentation
|
|
153
|
-
**Options:**
|
|
154
|
-
- `-n, --name <name>`: Service name
|
|
155
|
-
- `-c, --community <id>`: Community ID
|
|
156
|
-
- `-a, --app <id>`: App ID
|
|
157
|
-
- `-r, --readme <path>`: Path to README file
|
|
158
|
-
|
|
159
|
-
**Example:**
|
|
160
|
-
```bash
|
|
161
|
-
descix microservice vectorize -r ./SERVICE_README_myservice.md
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
---
|
|
165
|
-
|
|
166
|
-
### descix purchases
|
|
167
|
-
|
|
168
|
-
**Description:** List your entitlements (communities, apps, service slots)
|
|
169
|
-
**Use when:** Checking what resources you have access to
|
|
170
|
-
|
|
171
|
-
**Example:**
|
|
172
|
-
```bash
|
|
173
|
-
descix purchases
|
|
174
|
-
# Output shows communities, apps, and service slots
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
|
-
## MCP Tools (for Cursor AI)
|
|
180
|
-
|
|
181
|
-
After running `descix setup` and restarting Cursor, these MCP tools are available to the AI agent:
|
|
182
|
-
|
|
183
|
-
### tell_me_how
|
|
184
|
-
|
|
185
|
-
**Description:** Primary discovery tool - finds relevant commands for any task
|
|
186
|
-
**Use first:** Always use this before attempting platform operations
|
|
187
|
-
|
|
188
|
-
```javascript
|
|
189
|
-
tell_me_how({
|
|
190
|
-
question: "How do I deploy my app?",
|
|
191
|
-
scope: "entitlements"
|
|
192
|
-
})
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
**Scope options:**
|
|
196
|
-
- `project`: Uses `.descix/workspace.json` mappings
|
|
197
|
-
- `entitlements`: Only tools you have access to (default)
|
|
198
|
-
- `discovery`: All platform tools (may require purchase)
|
|
199
|
-
|
|
200
|
-
---
|
|
201
|
-
|
|
202
|
-
### execute_remote_command
|
|
203
|
-
|
|
204
|
-
**Description:** Execute any backend command discovered via tell_me_how
|
|
205
|
-
**Use after:** tell_me_how returns recommended commands
|
|
206
|
-
|
|
207
|
-
```javascript
|
|
208
|
-
execute_remote_command({
|
|
209
|
-
command: "create_app",
|
|
210
|
-
params: {
|
|
211
|
-
community_id: "descix",
|
|
212
|
-
app_name: "My New App"
|
|
213
|
-
}
|
|
214
|
-
})
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
---
|
|
218
|
-
|
|
219
|
-
### descix_init
|
|
220
|
-
|
|
221
|
-
**Description:** Initialize a local project for DeSciX deployment
|
|
222
|
-
**Use when:** Setting up a new project folder
|
|
223
|
-
|
|
224
|
-
```javascript
|
|
225
|
-
descix_init({
|
|
226
|
-
projectPath: "/Users/dev/Projects/MyApp",
|
|
227
|
-
appName: "my-app",
|
|
228
|
-
communityId: "descix"
|
|
229
|
-
})
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
**Creates:**
|
|
233
|
-
- `.descix/workspace.json` or `.descix/context.json`
|
|
234
|
-
- `app_description.md` from README if missing
|
|
235
|
-
- Folder structure for knowledge base
|
|
236
|
-
|
|
237
|
-
---
|
|
238
|
-
|
|
239
|
-
### descix_wizard_step
|
|
240
|
-
|
|
241
|
-
**Description:** Execute multi-step wizard workflows
|
|
242
|
-
**Use when:** Creating apps, communities, or complex operations
|
|
243
|
-
|
|
244
|
-
```javascript
|
|
245
|
-
descix_wizard_step({
|
|
246
|
-
wizard_type: "create_app",
|
|
247
|
-
step: "init",
|
|
248
|
-
params: {
|
|
249
|
-
community_id: "descix",
|
|
250
|
-
app_name: "My App"
|
|
251
|
-
}
|
|
252
|
-
})
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
**Wizard types:**
|
|
256
|
-
- `create_app`: App creation with folder setup
|
|
257
|
-
- `create_community`: Community creation with token
|
|
258
|
-
- `publish_kb`: Knowledge base sync and publish
|
|
259
|
-
|
|
260
|
-
---
|
|
261
|
-
|
|
262
|
-
### git_sync_ops
|
|
263
|
-
|
|
264
|
-
**Description:** Git operations with auto-generated commit messages
|
|
265
|
-
**Use when:** Committing changes, checking status
|
|
266
|
-
|
|
267
|
-
```javascript
|
|
268
|
-
git_sync_ops({
|
|
269
|
-
operation: "status", // or "commit", "diff", "sync_info"
|
|
270
|
-
projectPath: "/Users/dev/Projects/MyApp"
|
|
271
|
-
})
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
---
|
|
275
|
-
|
|
276
|
-
### search_knowledge_base
|
|
277
|
-
|
|
278
|
-
**Description:** Search a specific knowledge base via RAG
|
|
279
|
-
**Use when:** You know the exact KB to search
|
|
280
|
-
|
|
281
|
-
```javascript
|
|
282
|
-
search_knowledge_base({
|
|
283
|
-
communityId: "descix",
|
|
284
|
-
appId: "docs",
|
|
285
|
-
kbId: "sdk",
|
|
286
|
-
query: "How do I authenticate?"
|
|
287
|
-
})
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
---
|
|
291
|
-
|
|
292
|
-
### chat_with_kb
|
|
293
|
-
|
|
294
|
-
**Description:** Conversational RAG with knowledge base context
|
|
295
|
-
**Use when:** Complex questions requiring AI reasoning
|
|
296
|
-
|
|
297
|
-
```javascript
|
|
298
|
-
chat_with_kb({
|
|
299
|
-
communityId: "descix",
|
|
300
|
-
appId: "docs",
|
|
301
|
-
kbId: "sdk",
|
|
302
|
-
message: "Explain the authentication flow step by step"
|
|
303
|
-
})
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
---
|
|
307
|
-
|
|
308
|
-
## Workspace Configuration
|
|
309
|
-
|
|
310
|
-
### workspace.json (Monorepo)
|
|
311
|
-
|
|
312
|
-
For multi-app workspaces, create `.descix/workspace.json`:
|
|
313
|
-
|
|
314
|
-
```json
|
|
315
|
-
{
|
|
316
|
-
"version": "2.0",
|
|
317
|
-
"primaryCommunity": "descix",
|
|
318
|
-
"directoryMappings": {
|
|
319
|
-
"frontend": { "communityId": "descix", "appId": "pwa", "kbId": "General" },
|
|
320
|
-
"backend": { "communityId": "descix", "appId": "cloud", "kbId": "General" },
|
|
321
|
-
"docs": { "communityId": "descix", "appId": "docs", "kbId": "sdk" }
|
|
322
|
-
},
|
|
323
|
-
"defaultContext": {
|
|
324
|
-
"communityId": "descix",
|
|
325
|
-
"appId": "docs",
|
|
326
|
-
"kbId": "sdk"
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
```
|
|
330
|
-
|
|
331
|
-
### context.json (Single App)
|
|
332
|
-
|
|
333
|
-
For individual app folders, create `.descix/context.json`:
|
|
334
|
-
|
|
335
|
-
```json
|
|
336
|
-
{
|
|
337
|
-
"version": "2.0",
|
|
338
|
-
"type": "app",
|
|
339
|
-
"community_id": "descix",
|
|
340
|
-
"app_id": "myapp",
|
|
341
|
-
"app_name": "My Application",
|
|
342
|
-
"folders": {
|
|
343
|
-
"app": { "local_path": ".", "sync_type": "assets" },
|
|
344
|
-
"kb": { "local_path": "docs", "sync_type": "rag" }
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
```
|
|
348
|
-
|
|
349
|
-
---
|
|
350
|
-
|
|
351
|
-
## Common Workflows
|
|
352
|
-
|
|
353
|
-
### New Developer Onboarding (Cursor IDE)
|
|
354
|
-
|
|
355
|
-
1. Install CLI: `npm install -g @descix/cli`
|
|
356
|
-
2. Run setup: `descix setup`
|
|
357
|
-
3. Restart Cursor (Cmd+Shift+P → "Reload Window")
|
|
358
|
-
4. AI agent can now use MCP tools
|
|
359
|
-
5. Ask: "How do I create an app?"
|
|
360
|
-
6. AI uses `tell_me_how` → `execute_remote_command`
|
|
361
|
-
|
|
362
|
-
### Entitlements-First App Creation
|
|
363
|
-
|
|
364
|
-
1. AI calls `execute_remote_command({ command: "fetch_my_purchases" })`
|
|
365
|
-
2. AI presents user's communities and apps
|
|
366
|
-
3. User selects community (or creates new)
|
|
367
|
-
4. AI calls `descix_wizard_step` for app creation
|
|
368
|
-
5. AI creates local `.descix/context.json`
|
|
369
|
-
|
|
370
|
-
### Monorepo Setup
|
|
371
|
-
|
|
372
|
-
1. AI calls `fetch_my_purchases` to get entitlements
|
|
373
|
-
2. AI scans workspace folders
|
|
374
|
-
3. AI asks user: "Map `frontend/` to which app?"
|
|
375
|
-
4. AI creates `.descix/workspace.json` with mappings
|
|
376
|
-
5. `tell_me_how --scope project` now uses these mappings
|
|
377
|
-
|
|
378
|
-
---
|
|
379
|
-
|
|
380
|
-
## Troubleshooting
|
|
381
|
-
|
|
382
|
-
### "MCP tools not available"
|
|
383
|
-
1. Run `descix setup` in workspace root
|
|
384
|
-
2. Restart Cursor completely
|
|
385
|
-
3. Check `.cursor/mcp.json` exists with `descix` server
|
|
386
|
-
|
|
387
|
-
### "Session expired"
|
|
388
|
-
Run `descix reconnect` or `descix login`
|
|
389
|
-
|
|
390
|
-
### "No results from tell_me_how"
|
|
391
|
-
Service READMEs may not be vectorized. Ask admin to run `descix microservice vectorize` for relevant services.
|
|
392
|
-
|
|
393
|
-
### "workspace.json not found" for project scope
|
|
394
|
-
Run `descix init` or let AI create workspace.json via `descix_init` MCP tool.
|
|
395
|
-
|
|
396
|
-
---
|
|
397
|
-
|
|
398
|
-
*SDK Version: 2.0.0*
|
|
399
|
-
*Package: @descix/cli*
|
package/descix-cli-1.0.0.tgz
DELETED
|
Binary file
|