@crewx/cli 0.9.0-rc.92 → 0.9.0-rc.94

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.
@@ -126,7 +126,7 @@ Options:
126
126
  --version <ver> Override manifest version (semver, e.g. 1.0.0)
127
127
  --json Print machine-readable JSON to stdout
128
128
  --upload Submit + upload the packed archive to marketplace
129
- (requires CREWX_MARKETPLACE_URL and a prior login;
129
+ (uses the configured account target and a prior login;
130
130
  ignored when combined with --dry-run)
131
131
  --help, -h Show this help
132
132
 
@@ -136,13 +136,26 @@ Notes:
136
136
  .crewx/publish/<name>-<version>.tgz archive.
137
137
  `.trim());
138
138
  }
139
- /** CREWX_MARKETPLACE_URL same env var name as the server's MARKETPLACE_DISABLED check, never a second name. */
139
+ /** Resolve and validate the Marketplace target immediately before an upload. */
140
140
  function requireMarketplaceUrl() {
141
- const url = process.env['CREWX_MARKETPLACE_URL'];
142
- if (!url?.trim()) {
143
- throw new Error('publish: [E_ENV_MISSING] CREWX_MARKETPLACE_URL is not set — this environment variable is required for upload');
141
+ try {
142
+ const url = (0, account_1.resolveMarketplaceUrl)();
143
+ (0, account_1.assertAccountTargetNotMixed)();
144
+ return url;
145
+ }
146
+ catch (error) {
147
+ const code = typeof error === 'object' && error !== null && 'code' in error
148
+ ? error.code
149
+ : undefined;
150
+ if (code === 'ACCOUNT_TARGET_INVALID' ||
151
+ code === 'ACCOUNT_TARGET_MIXED' ||
152
+ code === 'MARKETPLACE_DISABLED' ||
153
+ code === 'MARKETPLACE_URL_INVALID') {
154
+ const message = error instanceof Error ? error.message : String(error);
155
+ throw new Error(`publish: [${code}] ${message}`);
156
+ }
157
+ throw error;
144
158
  }
145
- return url.trim();
146
159
  }
147
160
  function isMarketplaceUnauthorized(err) {
148
161
  return err instanceof Error
package/dist/main.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Boot sequence:
7
7
  * 1. Inject CREWX_CLI / CREWX_WORKSPACE env defaults (must be first)
8
- * 2. Load workspace .env (does not override existing process.env values)
8
+ * 2. Load workspace and ~/.crewx .env files (does not override process.env)
9
9
  * 3. Parse command
10
10
  * 4. Dispatch to handler
11
11
  */
package/dist/main.js CHANGED
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * Boot sequence:
8
8
  * 1. Inject CREWX_CLI / CREWX_WORKSPACE env defaults (must be first)
9
- * 2. Load workspace .env (does not override existing process.env values)
9
+ * 2. Load workspace and ~/.crewx .env files (does not override process.env)
10
10
  * 3. Parse command
11
11
  * 4. Dispatch to handler
12
12
  */
@@ -47,15 +47,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
47
47
  // ─── P0-1: Env Bootstrap ─────────────────────────────────────────────────────
48
48
  // Must run before any other code that might use process.env.CREWX_CLI.
49
49
  const sdk_compat_1 = require("./utils/sdk-compat");
50
- const dotenv = __importStar(require("dotenv"));
51
- const path_1 = require("path");
50
+ const account_1 = require("@crewx/sdk/account");
52
51
  process.env.CREWX_CLI ??= sdk_compat_1.sdkCompat.resolveCrewxCli();
53
52
  process.env.CREWX_WORKSPACE ??= sdk_compat_1.sdkCompat.resolveCrewxWorkspace();
54
- // Load the workspace .env (WI-20260725-010): keeps CLI (crewx q/x) in parity with
55
- // the server's ConfigModule, which already reads cwd/.env. override:false so a
56
- // value already present in the shell/environment always wins over the file.
57
- // quiet:true suppresses dotenv's injected-keys log and tip banner on stdout.
58
- dotenv.config({ path: (0, path_1.join)(process.env.CREWX_WORKSPACE, '.env'), override: false, quiet: true });
53
+ // Load workspace .env before ~/.crewx/.env. The SDK-owned loader keeps CLI and
54
+ // server bootstrap on the same process > workspace > home precedence contract.
55
+ (0, account_1.loadCrewxEnvFiles)();
59
56
  // ─── Pricing remote override (WI-20260701-002) ───────────────────────────────
60
57
  // Best-effort, non-blocking: fetch remote model registry so new models get
61
58
  // accurate pricing without a CLI republish. Falls back to bundled table on
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewx/cli",
3
- "version": "0.9.0-rc.92",
3
+ "version": "0.9.0-rc.94",
4
4
  "license": "UNLICENSED",
5
5
  "engines": {
6
6
  "node": ">=20.19.0"
@@ -25,17 +25,17 @@
25
25
  "better-sqlite3": "*",
26
26
  "dotenv": "17.2.3",
27
27
  "isomorphic-git": "1.37.1",
28
- "@crewx/sdk": "0.9.0-rc.92",
29
- "@crewx/memory": "0.1.23-rc.109",
30
- "@crewx/wbs": "0.1.10-rc.118",
31
- "@crewx/doc": "0.1.9-rc.85",
32
- "@crewx/search": "0.1.10-rc.88",
33
- "@crewx/workflow": "0.3.22-rc.138",
34
- "@crewx/cron": "0.1.10-rc.127",
35
- "@crewx/chromex": "0.1.0-rc.125",
28
+ "@crewx/memory": "0.1.23-rc.111",
29
+ "@crewx/sdk": "0.9.0-rc.94",
30
+ "@crewx/doc": "0.1.9-rc.87",
31
+ "@crewx/wbs": "0.1.10-rc.120",
32
+ "@crewx/search": "0.1.10-rc.90",
33
+ "@crewx/workflow": "0.3.22-rc.140",
34
+ "@crewx/cron": "0.1.10-rc.129",
35
+ "@crewx/notify": "0.1.0-rc.65",
36
36
  "@crewx/shared": "0.0.6",
37
- "@crewx/notify": "0.1.0-rc.63",
38
- "@crewx/wi": "0.1.10-rc.112",
37
+ "@crewx/wi": "0.1.10-rc.114",
38
+ "@crewx/chromex": "0.1.0-rc.127",
39
39
  "@crewx/skill": "0.1.20"
40
40
  },
41
41
  "devDependencies": {