@mnemonik/cli 7.140.1 → 7.140.3
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/auth/credentials.js +41 -8
- package/dist/auth/index.js +41 -8
- package/dist/auth/installSession.js +1 -1
- package/dist/auth/status.js +1 -1
- package/dist/authorizationWords.js +1 -1
- package/dist/diagnostics.js +41 -8
- package/dist/digests.json +71 -67
- package/dist/help.d.ts.map +1 -1
- package/dist/help.js +50 -4
- package/dist/help.js.map +1 -1
- package/dist/hooksLog.d.ts +61 -0
- package/dist/hooksLog.d.ts.map +1 -0
- package/dist/hooksLog.js +350 -0
- package/dist/hooksLog.js.map +1 -0
- package/dist/humanReason.d.ts +7 -0
- package/dist/humanReason.d.ts.map +1 -1
- package/dist/humanReason.js +12 -4
- package/dist/humanReason.js.map +1 -1
- package/dist/identity/migrate.js +102 -69
- package/dist/install/hosts.js +1 -1
- package/dist/install/journal.js +41 -8
- package/dist/install/journey.d.ts.map +1 -1
- package/dist/install/journey.js +41 -11
- package/dist/install/journey.js.map +1 -1
- package/dist/install/ownership.js +41 -8
- package/dist/install/transaction.d.ts.map +1 -1
- package/dist/install/transaction.js +42 -10
- package/dist/install/transaction.js.map +1 -1
- package/dist/install/ui.js +41 -8
- package/dist/installSession.js +1 -1
- package/dist/installation.js +41 -8
- package/dist/launcher.js +41 -8
- package/dist/preflight.js +201 -164
- package/dist/project/eligibility.js +41 -8
- package/dist/project/records.js +41 -8
- package/dist/project.d.ts +35 -1
- package/dist/project.d.ts.map +1 -1
- package/dist/project.js +294 -231
- package/dist/project.js.map +1 -1
- package/dist/router.d.ts +7 -0
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +340 -182
- package/dist/router.js.map +1 -1
- package/dist/runtime/bootstrap.d.ts +22 -1
- package/dist/runtime/bootstrap.d.ts.map +1 -1
- package/dist/runtime/bootstrap.js +61 -8
- package/dist/runtime/bootstrap.js.map +1 -1
- package/dist/runtime/releaseSource.js +41 -8
- package/dist/runtime/selfUpdate.js +41 -8
- package/dist/runtime/signers.js +789 -183
- package/dist/runtime/store.d.ts +1 -1
- package/dist/runtime/store.d.ts.map +1 -1
- package/dist/runtime/store.js +54 -5
- package/dist/runtime/store.js.map +1 -1
- package/dist/runtime/updateCheck.js +41 -8
- package/dist/sbom.json +21 -21
- package/dist/scanner/control.js +41 -8
- package/dist/scanner/data.js +1 -1
- package/dist/scanner/discover.d.ts.map +1 -1
- package/dist/scanner/discover.js +211 -171
- package/dist/scanner/discover.js.map +1 -1
- package/dist/scanner/enable.d.ts.map +1 -1
- package/dist/scanner/enable.js +440 -57
- package/dist/scanner/enable.js.map +1 -1
- package/dist/scanner/picker.d.ts.map +1 -1
- package/dist/scanner/picker.js +12 -4
- package/dist/scanner/picker.js.map +1 -1
- package/dist/scanner/service.js +41 -8
- package/dist/scanner/update.js +41 -8
- package/dist/scanner-release.json +24 -24
- package/dist/status.js +41 -8
- package/dist/vendor/local-setup.js +44 -11
- package/package.json +31 -31
package/dist/scanner/discover.js
CHANGED
|
@@ -873,11 +873,11 @@ var require_ignore = __commonJS({
|
|
|
873
873
|
|
|
874
874
|
// packages/cli/src/scanner/discover.ts
|
|
875
875
|
import { execFile as execFile2 } from "node:child_process";
|
|
876
|
-
import { access, lstat as lstat3, readdir, realpath } from "node:fs/promises";
|
|
876
|
+
import { access, lstat as lstat3, readdir, realpath as realpath2 } from "node:fs/promises";
|
|
877
877
|
import { basename, isAbsolute, join as join4, parse, relative, resolve as resolve2 } from "node:path";
|
|
878
878
|
|
|
879
879
|
// packages/shared/dist/instructions.js
|
|
880
|
-
var INSTRUCTIONS_CONTENT = `Mnemonik provides persistent project memory: decisions, rationale, tasks, and policies across sessions. If no block begins "PROJECT_CONTEXT schemaVersion=", session_bootstrap({
|
|
880
|
+
var INSTRUCTIONS_CONTENT = `Mnemonik provides persistent project memory: decisions, rationale, tasks, and policies across sessions. If no block begins "PROJECT_CONTEXT schemaVersion=", session_bootstrap({}) loads project context; installed hooks supply the project. With that block, context is loaded and no session_bootstrap call is needed. Code and docs show current artifacts, git shows changes, and memory carries the why; memory_search recalls rationale or intent, then Grep or Read verifies current source.
|
|
881
881
|
|
|
882
882
|
What I learn about you belongs in Companion; what I learn about this project belongs here.
|
|
883
883
|
|
|
@@ -915,6 +915,96 @@ var MCP_INSTRUCTIONS = getMcpInstructions();
|
|
|
915
915
|
// packages/shared/dist/codeScanner.js
|
|
916
916
|
var import_ignore = __toESM(require_ignore(), 1);
|
|
917
917
|
|
|
918
|
+
// packages/shared/dist/projectIdentityFile.js
|
|
919
|
+
import { lstat, readFile } from "node:fs/promises";
|
|
920
|
+
import { join } from "node:path";
|
|
921
|
+
var CANONICAL_UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
|
|
922
|
+
var isCanonicalUuid = (value) => typeof value === "string" && CANONICAL_UUID.test(value);
|
|
923
|
+
var IDENTITY_KEYS = /* @__PURE__ */ new Set([
|
|
924
|
+
"schemaVersion",
|
|
925
|
+
"projectId",
|
|
926
|
+
"projectName",
|
|
927
|
+
"repositoryFingerprint"
|
|
928
|
+
]);
|
|
929
|
+
var FINGERPRINT_KEYS = /* @__PURE__ */ new Set(["algorithmVersion", "hash"]);
|
|
930
|
+
function parseIdentityFile(text) {
|
|
931
|
+
let value;
|
|
932
|
+
try {
|
|
933
|
+
value = JSON.parse(text);
|
|
934
|
+
} catch (error) {
|
|
935
|
+
return { kind: "malformed", detail: `unparseable JSON: ${error.message}` };
|
|
936
|
+
}
|
|
937
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
938
|
+
return { kind: "malformed", detail: "identity file must contain a JSON object" };
|
|
939
|
+
}
|
|
940
|
+
const record = value;
|
|
941
|
+
if (record.schemaVersion !== 1) {
|
|
942
|
+
return { kind: "unknown_version", version: record.schemaVersion };
|
|
943
|
+
}
|
|
944
|
+
const unknownKey = Object.keys(record).find((key) => !IDENTITY_KEYS.has(key));
|
|
945
|
+
if (unknownKey)
|
|
946
|
+
return { kind: "malformed", detail: `unknown key "${unknownKey}"` };
|
|
947
|
+
if (!isCanonicalUuid(record.projectId)) {
|
|
948
|
+
return { kind: "malformed", detail: '"projectId" must be a canonical RFC 4122 UUID string' };
|
|
949
|
+
}
|
|
950
|
+
if ("projectName" in record && typeof record.projectName !== "string") {
|
|
951
|
+
return { kind: "malformed", detail: '"projectName" must be a string when present' };
|
|
952
|
+
}
|
|
953
|
+
if ("repositoryFingerprint" in record && (!record.repositoryFingerprint || typeof record.repositoryFingerprint !== "object" || Array.isArray(record.repositoryFingerprint))) {
|
|
954
|
+
return { kind: "malformed", detail: '"repositoryFingerprint" must be an object when present' };
|
|
955
|
+
}
|
|
956
|
+
const fingerprint = record.repositoryFingerprint;
|
|
957
|
+
const unknownFingerprintKey = fingerprint ? Object.keys(fingerprint).find((key) => !FINGERPRINT_KEYS.has(key)) : void 0;
|
|
958
|
+
if (unknownFingerprintKey) {
|
|
959
|
+
return {
|
|
960
|
+
kind: "malformed",
|
|
961
|
+
detail: `unknown repositoryFingerprint key "${unknownFingerprintKey}"`
|
|
962
|
+
};
|
|
963
|
+
}
|
|
964
|
+
if (fingerprint && (fingerprint.algorithmVersion !== 1 || typeof fingerprint.hash !== "string")) {
|
|
965
|
+
return {
|
|
966
|
+
kind: "malformed",
|
|
967
|
+
detail: '"repositoryFingerprint" must contain algorithmVersion 1 and a string hash'
|
|
968
|
+
};
|
|
969
|
+
}
|
|
970
|
+
const repositoryFingerprint = fingerprint ? { algorithmVersion: 1, hash: fingerprint.hash } : void 0;
|
|
971
|
+
return {
|
|
972
|
+
kind: "ok",
|
|
973
|
+
identity: {
|
|
974
|
+
schemaVersion: 1,
|
|
975
|
+
projectId: record.projectId,
|
|
976
|
+
...record.projectName === void 0 ? {} : { projectName: record.projectName },
|
|
977
|
+
...repositoryFingerprint ? { repositoryFingerprint } : {}
|
|
978
|
+
}
|
|
979
|
+
};
|
|
980
|
+
}
|
|
981
|
+
function isConfigurationOnly(text) {
|
|
982
|
+
try {
|
|
983
|
+
const value = JSON.parse(text);
|
|
984
|
+
return !!value && typeof value === "object" && !Array.isArray(value) && !("projectId" in value) && (!("schemaVersion" in value) || value.schemaVersion === 1);
|
|
985
|
+
} catch {
|
|
986
|
+
return false;
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
async function readIdentityFile(dir, options = {}) {
|
|
990
|
+
const path = join(dir, ".mnemonik.json");
|
|
991
|
+
try {
|
|
992
|
+
const stat = await lstat(path);
|
|
993
|
+
if (stat.isSymbolicLink())
|
|
994
|
+
return { kind: "malformed", detail: "symlink" };
|
|
995
|
+
if (!stat.isFile())
|
|
996
|
+
return { kind: "malformed", detail: "identity path is not a regular file" };
|
|
997
|
+
const text = await readFile(path, "utf8");
|
|
998
|
+
if ((options.selectedRoot || options.configurationOnlyAbsent) && isConfigurationOnly(text))
|
|
999
|
+
return { kind: "absent" };
|
|
1000
|
+
return parseIdentityFile(text);
|
|
1001
|
+
} catch (error) {
|
|
1002
|
+
if (error.code === "ENOENT")
|
|
1003
|
+
return { kind: "absent" };
|
|
1004
|
+
return { kind: "malformed", detail: `cannot read identity file: ${error.message}` };
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
|
|
918
1008
|
// node_modules/web-tree-sitter/web-tree-sitter.js
|
|
919
1009
|
var __defProp2 = Object.defineProperty;
|
|
920
1010
|
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
|
|
@@ -4959,9 +5049,9 @@ var Query = class {
|
|
|
4959
5049
|
};
|
|
4960
5050
|
|
|
4961
5051
|
// packages/shared/dist/ast/grammars.js
|
|
4962
|
-
import { dirname, extname, join } from "node:path";
|
|
5052
|
+
import { dirname, extname, join as join2 } from "node:path";
|
|
4963
5053
|
import { fileURLToPath } from "node:url";
|
|
4964
|
-
var WASM_DIR =
|
|
5054
|
+
var WASM_DIR = join2(dirname(fileURLToPath(import.meta.url)), "..", "..", "wasm");
|
|
4965
5055
|
|
|
4966
5056
|
// packages/shared/dist/ast/astChunker.js
|
|
4967
5057
|
var MAX_AST_PARSE_BYTES = 2 * 1024 * 1024;
|
|
@@ -5287,96 +5377,8 @@ function selectRemote(remotes) {
|
|
|
5287
5377
|
return { status: "fingerprint", remote: selected.name, fingerprint: first };
|
|
5288
5378
|
}
|
|
5289
5379
|
|
|
5290
|
-
// packages/shared/dist/projectIdentityFile.js
|
|
5291
|
-
import { lstat, readFile } from "node:fs/promises";
|
|
5292
|
-
import { join as join2 } from "node:path";
|
|
5293
|
-
var CANONICAL_UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
|
|
5294
|
-
var isCanonicalUuid = (value) => typeof value === "string" && CANONICAL_UUID.test(value);
|
|
5295
|
-
var IDENTITY_KEYS = /* @__PURE__ */ new Set([
|
|
5296
|
-
"schemaVersion",
|
|
5297
|
-
"projectId",
|
|
5298
|
-
"projectName",
|
|
5299
|
-
"repositoryFingerprint"
|
|
5300
|
-
]);
|
|
5301
|
-
var FINGERPRINT_KEYS = /* @__PURE__ */ new Set(["algorithmVersion", "hash"]);
|
|
5302
|
-
function parseIdentityFile(text) {
|
|
5303
|
-
let value;
|
|
5304
|
-
try {
|
|
5305
|
-
value = JSON.parse(text);
|
|
5306
|
-
} catch (error) {
|
|
5307
|
-
return { kind: "malformed", detail: `unparseable JSON: ${error.message}` };
|
|
5308
|
-
}
|
|
5309
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
5310
|
-
return { kind: "malformed", detail: "identity file must contain a JSON object" };
|
|
5311
|
-
}
|
|
5312
|
-
const record = value;
|
|
5313
|
-
if (record.schemaVersion !== 1) {
|
|
5314
|
-
return { kind: "unknown_version", version: record.schemaVersion };
|
|
5315
|
-
}
|
|
5316
|
-
const unknownKey = Object.keys(record).find((key) => !IDENTITY_KEYS.has(key));
|
|
5317
|
-
if (unknownKey)
|
|
5318
|
-
return { kind: "malformed", detail: `unknown key "${unknownKey}"` };
|
|
5319
|
-
if (!isCanonicalUuid(record.projectId)) {
|
|
5320
|
-
return { kind: "malformed", detail: '"projectId" must be a canonical RFC 4122 UUID string' };
|
|
5321
|
-
}
|
|
5322
|
-
if ("projectName" in record && typeof record.projectName !== "string") {
|
|
5323
|
-
return { kind: "malformed", detail: '"projectName" must be a string when present' };
|
|
5324
|
-
}
|
|
5325
|
-
if ("repositoryFingerprint" in record && (!record.repositoryFingerprint || typeof record.repositoryFingerprint !== "object" || Array.isArray(record.repositoryFingerprint))) {
|
|
5326
|
-
return { kind: "malformed", detail: '"repositoryFingerprint" must be an object when present' };
|
|
5327
|
-
}
|
|
5328
|
-
const fingerprint = record.repositoryFingerprint;
|
|
5329
|
-
const unknownFingerprintKey = fingerprint ? Object.keys(fingerprint).find((key) => !FINGERPRINT_KEYS.has(key)) : void 0;
|
|
5330
|
-
if (unknownFingerprintKey) {
|
|
5331
|
-
return {
|
|
5332
|
-
kind: "malformed",
|
|
5333
|
-
detail: `unknown repositoryFingerprint key "${unknownFingerprintKey}"`
|
|
5334
|
-
};
|
|
5335
|
-
}
|
|
5336
|
-
if (fingerprint && (fingerprint.algorithmVersion !== 1 || typeof fingerprint.hash !== "string")) {
|
|
5337
|
-
return {
|
|
5338
|
-
kind: "malformed",
|
|
5339
|
-
detail: '"repositoryFingerprint" must contain algorithmVersion 1 and a string hash'
|
|
5340
|
-
};
|
|
5341
|
-
}
|
|
5342
|
-
const repositoryFingerprint = fingerprint ? { algorithmVersion: 1, hash: fingerprint.hash } : void 0;
|
|
5343
|
-
return {
|
|
5344
|
-
kind: "ok",
|
|
5345
|
-
identity: {
|
|
5346
|
-
schemaVersion: 1,
|
|
5347
|
-
projectId: record.projectId,
|
|
5348
|
-
...record.projectName === void 0 ? {} : { projectName: record.projectName },
|
|
5349
|
-
...repositoryFingerprint ? { repositoryFingerprint } : {}
|
|
5350
|
-
}
|
|
5351
|
-
};
|
|
5352
|
-
}
|
|
5353
|
-
async function readIdentityFile(dir, options = {}) {
|
|
5354
|
-
const path = join2(dir, ".mnemonik.json");
|
|
5355
|
-
try {
|
|
5356
|
-
const stat = await lstat(path);
|
|
5357
|
-
if (stat.isSymbolicLink())
|
|
5358
|
-
return { kind: "malformed", detail: "symlink" };
|
|
5359
|
-
if (!stat.isFile())
|
|
5360
|
-
return { kind: "malformed", detail: "identity path is not a regular file" };
|
|
5361
|
-
const text = await readFile(path, "utf8");
|
|
5362
|
-
if (options.selectedRoot) {
|
|
5363
|
-
try {
|
|
5364
|
-
const value = JSON.parse(text);
|
|
5365
|
-
if (value && typeof value === "object" && !Array.isArray(value) && !("projectId" in value) && (!("schemaVersion" in value) || value.schemaVersion === 1))
|
|
5366
|
-
return { kind: "absent" };
|
|
5367
|
-
} catch {
|
|
5368
|
-
}
|
|
5369
|
-
}
|
|
5370
|
-
return parseIdentityFile(text);
|
|
5371
|
-
} catch (error) {
|
|
5372
|
-
if (error.code === "ENOENT")
|
|
5373
|
-
return { kind: "absent" };
|
|
5374
|
-
return { kind: "malformed", detail: `cannot read identity file: ${error.message}` };
|
|
5375
|
-
}
|
|
5376
|
-
}
|
|
5377
|
-
|
|
5378
5380
|
// packages/shared/dist/repositoryRoot.js
|
|
5379
|
-
import { lstat as lstat2, readFile as readFile2 } from "node:fs/promises";
|
|
5381
|
+
import { lstat as lstat2, readFile as readFile2, realpath } from "node:fs/promises";
|
|
5380
5382
|
import { execFile } from "node:child_process";
|
|
5381
5383
|
import { homedir } from "node:os";
|
|
5382
5384
|
import { dirname as dirname2, join as join3, resolve } from "node:path";
|
|
@@ -5438,7 +5440,7 @@ async function confirmedBoundaryAt(path) {
|
|
|
5438
5440
|
async function boundariesBetween(cwd, root) {
|
|
5439
5441
|
const boundaries = [];
|
|
5440
5442
|
let directory = cwd;
|
|
5441
|
-
while (directory
|
|
5443
|
+
while (!samePath(directory, root)) {
|
|
5442
5444
|
const boundary = await confirmedBoundaryAt(directory);
|
|
5443
5445
|
if (boundary)
|
|
5444
5446
|
boundaries.push(boundary);
|
|
@@ -5461,37 +5463,31 @@ async function containingRepository(root) {
|
|
|
5461
5463
|
directory = parent;
|
|
5462
5464
|
}
|
|
5463
5465
|
}
|
|
5464
|
-
async function
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
const gitDir = resolve(boundary.path, pointer);
|
|
5471
|
-
try {
|
|
5472
|
-
const commonDir = resolve(gitDir, (await readFile2(join3(gitDir, "commondir"), "utf8")).trim());
|
|
5473
|
-
return dirname2(commonDir);
|
|
5474
|
-
} catch (error) {
|
|
5475
|
-
if (error.code === "ENOENT")
|
|
5476
|
-
return boundary.path;
|
|
5477
|
-
throw error;
|
|
5478
|
-
}
|
|
5466
|
+
async function canonicalPath(path) {
|
|
5467
|
+
const absolute = resolve(path);
|
|
5468
|
+
return realpath(absolute).catch(() => absolute);
|
|
5469
|
+
}
|
|
5470
|
+
function samePath(left, right) {
|
|
5471
|
+
return process.platform === "win32" ? left.toLowerCase() === right.toLowerCase() : left === right;
|
|
5479
5472
|
}
|
|
5480
5473
|
async function resolveRepositoryRoot(cwd) {
|
|
5481
|
-
const absoluteCwd =
|
|
5474
|
+
const absoluteCwd = await canonicalPath(cwd);
|
|
5482
5475
|
try {
|
|
5483
5476
|
const { stdout } = await runGit(absoluteCwd, [
|
|
5484
5477
|
"rev-parse",
|
|
5485
5478
|
"--show-toplevel",
|
|
5479
|
+
"--git-dir",
|
|
5486
5480
|
"--git-common-dir"
|
|
5487
5481
|
]);
|
|
5488
|
-
const [rootLine, commonLine, ...extra] = stdout.trim().split(/\r?\n/);
|
|
5489
|
-
if (!rootLine || !commonLine || extra.length) {
|
|
5482
|
+
const [rootLine, gitDirLine, commonLine, ...extra] = stdout.trim().split(/\r?\n/);
|
|
5483
|
+
if (!rootLine || !gitDirLine || !commonLine || extra.length) {
|
|
5490
5484
|
return { kind: "git_unavailable", detail: "git rev-parse returned an unexpected response" };
|
|
5491
5485
|
}
|
|
5492
|
-
const
|
|
5493
|
-
const
|
|
5494
|
-
const
|
|
5486
|
+
const fromGit = (line) => canonicalPath(resolve(absoluteCwd, line));
|
|
5487
|
+
const root = await fromGit(rootLine);
|
|
5488
|
+
const gitDir = await fromGit(gitDirLine);
|
|
5489
|
+
const commonDir = await fromGit(commonLine);
|
|
5490
|
+
const isLinkedWorktree = !samePath(gitDir, commonDir);
|
|
5495
5491
|
const nested = await boundariesBetween(absoluteCwd, root);
|
|
5496
5492
|
if (!isLinkedWorktree && await containingRepository(root)) {
|
|
5497
5493
|
const boundary = await boundaryAt(root);
|
|
@@ -5513,14 +5509,41 @@ async function resolveRepositoryRoot(cwd) {
|
|
|
5513
5509
|
return { kind: "git_unavailable", detail: failure.message };
|
|
5514
5510
|
}
|
|
5515
5511
|
}
|
|
5512
|
+
async function linkedWorktreeCommonDir(dir) {
|
|
5513
|
+
try {
|
|
5514
|
+
if (!(await lstat2(join3(dir, ".git"))).isFile())
|
|
5515
|
+
return void 0;
|
|
5516
|
+
const pointer = /^gitdir:\s*(.+?)\s*$/im.exec(await readFile2(join3(dir, ".git"), "utf8"))?.[1];
|
|
5517
|
+
if (!pointer)
|
|
5518
|
+
return void 0;
|
|
5519
|
+
const gitDir = resolve(dir, pointer);
|
|
5520
|
+
const common = (await readFile2(join3(gitDir, "commondir"), "utf8")).trim();
|
|
5521
|
+
return common ? await canonicalPath(resolve(gitDir, common)) : void 0;
|
|
5522
|
+
} catch {
|
|
5523
|
+
return void 0;
|
|
5524
|
+
}
|
|
5525
|
+
}
|
|
5526
|
+
async function mainCheckout(worktreeTop, commonDir) {
|
|
5527
|
+
try {
|
|
5528
|
+
const { stdout } = await runGit(worktreeTop, ["worktree", "list", "--porcelain"]);
|
|
5529
|
+
const first = stdout.split(/\r?\n\r?\n/)[0] ?? "";
|
|
5530
|
+
const path = /^worktree (.+)$/m.exec(first)?.[1];
|
|
5531
|
+
if (path) {
|
|
5532
|
+
const main = await canonicalPath(resolve(worktreeTop, path));
|
|
5533
|
+
return /^bare$/m.test(first) ? dirname2(main) : main;
|
|
5534
|
+
}
|
|
5535
|
+
} catch {
|
|
5536
|
+
}
|
|
5537
|
+
return dirname2(commonDir);
|
|
5538
|
+
}
|
|
5516
5539
|
async function readPlainIdentity(start2) {
|
|
5517
|
-
const home =
|
|
5540
|
+
const home = await canonicalPath(homedir());
|
|
5518
5541
|
let directory = start2;
|
|
5519
5542
|
while (true) {
|
|
5520
|
-
const result = await readIdentityFile(directory);
|
|
5543
|
+
const result = await readIdentityFile(directory, { configurationOnlyAbsent: true });
|
|
5521
5544
|
if (result.kind !== "absent")
|
|
5522
5545
|
return { root: directory, result };
|
|
5523
|
-
if (directory
|
|
5546
|
+
if (samePath(directory, home))
|
|
5524
5547
|
break;
|
|
5525
5548
|
const parent = dirname2(directory);
|
|
5526
5549
|
if (parent === directory)
|
|
@@ -5529,58 +5552,72 @@ async function readPlainIdentity(start2) {
|
|
|
5529
5552
|
}
|
|
5530
5553
|
return { root: start2, result: { kind: "absent" } };
|
|
5531
5554
|
}
|
|
5555
|
+
async function nearestIdentity(start2) {
|
|
5556
|
+
const home = await canonicalPath(homedir());
|
|
5557
|
+
let directory = start2;
|
|
5558
|
+
while (true) {
|
|
5559
|
+
const commonDir = await linkedWorktreeCommonDir(directory);
|
|
5560
|
+
if (commonDir)
|
|
5561
|
+
return { worktreeTop: directory, commonDir };
|
|
5562
|
+
const result = await readIdentityFile(directory, { configurationOnlyAbsent: true });
|
|
5563
|
+
if (result.kind !== "absent")
|
|
5564
|
+
return { root: directory, result };
|
|
5565
|
+
if (samePath(directory, home))
|
|
5566
|
+
return void 0;
|
|
5567
|
+
const parent = dirname2(directory);
|
|
5568
|
+
if (parent === directory)
|
|
5569
|
+
return void 0;
|
|
5570
|
+
directory = parent;
|
|
5571
|
+
}
|
|
5572
|
+
}
|
|
5573
|
+
async function resolveNearestProjectIdentity(cwd) {
|
|
5574
|
+
const start2 = await canonicalPath(cwd);
|
|
5575
|
+
const resolved = await resolveRepositoryRoot(start2);
|
|
5576
|
+
const repository = resolved.kind === "git_unavailable" ? { kind: "plain", root: start2 } : resolved;
|
|
5577
|
+
const nested = repository.kind === "git" ? repository.nested : [];
|
|
5578
|
+
let found = await nearestIdentity(start2);
|
|
5579
|
+
if (found && "worktreeTop" in found) {
|
|
5580
|
+
found = await readPlainIdentity(await mainCheckout(found.worktreeTop, found.commonDir));
|
|
5581
|
+
}
|
|
5582
|
+
if (found) {
|
|
5583
|
+
return shapedIdentity(found, await projectFolderRepository(found.root, repository), nested);
|
|
5584
|
+
}
|
|
5585
|
+
return { ...withBase(repository, repository.root, nested), kind: "absent" };
|
|
5586
|
+
}
|
|
5587
|
+
async function resolveNamedProjectIdentity(cwd, options) {
|
|
5588
|
+
const start2 = await canonicalPath(cwd);
|
|
5589
|
+
const resolved = await resolveRepositoryRoot(start2);
|
|
5590
|
+
const repository = resolved.kind === "git_unavailable" ? { kind: "plain", root: start2 } : resolved;
|
|
5591
|
+
const commonDir = await linkedWorktreeCommonDir(start2);
|
|
5592
|
+
const root = commonDir ? await mainCheckout(start2, commonDir) : start2;
|
|
5593
|
+
return shapedIdentity({ root, result: await readIdentityFile(root, options) }, await projectFolderRepository(root, repository), repository.kind === "git" ? repository.nested : []);
|
|
5594
|
+
}
|
|
5595
|
+
function shapedIdentity(found, repository, nested) {
|
|
5596
|
+
const base = withBase(repository, found.root, nested);
|
|
5597
|
+
if (found.result.kind === "ok")
|
|
5598
|
+
return { ...base, ...found.result };
|
|
5599
|
+
if (found.result.kind === "unknown_version")
|
|
5600
|
+
return { ...base, ...found.result, path: found.root };
|
|
5601
|
+
if (found.result.kind === "malformed")
|
|
5602
|
+
return { ...base, ...found.result, path: found.root };
|
|
5603
|
+
return { ...base, kind: "absent" };
|
|
5604
|
+
}
|
|
5605
|
+
async function projectFolderRepository(projectRoot, known) {
|
|
5606
|
+
if (known.kind === "git" && samePath(known.root, projectRoot))
|
|
5607
|
+
return known;
|
|
5608
|
+
const repository = await resolveRepositoryRoot(projectRoot);
|
|
5609
|
+
if (repository.kind === "git" && samePath(repository.root, projectRoot))
|
|
5610
|
+
return repository;
|
|
5611
|
+
return { kind: "plain", root: projectRoot };
|
|
5612
|
+
}
|
|
5532
5613
|
function withBase(repository, root, nested) {
|
|
5533
5614
|
return { root, repository, nested };
|
|
5534
5615
|
}
|
|
5535
5616
|
async function resolveProjectIdentity(cwd, options = {}) {
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
if (repository.kind === "plain") {
|
|
5539
|
-
const { root, result } = options.selectedRoot ? { root: repository.root, result: await readIdentityFile(repository.root, options) } : await readPlainIdentity(repository.root);
|
|
5540
|
-
const base2 = withBase(repository, root, []);
|
|
5541
|
-
if (result.kind === "ok")
|
|
5542
|
-
return { ...base2, ...result };
|
|
5543
|
-
if (result.kind === "unknown_version")
|
|
5544
|
-
return { ...base2, ...result, path: root };
|
|
5545
|
-
if (result.kind === "malformed")
|
|
5546
|
-
return { ...base2, ...result, path: root };
|
|
5547
|
-
return { ...base2, kind: "absent" };
|
|
5548
|
-
}
|
|
5549
|
-
const ownRoot = repository.isLinkedWorktree ? dirname2(repository.commonDir) : repository.root;
|
|
5550
|
-
const outer = repository.isLinkedWorktree ? void 0 : await containingRepository(repository.root);
|
|
5551
|
-
const own = await readIdentityFile(ownRoot, options);
|
|
5552
|
-
if (!outer || options.selectedRoot || own.kind === "ok") {
|
|
5553
|
-
const base2 = withBase(repository, ownRoot, repository.nested);
|
|
5554
|
-
if (own.kind === "ok")
|
|
5555
|
-
return { ...base2, ...own };
|
|
5556
|
-
if (own.kind === "unknown_version")
|
|
5557
|
-
return { ...base2, ...own, path: ownRoot };
|
|
5558
|
-
if (own.kind === "malformed")
|
|
5559
|
-
return { ...base2, ...own, path: ownRoot };
|
|
5560
|
-
return { ...base2, kind: "absent" };
|
|
5561
|
-
}
|
|
5562
|
-
const nested = repository.nested;
|
|
5563
|
-
const parentRoot = await canonicalBoundaryRoot(outer);
|
|
5564
|
-
const parent = await readIdentityFile(parentRoot);
|
|
5565
|
-
const base = withBase(repository, parentRoot, nested);
|
|
5566
|
-
if (own.kind === "unknown_version")
|
|
5567
|
-
return { ...base, ...own, path: ownRoot };
|
|
5568
|
-
if (own.kind === "malformed")
|
|
5569
|
-
return { ...base, ...own, path: ownRoot };
|
|
5570
|
-
if (parent.kind === "unknown_version")
|
|
5571
|
-
return { ...base, ...parent, path: parentRoot };
|
|
5572
|
-
if (parent.kind === "malformed")
|
|
5573
|
-
return { ...base, ...parent, path: parentRoot };
|
|
5574
|
-
if (!options.allowNestedInherit) {
|
|
5575
|
-
return {
|
|
5576
|
-
...base,
|
|
5577
|
-
kind: "nested",
|
|
5578
|
-
...parent.kind === "ok" ? { parentIdentity: parent.identity } : {}
|
|
5579
|
-
};
|
|
5617
|
+
if (options.selectedRoot || options.namedRoot) {
|
|
5618
|
+
return resolveNamedProjectIdentity(cwd, { selectedRoot: options.selectedRoot });
|
|
5580
5619
|
}
|
|
5581
|
-
|
|
5582
|
-
return { ...base, kind: "ok", identity: parent.identity };
|
|
5583
|
-
return { ...base, kind: "absent" };
|
|
5620
|
+
return resolveNearestProjectIdentity(cwd);
|
|
5584
5621
|
}
|
|
5585
5622
|
|
|
5586
5623
|
// packages/cli/src/scanner/discover.ts
|
|
@@ -5624,13 +5661,11 @@ async function repositoryRemotes(path) {
|
|
|
5624
5661
|
);
|
|
5625
5662
|
}
|
|
5626
5663
|
async function classifyRepository(path, options = {}) {
|
|
5627
|
-
const canonical = await (options.canonicalizePath ??
|
|
5664
|
+
const canonical = await (options.canonicalizePath ?? realpath2)(path);
|
|
5628
5665
|
const resolution = await (options.resolveIdentity ?? resolveProjectIdentity)(canonical, {
|
|
5629
5666
|
selectedRoot: true
|
|
5630
5667
|
});
|
|
5631
|
-
const resolvedPath = resolution.kind === "git_unavailable" ? canonical :
|
|
5632
|
-
resolution.repository.kind === "git" ? resolution.repository.root : resolution.root
|
|
5633
|
-
);
|
|
5668
|
+
const resolvedPath = resolution.kind === "git_unavailable" ? canonical : resolution.root;
|
|
5634
5669
|
const kind = resolution.kind !== "git_unavailable" && resolution.repository.kind === "git" ? "git" : "folder";
|
|
5635
5670
|
if (resolution.kind === "ok") {
|
|
5636
5671
|
return {
|
|
@@ -5659,8 +5694,12 @@ async function classifyRepository(path, options = {}) {
|
|
|
5659
5694
|
}
|
|
5660
5695
|
return { path: resolvedPath, state: "not_set_up", kind };
|
|
5661
5696
|
}
|
|
5697
|
+
async function insideProject(folder, resolveIdentity = resolveProjectIdentity) {
|
|
5698
|
+
const resolution = await resolveIdentity(folder);
|
|
5699
|
+
return resolution.kind === "ok" && resolution.root !== folder;
|
|
5700
|
+
}
|
|
5662
5701
|
async function discoverRepositories(parentPath, options = {}) {
|
|
5663
|
-
const canonicalize = options.canonicalizePath ??
|
|
5702
|
+
const canonicalize = options.canonicalizePath ?? realpath2;
|
|
5664
5703
|
const root = await canonicalize(parentPath);
|
|
5665
5704
|
const maxDepth = options.maxDepth ?? DISCOVERY_DEPTH;
|
|
5666
5705
|
const limit = options.directoryLimit ?? DIRECTORY_LIMIT;
|
|
@@ -5709,7 +5748,8 @@ async function discoverRepositories(parentPath, options = {}) {
|
|
|
5709
5748
|
resolveIdentity: options.resolveIdentity,
|
|
5710
5749
|
readRemotes: repositories.length < REPOSITORY_LIMIT ? options.readRemotes : async () => []
|
|
5711
5750
|
});
|
|
5712
|
-
|
|
5751
|
+
const partOfProject = !identityBoundary && repository.path === canonical && (repository.state === "not_set_up" || repository.state === "remote_setup") && await insideProject(canonical, options.resolveIdentity);
|
|
5752
|
+
if (!partOfProject && !repositoryPaths.has(repository.path)) {
|
|
5713
5753
|
repositoryPaths.add(repository.path);
|
|
5714
5754
|
if (repositories.length < REPOSITORY_LIMIT) repositories.push(repository);
|
|
5715
5755
|
else omitted++;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discover.js","sourceRoot":"","sources":["../../src/scanner/discover.ts"],"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AAI,CAC1B,GAAG,EAAE,CAAC,IAAI,EACV,GAAG,EAAE,CAAC,KAAK,CACZ;YAED,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,OAAO,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;AAC3B,CAAC;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAY,EAAE,IAAY,EAAU,EAAE,CACnE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AAElD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,KAAsB,EAAU,EAAE,CACrE,CAAC;IACC,gBAAgB,EAAE,kBAAkB;IACpC,YAAY,EAAE,4BAA4B;IAC1C,UAAU,EAAE,gBAAgB;IAC5B,eAAe,EAAE,iBAAiB;CACnC,CAAC,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enable.d.ts","sourceRoot":"","sources":["../../src/scanner/enable.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG5C,OAAO,
|
|
1
|
+
{"version":3,"file":"enable.d.ts","sourceRoot":"","sources":["../../src/scanner/enable.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG5C,OAAO,EAIL,kBAAkB,EAGnB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAKhE,OAAO,EAAE,YAAY,EAAQ,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAE7E,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAkB,KAAK,qBAAqB,EAAE,MAAM,cAAc,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