@clipboard-health/groundcrew 4.20.1 → 4.20.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/adapters/todo-txt/source.d.ts.map +1 -1
- package/dist/lib/adapters/todo-txt/source.js +13 -12
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +24 -11
- package/dist/lib/paths.d.ts +2 -0
- package/dist/lib/paths.d.ts.map +1 -0
- package/dist/lib/paths.js +11 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../../src/lib/adapters/todo-txt/source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAIL,KAAK,UAAU,EAEhB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AA2ExD,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,cAAc,GACvB,UAAU,
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../../src/lib/adapters/todo-txt/source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAIL,KAAK,UAAU,EAEhB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AA2ExD,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,cAAc,GACvB,UAAU,CAkGZ"}
|
|
@@ -61,9 +61,10 @@ function buildIssue(options) {
|
|
|
61
61
|
}
|
|
62
62
|
export function createTodoTxtTaskSource(config, _context) {
|
|
63
63
|
const sourceName = config.name;
|
|
64
|
+
const { todoPath, tasksDir } = config;
|
|
64
65
|
function buildIssueList() {
|
|
65
|
-
const updatedAt = fileUpdatedAt(
|
|
66
|
-
const { parsedAll } = readAndParseTodo(
|
|
66
|
+
const updatedAt = fileUpdatedAt(todoPath);
|
|
67
|
+
const { parsedAll } = readAndParseTodo(todoPath);
|
|
67
68
|
const issues = [];
|
|
68
69
|
for (let i = 0; i < parsedAll.length; i++) {
|
|
69
70
|
const parsed = parsedAll[i];
|
|
@@ -77,8 +78,8 @@ export function createTodoTxtTaskSource(config, _context) {
|
|
|
77
78
|
parsedIndex: i,
|
|
78
79
|
parsedAll,
|
|
79
80
|
sourceName,
|
|
80
|
-
todoPath
|
|
81
|
-
tasksDir
|
|
81
|
+
todoPath,
|
|
82
|
+
tasksDir,
|
|
82
83
|
defaultRepository: config.defaultRepository,
|
|
83
84
|
updatedAt,
|
|
84
85
|
});
|
|
@@ -92,7 +93,7 @@ export function createTodoTxtTaskSource(config, _context) {
|
|
|
92
93
|
return {
|
|
93
94
|
name: sourceName,
|
|
94
95
|
async verify() {
|
|
95
|
-
const errors = validateTodoFile(
|
|
96
|
+
const errors = validateTodoFile(todoPath, tasksDir);
|
|
96
97
|
if (errors.length > 0) {
|
|
97
98
|
throw new Error(`todo-txt source "${sourceName}" verification failed:\n${errors.map((e) => ` - ${e}`).join("\n")}`);
|
|
98
99
|
}
|
|
@@ -102,8 +103,8 @@ export function createTodoTxtTaskSource(config, _context) {
|
|
|
102
103
|
},
|
|
103
104
|
async resolveOne(naturalId) {
|
|
104
105
|
const canonicalId = toCanonicalId(sourceName, naturalId);
|
|
105
|
-
const updatedAt = fileUpdatedAt(
|
|
106
|
-
const { parsedAll } = readAndParseTodo(
|
|
106
|
+
const updatedAt = fileUpdatedAt(todoPath);
|
|
107
|
+
const { parsedAll } = readAndParseTodo(todoPath);
|
|
107
108
|
const index = parsedAll.findIndex((p) => p !== null && toCanonicalId(sourceName, getMetadataFirst(p, "id") ?? "") === canonicalId);
|
|
108
109
|
if (index === -1) {
|
|
109
110
|
return undefined;
|
|
@@ -112,8 +113,8 @@ export function createTodoTxtTaskSource(config, _context) {
|
|
|
112
113
|
parsedIndex: index,
|
|
113
114
|
parsedAll,
|
|
114
115
|
sourceName,
|
|
115
|
-
todoPath
|
|
116
|
-
tasksDir
|
|
116
|
+
todoPath,
|
|
117
|
+
tasksDir,
|
|
117
118
|
defaultRepository: config.defaultRepository,
|
|
118
119
|
updatedAt,
|
|
119
120
|
});
|
|
@@ -121,18 +122,18 @@ export function createTodoTxtTaskSource(config, _context) {
|
|
|
121
122
|
async markInProgress(issue) {
|
|
122
123
|
// oxlint-disable-next-line typescript/no-unsafe-type-assertion -- TodoTxtTaskSource always writes TodoTxtSourceRef
|
|
123
124
|
const ref = issue.sourceRef;
|
|
124
|
-
await updateTaskStatus({ todoPath
|
|
125
|
+
await updateTaskStatus({ todoPath, ref }, "in-progress");
|
|
125
126
|
},
|
|
126
127
|
async markInReview(issue) {
|
|
127
128
|
// oxlint-disable-next-line typescript/no-unsafe-type-assertion -- TodoTxtTaskSource always writes TodoTxtSourceRef
|
|
128
129
|
const ref = issue.sourceRef;
|
|
129
|
-
await updateTaskStatus({ todoPath
|
|
130
|
+
await updateTaskStatus({ todoPath, ref }, "in-review");
|
|
130
131
|
return { outcome: "applied" };
|
|
131
132
|
},
|
|
132
133
|
async markDone(issue) {
|
|
133
134
|
// oxlint-disable-next-line typescript/no-unsafe-type-assertion -- TodoTxtTaskSource always writes TodoTxtSourceRef
|
|
134
135
|
const ref = issue.sourceRef;
|
|
135
|
-
const recurResult = await updateTaskStatus({ todoPath
|
|
136
|
+
const recurResult = await updateTaskStatus({ todoPath, ref }, "done");
|
|
136
137
|
if (recurResult !== undefined) {
|
|
137
138
|
copyPromptFile(recurResult.oldPromptPath, recurResult.newPromptPath);
|
|
138
139
|
}
|
package/dist/lib/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"
|
|
1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3
|
-
import { homedir } from "node:os";
|
|
4
3
|
import path from "node:path";
|
|
5
4
|
import { pathToFileURL } from "node:url";
|
|
6
5
|
import { cosmiconfig } from "cosmiconfig";
|
|
6
|
+
import { expandHome } from "./paths.js";
|
|
7
7
|
import { debug, log, readEnvironmentVariable, setLogFile } from "./util.js";
|
|
8
8
|
import { xdgConfigPath, xdgStatePath } from "./xdg.js";
|
|
9
9
|
import { BUILD_SECRET_NAMES } from "./buildSecrets.js";
|
|
@@ -119,15 +119,6 @@ const PERCENT_MAX = 100;
|
|
|
119
119
|
function defaultLogFile() {
|
|
120
120
|
return xdgStatePath("groundcrew", "groundcrew.log");
|
|
121
121
|
}
|
|
122
|
-
function expandHome(p) {
|
|
123
|
-
if (p === "~") {
|
|
124
|
-
return homedir();
|
|
125
|
-
}
|
|
126
|
-
if (p.startsWith("~/")) {
|
|
127
|
-
return path.resolve(homedir(), p.slice(2));
|
|
128
|
-
}
|
|
129
|
-
return p;
|
|
130
|
-
}
|
|
131
122
|
function fail(message) {
|
|
132
123
|
throw new Error(`groundcrew config: ${message}`);
|
|
133
124
|
}
|
|
@@ -415,6 +406,12 @@ function normalizeSources(raw) {
|
|
|
415
406
|
fail("sources must be an array");
|
|
416
407
|
}
|
|
417
408
|
const names = new Map();
|
|
409
|
+
// Expand ~ in path-typed fields for adapters that accept filesystem paths.
|
|
410
|
+
// All other path values in ResolvedConfig are expanded at this layer so
|
|
411
|
+
// downstream adapters receive absolute paths without each having to call
|
|
412
|
+
// expandHome defensively. isPlainObject() above narrows entry to
|
|
413
|
+
// Record<string, unknown> so no extra assertion is needed here.
|
|
414
|
+
const expanded = [];
|
|
418
415
|
for (const [index, entry] of raw.entries()) {
|
|
419
416
|
const configPath = `sources[${index}]`;
|
|
420
417
|
if (!isPlainObject(entry)) {
|
|
@@ -439,9 +436,25 @@ function normalizeSources(raw) {
|
|
|
439
436
|
fail(`${configPath} would produce a source named "${effectiveName}" (from ${name === undefined ? "default `kind` since `name` is omitted" : "`name`"}), duplicating sources[${previous}]. Configure distinct \`name\` fields.`);
|
|
440
437
|
}
|
|
441
438
|
names.set(effectiveName, index);
|
|
439
|
+
if (kind === "todo-txt") {
|
|
440
|
+
expanded.push({
|
|
441
|
+
...entry,
|
|
442
|
+
/* v8 ignore next @preserve -- Zod schema guarantees todoPath/tasksDir are strings; else branch only reachable with a non-string raw value rejected downstream by Zod */
|
|
443
|
+
...(typeof entry["todoPath"] === "string"
|
|
444
|
+
? { todoPath: expandHome(entry["todoPath"]) }
|
|
445
|
+
: {}),
|
|
446
|
+
/* v8 ignore next @preserve -- same as above */
|
|
447
|
+
...(typeof entry["tasksDir"] === "string"
|
|
448
|
+
? { tasksDir: expandHome(entry["tasksDir"]) }
|
|
449
|
+
: {}),
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
else {
|
|
453
|
+
expanded.push(entry);
|
|
454
|
+
}
|
|
442
455
|
}
|
|
443
456
|
// oxlint-disable-next-line typescript/no-unsafe-type-assertion -- structural validation above guarantees array of {kind: string} entries; per-source Zod validation lives in buildSources
|
|
444
|
-
return
|
|
457
|
+
return expanded;
|
|
445
458
|
}
|
|
446
459
|
/**
|
|
447
460
|
* Resolve one `knownRepositories` entry to its name and (optional) resolved
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/lib/paths.ts"],"names":[],"mappings":"AAGA,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAQ5C"}
|
package/package.json
CHANGED