@joshski/dust 0.1.43 → 0.1.44
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/dust.js +16 -14
- package/package.json +1 -1
package/dist/dust.js
CHANGED
|
@@ -972,7 +972,8 @@ import { spawn as nodeSpawn3 } from "node:child_process";
|
|
|
972
972
|
import { accessSync, statSync } from "node:fs";
|
|
973
973
|
import { chmod, mkdir, readdir, readFile, writeFile } from "node:fs/promises";
|
|
974
974
|
import { createServer as httpCreateServer } from "node:http";
|
|
975
|
-
import { homedir
|
|
975
|
+
import { homedir } from "node:os";
|
|
976
|
+
import { join as join7 } from "node:path";
|
|
976
977
|
|
|
977
978
|
// lib/bucket/auth.ts
|
|
978
979
|
import { join as join4 } from "node:path";
|
|
@@ -1119,7 +1120,7 @@ function getLogLines(buffer) {
|
|
|
1119
1120
|
}
|
|
1120
1121
|
|
|
1121
1122
|
// lib/bucket/repository.ts
|
|
1122
|
-
import { join as join6 } from "node:path";
|
|
1123
|
+
import { dirname as dirname2, join as join6 } from "node:path";
|
|
1123
1124
|
|
|
1124
1125
|
// lib/agent-events.ts
|
|
1125
1126
|
function rawEventToAgentEvent(rawEvent) {
|
|
@@ -1985,9 +1986,9 @@ function parseRepository(data) {
|
|
|
1985
1986
|
}
|
|
1986
1987
|
return null;
|
|
1987
1988
|
}
|
|
1988
|
-
function
|
|
1989
|
-
const safeName = repoName.replace(/[^a-zA-Z0-9-_]/g, "-");
|
|
1990
|
-
return join6(
|
|
1989
|
+
function getRepoPath(repoName, reposDir) {
|
|
1990
|
+
const safeName = repoName.replace(/[^a-zA-Z0-9-_/]/g, "-");
|
|
1991
|
+
return join6(reposDir, safeName);
|
|
1991
1992
|
}
|
|
1992
1993
|
async function cloneRepository(repository, targetPath, spawn, context) {
|
|
1993
1994
|
return new Promise((resolve) => {
|
|
@@ -2128,7 +2129,8 @@ async function addRepository(repository, manager, repoDeps, context) {
|
|
|
2128
2129
|
if (manager.repositories.has(repository.name)) {
|
|
2129
2130
|
return;
|
|
2130
2131
|
}
|
|
2131
|
-
const repoPath =
|
|
2132
|
+
const repoPath = getRepoPath(repository.name, repoDeps.getReposDir());
|
|
2133
|
+
await repoDeps.fileSystem.mkdir(dirname2(repoPath), { recursive: true });
|
|
2132
2134
|
if (repoDeps.fileSystem.exists(repoPath)) {
|
|
2133
2135
|
await removeRepository(repoPath, repoDeps.spawn, context);
|
|
2134
2136
|
}
|
|
@@ -2728,7 +2730,7 @@ function createDefaultBucketDependencies() {
|
|
|
2728
2730
|
writeStdout: defaultWriteStdout,
|
|
2729
2731
|
isTTY: process.stdout.isTTY ?? false,
|
|
2730
2732
|
sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
|
|
2731
|
-
|
|
2733
|
+
getReposDir: () => process.env.DUST_REPOS_DIR || join7(homedir(), ".dust", "repos"),
|
|
2732
2734
|
auth: {
|
|
2733
2735
|
createServer: defaultCreateServer,
|
|
2734
2736
|
openBrowser: defaultOpenBrowser,
|
|
@@ -2766,7 +2768,7 @@ function toRepositoryDependencies(bucketDeps, fileSystem) {
|
|
|
2766
2768
|
run,
|
|
2767
2769
|
fileSystem,
|
|
2768
2770
|
sleep: bucketDeps.sleep,
|
|
2769
|
-
|
|
2771
|
+
getReposDir: bucketDeps.getReposDir
|
|
2770
2772
|
};
|
|
2771
2773
|
}
|
|
2772
2774
|
function syncUIWithRepoList(state, repos) {
|
|
@@ -3097,7 +3099,7 @@ function runBufferedProcess(spawnFn, command, commandArguments, cwd, shell, time
|
|
|
3097
3099
|
}
|
|
3098
3100
|
|
|
3099
3101
|
// lib/cli/commands/lint-markdown.ts
|
|
3100
|
-
import { dirname as
|
|
3102
|
+
import { dirname as dirname3, join as join8, resolve } from "node:path";
|
|
3101
3103
|
var REQUIRED_HEADINGS = ["## Goals", "## Blocked By", "## Definition of Done"];
|
|
3102
3104
|
var REQUIRED_GOAL_HEADINGS = ["## Parent Goal", "## Sub-Goals"];
|
|
3103
3105
|
var SLUG_PATTERN = /^[a-z0-9]+(-[a-z0-9]+)*\.md$/;
|
|
@@ -3199,7 +3201,7 @@ function validateLinks(filePath, content, fileSystem) {
|
|
|
3199
3201
|
const violations = [];
|
|
3200
3202
|
const lines = content.split(`
|
|
3201
3203
|
`);
|
|
3202
|
-
const fileDir =
|
|
3204
|
+
const fileDir = dirname3(filePath);
|
|
3203
3205
|
for (let i = 0;i < lines.length; i++) {
|
|
3204
3206
|
const line = lines[i];
|
|
3205
3207
|
const linkPattern = new RegExp(MARKDOWN_LINK_PATTERN.source, "g");
|
|
@@ -3316,7 +3318,7 @@ function validateSemanticLinks(filePath, content) {
|
|
|
3316
3318
|
const violations = [];
|
|
3317
3319
|
const lines = content.split(`
|
|
3318
3320
|
`);
|
|
3319
|
-
const fileDir =
|
|
3321
|
+
const fileDir = dirname3(filePath);
|
|
3320
3322
|
let currentSection = null;
|
|
3321
3323
|
for (let i = 0;i < lines.length; i++) {
|
|
3322
3324
|
const line = lines[i];
|
|
@@ -3399,7 +3401,7 @@ function validateGoalHierarchyLinks(filePath, content) {
|
|
|
3399
3401
|
const violations = [];
|
|
3400
3402
|
const lines = content.split(`
|
|
3401
3403
|
`);
|
|
3402
|
-
const fileDir =
|
|
3404
|
+
const fileDir = dirname3(filePath);
|
|
3403
3405
|
let currentSection = null;
|
|
3404
3406
|
for (let i = 0;i < lines.length; i++) {
|
|
3405
3407
|
const line = lines[i];
|
|
@@ -3449,7 +3451,7 @@ function validateGoalHierarchyLinks(filePath, content) {
|
|
|
3449
3451
|
function extractGoalRelationships(filePath, content) {
|
|
3450
3452
|
const lines = content.split(`
|
|
3451
3453
|
`);
|
|
3452
|
-
const fileDir =
|
|
3454
|
+
const fileDir = dirname3(filePath);
|
|
3453
3455
|
const parentGoals = [];
|
|
3454
3456
|
const subGoals = [];
|
|
3455
3457
|
let currentSection = null;
|
|
@@ -3634,7 +3636,7 @@ async function lintMarkdown(dependencies) {
|
|
|
3634
3636
|
const violations = [];
|
|
3635
3637
|
context.stdout("Validating directory structure...");
|
|
3636
3638
|
violations.push(...await validateDirectoryStructure(dustPath, fileSystem, dependencies.settings.extraDirectories));
|
|
3637
|
-
const settingsPath =
|
|
3639
|
+
const settingsPath = join8(dustPath, "config", "settings.json");
|
|
3638
3640
|
if (fileSystem.exists(settingsPath)) {
|
|
3639
3641
|
context.stdout("Validating settings.json...");
|
|
3640
3642
|
try {
|