@indigoai-us/hq-cli 5.148.0 → 5.149.1

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/assets/scaffold/core/scripts/checkpoint-stop-gate.sh +8 -11
  3. package/dist/command-catalog.generated.d.ts +129 -0
  4. package/dist/command-catalog.generated.js +168 -0
  5. package/dist/commands/lanes.js +506 -23
  6. package/dist/commands/mesh.js +82 -11
  7. package/dist/lib/lanes/index.d.ts +3 -2
  8. package/dist/lib/lanes/index.js +2 -1
  9. package/dist/lib/lanes/mesh-events.d.ts +8 -0
  10. package/dist/lib/lanes/mesh-events.js +83 -6
  11. package/dist/lib/lanes/outpost-dispatch.d.ts +12 -0
  12. package/dist/lib/lanes/outpost-dispatch.js +17 -0
  13. package/dist/lib/lanes/reconcile.js +39 -12
  14. package/dist/lib/lanes/session-relink.d.ts +25 -0
  15. package/dist/lib/lanes/session-relink.js +216 -0
  16. package/dist/lib/lanes/spawn.d.ts +1 -0
  17. package/dist/lib/lanes/spawn.js +48 -5
  18. package/dist/lib/lanes/store.js +109 -1
  19. package/dist/lib/lanes/stories.d.ts +17 -0
  20. package/dist/lib/lanes/stories.js +73 -0
  21. package/dist/lib/lanes/types.d.ts +20 -0
  22. package/dist/lib/lanes/types.js +9 -2
  23. package/dist/lib/lanes/watcher.js +69 -9
  24. package/dist/lib/mesh/live/daemon/doctor.d.ts +27 -0
  25. package/dist/lib/mesh/live/daemon/doctor.js +84 -0
  26. package/dist/lib/mesh/live/daemon/index.d.ts +3 -3
  27. package/dist/lib/mesh/live/daemon/index.js +2 -2
  28. package/dist/lib/mesh/live/daemon/install.d.ts +40 -0
  29. package/dist/lib/mesh/live/daemon/install.js +88 -0
  30. package/dist/lib/mesh/live/daemon/run.d.ts +2 -0
  31. package/dist/lib/mesh/live/daemon/run.js +12 -1
  32. package/dist/lib/mesh/live/daemon/state.d.ts +4 -0
  33. package/dist/lib/mesh/project-board.d.ts +15 -0
  34. package/dist/lib/mesh/project-board.js +84 -0
  35. package/dist/lib/work-context/prd-sync.d.ts +5 -1
  36. package/dist/lib/work-context/prd-sync.js +22 -1
  37. package/package.json +5 -3
  38. package/scripts/mesh-daemon-if-stale.mjs +16 -0
@@ -114,7 +114,28 @@ export function planPrdSync(input) {
114
114
  events,
115
115
  ...(taskId ? { taskId } : {}),
116
116
  seqStart: previous?.seq ?? 0,
117
- commit: () => writeSnapshot(input.sessionId, input.root, snapshot),
117
+ commit: (acceptedTaskIds) => {
118
+ if (!acceptedTaskIds) {
119
+ writeSnapshot(input.sessionId, input.root, snapshot);
120
+ return;
121
+ }
122
+ const accepted = new Set(acceptedTaskIds);
123
+ const stories = { ...(previous?.stories ?? {}) };
124
+ let advanced = 0;
125
+ for (const event of events) {
126
+ if (!accepted.has(event.taskId))
127
+ continue;
128
+ const next = nextStories[event.taskId];
129
+ if (!next)
130
+ continue;
131
+ stories[event.taskId] = next;
132
+ advanced += 1;
133
+ }
134
+ writeSnapshot(input.sessionId, input.root, {
135
+ stories,
136
+ seq: (previous?.seq ?? 0) + advanced,
137
+ });
138
+ },
118
139
  };
119
140
  }
120
141
  //# sourceMappingURL=prd-sync.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@indigoai-us/hq-cli",
3
- "version": "5.148.0",
4
- "description": "HQ by Indigo management CLI \u2014 modules and cloud sync",
3
+ "version": "5.149.1",
4
+ "description": "HQ by Indigo management CLI — modules and cloud sync",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
7
7
  "hq": "dist/index.js",
@@ -18,7 +18,8 @@
18
18
  "templates",
19
19
  "CHANGELOG.md",
20
20
  "README.md",
21
- "contracts"
21
+ "contracts",
22
+ "scripts/mesh-daemon-if-stale.mjs"
22
23
  ],
23
24
  "scripts": {
24
25
  "build": "node scripts/generate-dsn.mjs && tsc && node scripts/generate-command-catalog.mjs --check && node scripts/copy-schemas.mjs && node scripts/chmod-bins.mjs",
@@ -33,6 +34,7 @@
33
34
  "coverage": "vitest run --coverage --coverage.reporter=text-summary --coverage.reporter=json-summary",
34
35
  "vitest": "vitest",
35
36
  "clean": "rm -rf dist",
37
+ "postinstall": "node scripts/mesh-daemon-if-stale.mjs || true",
36
38
  "prepare": "husky || true",
37
39
  "check:no-hermes": "bash scripts/check-no-hermes.sh"
38
40
  },
@@ -0,0 +1,16 @@
1
+ /**
2
+ * postinstall: point the mesh daemon at this install when it is newer.
3
+ * Best-effort. Never fails the package install. Tests do not run this.
4
+ */
5
+ import { spawnSync } from "node:child_process";
6
+ import fs from "node:fs";
7
+ import path from "node:path";
8
+ import { fileURLToPath } from "node:url";
9
+
10
+ const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
11
+ const cli = path.join(root, "dist", "index.js");
12
+ if (!fs.existsSync(cli)) process.exit(0);
13
+ spawnSync(process.execPath, [cli, "mesh", "daemon", "install", "--if-stale"], {
14
+ stdio: "inherit",
15
+ });
16
+ process.exit(0);