@descix/cli 1.0.7 → 1.0.9

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.
Files changed (43) hide show
  1. package/README.md +1 -1
  2. package/agent-assets/guides/README.md +1 -1
  3. package/agent-assets/guides/dynamic-site-pattern.md +7 -16
  4. package/agent-assets/instructions/app-asset-validation.md +1 -1
  5. package/agent-assets/reference/architecture.md +20 -25
  6. package/agent-assets/reference/local-dev.md +1 -6
  7. package/agent-assets/reference/mcp-integration.md +15 -9
  8. package/agent-assets/reference/platform-api-consumer.md +11 -5
  9. package/agent-assets/reference/workspace-config.md +2 -2
  10. package/bin/descix.js +211 -688
  11. package/lib/command-visibility.js +213 -0
  12. package/lib/commands/corpus.js +2 -5
  13. package/lib/commands/kb.js +2 -2
  14. package/lib/commands/media-upload.js +176 -0
  15. package/lib/commands/retired-kb-sync.js +5 -27
  16. package/lib/commands/status.js +0 -9
  17. package/lib/output.js +31 -0
  18. package/lib/sdk-assets.js +28 -0
  19. package/lib/verb-invokes.generated.json +233 -0
  20. package/lib/workspace-config.js +9 -44
  21. package/package.json +6 -2
  22. package/templates/agent-claude.md +1 -3
  23. package/templates/agent-cline.md +1 -2
  24. package/templates/agent-copilot.md +1 -2
  25. package/templates/agent-cursor.md +1 -2
  26. package/templates/scaffolds/microservice/SERVICE_README_sdk.md +1 -1
  27. package/templates/scaffolds/microservice/templates/SERVICE_README_TEMPLATE.md +2 -3
  28. package/agent-assets/rules/descix_mcp.template.mdc +0 -243
  29. package/lib/commands/briefer/errors.js +0 -88
  30. package/lib/commands/briefer/index.js +0 -322
  31. package/lib/commands/briefer/sources/canonical-sources.js +0 -129
  32. package/lib/commands/briefer/sources/entitlements.js +0 -220
  33. package/lib/commands/briefer/sources/environments.js +0 -205
  34. package/lib/commands/briefer/sources/identifiers.js +0 -214
  35. package/lib/commands/briefer/sources/microservice-deploy.js +0 -267
  36. package/lib/commands/briefer/sources/routing.js +0 -275
  37. package/lib/commands/briefer/sources/what-is-not.js +0 -223
  38. package/lib/commands/briefer/stitcher.js +0 -134
  39. package/lib/commands/briefer/util/source-reader.js +0 -502
  40. package/lib/commands/mcp.js +0 -273
  41. package/lib/commands/update.js +0 -581
  42. package/lib/wizard/setup.js +0 -585
  43. package/templates/descix_mcp.mdc +0 -122
package/README.md CHANGED
@@ -75,7 +75,7 @@ now exit non-zero and name this replacement.
75
75
 
76
76
  1. **Create** the knowledge base (once per KB):
77
77
  ```bash
78
- descix kb create -c <community_id> -a <app_id> -k <kb_name>
78
+ descix app init -a <app_id> --kb <kb_name>
79
79
  ```
80
80
  2. **Author** a corpus manifest at `.descix/manifests/<kb_name>.json` describing the sources to sync.
81
81
  3. **Sync** the corpus to the platform (Pinecone):
@@ -49,7 +49,7 @@ Does the user need a public website?
49
49
  ### Dynamic Site
50
50
  - SSR app where microservice serves the site
51
51
  - Everything in `microservice/` (no separate `site/`)
52
- - Commands: `descix microservice deploy` (ADMIN/LOCAL only — public deploy is not open yet)
52
+ - Commands: `descix microservice init`, `descix serve` locally; public microservice deploy is not open
53
53
 
54
54
  ## Two-Tier Template System
55
55
 
@@ -82,16 +82,14 @@ One `env.products[]` entry, written by `descix app init` and `descix app set-por
82
82
  # 1. Create microservice scaffold
83
83
  descix microservice init
84
84
 
85
- # 2. Add SSR routes to your service
85
+ # 2. Add SSR routes to your service, run it locally behind the gateway
86
+ descix serve
86
87
 
87
- # 3. Deploy to Cloud Run (ADMIN/LOCAL ONLY — see note below)
88
- descix microservice deploy
89
-
90
- # 4. Register and vectorize
88
+ # 3. Register and vectorize (after the service is deployed — see Deployment)
91
89
  descix microservice register
92
90
  descix microservice vectorize
93
91
 
94
- # 5. Sync KB
92
+ # 4. Sync KB
95
93
  descix kb corpus sync -c <community> -a <app>
96
94
  ```
97
95
 
@@ -124,13 +122,6 @@ descix kb corpus sync -c <community> -a <app>
124
122
 
125
123
  Dynamic sites deploy to Google Cloud Run as a single container. The service handles both API requests and page rendering.
126
124
 
127
- ```bash
128
- # Deploy the microservice (includes site) — ADMIN/LOCAL ONLY
129
- descix microservice deploy
130
- ```
131
-
132
- > **`descix microservice deploy` is not open to every developer yet.** Its own help
133
- > marks it `[ADMIN/LOCAL]` — it shells out to the platform deploy script — and the
134
- > CLI states that public MCP deploy is "coming soon". If you are not a platform
135
- > admin, expect this step to fail on permissions rather than on your code. Build and
136
- > run locally with `descix serve` until the public path lands.
125
+ > **Public microservice deploy is not open.** The CLI has no deploy verb for developers; a
126
+ > microservice reaches Cloud Run only through the platform team. Build and run it locally
127
+ > with `descix serve`.
@@ -334,7 +334,7 @@ This folder doesn't appear to be configured as a DeSciX app.
334
334
 
335
335
  Options:
336
336
  1. Run `descix init` to configure this folder as a new app
337
- 2. Run `descix mcp quickstart` to configure the entire workspace
337
+ 2. Run `descix quickstart` to configure the entire workspace
338
338
  3. Check if this is the correct folder
339
339
 
340
340
  Which would you like to do?
@@ -176,32 +176,27 @@ Every key is written by a CLI verb (`descix config init --env …`, `descix app
176
176
 
177
177
  ## 4. CLI Commands
178
178
 
179
- The DeSciX CLI provides two primary ways to manage content: **Context-Aware Updates** (for high-level sync) and **KB Processing Commands** (for low-level control).
179
+ The DeSciX CLI publishes content with one verb per plane. Each command resolves app context from `workspace.json` based on the current working directory, or takes `-a <app_id>` explicitly.
180
180
 
181
- ### 4.1 Context-Aware Updates (`descix update`)
182
-
183
- These commands auto-detect app context from `workspace.json` based on the current working directory.
181
+ ### 4.1 Publish Commands
184
182
 
185
183
  | Command | Description |
186
184
  |---------|-------------|
187
- | `descix update` | Auto-detect what to update based on current folder |
188
- | `descix app sync-assets` | Sync app assets (icon, description, instructions) to Drive |
189
- | `descix kb corpus sync` | Full three-stage sync (Local → Drive → GCS → Pinecone) |
190
- | `descix site upload` | Deploy CodeSite to GCS |
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. |
192
-
193
- ### 4.2 KB Processing Commands (`descix kb`)
185
+ | `descix app sync-assets` | Sync app assets (`system_instructions.md`, `app_description.md`, `icon.png`) to the platform |
186
+ | `descix kb corpus sync` | Sync a knowledge base from the git files its manifest names to Pinecone |
187
+ | `descix site upload` | Deploy the site to GCS and record its path on the app |
194
188
 
195
- These commands provide granular control over the V2 local-first pipeline.
189
+ ### 4.2 KB Commands (`descix kb`, `descix drive`)
196
190
 
197
191
  | Command | Description |
198
192
  |---------|-------------|
199
- | `descix drive pull` | Download from Drive, convert to text in `kb/General/` |
200
- | `descix drive push` | Upload files from `kb/staging/` to Drive |
201
- | `descix kb corpus sync` | Generate JSON chunks from `kb/General/` to `kb/chunks/` |
202
- | `descix kb corpus sync` | Push chunks to Pinecone via backend API |
203
- | `descix kb corpus sync` | Convenience: pull → chunk → sync |
204
- | `descix kb corpus status` | Show sync status (local vs Pinecone) |
193
+ | `descix app init -a <app_id> --kb <kb_name>` | Create a knowledge base on the app |
194
+ | `descix kb corpus sync` | Sync the manifest's git files to Pinecone |
195
+ | `descix kb corpus status` | Show corpus sync state (files, chunks, last sync, resolved ref) |
196
+ | `descix kb list` | List knowledge bases for an app |
197
+ | `descix kb delete` | Delete a knowledge base (refuses a non-empty KB unless `--force`) |
198
+ | `descix drive pull` | Pull content from Drive and convert to local markdown |
199
+ | `descix drive push` | Push staging files to Drive |
205
200
 
206
201
  ### Scaffold Commands
207
202
 
@@ -209,7 +204,7 @@ These commands provide granular control over the V2 local-first pipeline.
209
204
  |---------|-------------|
210
205
  | `descix site init` | Copy site template to current app's `site/` folder |
211
206
  | `descix site upload` | Deploy site to GCS |
212
- | `descix site servelocal [port]` | Register local dev server port |
207
+ | `descix app set-site -a <app_id> --port <port>` | Register the local dev-server port for the app's site (`env.products[].site.port`) |
213
208
  | `descix microservice init` | Copy microservice template to current app's `microservice/` folder |
214
209
  | `descix microservice register` | Register microservice with gateway |
215
210
  | `descix microservice vectorize` | Vectorize README for discovery |
@@ -228,14 +223,15 @@ These commands provide granular control over the V2 local-first pipeline.
228
223
  ### Setup Command
229
224
 
230
225
  ```bash
231
- descix mcp quickstart
226
+ descix quickstart
232
227
  ```
233
228
 
234
229
  Flow:
235
- 1. Check prerequisites (gcloud CLI, ADC credentials)
236
- 2. Open browser for device login + workspace configuration
237
- 3. Hydrate local workspace from PWA selection
238
- 4. Create folder structure with new KB layout
230
+ 1. Device login in the browser (skipped when `.descix/wallet.json` holds a valid session)
231
+ 2. Create `.descix/workspace.json` (skipped when a workspace already exists up the tree)
232
+ 3. Write agent instruction files (`CLAUDE.md`, `.github/copilot-instructions.md`, `.cursorrules`, `.clinerules`)
233
+ 4. Write `.vscode/mcp.json` (skipped when the DeSciX extension handles MCP)
234
+ 5. Copy the SDK agent assets to `.descix/sdk-assets/` (fails loud if the package's assets are missing)
239
235
 
240
236
  ---
241
237
 
@@ -344,7 +340,6 @@ gcloud auth application-default login \
344
340
  ```
345
341
 
346
342
  **Verification:**
347
- - `descix mcp quickstart` checks ADC before proceeding
348
343
  - `Hydrator` calls `verifyDriveAuth()` before operations
349
344
 
350
345
  ### Backend Authentication
@@ -136,12 +136,7 @@ Check before you write: `--dry-run` enumerates would-be upserts and purges with
136
136
  writes (exit 0 = no drift, 1 = drift), and `--show-walk` prints the resolved ref and the walked
137
137
  files. `descix kb corpus status` shows files, chunks, last sync and resolved ref.
138
138
 
139
- **Only `.md` is ingested.** The corpus walk takes Markdown; a `.mdc` file is shipped and read
140
- from disk but never enters a knowledge base. That matters for
141
- `agent-assets/rules/descix_mcp.template.mdc`, which agents read as a file and which no amount of
142
- KB querying will surface. If you fix something there, the fix reaches readers of the file and
143
- nobody asking the KB — so do not assume KB coverage for a surface that has none. This is a known
144
- boundary, not a defect.
139
+ **Only text extensions are ingested.** The corpus walk takes `.md .txt .js .mjs .cjs .ts .tsx .jsx .py .rs .go .sol .lean .json .jsonl .yaml .yml .toml .csv .tex .sh .bash` (`PROCESSABLE_EXTENSIONS` in `lib/core/CorpusWalker.js`); any other file in a manifest source, `.mdc` included, never enters a knowledge base.
145
140
 
146
141
  #### What you put in a KB changes what comes out of it
147
142
 
@@ -138,9 +138,9 @@ tell_me_how({
138
138
 
139
139
  ### 3.5 Integration with SDK V2 Setup
140
140
 
141
- After `descix mcp quickstart` completes:
141
+ After `descix quickstart` completes:
142
142
 
143
- 1. `workspace.json` is created with community/app mappings
143
+ 1. `.descix/workspace.json` exists (created when none was found up the tree)
144
144
  2. Credentials are saved to `.descix/wallet.json`
145
145
  3. `tell_me_how --scope project` now filters by configured apps
146
146
  4. Agent can discover project-specific tools
@@ -238,16 +238,22 @@ const result = await execute_remote_command({
238
238
  ### 5.1 Initial Setup Phase
239
239
 
240
240
  ```
241
- descix mcp quickstart
241
+ descix quickstart
242
242
  │
243
243
  ▼
244
- Requires a prior `descix login` (refuses and names it otherwise)
244
+ Device login (skipped when .descix/wallet.json holds a valid session)
245
245
  │
246
246
  ▼
247
- Setup wizard (lib/wizard/setup.js)
247
+ .descix/workspace.json created (skipped when one exists up the tree)
248
248
  │
249
249
  ▼
250
- .cursor/rules/descix_mcp.mdc deployed
250
+ CLAUDE.md, .github/copilot-instructions.md, .cursorrules, .clinerules written
251
+ │
252
+ ▼
253
+ .vscode/mcp.json written (skipped when the DeSciX extension handles MCP)
254
+ │
255
+ ▼
256
+ .descix/sdk-assets/ copied (fails loud if the package's assets are missing)
251
257
  │
252
258
  ▼
253
259
  ✓ Ready for agent interaction
@@ -312,7 +318,7 @@ descix tell-me-how "How do I sync my knowledge base?"
312
318
 
313
319
  ### 6.2 workspace.json from Hydration
314
320
 
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`:
321
+ `descix config init --env …` creates `workspace.json`; `descix app init` adds the app's `env.products[]` entry; no verb writes `driveConfig.base_folder_id` — set it in `.descix/workspace.json` when you use `descix drive pull/push`:
316
322
 
317
323
  ```javascript
318
324
  {
@@ -366,7 +372,7 @@ if (tools.recommended_tools.length > 0) {
366
372
 
367
373
  **Pattern: Project-Scoped Operations**
368
374
  ```javascript
369
- // Only works after descix mcp quickstart
375
+ // Only works inside a workspace (descix quickstart or descix config init)
370
376
  const tools = await tell_me_how({
371
377
  question: "How do I update this app?",
372
378
  scope: "project" // Uses workspace.json
@@ -393,7 +399,7 @@ descix microservice vectorize -r SERVICE_README.md
393
399
  **Solution:**
394
400
  ```bash
395
401
  # Run setup first
396
- descix mcp quickstart
402
+ descix quickstart
397
403
 
398
404
  # Or ensure you're in the workspace root
399
405
  cd /path/to/workspace
@@ -91,11 +91,17 @@ ASSET NOT FOUND at gs://... Upload it first with `descix app media-upload`.
91
91
  Both come back as `MEDIA_ASSET_UNREADABLE`. The first means you referenced the wrong app's asset;
92
92
  the second means you have not uploaded yet. Upload into the app that will do the asking.
93
93
 
94
- **The upload verb hands you both forms, and both work.** `descix app media-upload` returns a
95
- `path` (relative to the app's assets prefix) and a `ref` (the `gs://` URI) for every file, plus a
96
- `public_url`; `--json` prints them for scripting. Either `path` or `ref` is a valid `asset_ref` —
97
- so if a rule in your head says the tool's own `ref` field is unusable, the rule is wrong, not the
98
- tool.
94
+ **The upload verb hands you the relative `path`, and it is a valid `asset_ref` as-is.** `descix
95
+ app media-upload` returns, per file, a `path` (relative to the app's assets prefix), a
96
+ `public_url` (the app-host form, e.g. `https://{app}.descix.net/assets/<path>`), `gcs_path` and
97
+ `content_type`; `--json` prints them for scripting. Pass `path` (or a `gs://` URI you construct
98
+ yourself) as `asset_ref` — either form works, see below.
99
+
100
+ **Who can upload, and how much.** Any app owner, community admin or platform admin may call
101
+ `media-upload` for that app. Storage is capped **200 MB per app today** (pending credit-based
102
+ metering for more) — the cap is enforced server-side by `get_asset_upload_token`, which refuses
103
+ with its own message when a would-be upload exceeds it; the CLI never pre-checks quota locally,
104
+ so trust that refusal over any local math.
99
105
 
100
106
  **The `gs://` form is accepted.** A `gs://` URI works as an `asset_ref` — it is parsed and
101
107
  scope-checked, and the handler then looks the object up by path. What is PROVEN is the form and
@@ -38,7 +38,7 @@ is the schema and the verb that owns each key.
38
38
  | `env.siteUrl` | the App Shell origin the gateway proxies `/` to (optional; default is the API origin) | `descix config set-site-url <url>` |
39
39
  | `env.products[]` | one entry per app in this workspace, see below | `descix app init`, `app set-site`, `app set-port`, `app set-localpath`, `app unmap` |
40
40
  | `env.platform` | the platform shell's own entry — platform contributors only; an app developer has none | platform runbook |
41
- | `driveConfig.base_folder_id` | the Drive base folder for `descix drive pull/push` | `descix mcp quickstart` |
41
+ | `driveConfig.base_folder_id` | the Drive base folder for `descix drive pull/push` | no verb; set it in `.descix/workspace.json` |
42
42
 
43
43
  A product entry:
44
44
 
@@ -135,7 +135,7 @@ gcloud auth application-default login \
135
135
  |-------|-------|--------|
136
136
  | "Could not load default credentials" | ADC not configured | `gcloud auth application-default login` |
137
137
  | "Drive authentication failed" | scopes missing | re-run with the Drive scopes above |
138
- | "base_folder_id missing" | Drive not registered | `descix mcp quickstart` |
138
+ | "Drive is not linked" | `driveConfig.base_folder_id` unset | set `driveConfig.base_folder_id` in `.descix/workspace.json`, or pass `--folder <id>` to `descix drive pull` |
139
139
 
140
140
  The git path (`descix kb corpus sync`) needs none of this.
141
141