@clipboard-health/groundcrew 4.20.0 → 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/commands/resumeWorkspace.d.ts.map +1 -1
- package/dist/commands/resumeWorkspace.js +13 -3
- 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/buildSources.d.ts +8 -0
- package/dist/lib/buildSources.d.ts.map +1 -1
- package/dist/lib/buildSources.js +10 -0
- 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":"resumeWorkspace.d.ts","sourceRoot":"","sources":["../../src/commands/resumeWorkspace.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resumeWorkspace.d.ts","sourceRoot":"","sources":["../../src/commands/resumeWorkspace.ts"],"names":[],"mappings":"AAGA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAenE,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;CACd;AAuID,wBAAsB,eAAe,CACnC,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,IAAI,CAAC,CA0Ff;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAGtE"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { fetchResolvedIssue } from "../lib/adapters/linear/fetch.js";
|
|
2
2
|
import { getLinearClient } from "../lib/adapters/linear/client.js";
|
|
3
|
+
import { isLinearEnabled } from "../lib/buildSources.js";
|
|
3
4
|
import { loadConfig } from "../lib/config.js";
|
|
4
5
|
import { openAgentWorkspace, prepareAgentLaunch } from "../lib/agentLaunch.js";
|
|
5
6
|
import { buildLaunchCommand } from "../lib/launchCommand.js";
|
|
@@ -41,8 +42,11 @@ async function contextFromLinear(config, task, worktree) {
|
|
|
41
42
|
resumeCount: 0,
|
|
42
43
|
};
|
|
43
44
|
}
|
|
44
|
-
async function contextFromState(task, state, worktree) {
|
|
45
|
-
|
|
45
|
+
async function contextFromState(config, task, state, worktree) {
|
|
46
|
+
// Skip the Linear lookup when Linear is disabled — otherwise the
|
|
47
|
+
// missing-API-key error logs noisily even though resume only needs it to
|
|
48
|
+
// enrich the prompt title/description (which falls back to the task id).
|
|
49
|
+
const details = isLinearEnabled(config) ? await fetchTaskDetails(task) : undefined;
|
|
46
50
|
return {
|
|
47
51
|
task,
|
|
48
52
|
repository: state.repository,
|
|
@@ -64,7 +68,13 @@ async function buildResumeContext(config, task) {
|
|
|
64
68
|
throw new Error(`No worktree found for ${task}; cannot resume.`);
|
|
65
69
|
}
|
|
66
70
|
if (state !== undefined) {
|
|
67
|
-
return await contextFromState(task, state, worktree);
|
|
71
|
+
return await contextFromState(config, task, state, worktree);
|
|
72
|
+
}
|
|
73
|
+
// The cold-resume path resolves repository + model from Linear alone, so it
|
|
74
|
+
// can't proceed when Linear is disabled. Fail with a clear reason instead of
|
|
75
|
+
// the cryptic missing-API-key error getLinearClient() would otherwise raise.
|
|
76
|
+
if (!isLinearEnabled(config)) {
|
|
77
|
+
throw new Error(`Cannot resume ${task}: no run state recorded and Linear is disabled.`);
|
|
68
78
|
}
|
|
69
79
|
return await contextFromLinear(config, task, worktree);
|
|
70
80
|
}
|
|
@@ -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
|
}
|
|
@@ -37,4 +37,12 @@ export declare function buildSourcesWith(registry: Record<string, AdapterDefinit
|
|
|
37
37
|
* other source with `enabled: false` is likewise dropped from the result.
|
|
38
38
|
*/
|
|
39
39
|
export declare function sourcesFromConfig(config: ResolvedConfig): readonly unknown[];
|
|
40
|
+
/**
|
|
41
|
+
* True when the resolved config keeps Linear active — i.e. the user has not
|
|
42
|
+
* opted out with `{ kind: "linear", enabled: false }`. Callers use this to skip
|
|
43
|
+
* Linear API calls (and the missing-API-key error they raise) when Linear is
|
|
44
|
+
* off. Derived from `sourcesFromConfig` so it honors both the explicit opt-out
|
|
45
|
+
* sentinel and the implicit-source synthesis.
|
|
46
|
+
*/
|
|
47
|
+
export declare function isLinearEnabled(config: ResolvedConfig): boolean;
|
|
40
48
|
//# sourceMappingURL=buildSources.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildSources.d.ts","sourceRoot":"","sources":["../../src/lib/buildSources.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK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AC,EAC3C,UAAU,EAAE,SAAS,OAAO,EAAE,EAC9B,OAAO,EAAE,cAAc,GACtB,UAAU,EAAE,CAcd;AA6DD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,SAAS,OAAO,EAAE,CAa5E;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAE/D"}
|
package/dist/lib/buildSources.js
CHANGED
|
@@ -114,3 +114,13 @@ export function sourcesFromConfig(config) {
|
|
|
114
114
|
}
|
|
115
115
|
return [{ kind: "linear" }, ...kept];
|
|
116
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* True when the resolved config keeps Linear active — i.e. the user has not
|
|
119
|
+
* opted out with `{ kind: "linear", enabled: false }`. Callers use this to skip
|
|
120
|
+
* Linear API calls (and the missing-API-key error they raise) when Linear is
|
|
121
|
+
* off. Derived from `sourcesFromConfig` so it honors both the explicit opt-out
|
|
122
|
+
* sentinel and the implicit-source synthesis.
|
|
123
|
+
*/
|
|
124
|
+
export function isLinearEnabled(config) {
|
|
125
|
+
return sourcesFromConfig(config).some(isLinearKindSource);
|
|
126
|
+
}
|
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
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAO1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAA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H,wBAAgB,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAE9D;AAED,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,SAAS,GAAG,KAAK,CAAC;AAEzD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,gBAAgB,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;IACjC,MAAM,EAAE,QAAQ,CAAC,YAAY,CAAC,CAAC;CAChC;AA4MD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,IAAI,CAAC,eAAe,EAAE,cAAc,CAAC,GAAG,OAAO,CAE1F;AA6FD;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,EACtC,IAAI,EAAE,MAAM,GACX,OAAO,CAKT;AAohBD,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CA2B5E;AAED,wBAAsB,UAAU,IAAI,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAGpE"}
|
package/dist/lib/config.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { __rewriteRelativeImportExtension } from "tslib";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
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