@hexclave/cli 1.0.84 → 1.0.86
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/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/commands/init.ts +10 -3
package/dist/index.js
CHANGED
|
@@ -25,7 +25,7 @@ import { createHash, randomBytes } from "crypto";
|
|
|
25
25
|
import { replaceConfigObject } from "@hexclave/shared-backend";
|
|
26
26
|
import { detectImportPackageFromDir } from "@hexclave/shared/dist/config-eval";
|
|
27
27
|
import { isValidConfig } from "@hexclave/shared/dist/config/format";
|
|
28
|
-
import { ALL_APPS } from "@hexclave/shared/dist/apps/apps-config";
|
|
28
|
+
import { ALL_APPS, expandAppSoftRequirements } from "@hexclave/shared/dist/apps/apps-config";
|
|
29
29
|
import { renderConfigFileContent } from "@hexclave/shared/dist/config-rendering";
|
|
30
30
|
import { checkbox, confirm, input, select } from "@inquirer/prompts";
|
|
31
31
|
import { runHeadlessClaudeAgent } from "@hexclave/shared-backend/config-agent";
|
|
@@ -1715,7 +1715,10 @@ async function handleCreate(opts, outputDir) {
|
|
|
1715
1715
|
selectedApps = opts.apps.split(",").map((s) => s.trim()).filter(Boolean);
|
|
1716
1716
|
const validAppIds = Object.keys(ALL_APPS);
|
|
1717
1717
|
const invalidApps = selectedApps.filter((id) => !validAppIds.includes(id));
|
|
1718
|
-
if (invalidApps.length > 0)
|
|
1718
|
+
if (invalidApps.length > 0) {
|
|
1719
|
+
const availableAppIds = Object.entries(ALL_APPS).filter(([, app]) => app.stage !== "alpha").map(([appId]) => appId);
|
|
1720
|
+
throw new CliError(`Unknown app IDs: ${invalidApps.join(", ")}. Available IDs: ${availableAppIds.join(", ")}`);
|
|
1721
|
+
}
|
|
1719
1722
|
} else {
|
|
1720
1723
|
const stageOrder = {
|
|
1721
1724
|
stable: 0,
|
|
@@ -1730,7 +1733,9 @@ async function handleCreate(opts, outputDir) {
|
|
|
1730
1733
|
}))
|
|
1731
1734
|
});
|
|
1732
1735
|
}
|
|
1733
|
-
const
|
|
1736
|
+
const validatedSelectedApps = selectedApps.filter((appId) => Object.prototype.hasOwnProperty.call(ALL_APPS, appId));
|
|
1737
|
+
if (validatedSelectedApps.length !== selectedApps.length) throw new CliError("App selection contained an unknown app after validation.");
|
|
1738
|
+
const content = renderConfigFileContent({ apps: { installed: Object.fromEntries([...expandAppSoftRequirements(validatedSelectedApps)].map((appId) => [appId, { enabled: true }])) } }, detectImportPackageFromDir(path$1.dirname(configPath)));
|
|
1734
1739
|
fs$1.mkdirSync(path$1.dirname(configPath), { recursive: true });
|
|
1735
1740
|
if (fs$1.existsSync(configPath)) {
|
|
1736
1741
|
if (isNonInteractiveEnv()) throw new CliError(`Config file already exists at ${configPath}. Refusing to overwrite in non-interactive mode.`);
|