@descix/cli 1.0.6 → 1.0.7

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.
@@ -61,25 +61,21 @@ Keeping the scaffold's shape is what lets the service keep inheriting platform b
61
61
 
62
62
  ## Configuration (`workspace.json`)
63
63
 
64
+ One `env.products[]` entry, written by `descix app init` and `descix app set-port` (never by hand):
65
+
64
66
  ```json
65
67
  {
66
- "communities": {
67
- "my-community": {
68
- "apps": {
69
- "my-dynamic-app": {
70
- "localPath": "my-community/my-dynamic-app",
71
- "sync_mode": "git",
72
- "service": {
73
- "port": 4000,
74
- "devCommand": "npm run dev"
75
- }
76
- }
77
- }
78
- }
79
- }
68
+ "appId": "my-community-my-dynamic-app",
69
+ "communityId": "my-community",
70
+ "localPath": "my-dynamic-app",
71
+ "kbId": "General",
72
+ "microservice": { "port": 4001 }
80
73
  }
81
74
  ```
82
75
 
76
+ `descix microservice init` refuses to run until `microservice.port` is set: the gateway routes
77
+ `/s/<app_id>` to that port and the service must start on it.
78
+
83
79
  ## CLI Workflow
84
80
 
85
81
  ```bash
@@ -38,18 +38,15 @@ my-docs/
38
38
 
39
39
  ## Configuration (`workspace.json`)
40
40
 
41
+ One `env.products[]` entry, written by `descix app init` (never by hand); no `site` and no
42
+ `microservice` slot:
43
+
41
44
  ```json
42
45
  {
43
- "communities": {
44
- "my-community": {
45
- "apps": {
46
- "my-docs": {
47
- "localPath": "my-community/my-docs",
48
- "sync_mode": "git"
49
- }
50
- }
51
- }
52
- }
46
+ "appId": "my-community-my-docs",
47
+ "communityId": "my-community",
48
+ "localPath": "my-docs",
49
+ "kbId": "General"
53
50
  }
54
51
  ```
55
52
 
@@ -68,13 +65,12 @@ descix drive push -c <community> -a <app>
68
65
  # 4. Pull converted text back
69
66
  descix drive pull -c <community> -a <app>
70
67
 
71
- # 5. Chunk for RAG
72
- descix kb corpus sync -c <community> -a <app>
73
-
74
- # 6. Sync to Pinecone
75
- descix kb corpus sync -c <community> -a <app>
68
+ # 5. Commit the pulled markdown, name its folder in .descix/manifests/<KB>.json, then chunk + sync to Pinecone in one pass
69
+ descix kb corpus sync -a <app>
76
70
  ```
77
71
 
72
+ The git path needs no Drive at all: commit markdown, name it in the manifest, run step 5.
73
+
78
74
  ## Capabilities
79
75
 
80
76
  | Capability | Enabled |
@@ -85,25 +85,23 @@ out until something depends on the difference.
85
85
 
86
86
  ## Configuration (`workspace.json`)
87
87
 
88
+ One `env.products[]` entry, written by `descix app init`, `descix app set-port` and (for the optional
89
+ frontend) `descix app set-site` — never by hand:
90
+
88
91
  ```json
89
92
  {
90
- "communities": {
91
- "my-community": {
92
- "apps": {
93
- "my-service": {
94
- "localPath": "my-community/my-service",
95
- "sync_mode": "git",
96
- "service": {
97
- "port": 4000,
98
- "devCommand": "npm run start"
99
- }
100
- }
101
- }
102
- }
103
- }
93
+ "appId": "my-community-my-service",
94
+ "communityId": "my-community",
95
+ "localPath": "my-service",
96
+ "kbId": "General",
97
+ "site": { "static": "site" },
98
+ "microservice": { "port": 4001 }
104
99
  }
105
100
  ```
106
101
 
102
+ `descix microservice init` refuses to run until `microservice.port` is set: the gateway routes
103
+ `/s/<app_id>` to that port and the service must start on it.
104
+
107
105
  ## CLI Workflow
108
106
 
109
107
  ```bash
@@ -45,25 +45,22 @@ my-site/
45
45
 
46
46
  ## Configuration (`workspace.json`)
47
47
 
48
+ One `env.products[]` entry, written by `descix app init` and `descix app set-site` (never by hand):
49
+
48
50
  ```json
49
51
  {
50
- "communities": {
51
- "my-community": {
52
- "apps": {
53
- "my-site": {
54
- "localPath": "my-community/my-site",
55
- "sync_mode": "git",
56
- "site": {
57
- "port": 3000,
58
- "devCommand": "npm run docs:dev"
59
- }
60
- }
61
- }
62
- }
63
- }
52
+ "appId": "my-community-my-site",
53
+ "communityId": "my-community",
54
+ "localPath": "my-site",
55
+ "kbId": "General",
56
+ "site": { "static": "site" }
64
57
  }
65
58
  ```
66
59
 
60
+ For a framework dev server instead of files on disk, `descix app set-site -a <app_id> --port 3000`
61
+ writes `"site": { "port": 3000 }`; the gateway proxies `/p/<app_id>` to it without rewriting paths,
62
+ so the framework's base path must be `/p/<app_id>/`.
63
+
67
64
  ## CLI Workflow
68
65
 
69
66
  ```bash
@@ -116,4 +113,4 @@ This copies the site template with:
116
113
 
117
114
  ## Deployment
118
115
 
119
- Static files are deployed to Google Cloud Storage and served via signed URLs. The site URL is available in the app's metadata.
116
+ `descix site upload -a <app_id>` uploads the files (delta) to the app's site prefix in Google Cloud Storage and records the deploy manifest. The app is then served on its own host, `https://<app_id>.dev.descix.net/` on DEV and `https://<app_id>.descix.net/` on PROD; `descix site status -c <community> -a <app_id>` shows the deployed manifest.
@@ -17,13 +17,13 @@ Purpose: Maps local folders to DeSciX apps and stores all configuration.
17
17
  ```json
18
18
  {
19
19
  "version": "2.0",
20
- "primaryCommunity": "descix",
20
+ "primaryCommunity": "daita",
21
21
  "communities": {
22
- "descix": {
22
+ "daita": {
23
23
  "apps": {
24
24
  "appsdk": {
25
- "localPath": "descix/appsdk",
26
- "absolutePath": "/path/to/workspace/descix/appsdk",
25
+ "localPath": "daita/appsdk",
26
+ "absolutePath": "/path/to/workspace/daita/appsdk",
27
27
  "kbId": "General"
28
28
  }
29
29
  }
@@ -4,16 +4,17 @@
4
4
  **Version:** 2.0
5
5
  **Last Updated:** January 2026
6
6
 
7
- This document describes how apps and communities are created and hydrated in the DeSciX platform.
7
+ This document describes how apps and communities are created in the DeSciX platform and how the local workspace for an app is set up.
8
8
 
9
9
  ---
10
10
 
11
11
  ## 1. Core Philosophy
12
12
 
13
- **"PWA for Provisioning, CLI for Development"**
13
+ **"One path to an app"**
14
14
 
15
- - **Provisioning:** All apps and communities are created through the PWA. This enforces entitlement checks (NFTs, subscriptions) and ensures consistent folder structures via Drive templates.
16
- - **Development:** The CLI is the primary tool for hydrating the local workspace, managing content, and syncing to the cloud. The CLI does not create apps directly.
15
+ - **Apps:** `descix app init -a <name> -c <community> -p <dir>` creates the app on the platform (`create_app_for_community`, which composes the id `<community>-<short>` and guarantees the default KB) and registers it in the local workspace in one idempotent step. The PWA creates apps too; both reach the same server command. Entitlement checks run server-side either way.
16
+ - **Communities:** created by platform admins only (`descix community create` is `[ADMIN]` and writes live Polygon). A developer builds inside an existing community.
17
+ - **Development:** the CLI is the tool for the local workspace, content, and syncing to the cloud.
17
18
 
18
19
  **Important Distinction:**
19
20
 
@@ -128,7 +129,7 @@ the file to open first.
128
129
 
129
130
  ### Adding Scaffolds to Apps
130
131
 
131
- After an app is created via PWA, add code scaffolds via CLI:
132
+ After `descix app init` (or PWA creation), add code scaffolds via CLI:
132
133
 
133
134
  ```bash
134
135
  # Add site scaffold
@@ -213,96 +214,29 @@ sequenceDiagram
213
214
 
214
215
  ---
215
216
 
216
- ## 4. Workspace Builder
217
+ ## 4. Local Workspace
217
218
 
218
- The PWA Workspace Builder allows users to configure which apps to sync to their local workspace.
219
-
220
- ### Flow
221
-
222
- 1. User completes device login (`descix login --setup`)
223
- 2. PWA opens with Workspace Builder
224
- 3. User selects/creates apps to include
225
- 4. PWA returns `workspace_config` to CLI
226
- 5. CLI hydrates local folders
227
-
228
- ### Workspace Config Response
229
-
230
- ```json
231
- {
232
- "workspace_config": {
233
- "communities": {
234
- "descix": {
235
- "apps": {
236
- "agent": {
237
- "localPath": "descix/agent",
238
- "sync_mode": "git"
239
- }
240
- }
241
- }
242
- }
243
- },
244
- "drive_config": {
245
- "base_folder_id": "1ABC..."
246
- }
247
- }
248
- ```
249
-
250
- ---
251
-
252
- ## 5. CLI Hydration
253
-
254
- ### Setup Command
219
+ There is no PWA "workspace builder" hand-off and no hydration step. The local workspace is built by
220
+ CLI verbs, each writing one part of `.descix/workspace.json` (v2.1 — see `workspace-config.md`):
255
221
 
256
222
  ```bash
257
- descix mcp quickstart
223
+ descix config init --env dev # creates .descix/workspace.json, pins env.apiUrl
224
+ descix login # .descix/wallet.json (add it to .gitignore yourself)
225
+ descix app init -a <name> -c <community> -p . # env.products[] entry + site/ microservice/ assets/ + default KB
226
+ descix app set-site -a <app_id> --static site # what the gateway serves at /p/<app_id>
227
+ descix app set-port -a <app_id> -p 4001 # required before descix microservice init
258
228
  ```
259
229
 
260
- **Flow:**
261
- 1. Check prerequisites (gcloud CLI, ADC)
262
- 2. Verify Drive access
263
- 3. Open browser for device login
264
- 4. Receive workspace config from PWA
265
- 5. Call `Hydrator.hydrateWorkspace()`
266
- 6. Create local folder structure
267
- 7. Pull content from Drive
268
-
269
- ### Hydration Process
270
-
271
- The `Hydrator` module handles all folder creation and content sync:
272
-
273
- ```javascript
274
- // Hydrator.hydrateWorkspace() creates:
275
- [workspace]/
276
- ├── .descix/
277
- │ └── workspace.json # Workspace configuration (sole config file)
278
- ├── [community]/[app]/
279
- │ ├── assets/
280
- │ ├── kb/
281
- │ │ ├── staging/ # For local files to push to Drive
282
- │ │ ├── General/ # Converted text from Drive
283
- │ │ └── chunks/ # Generated chunk files
284
- │ ├── site/ # Optional: for CodeSite
285
- │ └── microservice/ # Optional: for backend service
286
- └── .gitignore # Updated with .descix/wallet.json
287
- ```
288
-
289
- **Note:** App configuration is stored in `workspace.json`, not in per-app `context.json` files. The CLI auto-detects app context based on the current working directory.
290
-
291
- ### Hydrating Individual Apps
292
-
293
- After initial setup, users can hydrate specific apps:
294
-
295
- ```bash
296
- # Pull entire app from Drive
297
- descix drive pull -c community -a app
298
-
299
- # Or use the build command for full pipeline
300
- descix kb corpus sync
301
- ```
230
+ `descix app init` creates `site/`, `microservice/` and `assets/` (with starter
231
+ `system_instructions.md` and `app_description.md`) under the app directory. Knowledge-base content
232
+ is whatever your corpus manifest names (`.descix/manifests/<KB>.json`); Drive content arrives via
233
+ `descix drive pull -c <community> -a <app_id>` into `kb/<KB>/` and goes back via `descix drive push`.
234
+ The CLI auto-detects the app from the directory you are standing in; `-c`/`-a` flags win over
235
+ detection.
302
236
 
303
237
  ---
304
238
 
305
- ## 6. Folder Structure Standards
239
+ ## 5. Folder Structure Standards
306
240
 
307
241
  ### App Folders
308
242
 
@@ -328,7 +262,7 @@ descix kb corpus sync
328
262
 
329
263
  ---
330
264
 
331
- ## 7. Entitlement Checks
265
+ ## 6. Entitlement Checks
332
266
 
333
267
  App creation requires appropriate entitlements:
334
268
 
@@ -343,7 +277,7 @@ The PWA and backend enforce these checks before template copying.
343
277
 
344
278
  ---
345
279
 
346
- ## 8. Key Backend Functions
280
+ ## 7. Key Backend Functions
347
281
 
348
282
  ### Template Copying
349
283
 
@@ -366,28 +300,29 @@ async function copyFolderRecursive(sourceFolderId, destParentId, newName) {
366
300
 
367
301
  ---
368
302
 
369
- ## 9. CLI Commands
303
+ ## 8. CLI Commands
370
304
 
371
- ### App Management (via PWA)
305
+ ### App Creation
372
306
 
373
- The CLI does not create apps directly. Users should:
307
+ ```bash
308
+ descix config init --env dev # pin the environment first (no default)
309
+ descix login # device-code sign-in
310
+ descix app init -a <name> -c <community> -p . # create on the platform + register locally + default KB
311
+ ```
374
312
 
375
- 1. Go to PWA dashboard
376
- 2. Create app/community
377
- 3. Run `descix mcp quickstart` or `descix login --setup` to hydrate
313
+ An app created in the PWA is initialized locally with the same verb, minus `-c`:
314
+ `descix app init -a <app_id> -p .`.
378
315
 
379
316
  ### Post-Creation Commands
380
317
 
381
318
  ```bash
382
- # After app is created via PWA:
383
- descix mcp quickstart # Hydrate workspace (first time)
384
- descix kb corpus sync # Pull, chunk, sync KB
385
- descix site upload -a app # Deploy static site
319
+ descix kb corpus sync -a <app_id> # chunk + sync the manifest's sources to Pinecone
320
+ descix site upload -a <app_id> # deploy the static site
386
321
  ```
387
322
 
388
323
  ---
389
324
 
390
- ## 10. File References
325
+ ## 9. File References
391
326
 
392
327
  | Component | Path | Description |
393
328
  |-----------|------|-------------|
@@ -397,7 +332,7 @@ descix site upload -a app # Deploy static site
397
332
  | Template Config | `DeSciX_Cloud/microservice/defaults-config.json` | Template folder IDs |
398
333
  | Drive Templates | `DeSciX_Core/descix-cli/templates/drive/` | Content templates |
399
334
  | Git Scaffolds | `DeSciX_Core/descix-cli/templates/scaffolds/` | Code scaffolds |
400
- | Hydrator | `DeSciX_Core/descix-cli/lib/core/Hydrator.js` | Workspace hydration |
335
+ | Hydrator | `DeSciX_Core/descix-cli/lib/core/Hydrator.js` | `copyScaffold` — copies the site / microservice scaffold into an app |
401
336
  | WorkspaceConfig | `DeSciX_Core/descix-cli/lib/workspace-config.js` | CLI configuration |
402
337
  | Setup Command | `DeSciX_Core/descix-cli/lib/wizard/setup.js` | Initial setup |
403
338
  | Scaffold Command | `DeSciX_Core/descix-cli/bin/descix.js` | CLI scaffolds |
@@ -41,7 +41,7 @@ All core SDK logic resides in `DeSciX_Core/descix-cli/lib/core/`.
41
41
 
42
42
  | Function | Description |
43
43
  |----------|-------------|
44
- | `hydrateWorkspace(root, config, driveConfig, options)` | Full workspace setup with folder creation and Drive sync |
44
+ | `copyScaffold(type, appPath, options)` | Copy the `site` or `microservice` scaffold into an app (`descix site init` / `descix microservice init`) |
45
45
  | `hydrateApp(config, options)` | Pull entire app from Drive |
46
46
  | `hydrateKb(config, options)` | Pull and convert KB files from Drive |
47
47
  | `pushStaging(config, options)` | Upload files from `kb/staging/` to Drive |
@@ -146,33 +146,30 @@ All core SDK logic resides in `DeSciX_Core/descix-cli/lib/core/`.
146
146
 
147
147
  ```json
148
148
  {
149
- "version": "2.0",
150
- "communities": {
151
- "descix": {
152
- "apps": {
153
- "agent": {
154
- "localPath": "descix/agent",
155
- "kbId": "General",
156
- "absolutePath": "/path/to/workspace/descix/agent",
157
- "site": {
158
- "port": 3000,
159
- "devCommand": "npm run docs:dev"
160
- },
161
- "service": {
162
- "port": 4001,
163
- "devCommand": "npm run start"
164
- }
165
- }
149
+ "version": "2.1",
150
+ "type": "workspace",
151
+ "workspaceRoot": "/path/to/workspace",
152
+ "env": {
153
+ "environment": "DEV",
154
+ "apiUrl": "https://dev.descix.net",
155
+ "gateway": { "port": 5599 },
156
+ "products": [
157
+ {
158
+ "appId": "daita-agent",
159
+ "communityId": "daita",
160
+ "localPath": "daita/agent",
161
+ "kbId": "General",
162
+ "site": { "port": 3000 },
163
+ "microservice": { "port": 4001 }
166
164
  }
167
- }
165
+ ]
168
166
  },
169
- "driveConfig": {
170
- "base_folder_id": "1ABC...",
171
- "base_folder_name": "DeSciX"
172
- }
167
+ "driveConfig": { "base_folder_id": "1ABC..." }
173
168
  }
174
169
  ```
175
170
 
171
+ Every key is written by a CLI verb (`descix config init --env …`, `descix app init`, `descix app set-site`, `descix app set-port`, …) — see `workspace-config.md` for the key → verb table. A `communities` block without `env` (the v1 shape) is refused on load.
172
+
176
173
  **Note:** `.descix.app/context.json` files are no longer used. All app configuration is stored in `workspace.json`. The CLI auto-detects app context from the current working directory by matching against registered app paths.
177
174
 
178
175
  ---
@@ -191,7 +188,7 @@ These commands auto-detect app context from `workspace.json` based on the curren
191
188
  | `descix app sync-assets` | Sync app assets (icon, description, instructions) to Drive |
192
189
  | `descix kb corpus sync` | Full three-stage sync (Local → Drive → GCS → Pinecone) |
193
190
  | `descix site upload` | Deploy CodeSite to GCS |
194
- | ~~`descix update all`~~ | **Deleted.** There is no single all-resources verb. Run the three canonical commands: `descix app sync-assets`, `descix kb corpus sync`, `descix site upload`. |
191
+ | `descix update all` | App assets + site in sequence. It does **not** touch the knowledge base (`update kb` is removed): run `descix kb corpus sync` for that. |
195
192
 
196
193
  ### 4.2 KB Processing Commands (`descix kb`)
197
194
 
@@ -256,15 +253,15 @@ Flow:
256
253
 
257
254
  ```json
258
255
  {
259
- "community_id": "descix",
256
+ "community_id": "daita",
260
257
  "app_id": "agent",
261
258
  "kb_id": "General",
262
259
  "chunks": [
263
260
  {
264
- "id": "descix_agent_General_research_0",
261
+ "id": "daita_agent_General_research_0",
265
262
  "text": "...",
266
263
  "entity_type": "CHUNK",
267
- "community_id": "descix",
264
+ "community_id": "daita",
268
265
  "app_id": "agent",
269
266
  "knowledgebase_name": "General",
270
267
  "file_id": "research.md",
@@ -71,7 +71,7 @@ All MCP calls include a `_descix` context object for identity propagation:
71
71
  expires_at: "..."
72
72
  },
73
73
  workspace: {
74
- community_id: "descix",
74
+ community_id: "daita",
75
75
  app_id: "agent"
76
76
  }
77
77
  }
@@ -224,7 +224,7 @@ const plan = await tell_me_how({
224
224
  const result = await execute_remote_command({
225
225
  command: plan.recommended_tools[0].name,
226
226
  params: {
227
- community_id: "descix",
227
+ community_id: "daita",
228
228
  app_id: "agent",
229
229
  kb_id: "General"
230
230
  }
@@ -241,19 +241,13 @@ const result = await execute_remote_command({
241
241
  descix mcp quickstart
242
242
  │
243
243
  ▼
244
- Prerequisites Check (gcloud, ADC)
244
+ Requires a prior `descix login` (refuses and names it otherwise)
245
245
  │
246
246
  ▼
247
- Device Login (browser)
247
+ Setup wizard (lib/wizard/setup.js)
248
248
  │
249
249
  ▼
250
- Workspace Builder (PWA)
251
- │
252
- ▼
253
- Hydration (Hydrator module)
254
- │
255
- ▼
256
- Credentials Saved (.descix/wallet.json)
250
+ .cursor/rules/descix_mcp.mdc deployed
257
251
  │
258
252
  ▼
259
253
  ✓ Ready for agent interaction
@@ -290,18 +284,17 @@ When `--scope project` is used:
290
284
  4. Returns focused recommendations
291
285
 
292
286
  ```javascript
293
- // workspace.json
287
+ // workspace.json (v2.1)
294
288
  {
295
- "communities": {
296
- "descix": {
297
- "apps": {
298
- "agent": { "localPath": ".", "sync_mode": "git" }
299
- }
300
- }
289
+ "env": {
290
+ "apiUrl": "https://dev.descix.net",
291
+ "products": [
292
+ { "appId": "daita-agent", "communityId": "daita", "localPath": ".", "kbId": "General" }
293
+ ]
301
294
  }
302
295
  }
303
296
 
304
- // tell_me_how with project scope only searches within descix/agent
297
+ // tell_me_how with project scope only searches within daita-agent
305
298
  ```
306
299
 
307
300
  ---
@@ -319,12 +312,11 @@ descix tell-me-how "How do I sync my knowledge base?"
319
312
 
320
313
  ### 6.2 workspace.json from Hydration
321
314
 
322
- The `Hydrator` module creates `workspace.json` during setup:
315
+ `descix config init --env …` creates `workspace.json`; `descix app init` adds the app's `env.products[]` entry; `descix mcp quickstart` fills `driveConfig.base_folder_id`:
323
316
 
324
317
  ```javascript
325
- // Created by Hydrator.hydrateWorkspace()
326
318
  {
327
- "communities": { ... },
319
+ "env": { "apiUrl": "https://dev.descix.net", "products": [ /* one entry per app */ ] },
328
320
  "driveConfig": {
329
321
  "base_folder_id": "..." // For tell_me_how project scope
330
322
  }