@mnemonik/cli 7.103.0 → 7.103.1

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/digests.json CHANGED
@@ -43,8 +43,8 @@
43
43
  "dist/router.d.ts.map": "0395d059355451637c0d6501875ec161bba7eb46f82a8023e6b3ba2d2886d1ec",
44
44
  "dist/router.js": "1de5b58c00627bd2d654a64d7ee4bd597cff989be9af8d5624ca3191d210f47a",
45
45
  "dist/router.js.map": "12a434e003c7cf2a62ea134224b9d79a64d69fd89cfdf3234c41f6b7d1befda0",
46
- "dist/sbom.json": "5da4967fbb3e573d1f157b470af1d6a20738311b12370ec26940a8adc101debb",
47
- "dist/scanner-release.json": "ff520f80b8153217e53faf187c0f5c4d2e96380a48323acceee8a4b4652af16d",
46
+ "dist/sbom.json": "b9922400c1e38c0e955c8def00511b107eb3abbe98c45057e0b0ff2bca4551fe",
47
+ "dist/scanner-release.json": "838d3b3f2447aa348c9cf02b02f36c327aaee1b14605b926a2f2cc850a966cb8",
48
48
  "dist/screens.d.ts": "1cf8371307f61409cb5f495a1577dac824b8c8b6cf41f1738c26d1eeb3379199",
49
49
  "dist/screens.d.ts.map": "04c06aec78103390eb80382c4d4f0776ade2abafdb8dd2c3a9e9292ee01c4af8",
50
50
  "dist/screens.js": "bc222e6dacd22f9d50432a7b6f48934c38913569a99f2636779ca45a7f88ac7b",
@@ -94,9 +94,9 @@
94
94
  "dist/install/journal.js": "f62f672259d0b750f09dfa0d76a4129eb361f4b0d00dac69fc420f5e0f661aed",
95
95
  "dist/install/journal.js.map": "24d7aa711920a3b514a72cb9914830d8540cf2188d93a0fd5dd726a8473e287d",
96
96
  "dist/install/journey.d.ts": "f8a4ae8fa564e7d5b2720f524e4c5c5081399fbfc19d0c633a6036a53cf19b21",
97
- "dist/install/journey.d.ts.map": "9344f4323c120a1bf619f12869efb81bb00fed2ea6a4a5bf24a072c5cbe88f40",
98
- "dist/install/journey.js": "19f4517ce06581b212d6ec9b980398a2f5228a67b42126c4cfd62ea86bfcfde1",
99
- "dist/install/journey.js.map": "7b78045780dcb877bf35d295d3cca57d5285706daaa6b13ab93e179d0f99e953",
97
+ "dist/install/journey.d.ts.map": "ebd7ca6f777534ae8361f681376e4987e12d38c3b7a583532d04afa1b7bfa560",
98
+ "dist/install/journey.js": "f0cd8dd49e8e95c5c7b578ebc7488091cf665aab42e8bb374cac195335ca7685",
99
+ "dist/install/journey.js.map": "6e653c4f08d1231d0deef5d87ffc5519fa97ccc0921bb81c00eb4a76a4a396dd",
100
100
  "dist/install/ownership.d.ts": "9ce76111b3424693a29036cd459ed14158ed11167f5f0aed13247df33941202b",
101
101
  "dist/install/ownership.d.ts.map": "e16f1f8d7c9375f73041289ad78b9d8ea2dfdb01199967cdeb3c436c6a64570b",
102
102
  "dist/install/ownership.js": "238b1e32ecbb170c8f24f03f31b06a2d308895168133291ee1a2902bf9c4255e",
@@ -145,18 +145,18 @@
145
145
  "dist/scanner/data.d.ts.map": "997415437937f3c1c8848497198eb8a070fd5296adf6d5faffdfc5a885d26f7e",
146
146
  "dist/scanner/data.js": "acb503efbe8e202550ef0b86c6a9a8a222682b8828042928947c92f76b13c1ae",
147
147
  "dist/scanner/data.js.map": "490a61e186b7be15e63cc846563e323e91add45e1ed4a28a185ec22b07c7e8bd",
148
- "dist/scanner/discover.d.ts": "910eb57fad447db376d530c01b87b85d66019f3dc4bc414876bed0f2fc127ca9",
149
- "dist/scanner/discover.d.ts.map": "ef9df03778731071efb8f1d406dff9e8a68d9993ec77c3090fca0b50357aca01",
150
- "dist/scanner/discover.js": "a6a7319590fd5bd2c23c2ae6fe0040fd4fd5911301d8da2f371d3eee5215a95b",
151
- "dist/scanner/discover.js.map": "741ab7b8ec6137ebf450fad4ade0a7ea1682fe2b08905d7c9cc98a1e4f505fb9",
148
+ "dist/scanner/discover.d.ts": "8daf535b311c5cd6b0d8d4149aa279ba937fccdf6a66a7941789ab0345c87972",
149
+ "dist/scanner/discover.d.ts.map": "ceace7bbc93bd32e46f0c0afbad8c8dd5f51af0660dfd3b34fd6a7c08ded7b08",
150
+ "dist/scanner/discover.js": "acf8981edca1c87f949a19426539206964f54dccf44a2e80642aec3c2c7efd52",
151
+ "dist/scanner/discover.js.map": "0c16181109df421ccb2a563f8343eb5306acc945fd69547054145c889c3e99af",
152
152
  "dist/scanner/enable.d.ts": "ea6928fe3c4de0f019de4e7903ebeec039b0edb2411fb4f07dab957d878a971e",
153
153
  "dist/scanner/enable.d.ts.map": "58c44313251016a3ce9991aea15da5efb4428f544661127eb93faace8a37324b",
154
154
  "dist/scanner/enable.js": "90bc7cf4a85f2635e88de7d31885861c6f646360a9e7ddf5d2d40cc9bc72e18b",
155
155
  "dist/scanner/enable.js.map": "cbfc913fa86406b12018730feb553d1af981e9a6183c343c4bce3f4af19f570c",
156
156
  "dist/scanner/picker.d.ts": "8e3a77dbfb004749e66d379544bdfc29189c4478c6e67e5dd5390979d55d0808",
157
- "dist/scanner/picker.d.ts.map": "7c58d8ccdd06c65996bf46cc1e5e398b34c06af4111bf3d22e197b82887ef06a",
158
- "dist/scanner/picker.js": "a62e3f6e774e671385046502977a8f79294ae5ae76894db8bf40fc322e583ddb",
159
- "dist/scanner/picker.js.map": "ddcfe69689f1a378541f69b0558746ab9006ad6a4ead049eeafd9c748c7cf1b8",
157
+ "dist/scanner/picker.d.ts.map": "1d4d49000a5d517fdfc83ecbecb30a815e3a01f6c21e70d0db7f71b8d54eb1f5",
158
+ "dist/scanner/picker.js": "57425c0c3344f7480c4e50994f0bcce48305821e8503007177d13170e810d913",
159
+ "dist/scanner/picker.js.map": "4d16b45e4c9852d6b8ca3086880e07403a84da5675c972919d4c08747ec46d94",
160
160
  "dist/scanner/service.d.ts": "f1559d1915dfc08efd7a149358fb39027312cbafd8a32f93e17cbc240ca62986",
161
161
  "dist/scanner/service.d.ts.map": "58409ca5b81129cc619b8b166b913f764cb42753ad2cdf95ce6598abb2a51b74",
162
162
  "dist/scanner/service.js": "f8b1dbf03ea07fc4bc9317673cbdcb2602c8d231ad7fcc67c79eb812a4c85638",
@@ -165,10 +165,10 @@
165
165
  "dist/scanner/update.d.ts.map": "fdd2e50b12615000681f3f867cbc57ce2a7684627142008c570fa9832316ee24",
166
166
  "dist/scanner/update.js": "a9427f65a91a0d19f72477d30607be00b472ac9b8a76e4dba8411377bcf1d145",
167
167
  "dist/scanner/update.js.map": "f1bbe0ad9aff2eda7c7a4ea7888ac7091059481b637b0a88e2c6cbb5da5033e2",
168
- "dist/screens/journey.d.ts": "e39f2d9b39ad70e6d388c65ef60c7bfa92b8d09912bb8428488e59a906d019a2",
169
- "dist/screens/journey.d.ts.map": "05d92996aff102dcf1abf363ba38c633a1fa44ff139401592086c4ec9cfca56a",
170
- "dist/screens/journey.js": "7849355983942c9090f25a88bf41d08b266bfb5b39c6ff569e94e723b146c76f",
171
- "dist/screens/journey.js.map": "f5197334064f919379f0686758f6d0cf9d8434c01f22c4790ba58e99a11da3ba",
168
+ "dist/screens/journey.d.ts": "c753f368bd0063c49b3b49093be4a61c30d11c060388428d4c2b6d853c758093",
169
+ "dist/screens/journey.d.ts.map": "1573603c4a0b976f46d74e91f7778cefc2f95375a1c9da337511a5dff6f19934",
170
+ "dist/screens/journey.js": "aef4c9094ec2a28a481eddc592623fcbc5aa151d456df72573dcb545d7fdfbd6",
171
+ "dist/screens/journey.js.map": "4a753adbf4837757f53131b525926f2f5f5e4f630c6a4a4278aa31471286e846",
172
172
  "dist/transport/server.d.ts": "7c753c747615d9a4360ac669538d6653cdf1f3a100d25f6e11ce7a93f2c99166",
173
173
  "dist/transport/server.d.ts.map": "86706da48210c58c6133bd104144dbdbfa4a48d27a109273a26607cf754c69f4",
174
174
  "dist/transport/server.js": "23b9b32f3b027d64f7d32e699d6277f4449b4ec6724836468ea871f4b6d5fec4",
@@ -1 +1 @@
1
- {"version":3,"file":"journey.d.ts","sourceRoot":"","sources":["../../src/install/journey.ts"],"names":[],"mappings":"AAKA,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACxB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAuB3C,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,UAAU,EAEhB,MAAM,YAAY,CAAC;AAUpB,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,UAAU,EAAE,EACrB,OAAO,EAAE,OAAO,GACf,kBAAkB,EAAE,CAUtB;AAED,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,MAAM,OAAO,CAAC,iBAAiB,CAAC,EACvC,OAAO,EAAE,MAAM,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,EACxC,KAAK,GAAE,IAAI,CAAC,gBAAgB,EAAE,KAAK,GAAG,OAAO,CAAM,GAClD,OAAO,CAAC;IAAE,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CA0B7D;AAED,wBAAsB,aAAa,CACjC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,EACjC,IAAI,EAAE,eAAe,EACrB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,EAChC,UAAU,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC,GAC1C,OAAO,CAAC,MAAM,CAAC,CA0yBjB"}
1
+ {"version":3,"file":"journey.d.ts","sourceRoot":"","sources":["../../src/install/journey.ts"],"names":[],"mappings":"AAKA,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACxB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AA0B3C,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,UAAU,EAEhB,MAAM,YAAY,CAAC;AAUpB,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,UAAU,EAAE,EACrB,OAAO,EAAE,OAAO,GACf,kBAAkB,EAAE,CAUtB;AAED,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,MAAM,OAAO,CAAC,iBAAiB,CAAC,EACvC,OAAO,EAAE,MAAM,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,EACxC,KAAK,GAAE,IAAI,CAAC,gBAAgB,EAAE,KAAK,GAAG,OAAO,CAAM,GAClD,OAAO,CAAC;IAAE,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CA0B7D;AAED,wBAAsB,aAAa,CACjC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,EACjC,IAAI,EAAE,eAAe,EACrB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,EAChC,UAAU,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC,GAC1C,OAAO,CAAC,MAAM,CAAC,CA40BjB"}
@@ -496,11 +496,54 @@ var require_ignore = __commonJS({
496
496
  });
497
497
 
498
498
  // packages/shared/dist/runtimeSigners.js
499
- var ttl;
499
+ import { basename, dirname as dirname2, join as join2, resolve, sep, win32 } from "node:path";
500
+ import { execFile, execFileSync } from "node:child_process";
501
+ function windowsCommand(file) {
502
+ const root = process.env.SystemRoot;
503
+ if (!root || !win32.isAbsolute(root))
504
+ throw new Error("acl_system_root_unavailable");
505
+ return win32.join(root, "System32", file);
506
+ }
507
+ function readIdentity(stdout) {
508
+ const match = /^"([^"\r\n]+)","(S-1-(?:\d+-)+\d+)"$/.exec(stdout.trim());
509
+ if (!match?.[1] || !match[2] || stdout.includes("\uFFFD"))
510
+ throw new Error("acl_identity_unavailable");
511
+ return { name: match[1], sid: match[2] };
512
+ }
513
+ function windowsCurrentAccountSync() {
514
+ return currentIdentity ??= readIdentity(hookExecuteSync(windowsCommand("whoami.exe"), identityArgs));
515
+ }
516
+ function hookInvocation(file, args2) {
517
+ if (win32.basename(file) === "whoami.exe") {
518
+ if ([file, ...args2].some((arg) => /[%!"\r\n]/.test(arg)))
519
+ throw new Error("acl_path_unavailable");
520
+ const command = args2.map((arg) => /^(?:[a-z0-9]+|\/[a-z]+)$/i.test(arg) ? arg : `"${arg}"`).join(" ");
521
+ return [
522
+ windowsCommand("cmd.exe"),
523
+ ["/d", "/v:off", "/s", "/c", `"chcp 65001>nul & "${file}" ${command}"`]
524
+ ];
525
+ }
526
+ if (win32.basename(file) === "cmd.exe")
527
+ return [file, ["/u", ...args2]];
528
+ return [file, args2];
529
+ }
530
+ function hookExecuteSync(file, args2, input) {
531
+ [file, args2] = hookInvocation(file, args2);
532
+ return execFileSync(file, args2, { ...hookOptions(file, args2), input });
533
+ }
534
+ var identityArgs, currentIdentity, ttl, hookOptions;
500
535
  var init_runtimeSigners = __esm({
501
536
  "packages/shared/dist/runtimeSigners.js"() {
502
537
  "use strict";
538
+ identityArgs = ["/user", "/fo", "csv", "/nh"];
503
539
  ttl = 10 * 6e4;
540
+ hookOptions = (file, args2) => ({
541
+ encoding: args2.includes("/u") ? "utf16le" : "utf8",
542
+ timeout: win32.basename(file) === "powershell.exe" ? 3e4 : 5e3,
543
+ windowsHide: true,
544
+ maxBuffer: 16 * 1024 * 1024,
545
+ windowsVerbatimArguments: win32.basename(file) === "cmd.exe"
546
+ });
504
547
  }
505
548
  });
506
549
 
@@ -562,8 +605,8 @@ var init_hookRuntime = __esm({
562
605
  });
563
606
 
564
607
  // packages/cli/src/install/journey.ts
565
- import { appendFile, mkdir, readFile } from "node:fs/promises";
566
- import { join as join3 } from "node:path";
608
+ import { appendFile, mkdir as mkdir2, readFile as readFile2, rm } from "node:fs/promises";
609
+ import { join as join4 } from "node:path";
567
610
  import { homedir as homedir2 } from "node:os";
568
611
  import { setTimeout as delay } from "node:timers/promises";
569
612
 
@@ -2177,13 +2220,13 @@ async function Module2(moduleArg = {}) {
2177
2220
  }
2178
2221
  readAsync = /* @__PURE__ */ __name(async (url) => {
2179
2222
  if (isFileURI(url)) {
2180
- return new Promise((resolve, reject) => {
2223
+ return new Promise((resolve2, reject) => {
2181
2224
  var xhr = new XMLHttpRequest();
2182
2225
  xhr.open("GET", url, true);
2183
2226
  xhr.responseType = "arraybuffer";
2184
2227
  xhr.onload = () => {
2185
2228
  if (xhr.status == 200 || xhr.status == 0 && xhr.response) {
2186
- resolve(xhr.response);
2229
+ resolve2(xhr.response);
2187
2230
  return;
2188
2231
  }
2189
2232
  reject(xhr.status);
@@ -2379,9 +2422,9 @@ async function Module2(moduleArg = {}) {
2379
2422
  __name(receiveInstantiationResult, "receiveInstantiationResult");
2380
2423
  var info22 = getWasmImports();
2381
2424
  if (Module["instantiateWasm"]) {
2382
- return new Promise((resolve, reject) => {
2425
+ return new Promise((resolve2, reject) => {
2383
2426
  Module["instantiateWasm"](info22, (mod, inst) => {
2384
- resolve(receiveInstance(mod, inst));
2427
+ resolve2(receiveInstance(mod, inst));
2385
2428
  });
2386
2429
  });
2387
2430
  }
@@ -3712,8 +3755,8 @@ async function Module2(moduleArg = {}) {
3712
3755
  if (runtimeInitialized) {
3713
3756
  moduleRtn = Module;
3714
3757
  } else {
3715
- moduleRtn = new Promise((resolve, reject) => {
3716
- readyPromiseResolve = resolve;
3758
+ moduleRtn = new Promise((resolve2, reject) => {
3759
+ readyPromiseResolve = resolve2;
3717
3760
  readyPromiseReject = reject;
3718
3761
  });
3719
3762
  }
@@ -4851,20 +4894,74 @@ function apiOrigin(env = process.env) {
4851
4894
  // packages/local-setup/dist/storage.js
4852
4895
  init_hookRuntime();
4853
4896
  import { createHash, randomUUID } from "node:crypto";
4897
+ import { execFile as nodeExecFile } from "node:child_process";
4898
+ import { open, rename, readFile, mkdir, lstat, chmod, writeFile, unlink, rmdir } from "node:fs/promises";
4854
4899
  import { homedir } from "node:os";
4855
- import { dirname as dirname2, join as join2, win32, posix } from "node:path";
4900
+ import { dirname as dirname3, join as join3, win32 as win322, posix } from "node:path";
4856
4901
  init_hookRuntime();
4857
4902
  var hash2 = (bytes) => createHash("sha256").update(bytes).digest("hex");
4858
4903
  function stateDirectory(platform = process.platform, env = process.env, home = homedir()) {
4859
4904
  if (env.MNEMONIK_STATE_DIR)
4860
4905
  return env.MNEMONIK_STATE_DIR;
4861
4906
  if (platform === "win32")
4862
- return win32.join(env.LOCALAPPDATA || win32.join(home, "AppData", "Local"), "Mnemonik");
4907
+ return win322.join(env.LOCALAPPDATA || win322.join(home, "AppData", "Local"), "Mnemonik");
4863
4908
  if (platform === "darwin")
4864
4909
  return posix.join(home, "Library", "Application Support", "Mnemonik");
4865
4910
  return posix.join(env.XDG_STATE_HOME || posix.join(home, ".local", "state"), "mnemonik");
4866
4911
  }
4867
- var recordPath = (root, state = stateDirectory()) => join2(state, "project-setup", `${hash2(root)}.json`);
4912
+ var recordPath = (root, state = stateDirectory()) => join3(state, "project-setup", `${hash2(root)}.json`);
4913
+ async function syncDirectory(path) {
4914
+ if (process.platform === "win32")
4915
+ return;
4916
+ const fd = await open(path, "r");
4917
+ try {
4918
+ await fd.sync();
4919
+ } finally {
4920
+ await fd.close();
4921
+ }
4922
+ }
4923
+ var windowsCurrentAccount = windowsCurrentAccountSync;
4924
+ async function windowsCurrentUserAcl(path, directory = false, options = {}) {
4925
+ const username = options.username ?? `*${windowsCurrentAccount().sid}`;
4926
+ const grant = `${username}:${directory ? "(OI)(CI)F" : "F"}`;
4927
+ const execFile2 = options.execFile ?? nodeExecFile;
4928
+ await new Promise((resolve2, reject) => {
4929
+ execFile2("icacls.exe", [path, "/inheritance:r", "/grant:r", grant], (error) => {
4930
+ if (error)
4931
+ reject(error);
4932
+ else
4933
+ resolve2();
4934
+ });
4935
+ });
4936
+ }
4937
+ async function protectStateFile(path, platform = process.platform, aclOptions) {
4938
+ if (platform === "win32")
4939
+ await windowsCurrentUserAcl(path, false, aclOptions);
4940
+ else
4941
+ await chmod(path, 384);
4942
+ return "private";
4943
+ }
4944
+ async function atomicWrite(path, bytes, fault, assertOwned) {
4945
+ await assertOwned?.();
4946
+ const temp = `${path}.${randomUUID()}.tmp`;
4947
+ const fd = await open(temp, "wx", 384);
4948
+ let permissionStatus;
4949
+ try {
4950
+ permissionStatus = await protectStateFile(temp);
4951
+ const split = Math.ceil(bytes.length / 2);
4952
+ await fd.writeFile(bytes.subarray(0, split));
4953
+ await fault?.("mid_write");
4954
+ await assertOwned?.();
4955
+ await fd.writeFile(bytes.subarray(split));
4956
+ await fd.sync();
4957
+ } finally {
4958
+ await fd.close();
4959
+ }
4960
+ await assertOwned?.();
4961
+ await rename(temp, path);
4962
+ await syncDirectory(dirname3(path));
4963
+ return permissionStatus;
4964
+ }
4868
4965
 
4869
4966
  // packages/local-setup/dist/index.js
4870
4967
  var MAX_ORIGINAL_BYTES = 64 * 1024;
@@ -4884,8 +4981,11 @@ import { devReadiness } from "../runtime/releaseSource.js";
4884
4981
  import {
4885
4982
  completedStep,
4886
4983
  completedLine,
4984
+ ADD_ANOTHER_FOLDER,
4887
4985
  renderCustomize,
4986
+ renderInterrupted,
4888
4987
  renderJourney,
4988
+ renderRollbackResult,
4889
4989
  journeyAnswers,
4890
4990
  INSTALLATION_STOPPED,
4891
4991
  stepProgress
@@ -4922,8 +5022,8 @@ async function waitForInstallation(check, timeout, clock = {}) {
4922
5022
  try {
4923
5023
  const result = await Promise.race([
4924
5024
  check(),
4925
- new Promise((resolve) => {
4926
- timer = setTimeout(() => resolve(void 0), Math.max(0, deadline - now()));
5025
+ new Promise((resolve2) => {
5026
+ timer = setTimeout(() => resolve2(void 0), Math.max(0, deadline - now()));
4927
5027
  })
4928
5028
  ]);
4929
5029
  if (result) document = result;
@@ -4941,7 +5041,9 @@ async function waitForInstallation(check, timeout, clock = {}) {
4941
5041
  async function joinedInstall(flags2, deps, output, authorize, management) {
4942
5042
  if (flags2.has("accept-scanner")) flags2.set("accept-indexing", true);
4943
5043
  const json = flags2.has("json");
4944
- const automatic = json || flags2.has("non-interactive");
5044
+ const input = deps.input ?? process.stdin;
5045
+ const interactive = Boolean(input.isTTY);
5046
+ const automatic = json || flags2.has("non-interactive") || !interactive;
4945
5047
  let components = String(
4946
5048
  flags2.get("components") ?? (flags2.has("without-scanner") ? "hooks,mcp" : "hooks,mcp,scanner")
4947
5049
  ).split(",");
@@ -4975,8 +5077,6 @@ async function joinedInstall(flags2, deps, output, authorize, management) {
4975
5077
  }
4976
5078
  const home = deps.home ?? homedir2();
4977
5079
  let cwd = deps.cwd ?? process.cwd();
4978
- const input = deps.input ?? process.stdin;
4979
- const interactive = Boolean(input.isTTY);
4980
5080
  let answers;
4981
5081
  let stopped = false;
4982
5082
  const interrupt = (signal) => {
@@ -5041,6 +5141,18 @@ async function joinedInstall(flags2, deps, output, authorize, management) {
5041
5141
  scanner = components.includes("scanner");
5042
5142
  names = [...new Set(previous.data.hostRequest?.selections.map((s) => s.host) ?? [])];
5043
5143
  }
5144
+ const indexingSkippedPath = join4(stateDir, "indexing-skipped");
5145
+ const indexingOnly = Boolean(
5146
+ !previous && !automatic && !flags2.has("hosts") && !flags2.has("components") && (await readFile2(indexingSkippedPath).catch(() => void 0) || (await ownership.readOwnership(stateDir)).targets.length) && !await readFile2(join4(stateDir, "scanner/state.json")).then(
5147
+ () => true,
5148
+ () => false
5149
+ )
5150
+ );
5151
+ if (indexingOnly) {
5152
+ components = ["scanner"];
5153
+ scanner = true;
5154
+ names = [];
5155
+ }
5044
5156
  startProgress("Checking this computer");
5045
5157
  let preflight;
5046
5158
  try {
@@ -5058,9 +5170,9 @@ async function joinedInstall(flags2, deps, output, authorize, management) {
5058
5170
  throw error;
5059
5171
  }
5060
5172
  const root = preflight.project.root ?? cwd;
5061
- const logPath = join3(stateDir, "install.log");
5173
+ const logPath = join4(stateDir, "install.log");
5062
5174
  const log = async (detail) => {
5063
- await mkdir(stateDir, { recursive: true, mode: 448 });
5175
+ await mkdir2(stateDir, { recursive: true, mode: 448 });
5064
5176
  await appendFile(logPath, `${JSON.stringify({ at: (/* @__PURE__ */ new Date()).toISOString(), detail })}
5065
5177
  `, {
5066
5178
  mode: 384
@@ -5068,7 +5180,7 @@ async function joinedInstall(flags2, deps, output, authorize, management) {
5068
5180
  };
5069
5181
  let roots = String(flags2.get("scan-roots") ?? previous?.data.roots.join(",") ?? "").split(",").filter(Boolean);
5070
5182
  output.setContext({ home, projectRoot: root });
5071
- if (!names.length)
5183
+ if (!names.length && !indexingOnly)
5072
5184
  names = preflight.hosts.filter((h) => h.supported).map(
5073
5185
  (h) => Object.keys(labels).find((key) => labels[key] === h.name) ?? ""
5074
5186
  ).filter(Boolean);
@@ -5146,7 +5258,8 @@ async function joinedInstall(flags2, deps, output, authorize, management) {
5146
5258
  };
5147
5259
  let restart = false;
5148
5260
  try {
5149
- if (previous?.data.joined && await choose("Previous installation was interrupted.", ["Resume", "Rollback"]) !== "Resume") {
5261
+ if (previous?.data.joined) renderInterrupted(output);
5262
+ if (previous?.data.joined && await answers?.choose(["Resume", "Rollback"]) !== "Resume") {
5150
5263
  const restored = await runHosts("install", [], {
5151
5264
  stateDir,
5152
5265
  account: previous.data.account,
@@ -5155,11 +5268,15 @@ async function joinedInstall(flags2, deps, output, authorize, management) {
5155
5268
  rollbackInstall,
5156
5269
  recovery: async () => "rollback"
5157
5270
  });
5158
- output.line(` Local rollback: ${restored.journal.phase}.`);
5159
- for (const report of restored.reports) output.line(` ${report}`);
5271
+ renderRollbackResult(restored.journal.phase === "rolled_back", output);
5160
5272
  return restored.journal.phase === "rolled_back" ? 130 : 1;
5161
5273
  }
5162
- if (!previous && !automatic && !flags2.has("hosts") && !flags2.has("components")) {
5274
+ if (indexingOnly) {
5275
+ const indexingLines = renderJourney("indexing", output);
5276
+ const choice = await answers?.choose(["Set up indexing", "Cancel"]);
5277
+ replaceScreen(indexingLines, choice === "Set up indexing" ? "Set up indexing" : void 0);
5278
+ if (choice !== "Set up indexing") return 130;
5279
+ } else if (!previous && !automatic && !flags2.has("hosts") && !flags2.has("components")) {
5163
5280
  for (; ; ) {
5164
5281
  const recommendedLines = renderJourney("recommended", output, {
5165
5282
  hosts: names.map((h) => labels[h]),
@@ -5213,14 +5330,14 @@ async function joinedInstall(flags2, deps, output, authorize, management) {
5213
5330
  }
5214
5331
  throw new Error("preflight_failed");
5215
5332
  }
5216
- if (!automatic && !flags2.has("apply")) {
5333
+ if (!automatic && !flags2.has("apply") && !indexingOnly) {
5217
5334
  renderJourney("account", output);
5218
5335
  }
5219
5336
  for (; ; ) {
5220
- startProgress("Signing in");
5337
+ startProgress(indexingOnly ? "Checking your account" : "Signing in");
5221
5338
  try {
5222
5339
  await authorize();
5223
- completeProgress("Signed in");
5340
+ completeProgress(indexingOnly ? "Account checked" : "Signed in");
5224
5341
  break;
5225
5342
  } catch (error) {
5226
5343
  activeProgress?.stop();
@@ -5229,8 +5346,8 @@ async function joinedInstall(flags2, deps, output, authorize, management) {
5229
5346
  throw error;
5230
5347
  }
5231
5348
  }
5232
- if (!automatic) output.line(completedStep(3, "Configure editors"));
5233
- startProgress("Configuring your editors");
5349
+ if (!automatic && !indexingOnly) output.line(completedStep(3, "Configure editors"));
5350
+ startProgress(indexingOnly ? "Getting ready" : "Configuring your editors");
5234
5351
  const managed = await management();
5235
5352
  reportFinal = async (readiness) => {
5236
5353
  const versions = await ownership.readInstallVersions(stateDir, readiness.scanner?.version ?? void 0).catch(() => void 0);
@@ -5295,7 +5412,9 @@ async function joinedInstall(flags2, deps, output, authorize, management) {
5295
5412
  }))
5296
5413
  );
5297
5414
  const afterHosts = async (journal, results, refreshHosts) => {
5298
- completeProgress(`${names.length} ${names.length === 1 ? "editor" : "editors"} configured`);
5415
+ completeProgress(
5416
+ indexingOnly ? "Ready" : `${names.length} ${names.length === 1 ? "editor" : "editors"} configured`
5417
+ );
5299
5418
  journal.data.components = components;
5300
5419
  journal.data.roots = roots;
5301
5420
  const projectConditions = [];
@@ -5321,7 +5440,7 @@ async function joinedInstall(flags2, deps, output, authorize, management) {
5321
5440
  allowNestedInherit: false,
5322
5441
  ...repo.nonGitSelected ? { nonGitSelected: true } : {}
5323
5442
  };
5324
- const target = await journal.plan(join3(repo.path, ".mnemonik.json"), null, {
5443
+ const target = await journal.plan(join4(repo.path, ".mnemonik.json"), null, {
5325
5444
  kind: "project"
5326
5445
  });
5327
5446
  await journal.event("project_stage_intent", repo.path);
@@ -5353,7 +5472,7 @@ async function joinedInstall(flags2, deps, output, authorize, management) {
5353
5472
  nonGitSelected: repo.nonGitSelected
5354
5473
  });
5355
5474
  const record = JSON.parse(
5356
- await readFile(recordPath(repo.path, deps.projectStateDir ?? stateDir), "utf8")
5475
+ await readFile2(recordPath(repo.path, deps.projectStateDir ?? stateDir), "utf8")
5357
5476
  );
5358
5477
  if (record.staged) await journal.propose(target, Buffer.from(record.staged.content));
5359
5478
  await journal.stage(target);
@@ -5362,7 +5481,10 @@ async function joinedInstall(flags2, deps, output, authorize, management) {
5362
5481
  roots = scannerPlan.roots;
5363
5482
  journal.data.roots = roots;
5364
5483
  }
5365
- if (scannerPlan) completeProgress("Repositories connected");
5484
+ if (scannerPlan) {
5485
+ completeProgress("Repositories connected");
5486
+ if (!json) output.line(` ${ADD_ANOTHER_FOLDER}`);
5487
+ }
5366
5488
  if (!automatic && !flags2.has("apply")) {
5367
5489
  for (; ; ) {
5368
5490
  const applyLines = renderJourney("apply", output, {
@@ -5394,7 +5516,7 @@ async function joinedInstall(flags2, deps, output, authorize, management) {
5394
5516
  if (result2?.status !== "done") throw new Error("project_apply_failed");
5395
5517
  project.uuid = result2.projectId;
5396
5518
  const target = journal.data.targets.find(
5397
- (t) => t.path === join3(project.root, ".mnemonik.json")
5519
+ (t) => t.path === join4(project.root, ".mnemonik.json")
5398
5520
  );
5399
5521
  if (target) {
5400
5522
  target.status = "committed";
@@ -5405,6 +5527,7 @@ async function joinedInstall(flags2, deps, output, authorize, management) {
5405
5527
  if (scannerPlan) {
5406
5528
  try {
5407
5529
  scannerDocument = await scannerPlan.apply(journal, scannerPlan.roots);
5530
+ await rm(indexingSkippedPath, { force: true });
5408
5531
  if (!json) {
5409
5532
  if (scannerPlan.roots.length)
5410
5533
  output.line(connectedProjectsMessage(scannerPlan.roots));
@@ -5541,7 +5664,7 @@ async function joinedInstall(flags2, deps, output, authorize, management) {
5541
5664
  (t) => t.kind === "project" && t.status !== "committed" && t.status !== "restored"
5542
5665
  )) {
5543
5666
  await executor?.rollback({
5544
- cwd: join3(target.path, ".."),
5667
+ cwd: join4(target.path, ".."),
5545
5668
  allowCreate: true,
5546
5669
  allowNestedInherit: false
5547
5670
  });
@@ -5627,6 +5750,8 @@ async function joinedInstall(flags2, deps, output, authorize, management) {
5627
5750
  };
5628
5751
  final = await reportFinal({ ...final, ...launcher ? { launcher } : {} });
5629
5752
  await log({ preflight, journal: result.journal, targets: result.results, readiness: final });
5753
+ if (!scanner && result.journal.state !== "FAILED")
5754
+ await atomicWrite(indexingSkippedPath, Buffer.from("indexing was skipped\n"));
5630
5755
  completeProgress("Installation finished");
5631
5756
  if (json)
5632
5757
  output.json({
@@ -5640,8 +5765,13 @@ async function joinedInstall(flags2, deps, output, authorize, management) {
5640
5765
  else {
5641
5766
  if (result.journal.state === "FAILED") {
5642
5767
  output.line(` Installation failed. Details: ${logPath}`);
5768
+ } else if (!scanner) {
5769
+ renderJourney("indexing_skipped", output);
5770
+ for (const action of new Set(final.installation.actions))
5771
+ if (action !== "mnemonik install" && action !== launcherError?.launcher.action)
5772
+ output.line(` ${action}`);
5643
5773
  } else if (final.installation.state === "READY")
5644
- renderJourney("done", output, {
5774
+ renderJourney(indexingOnly ? "indexing_done" : "done", output, {
5645
5775
  total: final.indexing?.total,
5646
5776
  completed: final.indexing?.completed
5647
5777
  });
@@ -5650,10 +5780,9 @@ async function joinedInstall(flags2, deps, output, authorize, management) {
5650
5780
  remaining: remainingReadinessCount(final.installation),
5651
5781
  skipped: [...new Set(final.installation.actions)].join("\n") || "mnemonik status"
5652
5782
  });
5653
- if (launcherError || launcher && !launcher.onPath)
5654
- output.line(
5655
- ` ${launcher ? launcherPathAction(launcherOptions) : "Run npx -y @mnemonik/cli@latest status"}`
5656
- );
5783
+ if (launcherError) output.line(` ${launcherError.launcher.action}`);
5784
+ else if (launcher && !launcher.onPath)
5785
+ output.line(` ${launcherPathAction(launcherOptions)}`);
5657
5786
  }
5658
5787
  return result.journal.state === "FAILED" ? 1 : result.journal.phase === "rolled_back" ? 130 : final.installation.state === "READY" ? 0 : 3;
5659
5788
  } catch (error) {