kenaz 0.3.2 → 0.3.5

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 (71) hide show
  1. package/core/.claude/commands/Ansuz.md +36 -35
  2. package/core/.claude/hooks/__tests__/task-2395-project-registration.test.js +84 -0
  3. package/core/.claude/hooks/_ansuz-conversation.js +1 -0
  4. package/core/.claude/hooks/_ansuz-conversation.test.js +6 -0
  5. package/core/.claude/hooks/_run-user-prompt.js +0 -4
  6. package/core/.claude/hooks/_run-user-prompt.test.js +2 -3
  7. package/core/.claude/hooks/handoff-staleness.js +2 -2
  8. package/core/.claude/hooks/turn-context.js +50 -2
  9. package/core/.claude/settings.json +0 -37
  10. package/core/.collaboration/core/task-api.js +4 -12
  11. package/core/.formation/README.md +21 -146
  12. package/core/.formation/bifrost/codex-doctor.js +37 -2
  13. package/core/.formation/bifrost/codex-doctor.test.js +18 -0
  14. package/core/.formation/bifrost/launch.js +1 -1
  15. package/core/.formation/bifrost/openai/codex-hook-shim.js +6 -0
  16. package/core/.formation/bifrost/openai/codex-hook-shim.test.js +11 -1
  17. package/core/.formation/bifrost/setup-codex.js +3 -0
  18. package/core/.formation/spec/task_operations.parity.test.js +0 -1
  19. package/core/.formation/tools/dashboard-models-chain.test.js +0 -6
  20. package/core/.formation/tools/dispatch-detail/cross-project-worktree.md +1 -9
  21. package/core/.formation/tools/dispatch-detail/worktree-subagent-mode.md +2 -2
  22. package/core/.formation/tools/dispatch.js +28 -549
  23. package/core/.formation/tools/mcp-allowlist.test.js +0 -1
  24. package/core/.formation/tools/post-complete/task2345.test.js +0 -5
  25. package/core/.formation/tools/pre-dispatch-snapshot.test.js +0 -100
  26. package/core/.formation/tools/prompt.js +66 -1607
  27. package/core/.formation/tools/prompt.test.js +43 -582
  28. package/core/.kenaz/claude-hooks-manifest.json +16 -16
  29. package/core/.specialist/Ansuz/RULES.md +6 -10
  30. package/core/.specialist/tools/__tests__/freya-cli-contract.test.js +0 -1
  31. package/core/.specialist/tools/__tests__/task-2218-boot-session-id.test.js +17 -1
  32. package/core/.specialist/tools/__tests__/task-2222-session-identity-interleave.test.js +17 -1
  33. package/core/.specialist/tools/__tests__/task-2254-handoff-archive-contract.test.js +6 -5
  34. package/core/.specialist/tools/ansuz-boot-fast.js +44 -100
  35. package/core/.specialist/tools/ansuz-boot-fast.test.js +45 -1
  36. package/core/KENAZ_CORE_VERSION +1 -1
  37. package/core/dev/plans/ANSUZ_SLIM_PLAN.md +68 -0
  38. package/core/plugins/kenaz/commands/Amelia.md +1 -1
  39. package/core/plugins/kenaz/commands/Ansuz.md +36 -35
  40. package/core/plugins/kenaz/hooks/hooks.json +1 -5
  41. package/core/plugins/kenaz/hooks/kenaz-hook.js +0 -4
  42. package/core/plugins/kenaz/scripts/kenaz-mode.js +11 -1
  43. package/core/plugins/kenaz/scripts/kenaz.test.js +1 -1
  44. package/core/plugins/kenaz/scripts/sync.js +6 -2
  45. package/core/plugins/kenaz/scripts/ygg.js +13 -1
  46. package/core/plugins/kenaz/skills/product_manager/SKILL.md +12 -12
  47. package/lib/cli.js +47 -6
  48. package/lib/cli.test.js +24 -0
  49. package/lib/dashboard.js +10 -0
  50. package/package.json +11 -7
  51. package/vendor/install-kenaz-cli.js +18 -7
  52. package/core/.formation/tools/broadcast.js +0 -103
  53. package/core/.formation/tools/dispatch-dryrun.test.js +0 -54
  54. package/core/.formation/tools/dispatch-notifier.js +0 -84
  55. package/core/.formation/tools/formations.js +0 -1203
  56. package/core/.formation/tools/headless-branch-recovery.test.js +0 -64
  57. package/core/.formation/tools/headless-dryrun.test.js +0 -79
  58. package/core/.formation/tools/headless-v2.js +0 -659
  59. package/core/.formation/tools/headless.js +0 -1071
  60. package/core/.formation/tools/legacy-scheduler.js +0 -1994
  61. package/core/.formation/tools/logger.js +0 -273
  62. package/core/.formation/tools/memory-loader.js +0 -422
  63. package/core/.formation/tools/process-state.js +0 -33
  64. package/core/.formation/tools/remote-conflict.js +0 -98
  65. package/core/.formation/tools/runner.js +0 -1332
  66. package/core/.formation/tools/task-utils.js +0 -344
  67. package/core/.formation/tools/task2028-headless-worktree.test.js +0 -112
  68. package/core/.formation/tools/tests/headless-mcp-args-plumbing.test.js +0 -123
  69. package/core/.formation/tools/worktree-leak.test.js +0 -162
  70. package/core/.specialist/tools/__tests__/task-1863-boot-lease-reuse.test.js +0 -99
  71. package/core/.specialist/tools/__tests__/task-1977-banner-cap.test.js +0 -129
@@ -1,84 +0,0 @@
1
- 'use strict';
2
-
3
- const fs = require('fs');
4
- const path = require('path');
5
- const { ROOT } = require('./utils');
6
-
7
- function getDispatchNotificationFile(corePath = ROOT) {
8
- return path.join(corePath, '.formation', '.dispatch-notifications.json');
9
- }
10
-
11
- function readDispatchNotifications(corePath = ROOT) {
12
- const file = getDispatchNotificationFile(corePath);
13
- try {
14
- if (fs.existsSync(file)) {
15
- const parsed = JSON.parse(fs.readFileSync(file, 'utf-8'));
16
- return Array.isArray(parsed) ? parsed : [];
17
- }
18
- } catch {}
19
- return [];
20
- }
21
-
22
- function writeDispatchNotifications(list, corePath = ROOT) {
23
- const file = getDispatchNotificationFile(corePath);
24
- try {
25
- fs.writeFileSync(file, JSON.stringify(list, null, 2));
26
- } catch {}
27
- }
28
-
29
- function enqueueDispatchNotification(event, corePath = ROOT) {
30
- if (!event || !event.originSessionId || !event.taskId || !event.status) return null;
31
-
32
- const list = readDispatchNotifications(corePath);
33
- const notification = {
34
- id: event.id || `dispatch-${event.taskId}-${Date.now()}`,
35
- originSessionId: event.originSessionId,
36
- taskId: event.taskId,
37
- status: event.status,
38
- summary: event.summary || '',
39
- formation: event.formation || 'unit',
40
- skill: event.skill || 'do',
41
- dispatchSessionId: event.dispatchSessionId || null,
42
- projectPath: event.projectPath || null,
43
- logPath: event.logPath || null,
44
- metadata: event.metadata || {},
45
- createdAt: event.createdAt || new Date().toISOString(),
46
- };
47
- list.push(notification);
48
- writeDispatchNotifications(list, corePath);
49
- return notification;
50
- }
51
-
52
- function takeDispatchNotifications(originSessionId, corePath = ROOT) {
53
- if (!originSessionId) return [];
54
- const list = readDispatchNotifications(corePath);
55
- if (list.length === 0) return [];
56
-
57
- const matches = [];
58
- const remaining = [];
59
- for (const item of list) {
60
- if (item && item.originSessionId === originSessionId) {
61
- matches.push(item);
62
- } else {
63
- remaining.push(item);
64
- }
65
- }
66
-
67
- if (matches.length > 0) {
68
- if (remaining.length === 0) {
69
- try { fs.unlinkSync(getDispatchNotificationFile(corePath)); } catch {}
70
- } else {
71
- writeDispatchNotifications(remaining, corePath);
72
- }
73
- }
74
-
75
- return matches;
76
- }
77
-
78
- module.exports = {
79
- getDispatchNotificationFile,
80
- readDispatchNotifications,
81
- writeDispatchNotifications,
82
- enqueueDispatchNotification,
83
- takeDispatchNotifications,
84
- };