@userreason/wizard 0.3.0 → 0.3.2
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/README.md +44 -51
- package/dist/agent-note.js +6 -5
- package/dist/agent-skill.js +5 -4
- package/dist/analytics.js +2 -2
- package/dist/bin.js +55 -51
- package/dist/{chunk-SFODN2YB.js → chunk-4INLEQE2.js} +2 -2
- package/dist/{chunk-77SK7TKZ.js → chunk-7AAH6C4L.js} +928 -631
- package/dist/{chunk-Z6ZY7X2K.js → chunk-7O7H3PIM.js} +6 -6
- package/dist/{chunk-VXWLSQYK.js → chunk-CSZW2ULJ.js} +39 -17
- package/dist/{chunk-P6DOSGRZ.js → chunk-DMXUXEQI.js} +1 -1
- package/dist/{chunk-GOYBYAUH.js → chunk-EVNEX5N5.js} +1 -1
- package/dist/{chunk-UN24JFV2.js → chunk-KF37D5WL.js} +1 -1
- package/dist/{chunk-5IO5LY22.js → chunk-LEJFE4U5.js} +2 -2
- package/dist/{chunk-MFGJ2KPT.js → chunk-NNPYUATH.js} +1 -1
- package/dist/chunk-PJQOSDYS.js +50 -0
- package/dist/{chunk-YYFC7TM2.js → chunk-Q5U5UOQN.js} +7 -5
- package/dist/{chunk-NZ65XDNL.js → chunk-SB3AYQWG.js} +4 -4
- package/dist/{chunk-CADA5WZ3.js → chunk-TOID3NYP.js} +13 -6
- package/dist/{chunk-ZHHIHHLU.js → chunk-TRBSH5G7.js} +5 -5
- package/dist/{chunk-2UEUVLCB.js → chunk-XASPGFYK.js} +3 -3
- package/dist/{chunk-F4FKAUQN.js → chunk-XPFKXLIZ.js} +2 -2
- package/dist/{chunk-HIF6NUNK.js → chunk-ZHJV247H.js} +6 -8
- package/dist/cli-access.js +3 -3
- package/dist/connection.js +2 -2
- package/dist/first-survey.js +2 -2
- package/dist/footer.js +5 -4
- package/dist/global-cli.js +5 -4
- package/dist/install-diagnostics.js +9 -0
- package/dist/integrate.js +4 -3
- package/dist/project.js +3 -2
- package/dist/setup-flow.js +9 -8
- package/dist/setup.js +8 -7
- package/dist/startup.js +2 -2
- package/dist/state.js +5 -4
- package/dist/ui.js +2 -2
- package/package.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { createRequire as createWizardRequire } from 'node:module'; import { fileURLToPath as wizardFileURLToPath } from 'node:url'; import { dirname as wizardDirname } from 'node:path'; const require = createWizardRequire(import.meta.url); const __filename = wizardFileURLToPath(import.meta.url); const __dirname = wizardDirname(__filename);
|
|
2
|
-
import {
|
|
3
|
-
Cancelled
|
|
4
|
-
} from "./chunk-GOYBYAUH.js";
|
|
5
2
|
import {
|
|
6
3
|
initializationPath
|
|
7
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LEJFE4U5.js";
|
|
8
5
|
import {
|
|
9
6
|
cliCommand
|
|
10
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TOID3NYP.js";
|
|
8
|
+
import {
|
|
9
|
+
Cancelled
|
|
10
|
+
} from "./chunk-EVNEX5N5.js";
|
|
11
11
|
import {
|
|
12
12
|
packageProfile
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-7AAH6C4L.js";
|
|
14
14
|
|
|
15
15
|
// src/agent-note.ts
|
|
16
16
|
import { constants } from "node:fs";
|
|
@@ -3,22 +3,23 @@ import {
|
|
|
3
3
|
connectSetup,
|
|
4
4
|
resumeSetup,
|
|
5
5
|
runSetup
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Q5U5UOQN.js";
|
|
7
7
|
import {
|
|
8
8
|
clean,
|
|
9
9
|
openBrowser
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-EVNEX5N5.js";
|
|
11
11
|
import {
|
|
12
12
|
BrowserSetupUnavailable
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-7AAH6C4L.js";
|
|
14
14
|
|
|
15
15
|
// src/setup-flow.ts
|
|
16
16
|
var shell = (value) => /^[A-Za-z0-9_./:@=-]+$/.test(value) ? value : `'${value.replace(/'/g, `'"'"'`)}'`;
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
var registryArgs = (profile) => profile?.kind === "local-development" ? ["--prefer-online", `--registry=${profile.registry}`, `--@userreason:registry=${profile.registry}`] : [];
|
|
18
|
+
function setupSampleCommand(setupId, apiOrigin, cliVersion, profile) {
|
|
19
|
+
return ["npx", "-y", ...registryArgs(profile), `@userreason/cli@${cliVersion}`, "setup", "sample", "--setup", setupId, "--api-url", apiOrigin, "--directory", ".", "--json"].map(shell).join(" ");
|
|
19
20
|
}
|
|
20
|
-
function setupResumeCommand(setupId, apiOrigin, version) {
|
|
21
|
-
return ["npx", "-y", `@userreason/wizard@${version}`, "--resume-setup", setupId, "--api-url", apiOrigin, "--directory", "."].map(shell).join(" ");
|
|
21
|
+
function setupResumeCommand(setupId, apiOrigin, version, profile) {
|
|
22
|
+
return ["npx", "-y", ...registryArgs(profile), `@userreason/wizard@${version}`, "--resume-setup", setupId, "--api-url", apiOrigin, "--directory", "."].map(shell).join(" ");
|
|
22
23
|
}
|
|
23
24
|
var setupManualGuidance = {
|
|
24
25
|
install_packages: "Review the project dependency and registry settings, install compatible @userreason/js and @userreason/cli versions with the project package manager, then rerun setup. See https://docs.userreason.com/get-started/quickstart/.",
|
|
@@ -45,20 +46,35 @@ async function runBrowserWizard(input) {
|
|
|
45
46
|
let connected;
|
|
46
47
|
try {
|
|
47
48
|
connected = input.resumeId ? await resumeSetup(apiOrigin, input.resumeId, project, { signal, measurementDisabled: input.measurementDisabled }) : await connectSetup(apiOrigin, project, async (url, code) => {
|
|
48
|
-
terminal.block("Continue in your browser", [url, `Verification code: ${code}`, "Review the project, local changes and source permissions there."]);
|
|
49
|
+
terminal.block("Continue in your browser", [url, `Verification code: ${code}`, input.development ? "Choose your workspace, site and installation options in the browser." : "Review the project, local changes and source permissions there."]);
|
|
49
50
|
if (!input.noOpen && !await openBrowser(url)) terminal.info("Open the link above to continue.");
|
|
50
|
-
}, {
|
|
51
|
+
}, {
|
|
52
|
+
signal,
|
|
53
|
+
browserOrigin: input.browserOrigin,
|
|
54
|
+
automaticSetup: input.development,
|
|
55
|
+
measurementDisabled: input.measurementDisabled,
|
|
56
|
+
...input.development ? { launcher: { wizard_version: input.version, api_origin: apiOrigin, ...input.profile.kind === "local-development" ? { registry: input.profile.registry } : {} } } : {}
|
|
57
|
+
});
|
|
51
58
|
} catch (error) {
|
|
52
59
|
if (!input.resumeId && error instanceof BrowserSetupUnavailable) return false;
|
|
53
60
|
throw error;
|
|
54
61
|
}
|
|
55
|
-
const resume = setupResumeCommand(connected.client.identity.setup_id, apiOrigin, input.version);
|
|
56
|
-
terminal.block("Setup connected", [`Setup: ${connected.client.identity.setup_id}`, "Keep this terminal open
|
|
62
|
+
const resume = setupResumeCommand(connected.client.identity.setup_id, apiOrigin, input.version, input.profile);
|
|
63
|
+
terminal.block("Setup connected", [`Setup: ${connected.client.identity.setup_id}`, "Keep this terminal open while you complete setup in the browser.", `To reconnect from this project: ${resume}`]);
|
|
57
64
|
let status = "", displayedPacket = "";
|
|
58
65
|
const shownManual = /* @__PURE__ */ new Set();
|
|
59
66
|
try {
|
|
67
|
+
const automaticSetup = connected.session.capabilities.onboarding_v2 === true;
|
|
60
68
|
const result = await runSetup(connected.client, project, {
|
|
61
69
|
signal,
|
|
70
|
+
automaticSetup,
|
|
71
|
+
onOperationError({ kind, message, receiptPath }) {
|
|
72
|
+
terminal.block(`${kind === "install_packages" ? "Package installation" : kind.replaceAll("_", " ")} failed`, [
|
|
73
|
+
...message.split("\n").map(clean),
|
|
74
|
+
`Local diagnostic receipt: ${receiptPath}`,
|
|
75
|
+
"The detailed error stays on this computer; the browser receives only the operation status."
|
|
76
|
+
]);
|
|
77
|
+
},
|
|
62
78
|
onSession(session) {
|
|
63
79
|
for (const step of session.local_plan?.manual_steps ?? []) {
|
|
64
80
|
const key = `${step.kind}:${step.code}`;
|
|
@@ -71,10 +87,10 @@ async function runBrowserWizard(input) {
|
|
|
71
87
|
status = next;
|
|
72
88
|
const messages = {
|
|
73
89
|
configuring: "Choose the workspace, site and installation options in the browser.",
|
|
74
|
-
awaiting_local_approval: "Review and approve the exact local changes in the browser.",
|
|
90
|
+
awaiting_local_approval: automaticSetup ? "Choose your setup options in the browser." : "Review and approve the exact local changes in the browser.",
|
|
75
91
|
applying: "Applying browser-approved local changes.",
|
|
76
|
-
ready_for_recommendations: session.source?.status === "pending" ? "Review source files and provider details in the browser before any source upload." : "Continue with recommendations or skip that step in the browser.",
|
|
77
|
-
analyzing: "Analyzing the source packet approved in the browser.",
|
|
92
|
+
ready_for_recommendations: !session.capabilities.source_review ? session.commands.some((command) => ["failed", "manual", "outcome_unknown"].includes(command.status)) ? "Setup needs attention. Check the error above and review the results in the browser." : session.capabilities.sample_read ? "Finish setup or try the optional agent check in the browser." : "Finish setup in the browser." : !automaticSetup && session.source?.status === "pending" ? "Review source files and provider details in the browser before any source upload." : "Continue with recommendations or skip that step in the browser.",
|
|
93
|
+
analyzing: automaticSetup ? "Preparing survey suggestions from your project." : "Analyzing the source packet approved in the browser.",
|
|
78
94
|
selecting_drafts: "Review recommendations and select drafts in the browser.",
|
|
79
95
|
creating_drafts: "Creating only the drafts selected in the browser.",
|
|
80
96
|
agent_test: session.sample.status === "received" ? "Simulated sample received. Finish or skip in the browser." : "Complete or skip the optional agent test in the browser.",
|
|
@@ -85,9 +101,14 @@ async function runBrowserWizard(input) {
|
|
|
85
101
|
terminal.info(messages[session.phase]);
|
|
86
102
|
},
|
|
87
103
|
onSourceIssue(code) {
|
|
104
|
+
if (automaticSetup) {
|
|
105
|
+
terminal.warn(`Survey suggestions need attention (${clean(code)}). Retry in the browser or continue without suggestions.`);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
88
108
|
terminal.warn(`Source analysis needs review (${clean(code)}). Check the browser status, then retry source review or skip it. Changed local source requires fresh approval.`);
|
|
89
109
|
},
|
|
90
110
|
onSourcePrepared(packet) {
|
|
111
|
+
if (automaticSetup) return;
|
|
91
112
|
if (displayedPacket === packet.manifest.packet_digest) return;
|
|
92
113
|
displayedPacket = packet.manifest.packet_digest;
|
|
93
114
|
terminal.block("Local source review", [
|
|
@@ -98,12 +119,13 @@ async function runBrowserWizard(input) {
|
|
|
98
119
|
]);
|
|
99
120
|
},
|
|
100
121
|
onSample(session) {
|
|
101
|
-
terminal.block("Try your agent", ["Ask: What do UserReason dummy respondents think?", "Tell your agent to read this setup\u2019s simulated sample, using:", setupSampleCommand(session.setup_id, apiOrigin, input.profile.cliVersion), "This is example data. It does not read production responses or grant ongoing CLI access."]);
|
|
122
|
+
terminal.block("Try your agent", ["Ask: What do UserReason dummy respondents think?", "Tell your agent to read this setup\u2019s simulated sample, using:", setupSampleCommand(session.setup_id, apiOrigin, input.profile.cliVersion, input.profile), "This is example data. It does not read production responses or grant ongoing CLI access."]);
|
|
102
123
|
}
|
|
103
124
|
});
|
|
104
125
|
const summary = setupSummary(result);
|
|
126
|
+
const needsAttention = result.commands.some((command) => ["failed", "manual", "outcome_unknown"].includes(command.status));
|
|
105
127
|
terminal.block("Setup result", [
|
|
106
|
-
`Status: ${result.phase}`,
|
|
128
|
+
`Status: ${result.phase}${needsAttention ? " (installation needs attention)" : ""}`,
|
|
107
129
|
...summary.local_operations.map((operation) => `${operation.kind}: ${operation.status}${operation.code ? ` (${operation.code})` : ""}`),
|
|
108
130
|
...summary.manual_steps.map((step) => `${step.kind}: manual (${step.code})`),
|
|
109
131
|
...summary.drafts.map((draft) => `Draft ${draft.prompt_id}: ${draft.status}${draft.revision ? ` (revision ${draft.revision})` : ""}`),
|
|
@@ -113,7 +135,7 @@ async function runBrowserWizard(input) {
|
|
|
113
135
|
if (input.json) process.stdout.write(`${JSON.stringify(summary)}
|
|
114
136
|
`);
|
|
115
137
|
if (result.phase === "cancelled") process.exitCode = 130;
|
|
116
|
-
else if (result.phase !== "complete") process.exitCode = 1;
|
|
138
|
+
else if (result.phase !== "complete" || needsAttention) process.exitCode = 1;
|
|
117
139
|
return true;
|
|
118
140
|
} catch (error) {
|
|
119
141
|
terminal.info(`Resume from this project: ${resume}`);
|
|
@@ -2,7 +2,7 @@ import { createRequire as createWizardRequire } from 'node:module'; import { fil
|
|
|
2
2
|
import {
|
|
3
3
|
TELEMETRY_REASONS,
|
|
4
4
|
ToolTelemetry
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-7AAH6C4L.js";
|
|
6
6
|
|
|
7
7
|
// src/analytics.ts
|
|
8
8
|
var WizardAnalytics = class extends ToolTelemetry {
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
DEFAULT_API,
|
|
4
4
|
initializationSource,
|
|
5
5
|
integrationSource
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TOID3NYP.js";
|
|
7
7
|
import {
|
|
8
8
|
require_typescript
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-7AAH6C4L.js";
|
|
10
10
|
import {
|
|
11
11
|
__toESM
|
|
12
12
|
} from "./chunk-WL3NOIM6.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as createWizardRequire } from 'node:module'; import { fileURLToPath as wizardFileURLToPath } from 'node:url'; import { dirname as wizardDirname } from 'node:path'; const require = createWizardRequire(import.meta.url); const __filename = wizardFileURLToPath(import.meta.url); const __dirname = wizardDirname(__filename);
|
|
2
2
|
import {
|
|
3
3
|
currentPackageProfile
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7AAH6C4L.js";
|
|
5
5
|
|
|
6
6
|
// src/startup.ts
|
|
7
7
|
import { readFile } from "node:fs/promises";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { createRequire as createWizardRequire } from 'node:module'; import { fileURLToPath as wizardFileURLToPath } from 'node:url'; import { dirname as wizardDirname } from 'node:path'; const require = createWizardRequire(import.meta.url); const __filename = wizardFileURLToPath(import.meta.url); const __dirname = wizardDirname(__filename);
|
|
2
|
+
import {
|
|
3
|
+
sanitizeSetupDiagnostic
|
|
4
|
+
} from "./chunk-7AAH6C4L.js";
|
|
5
|
+
|
|
6
|
+
// src/install-diagnostics.ts
|
|
7
|
+
import { readFile, readdir, stat } from "node:fs/promises";
|
|
8
|
+
import { homedir } from "node:os";
|
|
9
|
+
import { join } from "node:path";
|
|
10
|
+
async function installFailureDetails(directory, cache, output) {
|
|
11
|
+
const secrets = [], missing = /* @__PURE__ */ new Set();
|
|
12
|
+
for (const path of /* @__PURE__ */ new Set([join(directory, ".npmrc"), process.env.npm_config_userconfig ?? process.env.NPM_CONFIG_USERCONFIG ?? join(homedir(), ".npmrc")])) {
|
|
13
|
+
try {
|
|
14
|
+
if ((await stat(path)).size > 1e6) continue;
|
|
15
|
+
for (const line of (await readFile(path, "utf8")).split(/\r?\n/)) {
|
|
16
|
+
const match = /^\s*[^=]*(?:_authToken|_auth|_password)\s*=\s*(.+)$/i.exec(line);
|
|
17
|
+
if (!match) continue;
|
|
18
|
+
const value = match[1].trim();
|
|
19
|
+
const variable = /^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/.exec(value);
|
|
20
|
+
if (variable) {
|
|
21
|
+
if (!process.env[variable[1]]) missing.add(variable[1]);
|
|
22
|
+
} else secrets.push(value);
|
|
23
|
+
}
|
|
24
|
+
} catch {
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const requests = /* @__PURE__ */ new Set();
|
|
28
|
+
if (cache) try {
|
|
29
|
+
const folder = join(cache, "_logs");
|
|
30
|
+
for (const name of (await readdir(folder)).filter((name2) => name2.endsWith("-debug-0.log")).sort().slice(-3)) {
|
|
31
|
+
const path = join(folder, name);
|
|
32
|
+
if ((await stat(path)).size > 2e6) continue;
|
|
33
|
+
for (const line of (await readFile(path, "utf8")).split("\n")) {
|
|
34
|
+
const match = /\bhttp fetch (GET|POST|PUT) ([45]\d\d) (https?:\/\/\S+)/.exec(line);
|
|
35
|
+
if (match && requests.size < 12) requests.add(`${match[2]} ${match[1]} ${match[3]}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
} catch {
|
|
39
|
+
}
|
|
40
|
+
const lines = output.split(/\r?\n/).filter((line) => !/complete log of this run|npm notice/.test(line)).slice(-45);
|
|
41
|
+
return sanitizeSetupDiagnostic([
|
|
42
|
+
...requests,
|
|
43
|
+
...lines,
|
|
44
|
+
...[...missing].map((name) => `Authentication variable ${name} is not set in the wizard process.`)
|
|
45
|
+
].join("\n"), secrets);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
installFailureDetails
|
|
50
|
+
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { createRequire as createWizardRequire } from 'node:module'; import { fileURLToPath as wizardFileURLToPath } from 'node:url'; import { dirname as wizardDirname } from 'node:path'; const require = createWizardRequire(import.meta.url); const __filename = wizardFileURLToPath(import.meta.url); const __dirname = wizardDirname(__filename);
|
|
2
2
|
import {
|
|
3
3
|
planFooter
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4INLEQE2.js";
|
|
5
5
|
import {
|
|
6
6
|
planAgentSkill
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SB3AYQWG.js";
|
|
8
8
|
import {
|
|
9
9
|
detectInstallation,
|
|
10
10
|
initializationPath,
|
|
11
11
|
planIntegration
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-LEJFE4U5.js";
|
|
13
13
|
import {
|
|
14
14
|
compatibleProductionVersion,
|
|
15
15
|
inspectProject,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
installSdk,
|
|
18
18
|
installedVersion,
|
|
19
19
|
integrationSource
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-TOID3NYP.js";
|
|
21
21
|
import {
|
|
22
22
|
planPackageRegistry
|
|
23
23
|
} from "./chunk-NMHTFC5Q.js";
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
setupHash,
|
|
36
36
|
verifySetupFiles,
|
|
37
37
|
writeSetupFile
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-7AAH6C4L.js";
|
|
39
39
|
|
|
40
40
|
// src/setup.ts
|
|
41
41
|
import { basename } from "node:path";
|
|
@@ -261,6 +261,8 @@ function connectSetup(apiOrigin, project, onBrowser, options = {}) {
|
|
|
261
261
|
insert_footer: true,
|
|
262
262
|
source_review: true,
|
|
263
263
|
sample_read: true,
|
|
264
|
+
...options.automaticSetup ? { onboarding_v2: true } : {},
|
|
265
|
+
...options.launcher ? { launcher: options.launcher } : {},
|
|
264
266
|
project_name: basename(project.directory).replace(/[\u0000-\u001f\u007f\/\\]/g, "").trim().slice(0, 120) || "Application",
|
|
265
267
|
terminal: detectSetupTerminal()
|
|
266
268
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { createRequire as createWizardRequire } from 'node:module'; import { fileURLToPath as wizardFileURLToPath } from 'node:url'; import { dirname as wizardDirname } from 'node:path'; const require = createWizardRequire(import.meta.url); const __filename = wizardFileURLToPath(import.meta.url); const __dirname = wizardDirname(__filename);
|
|
2
|
-
import {
|
|
3
|
-
Cancelled
|
|
4
|
-
} from "./chunk-GOYBYAUH.js";
|
|
5
2
|
import {
|
|
6
3
|
cliCommand
|
|
7
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TOID3NYP.js";
|
|
8
5
|
import {
|
|
9
6
|
require_dist
|
|
10
7
|
} from "./chunk-NMHTFC5Q.js";
|
|
8
|
+
import {
|
|
9
|
+
Cancelled
|
|
10
|
+
} from "./chunk-EVNEX5N5.js";
|
|
11
11
|
import {
|
|
12
12
|
__toESM
|
|
13
13
|
} from "./chunk-WL3NOIM6.js";
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { createRequire as createWizardRequire } from 'node:module'; import { fileURLToPath as wizardFileURLToPath } from 'node:url'; import { dirname as wizardDirname } from 'node:path'; const require = createWizardRequire(import.meta.url); const __filename = wizardFileURLToPath(import.meta.url); const __dirname = wizardDirname(__filename);
|
|
2
|
+
import {
|
|
3
|
+
installFailureDetails
|
|
4
|
+
} from "./chunk-PJQOSDYS.js";
|
|
2
5
|
import {
|
|
3
6
|
configurePackageRegistry
|
|
4
7
|
} from "./chunk-NMHTFC5Q.js";
|
|
5
8
|
import {
|
|
6
9
|
packageProfile
|
|
7
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-7AAH6C4L.js";
|
|
8
11
|
|
|
9
12
|
// src/project.ts
|
|
10
13
|
import { lstat, readFile, writeFile, access, mkdtemp, realpath, rm } from "node:fs/promises";
|
|
@@ -184,6 +187,7 @@ async function installDependency(project, dependency, options) {
|
|
|
184
187
|
if (dependency === "cli") args.push(project.packageManager === "yarn" ? "--dev" : "--save-dev");
|
|
185
188
|
if (profile.kind === "local-development" || options.exact) args.push(project.packageManager === "yarn" ? "--exact" : "--save-exact");
|
|
186
189
|
let cache;
|
|
190
|
+
let logs = "";
|
|
187
191
|
try {
|
|
188
192
|
options.signal?.throwIfAborted();
|
|
189
193
|
if (options.configureRegistry !== false) await configurePackageRegistry(project, profile);
|
|
@@ -211,11 +215,9 @@ async function installDependency(project, dependency, options) {
|
|
|
211
215
|
};
|
|
212
216
|
options.signal?.addEventListener("abort", abort, { once: true });
|
|
213
217
|
if (options.signal?.aborted) abort();
|
|
214
|
-
let logs = "";
|
|
215
218
|
const capture = (chunk) => {
|
|
216
219
|
const text = chunk.toString();
|
|
217
220
|
logs = (logs + text).slice(-64e3);
|
|
218
|
-
if (options.verbose) process.stderr.write(text);
|
|
219
221
|
};
|
|
220
222
|
child.stdout?.on("data", capture);
|
|
221
223
|
child.stderr?.on("data", capture);
|
|
@@ -237,19 +239,24 @@ async function installDependency(project, dependency, options) {
|
|
|
237
239
|
const restricted = /ERR_ACCESS_DENIED|Access to this API has been restricted/.test(logs);
|
|
238
240
|
reject(
|
|
239
241
|
new SdkInstallError(
|
|
240
|
-
restricted ? `Your Node or package-manager permission policy blocked ${label} installation. Run the manual install command in your normal terminal.` : `${label} installation failed (${project.packageManager} exit ${code}).
|
|
242
|
+
restricted ? `Your Node or package-manager permission policy blocked ${label} installation. Run the manual install command in your normal terminal.` : `${label} installation failed (${project.packageManager} exit ${code}). Package-manager details follow.`
|
|
241
243
|
)
|
|
242
244
|
);
|
|
243
245
|
}
|
|
244
246
|
});
|
|
245
247
|
});
|
|
246
248
|
} catch (error) {
|
|
247
|
-
if (error instanceof SdkInstallError)
|
|
249
|
+
if (error instanceof SdkInstallError) {
|
|
250
|
+
const details = await installFailureDetails(project.directory, cache, logs);
|
|
251
|
+
if (details) error.message += "\n" + details;
|
|
252
|
+
throw error;
|
|
253
|
+
}
|
|
248
254
|
throw new SdkInstallError(
|
|
249
|
-
"Unable to prepare
|
|
255
|
+
"Unable to prepare or run package installation. " + await installFailureDetails(project.directory, cache, error instanceof Error ? error.message : "Unknown local error."),
|
|
250
256
|
{ cause: error }
|
|
251
257
|
);
|
|
252
258
|
} finally {
|
|
259
|
+
if (options.verbose && logs) process.stderr.write(await installFailureDetails(project.directory, cache, logs) + "\n");
|
|
253
260
|
if (cache) {
|
|
254
261
|
try {
|
|
255
262
|
await rm(cache, { recursive: true, force: true });
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { createRequire as createWizardRequire } from 'node:module'; import { fileURLToPath as wizardFileURLToPath } from 'node:url'; import { dirname as wizardDirname } from 'node:path'; const require = createWizardRequire(import.meta.url); const __filename = wizardFileURLToPath(import.meta.url); const __dirname = wizardDirname(__filename);
|
|
2
|
-
import {
|
|
3
|
-
Cancelled
|
|
4
|
-
} from "./chunk-GOYBYAUH.js";
|
|
5
2
|
import {
|
|
6
3
|
cliCommand,
|
|
7
4
|
compatibleCliVersion
|
|
8
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-TOID3NYP.js";
|
|
6
|
+
import {
|
|
7
|
+
Cancelled
|
|
8
|
+
} from "./chunk-EVNEX5N5.js";
|
|
9
9
|
import {
|
|
10
10
|
packageProfile
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-7AAH6C4L.js";
|
|
12
12
|
|
|
13
13
|
// src/global-cli.ts
|
|
14
14
|
import { execFile } from "node:child_process";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { createRequire as createWizardRequire } from 'node:module'; import { fileURLToPath as wizardFileURLToPath } from 'node:url'; import { dirname as wizardDirname } from 'node:path'; const require = createWizardRequire(import.meta.url); const __filename = wizardFileURLToPath(import.meta.url); const __dirname = wizardDirname(__filename);
|
|
2
2
|
import {
|
|
3
3
|
detectInstallation
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LEJFE4U5.js";
|
|
5
5
|
import {
|
|
6
6
|
DEFAULT_API
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TOID3NYP.js";
|
|
8
8
|
import {
|
|
9
9
|
apiUrl,
|
|
10
10
|
configDirectory,
|
|
11
11
|
uuid
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-7AAH6C4L.js";
|
|
13
13
|
|
|
14
14
|
// src/state.ts
|
|
15
15
|
import { mkdir, readFile, writeFile, rename, rm, realpath, lstat } from "node:fs/promises";
|
|
@@ -2,14 +2,14 @@ import { createRequire as createWizardRequire } from 'node:module'; import { fil
|
|
|
2
2
|
import {
|
|
3
3
|
Cancelled,
|
|
4
4
|
openBrowser
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-EVNEX5N5.js";
|
|
6
6
|
import {
|
|
7
7
|
authorizeCli,
|
|
8
8
|
grantSummary,
|
|
9
9
|
printable,
|
|
10
10
|
resolveCredentials,
|
|
11
11
|
saveConfig
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-7AAH6C4L.js";
|
|
13
13
|
|
|
14
14
|
// src/cli-access.ts
|
|
15
15
|
async function offerCliAccess(config, terminal, options) {
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import { createRequire as createWizardRequire } from 'node:module'; import { fileURLToPath as wizardFileURLToPath } from 'node:url'; import { dirname as wizardDirname } from 'node:path'; const require = createWizardRequire(import.meta.url); const __filename = wizardFileURLToPath(import.meta.url); const __dirname = wizardDirname(__filename);
|
|
2
2
|
import {
|
|
3
3
|
firstSurvey,
|
|
4
|
-
firstSurveyHandoff
|
|
5
|
-
|
|
6
|
-
recommendedSurveys
|
|
7
|
-
} from "./chunk-77SK7TKZ.js";
|
|
4
|
+
firstSurveyHandoff
|
|
5
|
+
} from "./chunk-7AAH6C4L.js";
|
|
8
6
|
|
|
9
7
|
// src/first-survey.ts
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
var surveySuggestionsEnabled = false;
|
|
9
|
+
function beginFirstSurveyPreparation(_root, _mode, _prepare) {
|
|
10
|
+
return void 0;
|
|
12
11
|
}
|
|
13
12
|
async function offerFirstSurvey(client, root, workspace, site, ui, mode) {
|
|
14
|
-
if (!mode.interactive || mode.preview) return { state: "skipped" };
|
|
15
|
-
if (mode.development) return recommendedSurveys(client, root, workspace, site, ui, mode);
|
|
13
|
+
if (!surveySuggestionsEnabled || mode.development || !mode.interactive || mode.preview) return { state: "skipped" };
|
|
16
14
|
const choice = await ui.choose(
|
|
17
15
|
"Find your first useful survey? Nothing changes or publishes automatically.",
|
|
18
16
|
[
|
package/dist/cli-access.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createRequire as createWizardRequire } from 'node:module'; import { fileURLToPath as wizardFileURLToPath } from 'node:url'; import { dirname as wizardDirname } from 'node:path'; const require = createWizardRequire(import.meta.url); const __filename = wizardFileURLToPath(import.meta.url); const __dirname = wizardDirname(__filename);
|
|
2
2
|
import {
|
|
3
3
|
offerCliAccess
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-XPFKXLIZ.js";
|
|
5
|
+
import "./chunk-EVNEX5N5.js";
|
|
6
|
+
import "./chunk-7AAH6C4L.js";
|
|
7
7
|
import "./chunk-WL3NOIM6.js";
|
|
8
8
|
export {
|
|
9
9
|
offerCliAccess
|
package/dist/connection.js
CHANGED
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
compatibilityCredentials,
|
|
5
5
|
connectInstallation,
|
|
6
6
|
memoryCredentials
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DMXUXEQI.js";
|
|
8
8
|
import {
|
|
9
9
|
CredentialStoreError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-7AAH6C4L.js";
|
|
11
11
|
import "./chunk-WL3NOIM6.js";
|
|
12
12
|
export {
|
|
13
13
|
BrowserConnectionUnavailable,
|
package/dist/first-survey.js
CHANGED
|
@@ -2,8 +2,8 @@ import { createRequire as createWizardRequire } from 'node:module'; import { fil
|
|
|
2
2
|
import {
|
|
3
3
|
beginFirstSurveyPreparation,
|
|
4
4
|
offerFirstSurvey
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-ZHJV247H.js";
|
|
6
|
+
import "./chunk-7AAH6C4L.js";
|
|
7
7
|
import "./chunk-WL3NOIM6.js";
|
|
8
8
|
export {
|
|
9
9
|
beginFirstSurveyPreparation,
|
package/dist/footer.js
CHANGED
|
@@ -3,11 +3,12 @@ import {
|
|
|
3
3
|
FOOTER_LINK,
|
|
4
4
|
applyFooter,
|
|
5
5
|
planFooter
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-4INLEQE2.js";
|
|
7
|
+
import "./chunk-LEJFE4U5.js";
|
|
8
|
+
import "./chunk-TOID3NYP.js";
|
|
9
|
+
import "./chunk-PJQOSDYS.js";
|
|
9
10
|
import "./chunk-NMHTFC5Q.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-7AAH6C4L.js";
|
|
11
12
|
import "./chunk-WL3NOIM6.js";
|
|
12
13
|
export {
|
|
13
14
|
FOOTER_LINK,
|
package/dist/global-cli.js
CHANGED
|
@@ -2,11 +2,12 @@ import { createRequire as createWizardRequire } from 'node:module'; import { fil
|
|
|
2
2
|
import {
|
|
3
3
|
globalCliInstallCommand,
|
|
4
4
|
offerGlobalCli
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-TRBSH5G7.js";
|
|
6
|
+
import "./chunk-TOID3NYP.js";
|
|
7
|
+
import "./chunk-PJQOSDYS.js";
|
|
8
8
|
import "./chunk-NMHTFC5Q.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-EVNEX5N5.js";
|
|
10
|
+
import "./chunk-7AAH6C4L.js";
|
|
10
11
|
import "./chunk-WL3NOIM6.js";
|
|
11
12
|
export {
|
|
12
13
|
globalCliInstallCommand,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createRequire as createWizardRequire } from 'node:module'; import { fileURLToPath as wizardFileURLToPath } from 'node:url'; import { dirname as wizardDirname } from 'node:path'; const require = createWizardRequire(import.meta.url); const __filename = wizardFileURLToPath(import.meta.url); const __dirname = wizardDirname(__filename);
|
|
2
|
+
import {
|
|
3
|
+
installFailureDetails
|
|
4
|
+
} from "./chunk-PJQOSDYS.js";
|
|
5
|
+
import "./chunk-7AAH6C4L.js";
|
|
6
|
+
import "./chunk-WL3NOIM6.js";
|
|
7
|
+
export {
|
|
8
|
+
installFailureDetails
|
|
9
|
+
};
|
package/dist/integrate.js
CHANGED
|
@@ -6,10 +6,11 @@ import {
|
|
|
6
6
|
integrationAdditions,
|
|
7
7
|
integrationPreview,
|
|
8
8
|
planIntegration
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-LEJFE4U5.js";
|
|
10
|
+
import "./chunk-TOID3NYP.js";
|
|
11
|
+
import "./chunk-PJQOSDYS.js";
|
|
11
12
|
import "./chunk-NMHTFC5Q.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-7AAH6C4L.js";
|
|
13
14
|
import "./chunk-WL3NOIM6.js";
|
|
14
15
|
export {
|
|
15
16
|
applyIntegration,
|
package/dist/project.js
CHANGED
|
@@ -19,9 +19,10 @@ import {
|
|
|
19
19
|
sdkInstallCommand,
|
|
20
20
|
verifyConfiguration,
|
|
21
21
|
writeIntegration
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-TOID3NYP.js";
|
|
23
|
+
import "./chunk-PJQOSDYS.js";
|
|
23
24
|
import "./chunk-NMHTFC5Q.js";
|
|
24
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-7AAH6C4L.js";
|
|
25
26
|
import "./chunk-WL3NOIM6.js";
|
|
26
27
|
export {
|
|
27
28
|
DEFAULT_API,
|
package/dist/setup-flow.js
CHANGED
|
@@ -5,15 +5,16 @@ import {
|
|
|
5
5
|
setupResumeCommand,
|
|
6
6
|
setupSampleCommand,
|
|
7
7
|
setupSummary
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-CSZW2ULJ.js";
|
|
9
|
+
import "./chunk-Q5U5UOQN.js";
|
|
10
|
+
import "./chunk-4INLEQE2.js";
|
|
11
|
+
import "./chunk-SB3AYQWG.js";
|
|
12
|
+
import "./chunk-LEJFE4U5.js";
|
|
13
|
+
import "./chunk-TOID3NYP.js";
|
|
14
|
+
import "./chunk-PJQOSDYS.js";
|
|
15
15
|
import "./chunk-NMHTFC5Q.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-EVNEX5N5.js";
|
|
17
|
+
import "./chunk-7AAH6C4L.js";
|
|
17
18
|
import "./chunk-WL3NOIM6.js";
|
|
18
19
|
export {
|
|
19
20
|
runBrowserWizard,
|
package/dist/setup.js
CHANGED
|
@@ -6,18 +6,19 @@ import {
|
|
|
6
6
|
resumeSetup,
|
|
7
7
|
runSetup,
|
|
8
8
|
setupRuntime
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-Q5U5UOQN.js";
|
|
10
|
+
import "./chunk-4INLEQE2.js";
|
|
11
|
+
import "./chunk-SB3AYQWG.js";
|
|
12
|
+
import "./chunk-LEJFE4U5.js";
|
|
13
|
+
import "./chunk-TOID3NYP.js";
|
|
14
|
+
import "./chunk-PJQOSDYS.js";
|
|
15
15
|
import "./chunk-NMHTFC5Q.js";
|
|
16
|
+
import "./chunk-EVNEX5N5.js";
|
|
16
17
|
import {
|
|
17
18
|
BrowserSetupUnavailable,
|
|
18
19
|
SetupError,
|
|
19
20
|
withSetupProjectLock
|
|
20
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-7AAH6C4L.js";
|
|
21
22
|
import "./chunk-WL3NOIM6.js";
|
|
22
23
|
export {
|
|
23
24
|
BrowserSetupUnavailable,
|