@descix/cli 1.0.9 → 1.0.10
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/agent-assets/instructions/onboarding-flow.md +6 -0
- package/agent-assets/reference/local-dev.md +41 -1
- package/agent-assets/reference/workspace-config.md +1 -1
- package/bin/descix.js +31 -0
- package/bin/mcp-server.js +24 -0
- package/lib/commands/dev-certs.js +93 -0
- package/lib/commands/doctor.js +31 -3
- package/lib/dev-cert-resolver.js +50 -0
- package/lib/verb-invokes.generated.json +2 -0
- package/package.json +3 -3
- package/templates/agent-claude.md +10 -0
- package/templates/agent-cline.md +10 -0
- package/templates/agent-copilot.md +10 -0
- package/templates/agent-cursor.md +10 -0
|
@@ -294,6 +294,12 @@ User is trying to configure an app they don't own. Suggest purchase.
|
|
|
294
294
|
### "Folder already configured"
|
|
295
295
|
Check if configuration matches intended app. Offer to update or skip.
|
|
296
296
|
|
|
297
|
+
### Powch sign-in under `descix serve` fails ("User cancelled", or "WebAuthn is not supported on sites with TLS certificate errors")
|
|
298
|
+
The gateway's dev certificate is not trusted. Run `descix dev-certs check`. If it is not trusted,
|
|
299
|
+
give the user exactly `descix dev-certs trust` to run (macOS password prompt), tell them to quit
|
|
300
|
+
and reopen Chrome, then run `descix dev-certs check` again. Details and Linux/Windows notes:
|
|
301
|
+
`reference/local-dev.md` §3.3.
|
|
302
|
+
|
|
297
303
|
## Next Steps After Onboarding
|
|
298
304
|
|
|
299
305
|
Once configured, guide user to:
|
|
@@ -187,11 +187,51 @@ a different case and FAILS LOUD naming the remedy, rather than quietly becoming
|
|
|
187
187
|
|
|
188
188
|
The derived Shell rule is the important one: point the API at a cloud environment and the shell comes from that same origin, so one origin carries shell + app + `/apifront` with nothing else configured. A stale `env.platform.site` block does not hijack the root once the API is remote. Platform developers opt IN to a local shell by naming it (`--site-url https://localhost:5174` or `env.siteUrl`).
|
|
189
189
|
|
|
190
|
+
### 3.3. The dev certificate and passkey sign-in
|
|
191
|
+
|
|
192
|
+
The gateway's HTTPS uses one certificate: the pair named by `env.devCerts`
|
|
193
|
+
(`descix config set-dev-certs`), else the SDK's shipped self-signed pair (SAN `localhost`,
|
|
194
|
+
`127.0.0.1`, `::1`). The same pair serves every app dev server behind the gateway.
|
|
195
|
+
|
|
196
|
+
**Chrome refuses WebAuthn on a tab whose certificate is untrusted, and it judges the whole tab.**
|
|
197
|
+
The Powch sign-in iframe on `powch.descix.net` therefore fails inside an untrusted
|
|
198
|
+
`https://localhost:<port>` tab, even though Powch's own origin is trusted.
|
|
199
|
+
|
|
200
|
+
| Symptom | Meaning |
|
|
201
|
+
|---|---|
|
|
202
|
+
| Powch/ChatWidget log shows only `User cancelled` on sign-in | Powch's panel-close rejection; the real error is in the browser console |
|
|
203
|
+
| Browser console: `NotAllowedError: WebAuthn is not supported on sites with TLS certificate errors` | the gateway certificate is not trusted (or has expired) |
|
|
204
|
+
| `descix serve` banner: `Passkey sign-in will fail: <reason>. Run: descix dev-certs trust` | same, detected before the browser opens |
|
|
205
|
+
| `descix doctor` row "Dev certificate" not passing | same |
|
|
206
|
+
|
|
207
|
+
| Command | Who runs it | Effect |
|
|
208
|
+
|---|---|---|
|
|
209
|
+
| `descix dev-certs check [--json]` | the assisting agent | resolves the cert the gateway uses; exits 0 only when it is trusted; reports `unverifiable` with the reason on Linux and Windows |
|
|
210
|
+
| `descix doctor` | the assisting agent | includes the same result as the "Dev certificate" check |
|
|
211
|
+
| `descix dev-certs trust` | **the human** | macOS: trusts that cert in the login keychain (password prompt), re-checks, and says to quit and reopen Chrome |
|
|
212
|
+
|
|
213
|
+
**Assisting-agent flow:**
|
|
214
|
+
|
|
215
|
+
1. Run `descix doctor` (or `descix dev-certs check`).
|
|
216
|
+
2. If the dev certificate is trusted, continue. Passkey failures then have another cause.
|
|
217
|
+
3. If it is not trusted, hand the human exactly one command to run in their own terminal:
|
|
218
|
+
`descix dev-certs trust`. It needs their macOS login password, so the agent does not run it.
|
|
219
|
+
4. When they report it succeeded, tell them to **quit Chrome completely and reopen it** (a running
|
|
220
|
+
Chrome keeps its old verdict), reload the `descix serve` URL, and sign in again.
|
|
221
|
+
5. Run `descix dev-certs check` again and confirm exit 0 before calling sign-in fixed.
|
|
222
|
+
|
|
223
|
+
**Linux and Windows:** the check reports `unverifiable`, and `descix dev-certs trust` is macOS-only.
|
|
224
|
+
Trusting the cert is a manual step that has not been verified on DeSciX: import the gateway's
|
|
225
|
+
`cert.pem` into the store Chrome reads (Linux: the NSS database,
|
|
226
|
+
`certutil -d sql:$HOME/.pki/nssdb -A -t "P,," -n descix-localhost -i <cert.pem>`; Windows: the
|
|
227
|
+
Current User "Trusted Root Certification Authorities" store), then restart the browser. Tell the
|
|
228
|
+
human it is unverified.
|
|
229
|
+
|
|
190
230
|
## 4. Scenarios
|
|
191
231
|
|
|
192
232
|
### Scenario 1: App Dev (the common case)
|
|
193
233
|
* **User**: App developer. No platform checkout.
|
|
194
|
-
* **Setup**: `descix config set-env dev`, `descix app init`, `descix app set-site`, then `cd my-app && descix serve`.
|
|
234
|
+
* **Setup**: `descix config set-env dev`, `descix app init`, `descix app set-site`, `descix dev-certs check` (if not trusted, the human runs `descix dev-certs trust` once — §3.3), then `cd my-app && descix serve`.
|
|
195
235
|
* **Result**: one HTTPS origin. `/` → the cloud App Shell, `/apifront` → the cloud API, `/p/my-app` → your app, and the shell boots **standalone into your app** — its INITIAL VIEW is your app rather than the store, with the platform views still reachable from there.
|
|
196
236
|
|
|
197
237
|
### Scenario 2: Platform Dev ("Dogfooding")
|
|
@@ -33,7 +33,7 @@ is the schema and the verb that owns each key.
|
|
|
33
33
|
| `env.environment` | `DEV`, `DEMO` or `PROD` | `descix config init --env dev\|demo\|prod` |
|
|
34
34
|
| `env.apiUrl` | the API origin this workspace talks to | `descix config init --env …` (known envs) / `descix config set-env <name> --url <origin>` (custom) |
|
|
35
35
|
| `env.gateway.port` | the port `descix serve` listens on | `descix config set-gateway-port <port>` |
|
|
36
|
-
| `env.devCerts` | `dir`, or `cert` + `key` — the TLS pair for the gateway and every app behind it | `descix config set-dev-certs --dir\|--cert\|--key\|--clear` |
|
|
36
|
+
| `env.devCerts` | `dir`, or `cert` + `key` — the TLS pair for the gateway and every app behind it; unset means the SDK's shipped pair. Passkey sign-in needs it trusted: `descix dev-certs check`, then the human runs `descix dev-certs trust` (see `reference/local-dev.md` §3.3) | `descix config set-dev-certs --dir\|--cert\|--key\|--clear` |
|
|
37
37
|
| `env.powchUrl` | Powch's own origin (optional; Powch is cross-origin from the shell by design) | `descix config set-powch-url <url>` |
|
|
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` |
|
package/bin/descix.js
CHANGED
|
@@ -4493,6 +4493,37 @@ program
|
|
|
4493
4493
|
}
|
|
4494
4494
|
});
|
|
4495
4495
|
|
|
4496
|
+
// ============ Dev Certs Commands ============
|
|
4497
|
+
|
|
4498
|
+
const devCertsCommand = program
|
|
4499
|
+
.command('dev-certs')
|
|
4500
|
+
.description('TLS dev-cert trust status for `descix serve` — passkey sign-in needs this cert trusted once per machine');
|
|
4501
|
+
|
|
4502
|
+
devCertsCommand
|
|
4503
|
+
.command('check')
|
|
4504
|
+
.description('Check whether the dev-server cert is trusted for https://localhost (exit 0 only when trusted)')
|
|
4505
|
+
.option('--json', 'Output raw JSON')
|
|
4506
|
+
.action(async (options) => {
|
|
4507
|
+
try {
|
|
4508
|
+
const { runDevCertsCheck } = await import('../lib/commands/dev-certs.js');
|
|
4509
|
+
await runDevCertsCheck(options);
|
|
4510
|
+
} catch (error) {
|
|
4511
|
+
fail(error);
|
|
4512
|
+
}
|
|
4513
|
+
});
|
|
4514
|
+
|
|
4515
|
+
devCertsCommand
|
|
4516
|
+
.command('trust')
|
|
4517
|
+
.description('Trust the dev-server cert in the macOS keychain (prompts for your password)')
|
|
4518
|
+
.action(async () => {
|
|
4519
|
+
try {
|
|
4520
|
+
const { runDevCertsTrust } = await import('../lib/commands/dev-certs.js');
|
|
4521
|
+
await runDevCertsTrust();
|
|
4522
|
+
} catch (error) {
|
|
4523
|
+
fail(error);
|
|
4524
|
+
}
|
|
4525
|
+
});
|
|
4526
|
+
|
|
4496
4527
|
// ============ Quickstart Command ============
|
|
4497
4528
|
|
|
4498
4529
|
program
|
package/bin/mcp-server.js
CHANGED
|
@@ -21,6 +21,8 @@ import { WorkspaceConfig } from '../lib/workspace-config.js';
|
|
|
21
21
|
import { DeSciXApiClient } from '../lib/api-client.js';
|
|
22
22
|
import { WalletFileManager } from '../lib/wallet-file.js';
|
|
23
23
|
import { CLI_VERSION } from '../lib/cli-version.js';
|
|
24
|
+
import { checkDevCert } from '@descix/app-sdk/dev';
|
|
25
|
+
import { resolveGatewayCertContext } from '../lib/dev-cert-resolver.js';
|
|
24
26
|
import * as fs from 'fs/promises';
|
|
25
27
|
import * as path from 'path';
|
|
26
28
|
// WS-MCP-SSOT-TIER2 (audit §5.B-1): the curated HTTP-valid core tools are the SINGLE SOURCE
|
|
@@ -322,6 +324,28 @@ try {
|
|
|
322
324
|
}
|
|
323
325
|
}
|
|
324
326
|
|
|
327
|
+
// Dev certificate — the ONE owner (checkDevCert, shared with `descix
|
|
328
|
+
// dev-certs`, `descix doctor` and the `descix serve` banner). An untrusted
|
|
329
|
+
// cert is invisible from inside a WebAuthn ceremony: Chrome judges the
|
|
330
|
+
// whole tab's TLS state and Powch only ever sees "User cancelled", so an
|
|
331
|
+
// agent assisting a stuck developer needs this named explicitly, not
|
|
332
|
+
// inferred from a login failure.
|
|
333
|
+
try {
|
|
334
|
+
const { certPath } = resolveGatewayCertContext(checkRoot);
|
|
335
|
+
const certResult = checkDevCert({ certPath });
|
|
336
|
+
report.dev_cert = { cert_path: certPath, ...certResult };
|
|
337
|
+
if (certResult.status !== 'trusted') {
|
|
338
|
+
report.warnings.push(
|
|
339
|
+
'Dev certificate not trusted: passkey sign-in under descix serve will fail ' +
|
|
340
|
+
'(Powch logs "User cancelled"; the console says "WebAuthn is not supported on sites ' +
|
|
341
|
+
'with TLS certificate errors"). Ask the user to run exactly: descix dev-certs trust ' +
|
|
342
|
+
'— then quit and reopen Chrome, and re-run descix dev-certs check.'
|
|
343
|
+
);
|
|
344
|
+
}
|
|
345
|
+
} catch (err) {
|
|
346
|
+
report.dev_cert = { status: 'unverifiable', detail: `Could not resolve dev cert: ${err.message}`, next: null };
|
|
347
|
+
}
|
|
348
|
+
|
|
325
349
|
// Suggest cloud brain alignment when workspace is configured but alignment is missing
|
|
326
350
|
if (!report.alignment && report.workspace?.configured) {
|
|
327
351
|
report.suggestions = report.suggestions || [];
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dev-certs — report and (on trust) apply this machine's TLS trust status for
|
|
3
|
+
* the cert `descix serve` uses for its localhost HTTPS origin.
|
|
4
|
+
*
|
|
5
|
+
* Cert resolution is the ONE owner shared with `descix doctor` and the
|
|
6
|
+
* `descix serve` banner: lib/dev-cert-resolver.js -> @descix/app-sdk/dev's
|
|
7
|
+
* resolveDevCertOptions + resolveCertPaths. This file never re-derives which
|
|
8
|
+
* cert is "the" dev cert, and never mints or replaces one — the shipped
|
|
9
|
+
* SDK-tracked pair (descix-app-sdk/src/dev/certs/) is the only cert this
|
|
10
|
+
* command ever points at, same as every other consumer.
|
|
11
|
+
*/
|
|
12
|
+
import { execSync } from 'child_process';
|
|
13
|
+
import chalk from 'chalk';
|
|
14
|
+
import { checkDevCert, trustCertCommand } from '@descix/app-sdk/dev';
|
|
15
|
+
import { resolveGatewayCertContext } from '../dev-cert-resolver.js';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* `descix dev-certs check [--json]` — exits 0 only when the cert is trusted.
|
|
19
|
+
*/
|
|
20
|
+
export async function runDevCertsCheck(options = {}) {
|
|
21
|
+
const { certPath, port } = resolveGatewayCertContext(process.cwd());
|
|
22
|
+
const result = checkDevCert({ certPath });
|
|
23
|
+
|
|
24
|
+
if (options.json) {
|
|
25
|
+
console.log(JSON.stringify({ certPath, port, ...result }, null, 2));
|
|
26
|
+
} else {
|
|
27
|
+
console.log(chalk.cyan('\nDev certificate\n'));
|
|
28
|
+
console.log(` Cert: ${certPath}`);
|
|
29
|
+
console.log(` Status: ${result.status === 'trusted' ? chalk.green(result.status) : chalk.red(result.status)}`);
|
|
30
|
+
console.log(` Detail: ${result.detail}`);
|
|
31
|
+
if (result.next) {
|
|
32
|
+
console.log(`\n Next:\n ${String(result.next).replace(/\n/g, '\n ')}`);
|
|
33
|
+
}
|
|
34
|
+
console.log('');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
process.exitCode = result.status === 'trusted' ? 0 : 1;
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* `descix dev-certs trust` — the ONE final human command. Runs the exact
|
|
43
|
+
* trustCertCommand() string (macOS prompts for the keychain password), then
|
|
44
|
+
* re-checks and tells the human to reload Chrome. Refuses to run against a
|
|
45
|
+
* cert that is structurally broken (missing / no SAN / expired) or on a
|
|
46
|
+
* platform this cannot verify — those are not this command's job to paper
|
|
47
|
+
* over, and running `security add-trusted-cert` on a bad cert would silently
|
|
48
|
+
* "succeed" while passkeys still fail.
|
|
49
|
+
*/
|
|
50
|
+
export async function runDevCertsTrust() {
|
|
51
|
+
const { certPath, port } = resolveGatewayCertContext(process.cwd());
|
|
52
|
+
const before = checkDevCert({ certPath });
|
|
53
|
+
|
|
54
|
+
if (before.status === 'trusted') {
|
|
55
|
+
console.log(chalk.green(`\n${certPath} is already trusted.\n`));
|
|
56
|
+
return before;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (before.status === 'unverifiable') {
|
|
60
|
+
// `security add-trusted-cert` is macOS-only — there is no automated trust
|
|
61
|
+
// step on this platform. Refuse loud rather than silently no-op, and hand
|
|
62
|
+
// the human the exact file so they can import it into their own OS/browser
|
|
63
|
+
// trust store by hand.
|
|
64
|
+
console.error(chalk.red(`\nCannot trust automatically on ${process.platform}: ${before.detail}`));
|
|
65
|
+
console.error(`\nImport this certificate into your OS/browser trust store manually:\n ${certPath}\n`);
|
|
66
|
+
process.exitCode = 1;
|
|
67
|
+
return before;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (before.status !== 'untrusted') {
|
|
71
|
+
console.error(chalk.red(`\nCannot trust this cert — status: ${before.status}`));
|
|
72
|
+
console.error(` ${before.detail}`);
|
|
73
|
+
if (before.next) {
|
|
74
|
+
console.error(`\n Next:\n ${String(before.next).replace(/\n/g, '\n ')}\n`);
|
|
75
|
+
}
|
|
76
|
+
process.exitCode = 1;
|
|
77
|
+
return before;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
console.log(chalk.cyan('\nTrusting the dev certificate — macOS will prompt for your password.\n'));
|
|
81
|
+
execSync(trustCertCommand(certPath), { stdio: 'inherit' });
|
|
82
|
+
|
|
83
|
+
const after = checkDevCert({ certPath });
|
|
84
|
+
if (after.status === 'trusted') {
|
|
85
|
+
console.log(chalk.green('\nTrusted.'));
|
|
86
|
+
console.log(`Quit and reopen Chrome, then reload https://localhost:${port}/\n`);
|
|
87
|
+
} else {
|
|
88
|
+
console.error(chalk.red(`\nStill not trusted after running the trust command (${after.status}).`));
|
|
89
|
+
console.error(` ${after.detail}\n`);
|
|
90
|
+
process.exitCode = 1;
|
|
91
|
+
}
|
|
92
|
+
return after;
|
|
93
|
+
}
|
package/lib/commands/doctor.js
CHANGED
|
@@ -14,6 +14,8 @@ import { exec } from 'child_process';
|
|
|
14
14
|
import { promisify } from 'util';
|
|
15
15
|
import { DeSciXApiClient } from '../api-client.js';
|
|
16
16
|
import { isAuthenticated } from '../auth-guard.js';
|
|
17
|
+
import { checkDevCert } from '@descix/app-sdk/dev';
|
|
18
|
+
import { resolveGatewayCertContext } from '../dev-cert-resolver.js';
|
|
17
19
|
|
|
18
20
|
const execAsync = promisify(exec);
|
|
19
21
|
|
|
@@ -223,6 +225,26 @@ export async function checkAdc() {
|
|
|
223
225
|
}
|
|
224
226
|
}
|
|
225
227
|
|
|
228
|
+
/**
|
|
229
|
+
* Check the TLS cert `descix serve` would load for the cwd. An untrusted or
|
|
230
|
+
* structurally broken cert breaks passkey (WebAuthn) sign-in — the only
|
|
231
|
+
* DeSciX auth — so this is a real failure, not an admin-only advisory.
|
|
232
|
+
* Resolution mirrors the gateway exactly (dev-cert-resolver.js, the ONE
|
|
233
|
+
* owner shared with `descix dev-certs` and the `descix serve` banner).
|
|
234
|
+
*/
|
|
235
|
+
async function checkDevCertificate() {
|
|
236
|
+
const { certPath } = resolveGatewayCertContext(process.cwd());
|
|
237
|
+
const result = checkDevCert({ certPath });
|
|
238
|
+
if (result.status === 'trusted') {
|
|
239
|
+
return { ok: true, message: `${certPath} (trusted)` };
|
|
240
|
+
}
|
|
241
|
+
return {
|
|
242
|
+
ok: false,
|
|
243
|
+
message: `${result.status} — ${result.detail}`,
|
|
244
|
+
remediation: result.next || 'Run: descix dev-certs check',
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
|
|
226
248
|
/**
|
|
227
249
|
* Run the doctor command
|
|
228
250
|
*/
|
|
@@ -282,7 +304,12 @@ export async function runDoctor(options = {}) {
|
|
|
282
304
|
spinner.text = 'Checking ADC Credentials...';
|
|
283
305
|
const adcRes = await checkAdc();
|
|
284
306
|
results.push({ label: 'ADC Credentials', ...adcRes });
|
|
285
|
-
|
|
307
|
+
|
|
308
|
+
// 7. Dev certificate (passkey sign-in under `descix serve`)
|
|
309
|
+
spinner.text = 'Checking dev certificate...';
|
|
310
|
+
const devCertRes = await checkDevCertificate();
|
|
311
|
+
results.push({ label: 'Dev certificate', ...devCertRes });
|
|
312
|
+
|
|
286
313
|
spinner.stop();
|
|
287
314
|
|
|
288
315
|
// Print Results
|
|
@@ -317,8 +344,9 @@ export async function runDoctor(options = {}) {
|
|
|
317
344
|
// the pass stops.
|
|
318
345
|
console.log(chalk.gray(
|
|
319
346
|
'Checked: Node version, API origin resolution + reachability, session, local write\n' +
|
|
320
|
-
'permissions
|
|
321
|
-
'checked: your app\'s own build, chain state, or any
|
|
347
|
+
'permissions, dev-cert trust for `descix serve`. [-] rows are admin-only dependencies and\n' +
|
|
348
|
+
'never fail this command. NOT checked: your app\'s own build, chain state, or any\n' +
|
|
349
|
+
'credential\'s permissions at the API.'
|
|
322
350
|
));
|
|
323
351
|
console.log();
|
|
324
352
|
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* resolveGatewayCertContext — the CLI-side mirror of which cert `descix serve`
|
|
3
|
+
* will load for a given cwd. ONE owner within the CLI: `doctor.js` and
|
|
4
|
+
* `dev-certs.js` both call this instead of re-deriving workspace lookup +
|
|
5
|
+
* resolveDevCertOptions + resolveCertPaths by hand — the same two-derivations
|
|
6
|
+
* risk `getViteHttpsConfig.js` names for the gateway itself.
|
|
7
|
+
*
|
|
8
|
+
* Mirrors gateway.js exactly: resolveDevCertOptions(workspaceRoot, {}, config)
|
|
9
|
+
* then resolveCertPaths(certOpts) — both from @descix/app-sdk/dev, the actual
|
|
10
|
+
* owner of "which TLS cert a local dev server uses". This module only supplies
|
|
11
|
+
* the workspaceRoot/config a CLI command has to hand; it never re-derives the
|
|
12
|
+
* precedence itself.
|
|
13
|
+
*/
|
|
14
|
+
import {
|
|
15
|
+
findWorkspaceRoot,
|
|
16
|
+
readWorkspaceConfig,
|
|
17
|
+
resolveDevCertOptions,
|
|
18
|
+
resolveCertPaths,
|
|
19
|
+
resolveGatewayPort,
|
|
20
|
+
} from '@descix/app-sdk/dev';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @param {string} cwd
|
|
24
|
+
* @returns {{
|
|
25
|
+
* certPath: string,
|
|
26
|
+
* keyPath: string,
|
|
27
|
+
* workspaceRoot: string|null,
|
|
28
|
+
* config: Object|null,
|
|
29
|
+
* port: number,
|
|
30
|
+
* portSource: string,
|
|
31
|
+
* }}
|
|
32
|
+
*/
|
|
33
|
+
export function resolveGatewayCertContext(cwd) {
|
|
34
|
+
const workspaceRoot = findWorkspaceRoot(cwd);
|
|
35
|
+
let config = null;
|
|
36
|
+
if (workspaceRoot) {
|
|
37
|
+
try {
|
|
38
|
+
config = readWorkspaceConfig(workspaceRoot);
|
|
39
|
+
} catch {
|
|
40
|
+
// A malformed workspace is the workspace resolver's problem to report
|
|
41
|
+
// elsewhere; this resolver just falls back to "no workspace opinion",
|
|
42
|
+
// same as resolveDevCertOptions does for a missing/malformed file.
|
|
43
|
+
config = null;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const certOpts = resolveDevCertOptions(workspaceRoot || cwd, {}, config);
|
|
47
|
+
const { certPath, keyPath } = resolveCertPaths(certOpts);
|
|
48
|
+
const { port, portSource } = resolveGatewayPort(config || {}, {});
|
|
49
|
+
return { certPath, keyPath, workspaceRoot, config, port, portSource };
|
|
50
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@descix/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "DeSciX CLI and MCP Server - Unified command-line interface for DeSciX platform",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"descix-mcp": "bin/mcp-server.js"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
|
-
"test": "node --test \"tests/*.test.js\"",
|
|
17
|
+
"test": "node --experimental-test-module-mocks --test \"tests/*.test.js\"",
|
|
18
18
|
"pack": "npm pack",
|
|
19
19
|
"check:doc-paths": "node scripts/check-doc-paths.js",
|
|
20
20
|
"briefer": "node scripts/briefer/run.mjs"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"author": "DeSciX",
|
|
31
31
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@descix/app-sdk": "^0.1.
|
|
33
|
+
"@descix/app-sdk": "^0.1.8",
|
|
34
34
|
"@descix/sdk": "^2.0.0",
|
|
35
35
|
"@modelcontextprotocol/sdk": "^1.25.1",
|
|
36
36
|
"axios": "^1.7.9",
|
|
@@ -174,6 +174,16 @@ resolves `--port` > `env.gateway.port` > 5173 and is printed with its source, so
|
|
|
174
174
|
never hardcode `:5173`. Set your framework's base path to `/p/<appId>` — the
|
|
175
175
|
gateway does not rewrite paths.
|
|
176
176
|
|
|
177
|
+
**Passkey sign-in needs a trusted dev certificate.** If Powch sign-in under
|
|
178
|
+
`descix serve` fails with `User cancelled`, or the browser console says
|
|
179
|
+
`WebAuthn is not supported on sites with TLS certificate errors`, the gateway's
|
|
180
|
+
certificate is not trusted. Run `descix dev-certs check` (or `descix doctor`, row
|
|
181
|
+
"Dev certificate"). If it is not trusted, do not try to trust it yourself: give
|
|
182
|
+
the user exactly `descix dev-certs trust` to run (macOS asks for their password),
|
|
183
|
+
tell them to quit and reopen Chrome, then run `descix dev-certs check` again. On
|
|
184
|
+
Linux and Windows the check reports `unverifiable` and trusting is a manual,
|
|
185
|
+
unverified step — see `.descix/sdk-assets/reference/local-dev.md` §3.3.
|
|
186
|
+
|
|
177
187
|
## Integrating Existing Content
|
|
178
188
|
|
|
179
189
|
If the repo already has content (an HTML page, a React app, an SDK with docs),
|
package/templates/agent-cline.md
CHANGED
|
@@ -136,6 +136,16 @@ resolves `--port` > `env.gateway.port` > 5173 and is printed with its source, so
|
|
|
136
136
|
never hardcode `:5173`. Set your framework's base path to `/p/<appId>` — the
|
|
137
137
|
gateway does not rewrite paths.
|
|
138
138
|
|
|
139
|
+
**Passkey sign-in needs a trusted dev certificate.** If Powch sign-in under
|
|
140
|
+
`descix serve` fails with `User cancelled`, or the browser console says
|
|
141
|
+
`WebAuthn is not supported on sites with TLS certificate errors`, the gateway's
|
|
142
|
+
certificate is not trusted. Run `descix dev-certs check` (or `descix doctor`, row
|
|
143
|
+
"Dev certificate"). If it is not trusted, do not try to trust it yourself: give
|
|
144
|
+
the user exactly `descix dev-certs trust` to run (macOS asks for their password),
|
|
145
|
+
tell them to quit and reopen Chrome, then run `descix dev-certs check` again. On
|
|
146
|
+
Linux and Windows the check reports `unverifiable` and trusting is a manual,
|
|
147
|
+
unverified step — see `.descix/sdk-assets/reference/local-dev.md` §3.3.
|
|
148
|
+
|
|
139
149
|
## MCP Tools
|
|
140
150
|
|
|
141
151
|
- `descix_doctor` — Startup diagnostic (call first)
|
|
@@ -136,6 +136,16 @@ resolves `--port` > `env.gateway.port` > 5173 and is printed with its source, so
|
|
|
136
136
|
never hardcode `:5173`. Set your framework's base path to `/p/<appId>` — the
|
|
137
137
|
gateway does not rewrite paths.
|
|
138
138
|
|
|
139
|
+
**Passkey sign-in needs a trusted dev certificate.** If Powch sign-in under
|
|
140
|
+
`descix serve` fails with `User cancelled`, or the browser console says
|
|
141
|
+
`WebAuthn is not supported on sites with TLS certificate errors`, the gateway's
|
|
142
|
+
certificate is not trusted. Run `descix dev-certs check` (or `descix doctor`, row
|
|
143
|
+
"Dev certificate"). If it is not trusted, do not try to trust it yourself: give
|
|
144
|
+
the user exactly `descix dev-certs trust` to run (macOS asks for their password),
|
|
145
|
+
tell them to quit and reopen Chrome, then run `descix dev-certs check` again. On
|
|
146
|
+
Linux and Windows the check reports `unverifiable` and trusting is a manual,
|
|
147
|
+
unverified step — see `.descix/sdk-assets/reference/local-dev.md` §3.3.
|
|
148
|
+
|
|
139
149
|
## MCP Tools
|
|
140
150
|
|
|
141
151
|
- `descix_doctor` — Startup diagnostic (call first)
|
|
@@ -136,6 +136,16 @@ resolves `--port` > `env.gateway.port` > 5173 and is printed with its source, so
|
|
|
136
136
|
never hardcode `:5173`. Set your framework's base path to `/p/<appId>` — the
|
|
137
137
|
gateway does not rewrite paths.
|
|
138
138
|
|
|
139
|
+
**Passkey sign-in needs a trusted dev certificate.** If Powch sign-in under
|
|
140
|
+
`descix serve` fails with `User cancelled`, or the browser console says
|
|
141
|
+
`WebAuthn is not supported on sites with TLS certificate errors`, the gateway's
|
|
142
|
+
certificate is not trusted. Run `descix dev-certs check` (or `descix doctor`, row
|
|
143
|
+
"Dev certificate"). If it is not trusted, do not try to trust it yourself: give
|
|
144
|
+
the user exactly `descix dev-certs trust` to run (macOS asks for their password),
|
|
145
|
+
tell them to quit and reopen Chrome, then run `descix dev-certs check` again. On
|
|
146
|
+
Linux and Windows the check reports `unverifiable` and trusting is a manual,
|
|
147
|
+
unverified step — see `.descix/sdk-assets/reference/local-dev.md` §3.3.
|
|
148
|
+
|
|
139
149
|
## MCP Tools
|
|
140
150
|
|
|
141
151
|
- `descix_doctor` — Startup diagnostic (call first)
|