@indigoai-us/hq-cli 5.167.0 → 5.169.0
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/CHANGELOG.md +30 -0
- package/dist/command-catalog.generated.d.ts +88 -1
- package/dist/command-catalog.generated.js +112 -1
- package/dist/commands/daemon.d.ts +2 -0
- package/dist/commands/daemon.js +79 -22
- package/dist/commands/lanes.js +146 -31
- package/dist/commands/mesh.js +13 -19
- package/dist/commands/outpost-pruner.d.ts +3 -0
- package/dist/commands/outpost-pruner.js +125 -0
- package/dist/lib/daemon/catalog.d.ts +11 -1
- package/dist/lib/daemon/catalog.js +31 -6
- package/dist/lib/daemon/install.d.ts +7 -0
- package/dist/lib/daemon/install.js +18 -2
- package/dist/lib/daemon/legacy.js +6 -1
- package/dist/lib/daemon/machine-type.d.ts +4 -1
- package/dist/lib/daemon/machine-type.js +29 -9
- package/dist/lib/daemon/migrate.js +2 -2
- package/dist/lib/daemon/remote-control.d.ts +32 -9
- package/dist/lib/daemon/remote-control.js +55 -11
- package/dist/lib/daemon/run.d.ts +6 -0
- package/dist/lib/daemon/run.js +43 -2
- package/dist/lib/daemon/tools.d.ts +52 -0
- package/dist/lib/daemon/tools.js +95 -0
- package/dist/lib/daemon/updater.d.ts +23 -15
- package/dist/lib/daemon/updater.js +97 -60
- package/dist/lib/lanes/mesh-events.d.ts +4 -0
- package/dist/lib/lanes/mesh-events.js +72 -4
- package/dist/lib/lanes/outpost-pruner-install.d.ts +37 -0
- package/dist/lib/lanes/outpost-pruner-install.js +226 -0
- package/dist/lib/lanes/outpost-worktree-pruner-flag.d.ts +19 -0
- package/dist/lib/lanes/outpost-worktree-pruner-flag.js +76 -0
- package/dist/lib/lanes/outpost-worktree-pruner.d.ts +60 -0
- package/dist/lib/lanes/outpost-worktree-pruner.js +1135 -0
- package/dist/lib/mesh/live/session-events-client.js +3 -2
- package/dist/lib/mesh/project-board.d.ts +7 -0
- package/dist/lib/mesh/project-board.js +29 -1
- package/package.json +1 -1
|
@@ -22,14 +22,15 @@ function parseRetryAfterMs(value, nowMs = Date.now()) {
|
|
|
22
22
|
const trimmed = value.trim();
|
|
23
23
|
if (/^\d+$/.test(trimmed)) {
|
|
24
24
|
const delayMs = Number(trimmed) * 1_000;
|
|
25
|
-
return Number.isSafeInteger(delayMs) ? delayMs : undefined;
|
|
25
|
+
return Number.isSafeInteger(delayMs) && delayMs > 0 ? delayMs : undefined;
|
|
26
26
|
}
|
|
27
27
|
if (/^[+-]/.test(trimmed))
|
|
28
28
|
return undefined;
|
|
29
29
|
const retryAtMs = Date.parse(trimmed);
|
|
30
30
|
if (!Number.isFinite(retryAtMs))
|
|
31
31
|
return undefined;
|
|
32
|
-
|
|
32
|
+
const delayMs = retryAtMs - nowMs;
|
|
33
|
+
return delayMs > 0 ? delayMs : undefined;
|
|
33
34
|
}
|
|
34
35
|
function retryAfterForStatus(status, headers) {
|
|
35
36
|
if (status !== 429 && status !== 503)
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { type MeshCompany, type MeshProjectRegistration, type MeshProjectRepo, type MeshProjectStoryInput, type MeshProjectView } from "./api.js";
|
|
2
|
+
/** Same merge as `hq mesh project ensure`: add missing stories, keep live status. */
|
|
3
|
+
export declare function mergeProjectStories(current: MeshProjectStoryInput[], planned: MeshProjectStoryInput[], opts?: {
|
|
4
|
+
resetStatus?: boolean;
|
|
5
|
+
}): MeshProjectStoryInput[];
|
|
6
|
+
export declare function boardStoryStatus(story: MeshProjectStoryInput): string;
|
|
7
|
+
/** One-line summary of live→next status diffs for existing story ids. */
|
|
8
|
+
export declare function formatStoryStatusChanges(current: MeshProjectStoryInput[], next: MeshProjectStoryInput[]): string | undefined;
|
|
2
9
|
/**
|
|
3
10
|
* Add Board stories that a prd-sync emit is about to name, when they are missing.
|
|
4
11
|
* A missing view uses ensureProjectBoard. An existing view is merged so live
|
|
@@ -6,13 +6,19 @@ function httpStatus(err) {
|
|
|
6
6
|
return undefined;
|
|
7
7
|
}
|
|
8
8
|
/** Same merge as `hq mesh project ensure`: add missing stories, keep live status. */
|
|
9
|
-
function mergeProjectStories(current, planned) {
|
|
9
|
+
export function mergeProjectStories(current, planned, opts) {
|
|
10
10
|
const currentById = new Map(current.map((story) => [story.id, story]));
|
|
11
11
|
const plannedIds = new Set(planned.map((story) => story.id));
|
|
12
12
|
const merged = planned.map((story) => {
|
|
13
13
|
const live = currentById.get(story.id);
|
|
14
14
|
if (!live)
|
|
15
15
|
return story;
|
|
16
|
+
if (opts?.resetStatus) {
|
|
17
|
+
return {
|
|
18
|
+
...story,
|
|
19
|
+
...(live.assigneeUid ? { assigneeUid: live.assigneeUid } : {}),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
16
22
|
const status = live.status || story.status;
|
|
17
23
|
return {
|
|
18
24
|
...story,
|
|
@@ -23,6 +29,28 @@ function mergeProjectStories(current, planned) {
|
|
|
23
29
|
});
|
|
24
30
|
return [...merged, ...current.filter((story) => !plannedIds.has(story.id))];
|
|
25
31
|
}
|
|
32
|
+
export function boardStoryStatus(story) {
|
|
33
|
+
if (story.status)
|
|
34
|
+
return story.status;
|
|
35
|
+
return story.passes === true ? "done" : "queued";
|
|
36
|
+
}
|
|
37
|
+
/** One-line summary of live→next status diffs for existing story ids. */
|
|
38
|
+
export function formatStoryStatusChanges(current, next) {
|
|
39
|
+
const currentById = new Map(current.map((story) => [story.id, story]));
|
|
40
|
+
const changes = [];
|
|
41
|
+
for (const story of next) {
|
|
42
|
+
const live = currentById.get(story.id);
|
|
43
|
+
if (!live)
|
|
44
|
+
continue;
|
|
45
|
+
const from = boardStoryStatus(live);
|
|
46
|
+
const to = boardStoryStatus(story);
|
|
47
|
+
if (from !== to)
|
|
48
|
+
changes.push(`${story.id} ${from}→${to}`);
|
|
49
|
+
}
|
|
50
|
+
if (changes.length === 0)
|
|
51
|
+
return undefined;
|
|
52
|
+
return `Work mesh: project set changed status: ${changes.join(", ")}`;
|
|
53
|
+
}
|
|
26
54
|
function mergeProjectRepos(current, planned) {
|
|
27
55
|
const plannedPaths = new Set(planned.map((repo) => repo.path));
|
|
28
56
|
return [...planned, ...current.filter((repo) => !plannedPaths.has(repo.path))];
|