@descix/cli 1.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 +95 -0
- package/SERVICE_README_sdk.md +399 -0
- package/agent-assets/guides/README.md +61 -0
- package/agent-assets/guides/dynamic-site-pattern.md +125 -0
- package/agent-assets/guides/knowledge-only-pattern.md +93 -0
- package/agent-assets/guides/microservice-pattern.md +152 -0
- package/agent-assets/guides/static-site-pattern.md +111 -0
- package/agent-assets/instructions/app-asset-validation.md +477 -0
- package/agent-assets/instructions/onboarding-flow.md +408 -0
- package/agent-assets/instructions/standard-folder-structure.md +125 -0
- package/agent-assets/reference/app-creation.md +381 -0
- package/agent-assets/reference/architecture.md +406 -0
- package/agent-assets/reference/local-dev.md +138 -0
- package/agent-assets/reference/mcp-integration.md +424 -0
- package/agent-assets/reference/workspace-config.md +415 -0
- package/agent-assets/rules/descix_mcp.template.mdc +243 -0
- package/bin/descix.js +3930 -0
- package/bin/mcp-server.js +382 -0
- package/descix-cli-1.0.0.tgz +0 -0
- package/lib/agent-files.js +162 -0
- package/lib/api-client.js +458 -0
- package/lib/auth-guard.js +67 -0
- package/lib/commands/app-wizard.js +627 -0
- package/lib/commands/auth.js +407 -0
- package/lib/commands/buy.js +207 -0
- package/lib/commands/clone.js +91 -0
- package/lib/commands/config.js +155 -0
- package/lib/commands/doctor.js +277 -0
- package/lib/commands/folder.js +291 -0
- package/lib/commands/init.js +257 -0
- package/lib/commands/kb.js +654 -0
- package/lib/commands/mcp.js +273 -0
- package/lib/commands/serve.js +12 -0
- package/lib/commands/status.js +239 -0
- package/lib/commands/update.js +653 -0
- package/lib/core/Chunker.js +610 -0
- package/lib/core/Hydrator.js +801 -0
- package/lib/core/PathContext.js +335 -0
- package/lib/core/Syncer.js +310 -0
- package/lib/core/index.js +32 -0
- package/lib/global-config.js +86 -0
- package/lib/google-storage-adc.js +511 -0
- package/lib/wallet-file.js +232 -0
- package/lib/wizard/setup.js +502 -0
- package/lib/workspace-config.js +712 -0
- package/lib/workspace-utils.js +126 -0
- package/package.json +41 -0
- package/templates/agent-claude.md +226 -0
- package/templates/agent-cline.md +133 -0
- package/templates/agent-copilot.md +133 -0
- package/templates/agent-cursor.md +133 -0
- package/templates/descix_mcp.mdc +122 -0
- package/templates/drive/README.md +42 -0
- package/templates/drive/app/assets/app_description.md +13 -0
- package/templates/drive/app/assets/icon.png +0 -0
- package/templates/drive/app/assets/system_instructions.md +17 -0
- package/templates/drive/app/kb/General/README.md +25 -0
- package/templates/drive/community/Apps/.gitkeep +4 -0
- package/templates/drive/community/community_assets/community_description.md +15 -0
- package/templates/drive/community/community_assets/icon.png +0 -0
- package/templates/drive_templates/README.md +104 -0
- package/templates/drive_templates/agent_app_template/assets/app_description.txt +13 -0
- package/templates/drive_templates/agent_app_template/assets/system_instructions.txt +17 -0
- package/templates/drive_templates/agent_app_template/kb/General/README.md +25 -0
- package/templates/drive_templates/agent_app_template/microservice/.gitkeep +10 -0
- package/templates/drive_templates/agent_app_template/site/.gitkeep +4 -0
- package/templates/drive_templates/community_template/Apps/.gitkeep +4 -0
- package/templates/drive_templates/community_template/community_assets/community_description.txt +15 -0
- package/templates/scaffolds/README.md +62 -0
- package/templates/scaffolds/microservice/Dockerfile +19 -0
- package/templates/scaffolds/microservice/SERVICE_README_sdk.md +399 -0
- package/templates/scaffolds/microservice/app.js +50 -0
- package/templates/scaffolds/microservice/app.yaml +8 -0
- package/templates/scaffolds/microservice/defaults-config.json +5 -0
- package/templates/scaffolds/microservice/dev-overrides.json.example +5 -0
- package/templates/scaffolds/microservice/manifest.json +49 -0
- package/templates/scaffolds/microservice/package-lock.json +2645 -0
- package/templates/scaffolds/microservice/package.json +29 -0
- package/templates/scaffolds/microservice/scripts/register.js +55 -0
- package/templates/scaffolds/microservice/services/apiFront.js +75 -0
- package/templates/scaffolds/microservice/services/commandHandlers/sampleCommands.js +57 -0
- package/templates/scaffolds/microservice/services/mcpClient.js +78 -0
- package/templates/scaffolds/microservice/services/utils.js +247 -0
- package/templates/scaffolds/microservice/setup-schema.json +18 -0
- package/templates/scaffolds/microservice/templates/SERVICE_README_TEMPLATE.md +143 -0
- package/templates/scaffolds/site/DeSciXAppSDK.js +62 -0
- package/templates/scaffolds/site/README.md +51 -0
- package/templates/scaffolds/site/app.js +22 -0
- package/templates/scaffolds/site/index.html +42 -0
- package/templates/scaffolds/site/styles.css +123 -0
- package/test-hydration.js +150 -0
- package/vendor/mcp/transports/http-sse-transport.js +196 -0
- package/vendor/mcp/transports/index.js +15 -0
- package/vendor/mcp/transports/stdio-transport.js +118 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Knowledge-Only App Pattern
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
A Knowledge-Only app is pure documentation/content that gets indexed for semantic search. No public URL, no executable code.
|
|
6
|
+
|
|
7
|
+
## When to Use
|
|
8
|
+
|
|
9
|
+
Choose this pattern when the user wants to:
|
|
10
|
+
- Make documentation searchable via RAG
|
|
11
|
+
- Create a reference library for AI agents
|
|
12
|
+
- Index research notes or papers
|
|
13
|
+
- Build training data for AI assistants
|
|
14
|
+
|
|
15
|
+
**Key Question:** "Do you need a public website or backend logic?"
|
|
16
|
+
- If NO → Knowledge-Only is the right choice
|
|
17
|
+
|
|
18
|
+
## Structure
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
my-docs/
|
|
22
|
+
├── assets/
|
|
23
|
+
│ ├── app_description.md # Required
|
|
24
|
+
│ ├── icon.png # Required (512x512)
|
|
25
|
+
│ └── system_instructions.md # Required
|
|
26
|
+
└── kb/
|
|
27
|
+
├── staging/ # New files to push
|
|
28
|
+
├── General/ # Text-converted content
|
|
29
|
+
│ ├── README.md
|
|
30
|
+
│ ├── getting-started.md
|
|
31
|
+
│ ├── api-reference.md
|
|
32
|
+
│ └── tutorials/
|
|
33
|
+
│ └── ...
|
|
34
|
+
└── chunks/ # Processed chunks (JSON)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Note:** No `site/` or `microservice/` folders needed.
|
|
38
|
+
|
|
39
|
+
## Configuration (`workspace.json`)
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"communities": {
|
|
44
|
+
"my-community": {
|
|
45
|
+
"apps": {
|
|
46
|
+
"my-docs": {
|
|
47
|
+
"localPath": "my-community/my-docs",
|
|
48
|
+
"sync_mode": "git"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## CLI Workflow
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# 1. Pull content from Drive (if any)
|
|
60
|
+
descix kb pull -c <community> -a <app>
|
|
61
|
+
|
|
62
|
+
# 2. Add local files to staging
|
|
63
|
+
cp my-new-doc.pdf kb/staging/
|
|
64
|
+
|
|
65
|
+
# 3. Push to Drive (converts to text)
|
|
66
|
+
descix kb push -c <community> -a <app>
|
|
67
|
+
|
|
68
|
+
# 4. Pull converted text back
|
|
69
|
+
descix kb pull -c <community> -a <app>
|
|
70
|
+
|
|
71
|
+
# 5. Chunk for RAG
|
|
72
|
+
descix kb chunk -c <community> -a <app>
|
|
73
|
+
|
|
74
|
+
# 6. Sync to Pinecone
|
|
75
|
+
descix kb sync -c <community> -a <app>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Capabilities
|
|
79
|
+
|
|
80
|
+
| Capability | Enabled |
|
|
81
|
+
|------------|---------|
|
|
82
|
+
| RAG search | Yes |
|
|
83
|
+
| chat_with_kb | Yes |
|
|
84
|
+
| Public URL | No |
|
|
85
|
+
| MCP tools | No |
|
|
86
|
+
| tell_me_how discovery | No |
|
|
87
|
+
|
|
88
|
+
## Example Use Cases
|
|
89
|
+
|
|
90
|
+
1. **Research Library** - Index academic papers for semantic search
|
|
91
|
+
2. **Internal Docs** - Make company documentation searchable by AI
|
|
92
|
+
3. **Training Data** - Build a knowledge base for fine-tuning AI models
|
|
93
|
+
4. **Reference Materials** - API docs, specifications, standards
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# Microservice App Pattern
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
A Microservice app is a backend service that exposes commands via MCP, plus optional frontend and documentation.
|
|
6
|
+
|
|
7
|
+
## When to Use
|
|
8
|
+
|
|
9
|
+
Choose this pattern when the user wants to:
|
|
10
|
+
- Create API endpoints callable via MCP
|
|
11
|
+
- Build tools discoverable via `tell_me_how`
|
|
12
|
+
- Add backend logic to their app
|
|
13
|
+
- Integrate with external services
|
|
14
|
+
|
|
15
|
+
**Key Questions:**
|
|
16
|
+
1. "Does it have backend logic (API endpoints, commands)?" → Yes
|
|
17
|
+
2. "Should AI agents be able to discover and use its tools?" → Yes
|
|
18
|
+
|
|
19
|
+
## Structure
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
my-service/
|
|
23
|
+
├── assets/
|
|
24
|
+
│ ├── app_description.md
|
|
25
|
+
│ ├── icon.png
|
|
26
|
+
│ └── system_instructions.md
|
|
27
|
+
├── kb/
|
|
28
|
+
│ ├── staging/
|
|
29
|
+
│ ├── General/
|
|
30
|
+
│ │ ├── README.md
|
|
31
|
+
│ │ └── api-reference.md
|
|
32
|
+
│ └── chunks/
|
|
33
|
+
├── site/ # Optional frontend
|
|
34
|
+
│ └── ...
|
|
35
|
+
├── microservice/
|
|
36
|
+
│ ├── manifest.json # Command registration
|
|
37
|
+
│ ├── SERVICE_README_myapp.md # Tool discovery docs
|
|
38
|
+
│ ├── package.json
|
|
39
|
+
│ ├── Dockerfile
|
|
40
|
+
│ ├── app.yaml
|
|
41
|
+
│ └── src/
|
|
42
|
+
│ ├── index.js
|
|
43
|
+
│ ├── apiFront.js
|
|
44
|
+
│ └── commandHandlers/
|
|
45
|
+
│ └── myCommands.js
|
|
46
|
+
└── package.json
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Configuration (`workspace.json`)
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"communities": {
|
|
54
|
+
"my-community": {
|
|
55
|
+
"apps": {
|
|
56
|
+
"my-service": {
|
|
57
|
+
"localPath": "my-community/my-service",
|
|
58
|
+
"sync_mode": "git",
|
|
59
|
+
"service": {
|
|
60
|
+
"port": 4000,
|
|
61
|
+
"devCommand": "npm run start"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## CLI Workflow
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# 1. Create microservice scaffold
|
|
74
|
+
descix microservice init
|
|
75
|
+
|
|
76
|
+
# 2. Implement your commands in commandHandlers/
|
|
77
|
+
|
|
78
|
+
# 3. Register service with gateway
|
|
79
|
+
descix microservice register
|
|
80
|
+
|
|
81
|
+
# 4. Vectorize SERVICE_README for discovery
|
|
82
|
+
descix microservice vectorize
|
|
83
|
+
|
|
84
|
+
# 5. Sync KB
|
|
85
|
+
descix kb sync -c <community> -a <app>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Capabilities
|
|
89
|
+
|
|
90
|
+
| Capability | Enabled |
|
|
91
|
+
|------------|---------|
|
|
92
|
+
| RAG search | Yes |
|
|
93
|
+
| chat_with_kb | Yes |
|
|
94
|
+
| Public URL | Yes (via service) |
|
|
95
|
+
| MCP tools | Yes |
|
|
96
|
+
| tell_me_how discovery | Yes |
|
|
97
|
+
|
|
98
|
+
## Key Files
|
|
99
|
+
|
|
100
|
+
### manifest.json
|
|
101
|
+
|
|
102
|
+
Defines commands exposed to MCP:
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"service_id": "my-service",
|
|
107
|
+
"version": "1.0.0",
|
|
108
|
+
"commands": [
|
|
109
|
+
{
|
|
110
|
+
"name": "my_command",
|
|
111
|
+
"description": "What this command does",
|
|
112
|
+
"parameters": {
|
|
113
|
+
"param1": { "type": "string", "required": true }
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### SERVICE_README_{app_id}.md
|
|
121
|
+
|
|
122
|
+
Documentation for `tell_me_how` discovery:
|
|
123
|
+
|
|
124
|
+
```markdown
|
|
125
|
+
# My Service
|
|
126
|
+
|
|
127
|
+
## Overview
|
|
128
|
+
What this service does and when to use it.
|
|
129
|
+
|
|
130
|
+
## Commands
|
|
131
|
+
|
|
132
|
+
### my_command
|
|
133
|
+
**Description:** What it does
|
|
134
|
+
**Use when:** Scenarios when appropriate
|
|
135
|
+
**Parameters:**
|
|
136
|
+
- param1 (required): Description
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Microservice Scaffold
|
|
140
|
+
|
|
141
|
+
To add the microservice folder to an existing app:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
descix microservice init
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
This copies the full Express microservice template with:
|
|
148
|
+
- `app.js` - Server entry point
|
|
149
|
+
- `manifest.json` - Command registration
|
|
150
|
+
- `services/` - API handlers and utilities
|
|
151
|
+
- `Dockerfile` - Container build
|
|
152
|
+
- `SERVICE_README_TEMPLATE.md` - Discovery docs template
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Static Site App Pattern
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
A Static Site app is a built website (HTML/CSS/JS) deployed to CDN, plus documentation indexed for RAG. No backend logic.
|
|
6
|
+
|
|
7
|
+
## When to Use
|
|
8
|
+
|
|
9
|
+
Choose this pattern when the user wants to:
|
|
10
|
+
- Deploy a documentation site (VitePress, Docusaurus)
|
|
11
|
+
- Host a landing page or portfolio
|
|
12
|
+
- Create a marketing site with searchable content
|
|
13
|
+
- Build a client-side-only web app
|
|
14
|
+
|
|
15
|
+
**Key Questions:**
|
|
16
|
+
1. "Do you need a public website?" → Yes
|
|
17
|
+
2. "Does it have backend logic?" → No
|
|
18
|
+
|
|
19
|
+
## Structure
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
my-site/
|
|
23
|
+
├── assets/
|
|
24
|
+
│ ├── app_description.md
|
|
25
|
+
│ ├── icon.png
|
|
26
|
+
│ └── system_instructions.md
|
|
27
|
+
├── kb/
|
|
28
|
+
│ ├── staging/
|
|
29
|
+
│ ├── General/
|
|
30
|
+
│ │ ├── README.md
|
|
31
|
+
│ │ └── ... (markdown for RAG)
|
|
32
|
+
│ └── chunks/
|
|
33
|
+
├── site/ # Static files to deploy
|
|
34
|
+
│ ├── index.html
|
|
35
|
+
│ ├── styles.css
|
|
36
|
+
│ ├── app.js
|
|
37
|
+
│ └── dist/ # Build output (if using bundler)
|
|
38
|
+
├── src/ # Source files (not deployed)
|
|
39
|
+
│ └── ...
|
|
40
|
+
├── package.json
|
|
41
|
+
└── vite.config.js
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Configuration (`workspace.json`)
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"communities": {
|
|
49
|
+
"my-community": {
|
|
50
|
+
"apps": {
|
|
51
|
+
"my-site": {
|
|
52
|
+
"localPath": "my-community/my-site",
|
|
53
|
+
"sync_mode": "git",
|
|
54
|
+
"site": {
|
|
55
|
+
"port": 3000,
|
|
56
|
+
"devCommand": "npm run docs:dev"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## CLI Workflow
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# 1. Create site scaffold (if starting fresh)
|
|
69
|
+
descix site init
|
|
70
|
+
|
|
71
|
+
# 2. Build your site
|
|
72
|
+
npm run build
|
|
73
|
+
|
|
74
|
+
# 3. Upload site to GCS
|
|
75
|
+
descix site upload
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Capabilities
|
|
79
|
+
|
|
80
|
+
| Capability | Enabled |
|
|
81
|
+
|------------|---------|
|
|
82
|
+
| RAG search | Yes |
|
|
83
|
+
| chat_with_kb | Yes |
|
|
84
|
+
| Public URL | Yes |
|
|
85
|
+
| MCP tools | No |
|
|
86
|
+
| tell_me_how discovery | No |
|
|
87
|
+
|
|
88
|
+
## Example Use Cases
|
|
89
|
+
|
|
90
|
+
1. **Documentation Site** - VitePress/Docusaurus docs with searchable content
|
|
91
|
+
2. **Landing Page** - Marketing site for a project or product
|
|
92
|
+
3. **Portfolio** - Personal or company portfolio
|
|
93
|
+
4. **Client-Side App** - React/Vue app with no backend
|
|
94
|
+
|
|
95
|
+
## Site Scaffold
|
|
96
|
+
|
|
97
|
+
To add the site folder to an existing app:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
descix site init
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
This copies the site template with:
|
|
104
|
+
- `index.html` - Main entry point
|
|
105
|
+
- `styles.css` - Basic styling
|
|
106
|
+
- `app.js` - Client-side JavaScript
|
|
107
|
+
- `README.md` - Usage instructions
|
|
108
|
+
|
|
109
|
+
## Deployment
|
|
110
|
+
|
|
111
|
+
Static files are deployed to Google Cloud Storage and served via signed URLs. The site URL is available in the app's metadata.
|