jackherd 1.1.0 → 1.3.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +36 -7
  3. package/dist/{chunk-R6MGHCD7.js → chunk-UI3AZNZF.js} +5 -0
  4. package/dist/config.d.ts +7 -0
  5. package/dist/config.js +17 -1
  6. package/dist/plan-format.d.ts +7 -1
  7. package/dist/plan-format.js +3 -1
  8. package/herdr-plugin/herdr-plugin.toml +1 -1
  9. package/install.sh +1 -1
  10. package/kit/hooks/hooks/git-guard/decision.ts +10 -79
  11. package/kit/hooks/hooks/merge-guard/approval.ts +107 -0
  12. package/kit/hooks/hooks/merge-guard/decision.ts +286 -0
  13. package/kit/hooks/hooks/merge-guard/index.ts +56 -0
  14. package/kit/hooks/hooks/merge-guard/pull-request.ts +33 -0
  15. package/kit/hooks/hooks/merge-guard/run.ts +60 -0
  16. package/kit/hooks/hooks/merge-guard/settings.ts +56 -0
  17. package/kit/hooks/hooks/merge-guard/worker.ts +14 -0
  18. package/kit/hooks/hooks/shared/program-position.ts +82 -0
  19. package/kit/hooks/hooks/watch-guard/shell-input.ts +1 -1
  20. package/kit/hooks/hooks/watch-guard/starts.ts +1 -1
  21. package/kit/hooks/hooks.json +10 -0
  22. package/kit/workflow/skills/orchestrate/SKILL.md +68 -5
  23. package/package.json +1 -1
  24. package/schemas/jackherd.schema.json +35 -0
  25. package/src/config/schema.ts +23 -0
  26. package/src/sync/command-context.ts +8 -4
  27. package/src/sync/command.ts +27 -9
  28. package/src/sync/if-changed.ts +18 -8
  29. package/src/sync/render.ts +4 -2
  30. package/src/sync/report.ts +21 -0
  31. package/src/sync/settings-migration.ts +45 -3
  32. package/src/sync/settings-offer.ts +8 -2
  33. package/src/sync/sync.ts +7 -3
  34. package/src/vocabulary/index.ts +10 -0
  35. package/src/watch/command.ts +7 -1
  36. package/src/watch/report-questions.ts +16 -2
  37. package/src/watch/update-available.ts +26 -0
  38. /package/kit/hooks/hooks/{git-guard → shared}/shell.ts +0 -0
@@ -0,0 +1,26 @@
1
+ import { latestVersionIfDue, type UpdateCheck } from '../sync/if-changed'
2
+ import { isNewerVersion } from '../version/release'
3
+
4
+ /** The one line that wakes the coordinator when npm has a newer release; the orchestrate skill asks the user. */
5
+ export const updateAvailableLine = (installed: string, latest: string): string =>
6
+ `=== update available ${installed} → ${latest}`
7
+
8
+ /**
9
+ * The watcher's daily look at npm, on the hook's timestamp and check, so a day holds one registry question across
10
+ * both. Prints a line only for a newer plain release it has not announced yet; otherwise nothing, so a quiet
11
+ * day costs no tokens. Call it on every poll: the timestamp decides whether npm is asked at all.
12
+ */
13
+ export const updateAnnouncer = (
14
+ home: string,
15
+ installed: string,
16
+ check: UpdateCheck,
17
+ log: (line: string) => void,
18
+ ): (() => Promise<void>) => {
19
+ let announced: string | null = null
20
+ return async () => {
21
+ const latest = await latestVersionIfDue(home, check)
22
+ if (latest === null || latest === announced || !isNewerVersion(latest, installed)) return
23
+ announced = latest
24
+ log(updateAvailableLine(installed, latest))
25
+ }
26
+ }
File without changes