dlw-machine-setup 0.5.14 → 0.5.16
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/bin/installer.js +27 -22
- package/package.json +1 -1
package/bin/installer.js
CHANGED
|
@@ -3309,7 +3309,8 @@ async function fetchWizardOptions(token, repo) {
|
|
|
3309
3309
|
});
|
|
3310
3310
|
if (!assetRes.ok) return null;
|
|
3311
3311
|
const data = await assetRes.json();
|
|
3312
|
-
|
|
3312
|
+
const techArray = data.personas?.technologies ?? data.personas?.personas;
|
|
3313
|
+
if (!Array.isArray(data.agents) || !Array.isArray(techArray)) {
|
|
3313
3314
|
return null;
|
|
3314
3315
|
}
|
|
3315
3316
|
return { options: data, releaseVersion: release.tag_name ?? "unknown" };
|
|
@@ -3571,9 +3572,9 @@ async function loadWizardOptions(token, repo) {
|
|
|
3571
3572
|
Object.entries(options.mcpServers).filter(([, config]) => config.active !== false)
|
|
3572
3573
|
);
|
|
3573
3574
|
return {
|
|
3574
|
-
|
|
3575
|
+
technologies: (options.personas?.technologies ?? options.personas?.personas ?? []).filter((p) => p.active !== false),
|
|
3575
3576
|
agents: options.agents.filter((a) => a.active !== false),
|
|
3576
|
-
baseMcpServers: options.personas
|
|
3577
|
+
baseMcpServers: options.personas?.baseMcpServers ?? [],
|
|
3577
3578
|
mcpServers: filteredMcpServers,
|
|
3578
3579
|
releaseVersion
|
|
3579
3580
|
};
|
|
@@ -3635,8 +3636,9 @@ var MIN_FILE_SIZE = 1024;
|
|
|
3635
3636
|
var fetch_contexts_default = defineStep({
|
|
3636
3637
|
name: "fetch-contexts",
|
|
3637
3638
|
label: "Downloading contexts",
|
|
3639
|
+
when: (ctx) => ctx.config.technologies.length > 0,
|
|
3638
3640
|
execute: async (ctx) => {
|
|
3639
|
-
const uniqueDomains = [...new Set(ctx.config.
|
|
3641
|
+
const uniqueDomains = [...new Set(ctx.config.technologies.flatMap((p) => p.domains))];
|
|
3640
3642
|
const domainValues = uniqueDomains.map((d) => d.toLowerCase());
|
|
3641
3643
|
const downloadResult = await fetchContexts(domainValues, ctx.token, ctx.repo, ctx.config.projectPath);
|
|
3642
3644
|
ctx.installed.domainsInstalled = downloadResult.successful;
|
|
@@ -4025,12 +4027,12 @@ var import_path4 = require("path");
|
|
|
4025
4027
|
// src/steps/shared.ts
|
|
4026
4028
|
function getFilteredMcpConfig(ctx) {
|
|
4027
4029
|
const successfulDomains = new Set(ctx.installed.domainsInstalled ?? []);
|
|
4028
|
-
const
|
|
4030
|
+
const successfulTechnologies = ctx.config.technologies.filter(
|
|
4029
4031
|
(p) => p.domains.every((d) => successfulDomains.has(d.toLowerCase()))
|
|
4030
4032
|
);
|
|
4031
4033
|
const successfulMcpServers = /* @__PURE__ */ new Set([
|
|
4032
4034
|
...ctx.config.baseMcpServers,
|
|
4033
|
-
...
|
|
4035
|
+
...successfulTechnologies.flatMap((p) => p.mcpServers)
|
|
4034
4036
|
]);
|
|
4035
4037
|
return Object.fromEntries(
|
|
4036
4038
|
Object.entries(ctx.config.mcpConfig).filter(([name]) => successfulMcpServers.has(name))
|
|
@@ -4044,10 +4046,10 @@ var red = (text) => `\x1B[31m${text}\x1B[0m`;
|
|
|
4044
4046
|
var write_instructions_default = defineStep({
|
|
4045
4047
|
name: "write-instructions",
|
|
4046
4048
|
label: "Writing instruction file",
|
|
4047
|
-
when: (ctx) => (ctx.installed.domainsInstalled?.length ?? 0) > 0,
|
|
4049
|
+
when: (ctx) => (ctx.installed.domainsInstalled?.length ?? 0) > 0 || Object.keys(ctx.config.mcpConfig).length > 0 || ctx.installed.factoryInstalled,
|
|
4048
4050
|
execute: async (ctx) => {
|
|
4049
4051
|
const filteredMcpConfig = getFilteredMcpConfig(ctx);
|
|
4050
|
-
const domains = ctx.installed.domainsInstalled;
|
|
4052
|
+
const domains = ctx.installed.domainsInstalled ?? [];
|
|
4051
4053
|
const agent = ctx.config.agent;
|
|
4052
4054
|
const projectPath = ctx.config.projectPath;
|
|
4053
4055
|
const factoryInstalled = ctx.installed.factoryInstalled ?? false;
|
|
@@ -4302,7 +4304,7 @@ var red2 = (text) => `\x1B[31m${text}\x1B[0m`;
|
|
|
4302
4304
|
var write_mcp_config_default = defineStep({
|
|
4303
4305
|
name: "write-mcp-config",
|
|
4304
4306
|
label: "Writing MCP configuration",
|
|
4305
|
-
when: (ctx) => (ctx.
|
|
4307
|
+
when: (ctx) => Object.keys(ctx.config.mcpConfig).length > 0,
|
|
4306
4308
|
execute: async (ctx) => {
|
|
4307
4309
|
const filteredMcpConfig = getFilteredMcpConfig(ctx);
|
|
4308
4310
|
const target = getAgentMCPTarget(ctx.config.agent);
|
|
@@ -4420,7 +4422,7 @@ var update_gitignore_default = defineStep({
|
|
|
4420
4422
|
var import_fs7 = require("fs");
|
|
4421
4423
|
var import_path7 = require("path");
|
|
4422
4424
|
var import_os2 = require("os");
|
|
4423
|
-
var INSTALLER_VERSION = "0.5.
|
|
4425
|
+
var INSTALLER_VERSION = "0.5.16";
|
|
4424
4426
|
var write_state_default = defineStep({
|
|
4425
4427
|
name: "write-state",
|
|
4426
4428
|
label: "Saving installation state",
|
|
@@ -4436,7 +4438,7 @@ var write_state_default = defineStep({
|
|
|
4436
4438
|
releaseVersion: ctx.config.releaseVersion,
|
|
4437
4439
|
projectPath: ctx.config.projectPath,
|
|
4438
4440
|
agent: ctx.config.agent,
|
|
4439
|
-
|
|
4441
|
+
technologies: ctx.config.technologies.map((p) => p.id),
|
|
4440
4442
|
domains: ctx.installed.domainsInstalled ?? [],
|
|
4441
4443
|
mcpServers: mcpServersAdded,
|
|
4442
4444
|
mcpConfigs: filteredMcpConfig,
|
|
@@ -4579,20 +4581,23 @@ async function main() {
|
|
|
4579
4581
|
}
|
|
4580
4582
|
async function collectInputs(options, releaseVersion, factoryAvailable = false) {
|
|
4581
4583
|
const selectedIds = await esm_default2({
|
|
4582
|
-
message: "
|
|
4584
|
+
message: "Technology:",
|
|
4583
4585
|
instructions: " Space to select \xB7 Enter to confirm",
|
|
4584
|
-
choices:
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4586
|
+
choices: [
|
|
4587
|
+
...options.technologies.map((p) => ({
|
|
4588
|
+
name: p.name.replace(/ Developer$/, ""),
|
|
4589
|
+
value: p.id
|
|
4590
|
+
})),
|
|
4591
|
+
{ name: "None", value: "none" }
|
|
4592
|
+
],
|
|
4588
4593
|
required: true
|
|
4589
4594
|
});
|
|
4590
|
-
const
|
|
4595
|
+
const selectedTechnologies = options.technologies.filter((p) => selectedIds.includes(p.id));
|
|
4591
4596
|
const agent = await esm_default5({
|
|
4592
4597
|
message: "AI coding tool:",
|
|
4593
4598
|
choices: options.agents
|
|
4594
4599
|
});
|
|
4595
|
-
const mcpConfig = buildMCPConfiguration(
|
|
4600
|
+
const mcpConfig = buildMCPConfiguration(selectedTechnologies, options.baseMcpServers, options.mcpServers);
|
|
4596
4601
|
let azureDevOpsOrg = "";
|
|
4597
4602
|
if (mcpConfig["azure-devops"]) {
|
|
4598
4603
|
const org = await esm_default4({
|
|
@@ -4612,7 +4617,7 @@ async function collectInputs(options, releaseVersion, factoryAvailable = false)
|
|
|
4612
4617
|
default: (0, import_path8.resolve)(process.cwd())
|
|
4613
4618
|
});
|
|
4614
4619
|
return {
|
|
4615
|
-
|
|
4620
|
+
technologies: selectedTechnologies,
|
|
4616
4621
|
agent,
|
|
4617
4622
|
azureDevOpsOrg,
|
|
4618
4623
|
projectPath: (0, import_path8.resolve)(projectInput),
|
|
@@ -4623,7 +4628,7 @@ async function collectInputs(options, releaseVersion, factoryAvailable = false)
|
|
|
4623
4628
|
};
|
|
4624
4629
|
}
|
|
4625
4630
|
async function previewAndConfirm(config, options) {
|
|
4626
|
-
const
|
|
4631
|
+
const technologyNames = config.technologies.length > 0 ? config.technologies.map((p) => p.name.replace(/ Developer$/, "")).join(", ") : "None";
|
|
4627
4632
|
const agentDisplay = options.agents.find((a) => a.value === config.agent)?.name ?? config.agent;
|
|
4628
4633
|
const instructionFile = getInstructionFilePath3(config.agent);
|
|
4629
4634
|
const mcpConfigFile = getMCPConfigPath2(config.agent);
|
|
@@ -4634,7 +4639,7 @@ async function previewAndConfirm(config, options) {
|
|
|
4634
4639
|
const instructionMode = detectMarkerFileMode(instructionFilePath, "<!-- one-shot-installer:start -->");
|
|
4635
4640
|
const mcpMode = detectMCPFileMode(mcpConfigFilePath);
|
|
4636
4641
|
const gitignoreMode = detectMarkerFileMode(gitignorePath, "# one-shot-installer:start");
|
|
4637
|
-
const uniqueDomains = [...new Set(config.
|
|
4642
|
+
const uniqueDomains = [...new Set(config.technologies.flatMap((p) => p.domains))];
|
|
4638
4643
|
const domainModes = uniqueDomains.map((d) => ({
|
|
4639
4644
|
domain: d,
|
|
4640
4645
|
mode: detectContextMode(config.projectPath, d)
|
|
@@ -4642,7 +4647,7 @@ async function previewAndConfirm(config, options) {
|
|
|
4642
4647
|
console.log("\n" + "\u2500".repeat(48));
|
|
4643
4648
|
console.log(" Ready to install");
|
|
4644
4649
|
console.log("\u2500".repeat(48) + "\n");
|
|
4645
|
-
console.log(`
|
|
4650
|
+
console.log(` Technology ${technologyNames}`);
|
|
4646
4651
|
console.log(` Tool ${agentDisplay}`);
|
|
4647
4652
|
console.log(` Factory ${config.installFactory ? "yes" : "no"}`);
|
|
4648
4653
|
console.log(` Directory ${config.projectPath}`);
|