chatroom-cli 1.68.4 → 1.68.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +312 -239
- package/dist/index.js.map +11 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -77106,6 +77106,40 @@ function getFileReferenceProofOfCompletionExample() {
|
|
|
77106
77106
|
- \`apps/webapp/src/path/to/file.ts\` — <what changed and why>`;
|
|
77107
77107
|
}
|
|
77108
77108
|
|
|
77109
|
+
// ../../services/backend/prompts/utils/handoff-quality-principles.ts
|
|
77110
|
+
function getHandoffQualityPrinciplesCommentBlock() {
|
|
77111
|
+
const bullets = HANDOFF_QUALITY_PRINCIPLES.map((p) => `- ${p.name}: ${p.description}`).join(`
|
|
77112
|
+
`);
|
|
77113
|
+
return `<!-- Demonstrate adherence to:
|
|
77114
|
+
${bullets}
|
|
77115
|
+
-->`;
|
|
77116
|
+
}
|
|
77117
|
+
var HANDOFF_QUALITY_PRINCIPLES, PROOF_OF_PRINCIPLES_HEADING_H2 = "## Proof of Principles", PROOF_OF_PRINCIPLES_HEADING_H3 = "### Proof of Principles";
|
|
77118
|
+
var init_handoff_quality_principles = __esm(() => {
|
|
77119
|
+
HANDOFF_QUALITY_PRINCIPLES = [
|
|
77120
|
+
{
|
|
77121
|
+
name: "Semantic Consistency",
|
|
77122
|
+
description: "the organization of the code, the code and the functionality of the code use a consistent and well maintained set of terms."
|
|
77123
|
+
},
|
|
77124
|
+
{
|
|
77125
|
+
name: "Organization & Maintainability",
|
|
77126
|
+
description: "a small change in requirements should result in a small change in code in a small number of files and folders."
|
|
77127
|
+
},
|
|
77128
|
+
{
|
|
77129
|
+
name: "Static Evaluability and Provability",
|
|
77130
|
+
description: "the system's behavior should be provably correct by looking at the source code, then automated tests, then manual tests, in this order."
|
|
77131
|
+
},
|
|
77132
|
+
{
|
|
77133
|
+
name: "No Revisit",
|
|
77134
|
+
description: "implemented in a way so the user does not have to revisit this implementation again."
|
|
77135
|
+
},
|
|
77136
|
+
{
|
|
77137
|
+
name: "Leave It Better",
|
|
77138
|
+
description: "leave the code in a slightly better state than before when touching files."
|
|
77139
|
+
}
|
|
77140
|
+
];
|
|
77141
|
+
});
|
|
77142
|
+
|
|
77109
77143
|
// ../../services/backend/prompts/cli/role-guidance/command.ts
|
|
77110
77144
|
function roleGuidanceCommand(params = {}) {
|
|
77111
77145
|
const prefix = params.cliEnvPrefix ?? "";
|
|
@@ -77140,13 +77174,8 @@ function getBuilderToPlannerHandoffTemplate(roleGuidanceContext) {
|
|
|
77140
77174
|
- [ ] I confirm that I have seen this template at the start of this task, before implementing or modifying any code
|
|
77141
77175
|
${getRoleGuidanceDisclosureBlock(roleGuidanceContext)}
|
|
77142
77176
|
|
|
77143
|
-
|
|
77144
|
-
|
|
77145
|
-
- Organization & Maintainability: a small change in requirements should result in a small change in code in a small number of files and folders.
|
|
77146
|
-
- Static Evaluability and Provability: the system's behavior should be provably correct by looking at the source code, then automated tests, then manual tests, in this order.
|
|
77147
|
-
- No Revisit: implemented in a way so the user does not have to revisit this implementation again.
|
|
77148
|
-
- Leave It Better: leave the code in a slightly better state than before when touching files.
|
|
77149
|
-
-->
|
|
77177
|
+
${PROOF_OF_PRINCIPLES_HEADING_H2}
|
|
77178
|
+
${getHandoffQualityPrinciplesCommentBlock()}
|
|
77150
77179
|
<how this work follows the principles above — localized changes, readable structure, correctness provable from source then tests>
|
|
77151
77180
|
|
|
77152
77181
|
## Proof of Completion
|
|
@@ -77165,6 +77194,7 @@ ${CODE_CHANGE_VERIFICATION_CONFIRMATION}
|
|
|
77165
77194
|
\`\`\``;
|
|
77166
77195
|
}
|
|
77167
77196
|
var init_builder_to_planner = __esm(() => {
|
|
77197
|
+
init_handoff_quality_principles();
|
|
77168
77198
|
init_role_guidance_disclosure();
|
|
77169
77199
|
});
|
|
77170
77200
|
|
|
@@ -77303,13 +77333,8 @@ ${getRoleGuidanceDisclosureBlock(roleGuidanceContext)}
|
|
|
77303
77333
|
## What changed
|
|
77304
77334
|
<high-level view of what changed since the user's message before the detailed proofs below>
|
|
77305
77335
|
|
|
77306
|
-
|
|
77307
|
-
|
|
77308
|
-
- Organization & Maintainability: a small change in requirements should result in a small change in code in a small number of files and folders.
|
|
77309
|
-
- Static Evaluability and Provability: the system's behavior should be provably correct by looking at the source code, then automated tests, then manual tests, in this order.
|
|
77310
|
-
- No Revisit: implemented in a way so the user does not have to revisit this implementation again.
|
|
77311
|
-
- Leave It Better: leave the code in a slightly better state than before when touching files.
|
|
77312
|
-
-->
|
|
77336
|
+
${PROOF_OF_PRINCIPLES_HEADING_H3}
|
|
77337
|
+
${getHandoffQualityPrinciplesCommentBlock()}
|
|
77313
77338
|
<how this work follows the principles above — localized changes, readable structure, correctness provable from source then tests>
|
|
77314
77339
|
|
|
77315
77340
|
### Proof of Completion
|
|
@@ -77354,6 +77379,7 @@ ${getUnresolvedDecisionsSectionBlock()}
|
|
|
77354
77379
|
}
|
|
77355
77380
|
var init_planner_to_user = __esm(() => {
|
|
77356
77381
|
init_context_disclosure();
|
|
77382
|
+
init_handoff_quality_principles();
|
|
77357
77383
|
init_role_guidance_disclosure();
|
|
77358
77384
|
});
|
|
77359
77385
|
|
|
@@ -77405,13 +77431,8 @@ ${getRoleGuidanceDisclosureBlock(roleGuidanceContext)}
|
|
|
77405
77431
|
## What changed
|
|
77406
77432
|
<high-level view of what changed since the user's message before the detailed proofs below>
|
|
77407
77433
|
|
|
77408
|
-
|
|
77409
|
-
|
|
77410
|
-
- Organization & Maintainability: a small change in requirements should result in a small change in code in a small number of files and folders.
|
|
77411
|
-
- Static Evaluability and Provability: the system's behavior should be provably correct by looking at the source code, then automated tests, then manual tests, in this order.
|
|
77412
|
-
- No Revisit: implemented in a way so the user does not have to revisit this implementation again.
|
|
77413
|
-
- Leave It Better: leave the code in a slightly better state than before when touching files.
|
|
77414
|
-
-->
|
|
77434
|
+
${PROOF_OF_PRINCIPLES_HEADING_H3}
|
|
77435
|
+
${getHandoffQualityPrinciplesCommentBlock()}
|
|
77415
77436
|
<how this work follows the principles above — localized changes, readable structure, correctness provable from source then tests>
|
|
77416
77437
|
|
|
77417
77438
|
### Proof of Completion
|
|
@@ -77456,6 +77477,7 @@ ${getUnresolvedDecisionsSectionBlock()}
|
|
|
77456
77477
|
}
|
|
77457
77478
|
var init_solo_to_user = __esm(() => {
|
|
77458
77479
|
init_context_disclosure();
|
|
77480
|
+
init_handoff_quality_principles();
|
|
77459
77481
|
init_role_guidance_disclosure();
|
|
77460
77482
|
});
|
|
77461
77483
|
|
|
@@ -101119,8 +101141,31 @@ function gunzipBase64Payload(base643, maxBytes) {
|
|
|
101119
101141
|
var init_workspace_path_security = () => {};
|
|
101120
101142
|
|
|
101121
101143
|
// src/infrastructure/services/workspace/workspace-visibility-policy.ts
|
|
101144
|
+
function isHiddenDirName(name) {
|
|
101145
|
+
return HIDDEN_DIR_NAMES.has(name);
|
|
101146
|
+
}
|
|
101147
|
+
function isShallowSyncDirName(name) {
|
|
101148
|
+
return SHALLOW_SYNC_DIR_NAMES.has(name);
|
|
101149
|
+
}
|
|
101122
101150
|
function isAlwaysExcludedDirName(name) {
|
|
101123
|
-
return
|
|
101151
|
+
return isHiddenDirName(name) || isShallowSyncDirName(name);
|
|
101152
|
+
}
|
|
101153
|
+
function shouldShallowSyncByHeuristics(context5) {
|
|
101154
|
+
if (context5.immediateChildCount >= SHALLOW_HEURISTIC_MIN_CHILD_COUNT)
|
|
101155
|
+
return true;
|
|
101156
|
+
if (!context5.relativePath.includes("/") && context5.immediateSiblingCount >= 300) {
|
|
101157
|
+
return context5.immediateChildCount >= 100;
|
|
101158
|
+
}
|
|
101159
|
+
return false;
|
|
101160
|
+
}
|
|
101161
|
+
function classifyDirectorySyncMode(dirName, context5) {
|
|
101162
|
+
if (isHiddenDirName(dirName))
|
|
101163
|
+
return "hidden";
|
|
101164
|
+
if (isShallowSyncDirName(dirName))
|
|
101165
|
+
return "shallow";
|
|
101166
|
+
if (shouldShallowSyncByHeuristics(context5))
|
|
101167
|
+
return "shallow";
|
|
101168
|
+
return "full";
|
|
101124
101169
|
}
|
|
101125
101170
|
function isSecretPath(relativePath) {
|
|
101126
101171
|
const normalized = relativePath.replace(/\\/g, "/");
|
|
@@ -101128,7 +101173,15 @@ function isSecretPath(relativePath) {
|
|
|
101128
101173
|
}
|
|
101129
101174
|
function hasExcludedDirSegment(relativePath) {
|
|
101130
101175
|
const segments = relativePath.split("/");
|
|
101131
|
-
|
|
101176
|
+
const lastIndex = segments.length - 1;
|
|
101177
|
+
for (let index = 0;index < segments.length; index++) {
|
|
101178
|
+
const name = segments[index];
|
|
101179
|
+
if (isHiddenDirName(name))
|
|
101180
|
+
return true;
|
|
101181
|
+
if (isShallowSyncDirName(name) && index < lastIndex)
|
|
101182
|
+
return true;
|
|
101183
|
+
}
|
|
101184
|
+
return false;
|
|
101132
101185
|
}
|
|
101133
101186
|
function isPathVisible(relativePath) {
|
|
101134
101187
|
if (!relativePath)
|
|
@@ -101138,11 +101191,11 @@ function isPathVisible(relativePath) {
|
|
|
101138
101191
|
function isPathContentReadable(relativePath) {
|
|
101139
101192
|
return isPathVisible(relativePath);
|
|
101140
101193
|
}
|
|
101141
|
-
var ALWAYS_EXCLUDE_DIR_NAMES, SECRET_PATH_PATTERNS;
|
|
101194
|
+
var HIDDEN_DIR_NAMES, SHALLOW_SYNC_DIR_NAMES, ALWAYS_EXCLUDE_DIR_NAMES, SECRET_PATH_PATTERNS, SHALLOW_HEURISTIC_MIN_CHILD_COUNT = 500;
|
|
101142
101195
|
var init_workspace_visibility_policy = __esm(() => {
|
|
101143
|
-
|
|
101196
|
+
HIDDEN_DIR_NAMES = new Set([".git"]);
|
|
101197
|
+
SHALLOW_SYNC_DIR_NAMES = new Set([
|
|
101144
101198
|
"node_modules",
|
|
101145
|
-
".git",
|
|
101146
101199
|
"dist",
|
|
101147
101200
|
"build",
|
|
101148
101201
|
".next",
|
|
@@ -101155,6 +101208,7 @@ var init_workspace_visibility_policy = __esm(() => {
|
|
|
101155
101208
|
"_generated",
|
|
101156
101209
|
".vercel"
|
|
101157
101210
|
]);
|
|
101211
|
+
ALWAYS_EXCLUDE_DIR_NAMES = new Set([...HIDDEN_DIR_NAMES, ...SHALLOW_SYNC_DIR_NAMES]);
|
|
101158
101212
|
SECRET_PATH_PATTERNS = [
|
|
101159
101213
|
/^\.env$/,
|
|
101160
101214
|
/^\.env\./,
|
|
@@ -101928,29 +101982,41 @@ async function isWorkspacePathIgnored(rootDir, relativePath) {
|
|
|
101928
101982
|
const ruleSets = await loadApplicableIgnoreRuleSets(rootDir, relativePath);
|
|
101929
101983
|
return isPathIgnoredByRuleSets(ruleSets, relativePath);
|
|
101930
101984
|
}
|
|
101985
|
+
function mergeWorkspaceIgnoreRuleSets(inheritedRuleSets, localRuleSets) {
|
|
101986
|
+
return localRuleSets.length === 0 ? [...inheritedRuleSets] : [...inheritedRuleSets, ...localRuleSets];
|
|
101987
|
+
}
|
|
101988
|
+
async function readWorkspaceDirectoryDirents(rootDir, relDir) {
|
|
101989
|
+
const absDir = relDir ? path3.join(rootDir, relDir) : rootDir;
|
|
101990
|
+
try {
|
|
101991
|
+
return await fsPromises.readdir(absDir, { withFileTypes: true });
|
|
101992
|
+
} catch {
|
|
101993
|
+
return null;
|
|
101994
|
+
}
|
|
101995
|
+
}
|
|
101931
101996
|
async function loadAllWorkspaceIgnoreRuleSets(rootDir) {
|
|
101932
101997
|
const collected = [];
|
|
101933
101998
|
async function visit(relDir, inheritedRuleSets) {
|
|
101934
101999
|
const localRuleSets = await loadDirectoryIgnoreRuleSets(rootDir, relDir);
|
|
101935
|
-
const ruleSets =
|
|
102000
|
+
const ruleSets = mergeWorkspaceIgnoreRuleSets(inheritedRuleSets, localRuleSets);
|
|
101936
102001
|
collected.push(...localRuleSets);
|
|
101937
|
-
const
|
|
101938
|
-
|
|
101939
|
-
try {
|
|
101940
|
-
dirents = await fsPromises.readdir(absDir, { withFileTypes: true });
|
|
101941
|
-
} catch {
|
|
102002
|
+
const dirents = await readWorkspaceDirectoryDirents(rootDir, relDir);
|
|
102003
|
+
if (!dirents)
|
|
101942
102004
|
return;
|
|
101943
|
-
}
|
|
101944
102005
|
for (const ent of dirents) {
|
|
101945
102006
|
if (!ent.isDirectory())
|
|
101946
102007
|
continue;
|
|
101947
|
-
if (isAlwaysExcludedDirName(ent.name))
|
|
101948
|
-
continue;
|
|
101949
102008
|
const relativePath = relDir ? `${relDir}/${ent.name}` : ent.name;
|
|
101950
102009
|
if (!isPathVisible(relativePath))
|
|
101951
102010
|
continue;
|
|
101952
102011
|
if (isPathIgnoredByRuleSets(ruleSets, relativePath))
|
|
101953
102012
|
continue;
|
|
102013
|
+
const syncMode = classifyDirectorySyncMode(ent.name, {
|
|
102014
|
+
relativePath,
|
|
102015
|
+
immediateSiblingCount: dirents.length,
|
|
102016
|
+
immediateChildCount: 0
|
|
102017
|
+
});
|
|
102018
|
+
if (syncMode !== "full")
|
|
102019
|
+
continue;
|
|
101954
102020
|
await visit(relativePath, ruleSets);
|
|
101955
102021
|
}
|
|
101956
102022
|
}
|
|
@@ -101965,40 +102031,43 @@ var init_workspace_ignore = __esm(() => {
|
|
|
101965
102031
|
});
|
|
101966
102032
|
|
|
101967
102033
|
// src/infrastructure/services/workspace/workspace-file-walk.ts
|
|
101968
|
-
import { promises as fsPromises2 } from "node:fs";
|
|
101969
|
-
import path4 from "node:path";
|
|
101970
102034
|
async function walkWorkspaceFiles(rootDir, options) {
|
|
101971
102035
|
const maxFilePaths = options?.maxFilePaths ?? 1e4;
|
|
101972
102036
|
const filePaths = [];
|
|
102037
|
+
const directoryStubs = [];
|
|
101973
102038
|
let truncated = false;
|
|
101974
|
-
async function visitDir(relDir, inheritedRuleSets) {
|
|
102039
|
+
async function visitDir(relDir, inheritedRuleSets, siblingCount) {
|
|
101975
102040
|
if (truncated || filePaths.length >= maxFilePaths) {
|
|
101976
102041
|
truncated = true;
|
|
101977
102042
|
return;
|
|
101978
102043
|
}
|
|
101979
102044
|
const localRuleSets = await loadDirectoryIgnoreRuleSets(rootDir, relDir);
|
|
101980
|
-
const ruleSets =
|
|
101981
|
-
const
|
|
101982
|
-
|
|
101983
|
-
try {
|
|
101984
|
-
dirents = await fsPromises2.readdir(absDir, { withFileTypes: true });
|
|
101985
|
-
} catch {
|
|
102045
|
+
const ruleSets = mergeWorkspaceIgnoreRuleSets(inheritedRuleSets, localRuleSets);
|
|
102046
|
+
const dirents = await readWorkspaceDirectoryDirents(rootDir, relDir);
|
|
102047
|
+
if (!dirents)
|
|
101986
102048
|
return;
|
|
101987
|
-
}
|
|
101988
102049
|
for (const ent of dirents) {
|
|
101989
102050
|
if (truncated || filePaths.length >= maxFilePaths) {
|
|
101990
102051
|
truncated = true;
|
|
101991
102052
|
return;
|
|
101992
102053
|
}
|
|
101993
|
-
if (isAlwaysExcludedDirName(ent.name))
|
|
101994
|
-
continue;
|
|
101995
102054
|
const relativePath = relDir ? `${relDir}/${ent.name}` : ent.name;
|
|
101996
102055
|
if (!isPathVisible(relativePath))
|
|
101997
102056
|
continue;
|
|
101998
102057
|
if (ent.isDirectory()) {
|
|
101999
102058
|
if (isPathIgnoredByRuleSets(ruleSets, relativePath))
|
|
102000
102059
|
continue;
|
|
102001
|
-
|
|
102060
|
+
const syncMode = classifyDirectorySyncMode(ent.name, {
|
|
102061
|
+
relativePath,
|
|
102062
|
+
immediateSiblingCount: siblingCount,
|
|
102063
|
+
immediateChildCount: dirents.length
|
|
102064
|
+
});
|
|
102065
|
+
if (syncMode === "hidden")
|
|
102066
|
+
continue;
|
|
102067
|
+
directoryStubs.push(relativePath);
|
|
102068
|
+
if (syncMode === "shallow")
|
|
102069
|
+
continue;
|
|
102070
|
+
await visitDir(relativePath, ruleSets, dirents.length);
|
|
102002
102071
|
} else if (ent.isFile()) {
|
|
102003
102072
|
if (isPathIgnoredByRuleSets(ruleSets, relativePath))
|
|
102004
102073
|
continue;
|
|
@@ -102008,8 +102077,8 @@ async function walkWorkspaceFiles(rootDir, options) {
|
|
|
102008
102077
|
}
|
|
102009
102078
|
}
|
|
102010
102079
|
}
|
|
102011
|
-
await visitDir("", []);
|
|
102012
|
-
return { filePaths, truncated };
|
|
102080
|
+
await visitDir("", [], 0);
|
|
102081
|
+
return { filePaths, directoryStubs, truncated };
|
|
102013
102082
|
}
|
|
102014
102083
|
var init_workspace_file_walk = __esm(() => {
|
|
102015
102084
|
init_workspace_ignore();
|
|
@@ -102022,7 +102091,8 @@ async function scanFileTree(rootDir, options) {
|
|
|
102022
102091
|
const scannedAt = Date.now();
|
|
102023
102092
|
const walk = await walkWorkspaceFiles(rootDir, { maxFilePaths: maxEntries });
|
|
102024
102093
|
const filteredPaths = walk.filePaths.filter((p) => !isExcluded(p));
|
|
102025
|
-
const
|
|
102094
|
+
const filteredStubs = walk.directoryStubs.filter((p) => !isExcluded(p));
|
|
102095
|
+
const entries2 = buildEntries(filteredPaths, filteredStubs, maxEntries);
|
|
102026
102096
|
return {
|
|
102027
102097
|
entries: entries2,
|
|
102028
102098
|
scannedAt,
|
|
@@ -102032,28 +102102,31 @@ async function scanFileTree(rootDir, options) {
|
|
|
102032
102102
|
function isExcluded(filePath) {
|
|
102033
102103
|
return hasExcludedDirSegment(filePath);
|
|
102034
102104
|
}
|
|
102035
|
-
function
|
|
102036
|
-
|
|
102105
|
+
function entryDepth(entryPath) {
|
|
102106
|
+
return entryPath.split("/").length;
|
|
102107
|
+
}
|
|
102108
|
+
function buildEntries(filePaths, directoryStubs, maxEntries) {
|
|
102109
|
+
const directories = new Set(directoryStubs);
|
|
102037
102110
|
for (const filePath of filePaths) {
|
|
102038
102111
|
const parts2 = filePath.split("/");
|
|
102039
102112
|
for (let i2 = 1;i2 < parts2.length; i2++) {
|
|
102040
102113
|
directories.add(parts2.slice(0, i2).join("/"));
|
|
102041
102114
|
}
|
|
102042
102115
|
}
|
|
102043
|
-
const entries2 = [
|
|
102044
|
-
|
|
102045
|
-
|
|
102046
|
-
|
|
102047
|
-
|
|
102048
|
-
|
|
102049
|
-
|
|
102050
|
-
const sortedFiles = filePaths.slice().sort();
|
|
102051
|
-
for (const file2 of sortedFiles) {
|
|
102052
|
-
if (entries2.length >= maxEntries)
|
|
102053
|
-
break;
|
|
102054
|
-
entries2.push({ path: file2, type: "file" });
|
|
102116
|
+
const entries2 = [
|
|
102117
|
+
...Array.from(directories).map((dir) => ({ path: dir, type: "directory" })),
|
|
102118
|
+
...filePaths.map((file2) => ({ path: file2, type: "file" }))
|
|
102119
|
+
];
|
|
102120
|
+
const uniqueByPath = new Map;
|
|
102121
|
+
for (const entry of entries2) {
|
|
102122
|
+
uniqueByPath.set(entry.path, entry);
|
|
102055
102123
|
}
|
|
102056
|
-
return
|
|
102124
|
+
return Array.from(uniqueByPath.values()).sort((left3, right3) => {
|
|
102125
|
+
const depthDelta = entryDepth(left3.path) - entryDepth(right3.path);
|
|
102126
|
+
if (depthDelta !== 0)
|
|
102127
|
+
return depthDelta;
|
|
102128
|
+
return left3.path.localeCompare(right3.path);
|
|
102129
|
+
}).slice(0, maxEntries);
|
|
102057
102130
|
}
|
|
102058
102131
|
var DEFAULT_MAX_ENTRIES = 1e4;
|
|
102059
102132
|
var init_file_tree_scanner = __esm(() => {
|
|
@@ -102063,7 +102136,7 @@ var init_file_tree_scanner = __esm(() => {
|
|
|
102063
102136
|
|
|
102064
102137
|
// src/infrastructure/services/workspace/git-workspace-porcelain.ts
|
|
102065
102138
|
import { existsSync as existsSync7 } from "node:fs";
|
|
102066
|
-
import
|
|
102139
|
+
import path4 from "node:path";
|
|
102067
102140
|
function isEmptyRepoHeadError(error51) {
|
|
102068
102141
|
const message = error51.message.toLowerCase();
|
|
102069
102142
|
return message.includes("unknown revision") || message.includes("bad revision") || message.includes("ambiguous argument") || message.includes("needed a single revision");
|
|
@@ -102262,7 +102335,7 @@ function porcelainUntrackedDeletedEvents(args2) {
|
|
|
102262
102335
|
const prevEntry = prevByWsPath.get(wsPath);
|
|
102263
102336
|
if (prevEntry?.xy !== "??")
|
|
102264
102337
|
continue;
|
|
102265
|
-
const absPath =
|
|
102338
|
+
const absPath = path4.join(args2.node.workTree, prevEntry.path);
|
|
102266
102339
|
if (!exists3(absPath)) {
|
|
102267
102340
|
events.push({
|
|
102268
102341
|
kind: prevEntry.path.endsWith("/") ? "unlinkDir" : "unlink",
|
|
@@ -102529,8 +102602,8 @@ var init_git_workspace_change_source = __esm(() => {
|
|
|
102529
102602
|
});
|
|
102530
102603
|
|
|
102531
102604
|
// src/infrastructure/services/workspace/git-workspace-hierarchy.ts
|
|
102532
|
-
import { promises as
|
|
102533
|
-
import
|
|
102605
|
+
import { promises as fsPromises2 } from "node:fs";
|
|
102606
|
+
import path5 from "node:path";
|
|
102534
102607
|
function normalizeRel(p) {
|
|
102535
102608
|
return p.replace(/\\/g, "/").replace(/^\.\/+/, "").replace(/\/+$/, "");
|
|
102536
102609
|
}
|
|
@@ -102545,15 +102618,15 @@ async function resolveGitDir(workTree) {
|
|
|
102545
102618
|
const raw = await revParse(workTree, "--git-dir");
|
|
102546
102619
|
if (!raw)
|
|
102547
102620
|
return null;
|
|
102548
|
-
return
|
|
102621
|
+
return path5.isAbsolute(raw) ? raw : path5.resolve(workTree, raw);
|
|
102549
102622
|
}
|
|
102550
102623
|
async function findNestedWorkTrees(workspaceRoot) {
|
|
102551
102624
|
const found = [];
|
|
102552
102625
|
async function visit(relDir) {
|
|
102553
|
-
const absDir = relDir ?
|
|
102626
|
+
const absDir = relDir ? path5.join(workspaceRoot, relDir) : workspaceRoot;
|
|
102554
102627
|
let dirents;
|
|
102555
102628
|
try {
|
|
102556
|
-
dirents = await
|
|
102629
|
+
dirents = await fsPromises2.readdir(absDir, { withFileTypes: true });
|
|
102557
102630
|
} catch {
|
|
102558
102631
|
return;
|
|
102559
102632
|
}
|
|
@@ -102562,7 +102635,7 @@ async function findNestedWorkTrees(workspaceRoot) {
|
|
|
102562
102635
|
const relativePath = relDir ? `${relDir}/${name}` : name;
|
|
102563
102636
|
if (name === ".git") {
|
|
102564
102637
|
if (relDir) {
|
|
102565
|
-
found.push(
|
|
102638
|
+
found.push(path5.resolve(workspaceRoot, relDir));
|
|
102566
102639
|
}
|
|
102567
102640
|
continue;
|
|
102568
102641
|
}
|
|
@@ -102576,12 +102649,12 @@ async function findNestedWorkTrees(workspaceRoot) {
|
|
|
102576
102649
|
}
|
|
102577
102650
|
}
|
|
102578
102651
|
await visit("");
|
|
102579
|
-
return [...new Set(found.map((p) =>
|
|
102652
|
+
return [...new Set(found.map((p) => path5.resolve(p)))].sort((a, b) => a.length - b.length || a.localeCompare(b));
|
|
102580
102653
|
}
|
|
102581
102654
|
async function discoverGitWorkspaceHierarchy(workingDir) {
|
|
102582
102655
|
let workspaceRoot;
|
|
102583
102656
|
try {
|
|
102584
|
-
workspaceRoot = await
|
|
102657
|
+
workspaceRoot = await fsPromises2.realpath(workingDir);
|
|
102585
102658
|
} catch {
|
|
102586
102659
|
return null;
|
|
102587
102660
|
}
|
|
@@ -102592,8 +102665,8 @@ async function discoverGitWorkspaceHierarchy(workingDir) {
|
|
|
102592
102665
|
const gitDir = await resolveGitDir(workspaceRoot);
|
|
102593
102666
|
if (!toplevelRaw || !gitDir)
|
|
102594
102667
|
return null;
|
|
102595
|
-
const toplevel =
|
|
102596
|
-
const relFromToplevel = normalizeRel(
|
|
102668
|
+
const toplevel = path5.resolve(toplevelRaw);
|
|
102669
|
+
const relFromToplevel = normalizeRel(path5.relative(toplevel, workspaceRoot));
|
|
102597
102670
|
if (relFromToplevel.startsWith(".."))
|
|
102598
102671
|
return null;
|
|
102599
102672
|
const pathspec = relFromToplevel && toplevel !== workspaceRoot ? [relFromToplevel] : [];
|
|
@@ -102606,7 +102679,7 @@ async function discoverGitWorkspaceHierarchy(workingDir) {
|
|
|
102606
102679
|
nestedNodes.push({
|
|
102607
102680
|
workTree,
|
|
102608
102681
|
gitDir: nestedGitDir,
|
|
102609
|
-
relativePath: normalizeRel(
|
|
102682
|
+
relativePath: normalizeRel(path5.relative(workspaceRoot, workTree)),
|
|
102610
102683
|
pathspec: [],
|
|
102611
102684
|
children: []
|
|
102612
102685
|
});
|
|
@@ -102624,7 +102697,7 @@ async function discoverGitWorkspaceHierarchy(workingDir) {
|
|
|
102624
102697
|
for (const candidate of sorted) {
|
|
102625
102698
|
if (candidate === node)
|
|
102626
102699
|
continue;
|
|
102627
|
-
const prefix = candidate.workTree.endsWith(
|
|
102700
|
+
const prefix = candidate.workTree.endsWith(path5.sep) ? candidate.workTree : candidate.workTree + path5.sep;
|
|
102628
102701
|
if (node.workTree.startsWith(prefix) && candidate.workTree.length >= parent.workTree.length) {
|
|
102629
102702
|
parent = candidate;
|
|
102630
102703
|
}
|
|
@@ -102736,7 +102809,7 @@ var init_readdirp = __esm(() => {
|
|
|
102736
102809
|
this._directoryFilter = normalizeFilter(opts.directoryFilter);
|
|
102737
102810
|
const statMethod = opts.lstat ? lstat : stat2;
|
|
102738
102811
|
if (wantBigintFsStats) {
|
|
102739
|
-
this._stat = (
|
|
102812
|
+
this._stat = (path6) => statMethod(path6, { bigint: true });
|
|
102740
102813
|
} else {
|
|
102741
102814
|
this._stat = statMethod;
|
|
102742
102815
|
}
|
|
@@ -102761,8 +102834,8 @@ var init_readdirp = __esm(() => {
|
|
|
102761
102834
|
const par2 = this.parent;
|
|
102762
102835
|
const fil = par2 && par2.files;
|
|
102763
102836
|
if (fil && fil.length > 0) {
|
|
102764
|
-
const { path:
|
|
102765
|
-
const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent,
|
|
102837
|
+
const { path: path6, depth } = par2;
|
|
102838
|
+
const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path6));
|
|
102766
102839
|
const awaited = await Promise.all(slice);
|
|
102767
102840
|
for (const entry of awaited) {
|
|
102768
102841
|
if (!entry)
|
|
@@ -102802,20 +102875,20 @@ var init_readdirp = __esm(() => {
|
|
|
102802
102875
|
this.reading = false;
|
|
102803
102876
|
}
|
|
102804
102877
|
}
|
|
102805
|
-
async _exploreDir(
|
|
102878
|
+
async _exploreDir(path6, depth) {
|
|
102806
102879
|
let files;
|
|
102807
102880
|
try {
|
|
102808
|
-
files = await readdir(
|
|
102881
|
+
files = await readdir(path6, this._rdOptions);
|
|
102809
102882
|
} catch (error51) {
|
|
102810
102883
|
this._onError(error51);
|
|
102811
102884
|
}
|
|
102812
|
-
return { files, depth, path:
|
|
102885
|
+
return { files, depth, path: path6 };
|
|
102813
102886
|
}
|
|
102814
|
-
async _formatEntry(dirent,
|
|
102887
|
+
async _formatEntry(dirent, path6) {
|
|
102815
102888
|
let entry;
|
|
102816
102889
|
const basename2 = this._isDirent ? dirent.name : dirent;
|
|
102817
102890
|
try {
|
|
102818
|
-
const fullPath = presolve(pjoin(
|
|
102891
|
+
const fullPath = presolve(pjoin(path6, basename2));
|
|
102819
102892
|
entry = { path: prelative(this._root, fullPath), fullPath, basename: basename2 };
|
|
102820
102893
|
entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
|
|
102821
102894
|
} catch (err) {
|
|
@@ -102875,16 +102948,16 @@ import { watch as fs_watch, unwatchFile, watchFile } from "node:fs";
|
|
|
102875
102948
|
import { realpath as fsrealpath, lstat as lstat2, open, stat as stat3 } from "node:fs/promises";
|
|
102876
102949
|
import { type as osType } from "node:os";
|
|
102877
102950
|
import * as sp from "node:path";
|
|
102878
|
-
function createFsWatchInstance(
|
|
102951
|
+
function createFsWatchInstance(path6, options, listener, errHandler, emitRaw) {
|
|
102879
102952
|
const handleEvent = (rawEvent, evPath) => {
|
|
102880
|
-
listener(
|
|
102881
|
-
emitRaw(rawEvent, evPath, { watchedPath:
|
|
102882
|
-
if (evPath &&
|
|
102883
|
-
fsWatchBroadcast(sp.resolve(
|
|
102953
|
+
listener(path6);
|
|
102954
|
+
emitRaw(rawEvent, evPath, { watchedPath: path6 });
|
|
102955
|
+
if (evPath && path6 !== evPath) {
|
|
102956
|
+
fsWatchBroadcast(sp.resolve(path6, evPath), KEY_LISTENERS, sp.join(path6, evPath));
|
|
102884
102957
|
}
|
|
102885
102958
|
};
|
|
102886
102959
|
try {
|
|
102887
|
-
return fs_watch(
|
|
102960
|
+
return fs_watch(path6, {
|
|
102888
102961
|
persistent: options.persistent
|
|
102889
102962
|
}, handleEvent);
|
|
102890
102963
|
} catch (error51) {
|
|
@@ -102900,13 +102973,13 @@ class NodeFsHandler {
|
|
|
102900
102973
|
this.fsw = fsW;
|
|
102901
102974
|
this._boundHandleError = (error51) => fsW._handleError(error51);
|
|
102902
102975
|
}
|
|
102903
|
-
_watchWithNodeFs(
|
|
102976
|
+
_watchWithNodeFs(path6, listener) {
|
|
102904
102977
|
const opts = this.fsw.options;
|
|
102905
|
-
const directory = sp.dirname(
|
|
102906
|
-
const basename3 = sp.basename(
|
|
102978
|
+
const directory = sp.dirname(path6);
|
|
102979
|
+
const basename3 = sp.basename(path6);
|
|
102907
102980
|
const parent = this.fsw._getWatchedDir(directory);
|
|
102908
102981
|
parent.add(basename3);
|
|
102909
|
-
const absolutePath = sp.resolve(
|
|
102982
|
+
const absolutePath = sp.resolve(path6);
|
|
102910
102983
|
const options = {
|
|
102911
102984
|
persistent: opts.persistent
|
|
102912
102985
|
};
|
|
@@ -102916,12 +102989,12 @@ class NodeFsHandler {
|
|
|
102916
102989
|
if (opts.usePolling) {
|
|
102917
102990
|
const enableBin = opts.interval !== opts.binaryInterval;
|
|
102918
102991
|
options.interval = enableBin && isBinaryPath(basename3) ? opts.binaryInterval : opts.interval;
|
|
102919
|
-
closer = setFsWatchFileListener(
|
|
102992
|
+
closer = setFsWatchFileListener(path6, absolutePath, options, {
|
|
102920
102993
|
listener,
|
|
102921
102994
|
rawEmitter: this.fsw._emitRaw
|
|
102922
102995
|
});
|
|
102923
102996
|
} else {
|
|
102924
|
-
closer = setFsWatchListener(
|
|
102997
|
+
closer = setFsWatchListener(path6, absolutePath, options, {
|
|
102925
102998
|
listener,
|
|
102926
102999
|
errHandler: this._boundHandleError,
|
|
102927
103000
|
rawEmitter: this.fsw._emitRaw
|
|
@@ -102939,7 +103012,7 @@ class NodeFsHandler {
|
|
|
102939
103012
|
let prevStats = stats;
|
|
102940
103013
|
if (parent.has(basename3))
|
|
102941
103014
|
return;
|
|
102942
|
-
const listener = async (
|
|
103015
|
+
const listener = async (path6, newStats) => {
|
|
102943
103016
|
if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file2, 5))
|
|
102944
103017
|
return;
|
|
102945
103018
|
if (!newStats || newStats.mtimeMs === 0) {
|
|
@@ -102953,11 +103026,11 @@ class NodeFsHandler {
|
|
|
102953
103026
|
this.fsw._emit(EV.CHANGE, file2, newStats2);
|
|
102954
103027
|
}
|
|
102955
103028
|
if ((isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats2.ino) {
|
|
102956
|
-
this.fsw._closeFile(
|
|
103029
|
+
this.fsw._closeFile(path6);
|
|
102957
103030
|
prevStats = newStats2;
|
|
102958
103031
|
const closer2 = this._watchWithNodeFs(file2, listener);
|
|
102959
103032
|
if (closer2)
|
|
102960
|
-
this.fsw._addPathCloser(
|
|
103033
|
+
this.fsw._addPathCloser(path6, closer2);
|
|
102961
103034
|
} else {
|
|
102962
103035
|
prevStats = newStats2;
|
|
102963
103036
|
}
|
|
@@ -102981,7 +103054,7 @@ class NodeFsHandler {
|
|
|
102981
103054
|
}
|
|
102982
103055
|
return closer;
|
|
102983
103056
|
}
|
|
102984
|
-
async _handleSymlink(entry, directory,
|
|
103057
|
+
async _handleSymlink(entry, directory, path6, item) {
|
|
102985
103058
|
if (this.fsw.closed) {
|
|
102986
103059
|
return;
|
|
102987
103060
|
}
|
|
@@ -102991,7 +103064,7 @@ class NodeFsHandler {
|
|
|
102991
103064
|
this.fsw._incrReadyCount();
|
|
102992
103065
|
let linkPath;
|
|
102993
103066
|
try {
|
|
102994
|
-
linkPath = await fsrealpath(
|
|
103067
|
+
linkPath = await fsrealpath(path6);
|
|
102995
103068
|
} catch (e) {
|
|
102996
103069
|
this.fsw._emitReady();
|
|
102997
103070
|
return true;
|
|
@@ -103001,12 +103074,12 @@ class NodeFsHandler {
|
|
|
103001
103074
|
if (dir.has(item)) {
|
|
103002
103075
|
if (this.fsw._symlinkPaths.get(full) !== linkPath) {
|
|
103003
103076
|
this.fsw._symlinkPaths.set(full, linkPath);
|
|
103004
|
-
this.fsw._emit(EV.CHANGE,
|
|
103077
|
+
this.fsw._emit(EV.CHANGE, path6, entry.stats);
|
|
103005
103078
|
}
|
|
103006
103079
|
} else {
|
|
103007
103080
|
dir.add(item);
|
|
103008
103081
|
this.fsw._symlinkPaths.set(full, linkPath);
|
|
103009
|
-
this.fsw._emit(EV.ADD,
|
|
103082
|
+
this.fsw._emit(EV.ADD, path6, entry.stats);
|
|
103010
103083
|
}
|
|
103011
103084
|
this.fsw._emitReady();
|
|
103012
103085
|
return true;
|
|
@@ -103036,9 +103109,9 @@ class NodeFsHandler {
|
|
|
103036
103109
|
return;
|
|
103037
103110
|
}
|
|
103038
103111
|
const item = entry.path;
|
|
103039
|
-
let
|
|
103112
|
+
let path6 = sp.join(directory, item);
|
|
103040
103113
|
current.add(item);
|
|
103041
|
-
if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory,
|
|
103114
|
+
if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path6, item)) {
|
|
103042
103115
|
return;
|
|
103043
103116
|
}
|
|
103044
103117
|
if (this.fsw.closed) {
|
|
@@ -103047,8 +103120,8 @@ class NodeFsHandler {
|
|
|
103047
103120
|
}
|
|
103048
103121
|
if (item === target || !target && !previous.has(item)) {
|
|
103049
103122
|
this.fsw._incrReadyCount();
|
|
103050
|
-
|
|
103051
|
-
this._addToNodeFs(
|
|
103123
|
+
path6 = sp.join(dir, sp.relative(dir, path6));
|
|
103124
|
+
this._addToNodeFs(path6, initialAdd, wh, depth + 1);
|
|
103052
103125
|
}
|
|
103053
103126
|
}).on(EV.ERROR, this._boundHandleError);
|
|
103054
103127
|
return new Promise((resolve6, reject) => {
|
|
@@ -103097,13 +103170,13 @@ class NodeFsHandler {
|
|
|
103097
103170
|
}
|
|
103098
103171
|
return closer;
|
|
103099
103172
|
}
|
|
103100
|
-
async _addToNodeFs(
|
|
103173
|
+
async _addToNodeFs(path6, initialAdd, priorWh, depth, target) {
|
|
103101
103174
|
const ready = this.fsw._emitReady;
|
|
103102
|
-
if (this.fsw._isIgnored(
|
|
103175
|
+
if (this.fsw._isIgnored(path6) || this.fsw.closed) {
|
|
103103
103176
|
ready();
|
|
103104
103177
|
return false;
|
|
103105
103178
|
}
|
|
103106
|
-
const wh = this.fsw._getWatchHelpers(
|
|
103179
|
+
const wh = this.fsw._getWatchHelpers(path6);
|
|
103107
103180
|
if (priorWh) {
|
|
103108
103181
|
wh.filterPath = (entry) => priorWh.filterPath(entry);
|
|
103109
103182
|
wh.filterDir = (entry) => priorWh.filterDir(entry);
|
|
@@ -103119,8 +103192,8 @@ class NodeFsHandler {
|
|
|
103119
103192
|
const follow = this.fsw.options.followSymlinks;
|
|
103120
103193
|
let closer;
|
|
103121
103194
|
if (stats.isDirectory()) {
|
|
103122
|
-
const absPath = sp.resolve(
|
|
103123
|
-
const targetPath = follow ? await fsrealpath(
|
|
103195
|
+
const absPath = sp.resolve(path6);
|
|
103196
|
+
const targetPath = follow ? await fsrealpath(path6) : path6;
|
|
103124
103197
|
if (this.fsw.closed)
|
|
103125
103198
|
return;
|
|
103126
103199
|
closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
|
|
@@ -103130,29 +103203,29 @@ class NodeFsHandler {
|
|
|
103130
103203
|
this.fsw._symlinkPaths.set(absPath, targetPath);
|
|
103131
103204
|
}
|
|
103132
103205
|
} else if (stats.isSymbolicLink()) {
|
|
103133
|
-
const targetPath = follow ? await fsrealpath(
|
|
103206
|
+
const targetPath = follow ? await fsrealpath(path6) : path6;
|
|
103134
103207
|
if (this.fsw.closed)
|
|
103135
103208
|
return;
|
|
103136
103209
|
const parent = sp.dirname(wh.watchPath);
|
|
103137
103210
|
this.fsw._getWatchedDir(parent).add(wh.watchPath);
|
|
103138
103211
|
this.fsw._emit(EV.ADD, wh.watchPath, stats);
|
|
103139
|
-
closer = await this._handleDir(parent, stats, initialAdd, depth,
|
|
103212
|
+
closer = await this._handleDir(parent, stats, initialAdd, depth, path6, wh, targetPath);
|
|
103140
103213
|
if (this.fsw.closed)
|
|
103141
103214
|
return;
|
|
103142
103215
|
if (targetPath !== undefined) {
|
|
103143
|
-
this.fsw._symlinkPaths.set(sp.resolve(
|
|
103216
|
+
this.fsw._symlinkPaths.set(sp.resolve(path6), targetPath);
|
|
103144
103217
|
}
|
|
103145
103218
|
} else {
|
|
103146
103219
|
closer = this._handleFile(wh.watchPath, stats, initialAdd);
|
|
103147
103220
|
}
|
|
103148
103221
|
ready();
|
|
103149
103222
|
if (closer)
|
|
103150
|
-
this.fsw._addPathCloser(
|
|
103223
|
+
this.fsw._addPathCloser(path6, closer);
|
|
103151
103224
|
return false;
|
|
103152
103225
|
} catch (error51) {
|
|
103153
103226
|
if (this.fsw._handleError(error51)) {
|
|
103154
103227
|
ready();
|
|
103155
|
-
return
|
|
103228
|
+
return path6;
|
|
103156
103229
|
}
|
|
103157
103230
|
}
|
|
103158
103231
|
}
|
|
@@ -103190,12 +103263,12 @@ var STR_DATA = "data", STR_END = "end", STR_CLOSE = "close", EMPTY_FN = () => {}
|
|
|
103190
103263
|
foreach(cont[listenerType], (listener) => {
|
|
103191
103264
|
listener(val1, val2, val3);
|
|
103192
103265
|
});
|
|
103193
|
-
}, setFsWatchListener = (
|
|
103266
|
+
}, setFsWatchListener = (path6, fullPath, options, handlers) => {
|
|
103194
103267
|
const { listener, errHandler, rawEmitter } = handlers;
|
|
103195
103268
|
let cont = FsWatchInstances.get(fullPath);
|
|
103196
103269
|
let watcher;
|
|
103197
103270
|
if (!options.persistent) {
|
|
103198
|
-
watcher = createFsWatchInstance(
|
|
103271
|
+
watcher = createFsWatchInstance(path6, options, listener, errHandler, rawEmitter);
|
|
103199
103272
|
if (!watcher)
|
|
103200
103273
|
return;
|
|
103201
103274
|
return watcher.close.bind(watcher);
|
|
@@ -103205,7 +103278,7 @@ var STR_DATA = "data", STR_END = "end", STR_CLOSE = "close", EMPTY_FN = () => {}
|
|
|
103205
103278
|
addAndConvert(cont, KEY_ERR, errHandler);
|
|
103206
103279
|
addAndConvert(cont, KEY_RAW, rawEmitter);
|
|
103207
103280
|
} else {
|
|
103208
|
-
watcher = createFsWatchInstance(
|
|
103281
|
+
watcher = createFsWatchInstance(path6, options, fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS), errHandler, fsWatchBroadcast.bind(null, fullPath, KEY_RAW));
|
|
103209
103282
|
if (!watcher)
|
|
103210
103283
|
return;
|
|
103211
103284
|
watcher.on(EV.ERROR, async (error51) => {
|
|
@@ -103214,7 +103287,7 @@ var STR_DATA = "data", STR_END = "end", STR_CLOSE = "close", EMPTY_FN = () => {}
|
|
|
103214
103287
|
cont.watcherUnusable = true;
|
|
103215
103288
|
if (isWindows && error51.code === "EPERM") {
|
|
103216
103289
|
try {
|
|
103217
|
-
const fd = await open(
|
|
103290
|
+
const fd = await open(path6, "r");
|
|
103218
103291
|
await fd.close();
|
|
103219
103292
|
broadcastErr(error51);
|
|
103220
103293
|
} catch (err) {}
|
|
@@ -103242,7 +103315,7 @@ var STR_DATA = "data", STR_END = "end", STR_CLOSE = "close", EMPTY_FN = () => {}
|
|
|
103242
103315
|
Object.freeze(cont);
|
|
103243
103316
|
}
|
|
103244
103317
|
};
|
|
103245
|
-
}, FsWatchFileInstances, setFsWatchFileListener = (
|
|
103318
|
+
}, FsWatchFileInstances, setFsWatchFileListener = (path6, fullPath, options, handlers) => {
|
|
103246
103319
|
const { listener, rawEmitter } = handlers;
|
|
103247
103320
|
let cont = FsWatchFileInstances.get(fullPath);
|
|
103248
103321
|
const copts = cont && cont.options;
|
|
@@ -103264,7 +103337,7 @@ var STR_DATA = "data", STR_END = "end", STR_CLOSE = "close", EMPTY_FN = () => {}
|
|
|
103264
103337
|
});
|
|
103265
103338
|
const currmtime = curr.mtimeMs;
|
|
103266
103339
|
if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
|
|
103267
|
-
foreach(cont.listeners, (listener2) => listener2(
|
|
103340
|
+
foreach(cont.listeners, (listener2) => listener2(path6, curr));
|
|
103268
103341
|
}
|
|
103269
103342
|
})
|
|
103270
103343
|
};
|
|
@@ -103600,24 +103673,24 @@ function createPattern(matcher) {
|
|
|
103600
103673
|
}
|
|
103601
103674
|
return () => false;
|
|
103602
103675
|
}
|
|
103603
|
-
function normalizePath(
|
|
103604
|
-
if (typeof
|
|
103676
|
+
function normalizePath(path6) {
|
|
103677
|
+
if (typeof path6 !== "string")
|
|
103605
103678
|
throw new Error("string expected");
|
|
103606
|
-
|
|
103607
|
-
|
|
103679
|
+
path6 = sp2.normalize(path6);
|
|
103680
|
+
path6 = path6.replace(/\\/g, "/");
|
|
103608
103681
|
let prepend4 = false;
|
|
103609
|
-
if (
|
|
103682
|
+
if (path6.startsWith("//"))
|
|
103610
103683
|
prepend4 = true;
|
|
103611
|
-
|
|
103684
|
+
path6 = path6.replace(DOUBLE_SLASH_RE, "/");
|
|
103612
103685
|
if (prepend4)
|
|
103613
|
-
|
|
103614
|
-
return
|
|
103686
|
+
path6 = "/" + path6;
|
|
103687
|
+
return path6;
|
|
103615
103688
|
}
|
|
103616
103689
|
function matchPatterns(patterns, testString, stats) {
|
|
103617
|
-
const
|
|
103690
|
+
const path6 = normalizePath(testString);
|
|
103618
103691
|
for (let index = 0;index < patterns.length; index++) {
|
|
103619
103692
|
const pattern = patterns[index];
|
|
103620
|
-
if (pattern(
|
|
103693
|
+
if (pattern(path6, stats)) {
|
|
103621
103694
|
return true;
|
|
103622
103695
|
}
|
|
103623
103696
|
}
|
|
@@ -103698,10 +103771,10 @@ class WatchHelper {
|
|
|
103698
103771
|
dirParts;
|
|
103699
103772
|
followSymlinks;
|
|
103700
103773
|
statMethod;
|
|
103701
|
-
constructor(
|
|
103774
|
+
constructor(path6, follow, fsw) {
|
|
103702
103775
|
this.fsw = fsw;
|
|
103703
|
-
const watchPath =
|
|
103704
|
-
this.path =
|
|
103776
|
+
const watchPath = path6;
|
|
103777
|
+
this.path = path6 = path6.replace(REPLACER_RE, "");
|
|
103705
103778
|
this.watchPath = watchPath;
|
|
103706
103779
|
this.fullWatchPath = sp2.resolve(watchPath);
|
|
103707
103780
|
this.dirParts = [];
|
|
@@ -103748,17 +103821,17 @@ var SLASH = "/", SLASH_SLASH = "//", ONE_DOT = ".", TWO_DOTS = "..", STRING_TYPE
|
|
|
103748
103821
|
str = SLASH + str;
|
|
103749
103822
|
}
|
|
103750
103823
|
return str;
|
|
103751
|
-
}, normalizePathToUnix = (
|
|
103752
|
-
if (typeof
|
|
103753
|
-
return normalizePathToUnix(sp2.isAbsolute(
|
|
103824
|
+
}, normalizePathToUnix = (path6) => toUnix(sp2.normalize(toUnix(path6))), normalizeIgnored = (cwd = "") => (path6) => {
|
|
103825
|
+
if (typeof path6 === "string") {
|
|
103826
|
+
return normalizePathToUnix(sp2.isAbsolute(path6) ? path6 : sp2.join(cwd, path6));
|
|
103754
103827
|
} else {
|
|
103755
|
-
return
|
|
103828
|
+
return path6;
|
|
103756
103829
|
}
|
|
103757
|
-
}, getAbsolutePath = (
|
|
103758
|
-
if (sp2.isAbsolute(
|
|
103759
|
-
return
|
|
103830
|
+
}, getAbsolutePath = (path6, cwd) => {
|
|
103831
|
+
if (sp2.isAbsolute(path6)) {
|
|
103832
|
+
return path6;
|
|
103760
103833
|
}
|
|
103761
|
-
return sp2.join(cwd,
|
|
103834
|
+
return sp2.join(cwd, path6);
|
|
103762
103835
|
}, EMPTY_SET, STAT_METHOD_F = "stat", STAT_METHOD_L = "lstat", FSWatcher;
|
|
103763
103836
|
var init_chokidar = __esm(() => {
|
|
103764
103837
|
init_readdirp();
|
|
@@ -103874,20 +103947,20 @@ var init_chokidar = __esm(() => {
|
|
|
103874
103947
|
this._closePromise = undefined;
|
|
103875
103948
|
let paths = unifyPaths(paths_);
|
|
103876
103949
|
if (cwd) {
|
|
103877
|
-
paths = paths.map((
|
|
103878
|
-
const absPath = getAbsolutePath(
|
|
103950
|
+
paths = paths.map((path6) => {
|
|
103951
|
+
const absPath = getAbsolutePath(path6, cwd);
|
|
103879
103952
|
return absPath;
|
|
103880
103953
|
});
|
|
103881
103954
|
}
|
|
103882
|
-
paths.forEach((
|
|
103883
|
-
this._removeIgnoredPath(
|
|
103955
|
+
paths.forEach((path6) => {
|
|
103956
|
+
this._removeIgnoredPath(path6);
|
|
103884
103957
|
});
|
|
103885
103958
|
this._userIgnored = undefined;
|
|
103886
103959
|
if (!this._readyCount)
|
|
103887
103960
|
this._readyCount = 0;
|
|
103888
103961
|
this._readyCount += paths.length;
|
|
103889
|
-
Promise.all(paths.map(async (
|
|
103890
|
-
const res = await this._nodeFsHandler._addToNodeFs(
|
|
103962
|
+
Promise.all(paths.map(async (path6) => {
|
|
103963
|
+
const res = await this._nodeFsHandler._addToNodeFs(path6, !_internal, undefined, 0, _origAdd);
|
|
103891
103964
|
if (res)
|
|
103892
103965
|
this._emitReady();
|
|
103893
103966
|
return res;
|
|
@@ -103906,17 +103979,17 @@ var init_chokidar = __esm(() => {
|
|
|
103906
103979
|
return this;
|
|
103907
103980
|
const paths = unifyPaths(paths_);
|
|
103908
103981
|
const { cwd } = this.options;
|
|
103909
|
-
paths.forEach((
|
|
103910
|
-
if (!sp2.isAbsolute(
|
|
103982
|
+
paths.forEach((path6) => {
|
|
103983
|
+
if (!sp2.isAbsolute(path6) && !this._closers.has(path6)) {
|
|
103911
103984
|
if (cwd)
|
|
103912
|
-
|
|
103913
|
-
|
|
103985
|
+
path6 = sp2.join(cwd, path6);
|
|
103986
|
+
path6 = sp2.resolve(path6);
|
|
103914
103987
|
}
|
|
103915
|
-
this._closePath(
|
|
103916
|
-
this._addIgnoredPath(
|
|
103917
|
-
if (this._watched.has(
|
|
103988
|
+
this._closePath(path6);
|
|
103989
|
+
this._addIgnoredPath(path6);
|
|
103990
|
+
if (this._watched.has(path6)) {
|
|
103918
103991
|
this._addIgnoredPath({
|
|
103919
|
-
path:
|
|
103992
|
+
path: path6,
|
|
103920
103993
|
recursive: true
|
|
103921
103994
|
});
|
|
103922
103995
|
}
|
|
@@ -103965,38 +104038,38 @@ var init_chokidar = __esm(() => {
|
|
|
103965
104038
|
if (event !== EVENTS.ERROR)
|
|
103966
104039
|
this.emit(EVENTS.ALL, event, ...args2);
|
|
103967
104040
|
}
|
|
103968
|
-
async _emit(event,
|
|
104041
|
+
async _emit(event, path6, stats) {
|
|
103969
104042
|
if (this.closed)
|
|
103970
104043
|
return;
|
|
103971
104044
|
const opts = this.options;
|
|
103972
104045
|
if (isWindows)
|
|
103973
|
-
|
|
104046
|
+
path6 = sp2.normalize(path6);
|
|
103974
104047
|
if (opts.cwd)
|
|
103975
|
-
|
|
103976
|
-
const args2 = [
|
|
104048
|
+
path6 = sp2.relative(opts.cwd, path6);
|
|
104049
|
+
const args2 = [path6];
|
|
103977
104050
|
if (stats != null)
|
|
103978
104051
|
args2.push(stats);
|
|
103979
104052
|
const awf = opts.awaitWriteFinish;
|
|
103980
104053
|
let pw;
|
|
103981
|
-
if (awf && (pw = this._pendingWrites.get(
|
|
104054
|
+
if (awf && (pw = this._pendingWrites.get(path6))) {
|
|
103982
104055
|
pw.lastChange = new Date;
|
|
103983
104056
|
return this;
|
|
103984
104057
|
}
|
|
103985
104058
|
if (opts.atomic) {
|
|
103986
104059
|
if (event === EVENTS.UNLINK) {
|
|
103987
|
-
this._pendingUnlinks.set(
|
|
104060
|
+
this._pendingUnlinks.set(path6, [event, ...args2]);
|
|
103988
104061
|
setTimeout(() => {
|
|
103989
|
-
this._pendingUnlinks.forEach((entry,
|
|
104062
|
+
this._pendingUnlinks.forEach((entry, path7) => {
|
|
103990
104063
|
this.emit(...entry);
|
|
103991
104064
|
this.emit(EVENTS.ALL, ...entry);
|
|
103992
|
-
this._pendingUnlinks.delete(
|
|
104065
|
+
this._pendingUnlinks.delete(path7);
|
|
103993
104066
|
});
|
|
103994
104067
|
}, typeof opts.atomic === "number" ? opts.atomic : 100);
|
|
103995
104068
|
return this;
|
|
103996
104069
|
}
|
|
103997
|
-
if (event === EVENTS.ADD && this._pendingUnlinks.has(
|
|
104070
|
+
if (event === EVENTS.ADD && this._pendingUnlinks.has(path6)) {
|
|
103998
104071
|
event = EVENTS.CHANGE;
|
|
103999
|
-
this._pendingUnlinks.delete(
|
|
104072
|
+
this._pendingUnlinks.delete(path6);
|
|
104000
104073
|
}
|
|
104001
104074
|
}
|
|
104002
104075
|
if (awf && (event === EVENTS.ADD || event === EVENTS.CHANGE) && this._readyEmitted) {
|
|
@@ -104014,16 +104087,16 @@ var init_chokidar = __esm(() => {
|
|
|
104014
104087
|
this.emitWithAll(event, args2);
|
|
104015
104088
|
}
|
|
104016
104089
|
};
|
|
104017
|
-
this._awaitWriteFinish(
|
|
104090
|
+
this._awaitWriteFinish(path6, awf.stabilityThreshold, event, awfEmit);
|
|
104018
104091
|
return this;
|
|
104019
104092
|
}
|
|
104020
104093
|
if (event === EVENTS.CHANGE) {
|
|
104021
|
-
const isThrottled = !this._throttle(EVENTS.CHANGE,
|
|
104094
|
+
const isThrottled = !this._throttle(EVENTS.CHANGE, path6, 50);
|
|
104022
104095
|
if (isThrottled)
|
|
104023
104096
|
return this;
|
|
104024
104097
|
}
|
|
104025
104098
|
if (opts.alwaysStat && stats === undefined && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
|
|
104026
|
-
const fullPath = opts.cwd ? sp2.join(opts.cwd,
|
|
104099
|
+
const fullPath = opts.cwd ? sp2.join(opts.cwd, path6) : path6;
|
|
104027
104100
|
let stats2;
|
|
104028
104101
|
try {
|
|
104029
104102
|
stats2 = await stat4(fullPath);
|
|
@@ -104042,23 +104115,23 @@ var init_chokidar = __esm(() => {
|
|
|
104042
104115
|
}
|
|
104043
104116
|
return error51 || this.closed;
|
|
104044
104117
|
}
|
|
104045
|
-
_throttle(actionType,
|
|
104118
|
+
_throttle(actionType, path6, timeout3) {
|
|
104046
104119
|
if (!this._throttled.has(actionType)) {
|
|
104047
104120
|
this._throttled.set(actionType, new Map);
|
|
104048
104121
|
}
|
|
104049
104122
|
const action = this._throttled.get(actionType);
|
|
104050
104123
|
if (!action)
|
|
104051
104124
|
throw new Error("invalid throttle");
|
|
104052
|
-
const actionPath = action.get(
|
|
104125
|
+
const actionPath = action.get(path6);
|
|
104053
104126
|
if (actionPath) {
|
|
104054
104127
|
actionPath.count++;
|
|
104055
104128
|
return false;
|
|
104056
104129
|
}
|
|
104057
104130
|
let timeoutObject;
|
|
104058
104131
|
const clear = () => {
|
|
104059
|
-
const item = action.get(
|
|
104132
|
+
const item = action.get(path6);
|
|
104060
104133
|
const count3 = item ? item.count : 0;
|
|
104061
|
-
action.delete(
|
|
104134
|
+
action.delete(path6);
|
|
104062
104135
|
clearTimeout(timeoutObject);
|
|
104063
104136
|
if (item)
|
|
104064
104137
|
clearTimeout(item.timeoutObject);
|
|
@@ -104066,50 +104139,50 @@ var init_chokidar = __esm(() => {
|
|
|
104066
104139
|
};
|
|
104067
104140
|
timeoutObject = setTimeout(clear, timeout3);
|
|
104068
104141
|
const thr = { timeoutObject, clear, count: 0 };
|
|
104069
|
-
action.set(
|
|
104142
|
+
action.set(path6, thr);
|
|
104070
104143
|
return thr;
|
|
104071
104144
|
}
|
|
104072
104145
|
_incrReadyCount() {
|
|
104073
104146
|
return this._readyCount++;
|
|
104074
104147
|
}
|
|
104075
|
-
_awaitWriteFinish(
|
|
104148
|
+
_awaitWriteFinish(path6, threshold, event, awfEmit) {
|
|
104076
104149
|
const awf = this.options.awaitWriteFinish;
|
|
104077
104150
|
if (typeof awf !== "object")
|
|
104078
104151
|
return;
|
|
104079
104152
|
const pollInterval = awf.pollInterval;
|
|
104080
104153
|
let timeoutHandler;
|
|
104081
|
-
let fullPath =
|
|
104082
|
-
if (this.options.cwd && !sp2.isAbsolute(
|
|
104083
|
-
fullPath = sp2.join(this.options.cwd,
|
|
104154
|
+
let fullPath = path6;
|
|
104155
|
+
if (this.options.cwd && !sp2.isAbsolute(path6)) {
|
|
104156
|
+
fullPath = sp2.join(this.options.cwd, path6);
|
|
104084
104157
|
}
|
|
104085
104158
|
const now = new Date;
|
|
104086
104159
|
const writes = this._pendingWrites;
|
|
104087
104160
|
function awaitWriteFinishFn(prevStat) {
|
|
104088
104161
|
statcb(fullPath, (err, curStat) => {
|
|
104089
|
-
if (err || !writes.has(
|
|
104162
|
+
if (err || !writes.has(path6)) {
|
|
104090
104163
|
if (err && err.code !== "ENOENT")
|
|
104091
104164
|
awfEmit(err);
|
|
104092
104165
|
return;
|
|
104093
104166
|
}
|
|
104094
104167
|
const now2 = Number(new Date);
|
|
104095
104168
|
if (prevStat && curStat.size !== prevStat.size) {
|
|
104096
|
-
writes.get(
|
|
104169
|
+
writes.get(path6).lastChange = now2;
|
|
104097
104170
|
}
|
|
104098
|
-
const pw = writes.get(
|
|
104171
|
+
const pw = writes.get(path6);
|
|
104099
104172
|
const df = now2 - pw.lastChange;
|
|
104100
104173
|
if (df >= threshold) {
|
|
104101
|
-
writes.delete(
|
|
104174
|
+
writes.delete(path6);
|
|
104102
104175
|
awfEmit(undefined, curStat);
|
|
104103
104176
|
} else {
|
|
104104
104177
|
timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat);
|
|
104105
104178
|
}
|
|
104106
104179
|
});
|
|
104107
104180
|
}
|
|
104108
|
-
if (!writes.has(
|
|
104109
|
-
writes.set(
|
|
104181
|
+
if (!writes.has(path6)) {
|
|
104182
|
+
writes.set(path6, {
|
|
104110
104183
|
lastChange: now,
|
|
104111
104184
|
cancelWait: () => {
|
|
104112
|
-
writes.delete(
|
|
104185
|
+
writes.delete(path6);
|
|
104113
104186
|
clearTimeout(timeoutHandler);
|
|
104114
104187
|
return event;
|
|
104115
104188
|
}
|
|
@@ -104117,8 +104190,8 @@ var init_chokidar = __esm(() => {
|
|
|
104117
104190
|
timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval);
|
|
104118
104191
|
}
|
|
104119
104192
|
}
|
|
104120
|
-
_isIgnored(
|
|
104121
|
-
if (this.options.atomic && DOT_RE.test(
|
|
104193
|
+
_isIgnored(path6, stats) {
|
|
104194
|
+
if (this.options.atomic && DOT_RE.test(path6))
|
|
104122
104195
|
return true;
|
|
104123
104196
|
if (!this._userIgnored) {
|
|
104124
104197
|
const { cwd } = this.options;
|
|
@@ -104128,13 +104201,13 @@ var init_chokidar = __esm(() => {
|
|
|
104128
104201
|
const list = [...ignoredPaths.map(normalizeIgnored(cwd)), ...ignored];
|
|
104129
104202
|
this._userIgnored = anymatch(list, undefined);
|
|
104130
104203
|
}
|
|
104131
|
-
return this._userIgnored(
|
|
104204
|
+
return this._userIgnored(path6, stats);
|
|
104132
104205
|
}
|
|
104133
|
-
_isntIgnored(
|
|
104134
|
-
return !this._isIgnored(
|
|
104206
|
+
_isntIgnored(path6, stat5) {
|
|
104207
|
+
return !this._isIgnored(path6, stat5);
|
|
104135
104208
|
}
|
|
104136
|
-
_getWatchHelpers(
|
|
104137
|
-
return new WatchHelper(
|
|
104209
|
+
_getWatchHelpers(path6) {
|
|
104210
|
+
return new WatchHelper(path6, this.options.followSymlinks, this);
|
|
104138
104211
|
}
|
|
104139
104212
|
_getWatchedDir(directory) {
|
|
104140
104213
|
const dir = sp2.resolve(directory);
|
|
@@ -104148,57 +104221,57 @@ var init_chokidar = __esm(() => {
|
|
|
104148
104221
|
return Boolean(Number(stats.mode) & 256);
|
|
104149
104222
|
}
|
|
104150
104223
|
_remove(directory, item, isDirectory) {
|
|
104151
|
-
const
|
|
104152
|
-
const fullPath = sp2.resolve(
|
|
104153
|
-
isDirectory = isDirectory != null ? isDirectory : this._watched.has(
|
|
104154
|
-
if (!this._throttle("remove",
|
|
104224
|
+
const path6 = sp2.join(directory, item);
|
|
104225
|
+
const fullPath = sp2.resolve(path6);
|
|
104226
|
+
isDirectory = isDirectory != null ? isDirectory : this._watched.has(path6) || this._watched.has(fullPath);
|
|
104227
|
+
if (!this._throttle("remove", path6, 100))
|
|
104155
104228
|
return;
|
|
104156
104229
|
if (!isDirectory && this._watched.size === 1) {
|
|
104157
104230
|
this.add(directory, item, true);
|
|
104158
104231
|
}
|
|
104159
|
-
const wp = this._getWatchedDir(
|
|
104232
|
+
const wp = this._getWatchedDir(path6);
|
|
104160
104233
|
const nestedDirectoryChildren = wp.getChildren();
|
|
104161
|
-
nestedDirectoryChildren.forEach((nested2) => this._remove(
|
|
104234
|
+
nestedDirectoryChildren.forEach((nested2) => this._remove(path6, nested2));
|
|
104162
104235
|
const parent = this._getWatchedDir(directory);
|
|
104163
104236
|
const wasTracked = parent.has(item);
|
|
104164
104237
|
parent.remove(item);
|
|
104165
104238
|
if (this._symlinkPaths.has(fullPath)) {
|
|
104166
104239
|
this._symlinkPaths.delete(fullPath);
|
|
104167
104240
|
}
|
|
104168
|
-
let relPath =
|
|
104241
|
+
let relPath = path6;
|
|
104169
104242
|
if (this.options.cwd)
|
|
104170
|
-
relPath = sp2.relative(this.options.cwd,
|
|
104243
|
+
relPath = sp2.relative(this.options.cwd, path6);
|
|
104171
104244
|
if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
|
|
104172
104245
|
const event = this._pendingWrites.get(relPath).cancelWait();
|
|
104173
104246
|
if (event === EVENTS.ADD)
|
|
104174
104247
|
return;
|
|
104175
104248
|
}
|
|
104176
|
-
this._watched.delete(
|
|
104249
|
+
this._watched.delete(path6);
|
|
104177
104250
|
this._watched.delete(fullPath);
|
|
104178
104251
|
const eventName = isDirectory ? EVENTS.UNLINK_DIR : EVENTS.UNLINK;
|
|
104179
|
-
if (wasTracked && !this._isIgnored(
|
|
104180
|
-
this._emit(eventName,
|
|
104181
|
-
this._closePath(
|
|
104252
|
+
if (wasTracked && !this._isIgnored(path6))
|
|
104253
|
+
this._emit(eventName, path6);
|
|
104254
|
+
this._closePath(path6);
|
|
104182
104255
|
}
|
|
104183
|
-
_closePath(
|
|
104184
|
-
this._closeFile(
|
|
104185
|
-
const dir = sp2.dirname(
|
|
104186
|
-
this._getWatchedDir(dir).remove(sp2.basename(
|
|
104256
|
+
_closePath(path6) {
|
|
104257
|
+
this._closeFile(path6);
|
|
104258
|
+
const dir = sp2.dirname(path6);
|
|
104259
|
+
this._getWatchedDir(dir).remove(sp2.basename(path6));
|
|
104187
104260
|
}
|
|
104188
|
-
_closeFile(
|
|
104189
|
-
const closers = this._closers.get(
|
|
104261
|
+
_closeFile(path6) {
|
|
104262
|
+
const closers = this._closers.get(path6);
|
|
104190
104263
|
if (!closers)
|
|
104191
104264
|
return;
|
|
104192
104265
|
closers.forEach((closer) => closer());
|
|
104193
|
-
this._closers.delete(
|
|
104266
|
+
this._closers.delete(path6);
|
|
104194
104267
|
}
|
|
104195
|
-
_addPathCloser(
|
|
104268
|
+
_addPathCloser(path6, closer) {
|
|
104196
104269
|
if (!closer)
|
|
104197
104270
|
return;
|
|
104198
|
-
let list = this._closers.get(
|
|
104271
|
+
let list = this._closers.get(path6);
|
|
104199
104272
|
if (!list) {
|
|
104200
104273
|
list = [];
|
|
104201
|
-
this._closers.set(
|
|
104274
|
+
this._closers.set(path6, list);
|
|
104202
104275
|
}
|
|
104203
104276
|
list.push(closer);
|
|
104204
104277
|
}
|
|
@@ -104223,7 +104296,7 @@ var init_chokidar = __esm(() => {
|
|
|
104223
104296
|
});
|
|
104224
104297
|
|
|
104225
104298
|
// src/infrastructure/services/workspace/workspace-fs-watcher.ts
|
|
104226
|
-
import
|
|
104299
|
+
import path6 from "node:path";
|
|
104227
104300
|
function isTooManyOpenFilesError(error51) {
|
|
104228
104301
|
if (!(error51 instanceof Error))
|
|
104229
104302
|
return false;
|
|
@@ -104231,10 +104304,10 @@ function isTooManyOpenFilesError(error51) {
|
|
|
104231
104304
|
return errno === "EMFILE" || errno === "ENOSPC" || error51.message.includes("EMFILE");
|
|
104232
104305
|
}
|
|
104233
104306
|
function toRelativePath(rootDir, absolutePath) {
|
|
104234
|
-
return
|
|
104307
|
+
return path6.relative(rootDir, absolutePath).replace(/\\/g, "/").replace(/^\.?\//, "");
|
|
104235
104308
|
}
|
|
104236
104309
|
function createWorkspaceFsWatcher(options) {
|
|
104237
|
-
const absWorkingDir =
|
|
104310
|
+
const absWorkingDir = path6.resolve(options.workingDir);
|
|
104238
104311
|
const debounceMs = options.debounceMs ?? DEFAULT_DEBOUNCE_MS;
|
|
104239
104312
|
let stopped = false;
|
|
104240
104313
|
let debounceTimer = null;
|
|
@@ -104330,16 +104403,16 @@ function diffPathIndexes(previous, next4) {
|
|
|
104330
104403
|
const removed = [];
|
|
104331
104404
|
const typeChanged = [];
|
|
104332
104405
|
const prev = previous ?? {};
|
|
104333
|
-
for (const [
|
|
104334
|
-
if (!(
|
|
104335
|
-
added.push(
|
|
104336
|
-
} else if (prev[
|
|
104337
|
-
typeChanged.push(
|
|
104406
|
+
for (const [path7, type] of Object.entries(next4)) {
|
|
104407
|
+
if (!(path7 in prev)) {
|
|
104408
|
+
added.push(path7);
|
|
104409
|
+
} else if (prev[path7] !== type) {
|
|
104410
|
+
typeChanged.push(path7);
|
|
104338
104411
|
}
|
|
104339
104412
|
}
|
|
104340
|
-
for (const
|
|
104341
|
-
if (!(
|
|
104342
|
-
removed.push(
|
|
104413
|
+
for (const path7 of Object.keys(prev)) {
|
|
104414
|
+
if (!(path7 in next4)) {
|
|
104415
|
+
removed.push(path7);
|
|
104343
104416
|
}
|
|
104344
104417
|
}
|
|
104345
104418
|
added.sort();
|
|
@@ -104425,7 +104498,7 @@ function createManifestFromTree(args2) {
|
|
|
104425
104498
|
};
|
|
104426
104499
|
}
|
|
104427
104500
|
function entriesFromPathIndex(paths) {
|
|
104428
|
-
return Object.entries(paths).map(([
|
|
104501
|
+
return Object.entries(paths).map(([path7, type]) => ({ path: path7, type })).sort((a, b) => a.path.localeCompare(b.path));
|
|
104429
104502
|
}
|
|
104430
104503
|
var SYNC_STATE_VERSION = "2", SYNC_STATE_DIR;
|
|
104431
104504
|
var init_workspace_sync_state = __esm(() => {
|
|
@@ -104434,7 +104507,7 @@ var init_workspace_sync_state = __esm(() => {
|
|
|
104434
104507
|
|
|
104435
104508
|
// src/infrastructure/services/workspace/workspace-file-tree-coordinator.ts
|
|
104436
104509
|
import { randomUUID as randomUUID9 } from "node:crypto";
|
|
104437
|
-
import
|
|
104510
|
+
import path7 from "node:path";
|
|
104438
104511
|
function deltaEntry(paths, pathValue) {
|
|
104439
104512
|
const type = paths[pathValue];
|
|
104440
104513
|
if (type === undefined)
|
|
@@ -104500,7 +104573,7 @@ async function addDirectorySubtree(rootDir, relativeDir, paths) {
|
|
|
104500
104573
|
return;
|
|
104501
104574
|
ensureParentDirectories(paths, relativeDir);
|
|
104502
104575
|
paths[relativeDir] = "directory";
|
|
104503
|
-
const subtree = await scanFileTree(
|
|
104576
|
+
const subtree = await scanFileTree(path7.join(rootDir, relativeDir));
|
|
104504
104577
|
for (const entry of subtree.entries) {
|
|
104505
104578
|
const prefixedPath = `${relativeDir}/${entry.path}`;
|
|
104506
104579
|
if (await isWorkspacePathIgnored(rootDir, prefixedPath))
|
|
@@ -111934,7 +112007,7 @@ __export(exports_opencode_install, {
|
|
|
111934
112007
|
installTool: () => installTool
|
|
111935
112008
|
});
|
|
111936
112009
|
import * as os2 from "os";
|
|
111937
|
-
import * as
|
|
112010
|
+
import * as path8 from "path";
|
|
111938
112011
|
async function isChatroomInstalledDefault() {
|
|
111939
112012
|
try {
|
|
111940
112013
|
const { execSync: execSync3 } = await import("child_process");
|
|
@@ -112304,9 +112377,9 @@ After logging in, try this command again.\`;
|
|
|
112304
112377
|
const fsService = yield* OpenCodeInstallFsService;
|
|
112305
112378
|
const { checkExisting = true } = options;
|
|
112306
112379
|
const homeDir = os2.homedir();
|
|
112307
|
-
const toolDir =
|
|
112308
|
-
const toolPath =
|
|
112309
|
-
const handoffToolPath =
|
|
112380
|
+
const toolDir = path8.join(homeDir, ".config", "opencode", "tool");
|
|
112381
|
+
const toolPath = path8.join(toolDir, "chatroom.ts");
|
|
112382
|
+
const handoffToolPath = path8.join(toolDir, "chatroom-handoff.ts");
|
|
112310
112383
|
if (checkExisting) {
|
|
112311
112384
|
const existingFiles = [];
|
|
112312
112385
|
const toolExists = yield* fsService.access(toolPath);
|
|
@@ -112861,4 +112934,4 @@ program2.hook("preAction", async (_thisCommand, actionCommand) => {
|
|
|
112861
112934
|
});
|
|
112862
112935
|
program2.parse();
|
|
112863
112936
|
|
|
112864
|
-
//# debugId=
|
|
112937
|
+
//# debugId=4AEC2FD829D3A5B464756E2164756E21
|