@telora/daemon 0.15.3 → 0.15.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 (115) hide show
  1. package/build-info.json +2 -2
  2. package/dist/directive-executor.d.ts +18 -3
  3. package/dist/directive-executor.d.ts.map +1 -1
  4. package/dist/directive-executor.js +45 -4
  5. package/dist/directive-executor.js.map +1 -1
  6. package/dist/focus-completion.js +12 -12
  7. package/dist/focus-completion.js.map +1 -1
  8. package/dist/focus-executor.d.ts.map +1 -1
  9. package/dist/focus-executor.js +30 -13
  10. package/dist/focus-executor.js.map +1 -1
  11. package/dist/focus-phase.d.ts +22 -0
  12. package/dist/focus-phase.d.ts.map +1 -0
  13. package/dist/focus-phase.js +54 -0
  14. package/dist/focus-phase.js.map +1 -0
  15. package/dist/focus-team-state.d.ts +6 -0
  16. package/dist/focus-team-state.d.ts.map +1 -1
  17. package/dist/focus-team-state.js +13 -0
  18. package/dist/focus-team-state.js.map +1 -1
  19. package/dist/index.js +0 -0
  20. package/dist/listener.d.ts.map +1 -1
  21. package/dist/listener.js +0 -5
  22. package/dist/listener.js.map +1 -1
  23. package/dist/queries/focuses.d.ts +5 -0
  24. package/dist/queries/focuses.d.ts.map +1 -1
  25. package/dist/queries/focuses.js +15 -0
  26. package/dist/queries/focuses.js.map +1 -1
  27. package/dist/review-defect-detector.d.ts +16 -95
  28. package/dist/review-defect-detector.d.ts.map +1 -1
  29. package/dist/review-defect-detector.js +19 -211
  30. package/dist/review-defect-detector.js.map +1 -1
  31. package/dist/state-cascade.d.ts +45 -41
  32. package/dist/state-cascade.d.ts.map +1 -1
  33. package/dist/state-cascade.js +123 -215
  34. package/dist/state-cascade.js.map +1 -1
  35. package/package.json +2 -2
  36. package/dist/listener-review.d.ts +0 -37
  37. package/dist/listener-review.d.ts.map +0 -1
  38. package/dist/listener-review.js +0 -217
  39. package/dist/listener-review.js.map +0 -1
  40. package/dist/queries/strategies.d.ts +0 -97
  41. package/dist/queries/strategies.d.ts.map +0 -1
  42. package/dist/queries/strategies.js +0 -136
  43. package/dist/queries/strategies.js.map +0 -1
  44. package/dist/review-spawner.d.ts +0 -32
  45. package/dist/review-spawner.d.ts.map +0 -1
  46. package/dist/review-spawner.js +0 -170
  47. package/dist/review-spawner.js.map +0 -1
  48. package/dist/strategy-completion-event.d.ts +0 -63
  49. package/dist/strategy-completion-event.d.ts.map +0 -1
  50. package/dist/strategy-completion-event.js +0 -138
  51. package/dist/strategy-completion-event.js.map +0 -1
  52. package/dist/strategy-completion.d.ts +0 -85
  53. package/dist/strategy-completion.d.ts.map +0 -1
  54. package/dist/strategy-completion.js +0 -459
  55. package/dist/strategy-completion.js.map +0 -1
  56. package/dist/strategy-engine.d.ts +0 -47
  57. package/dist/strategy-engine.d.ts.map +0 -1
  58. package/dist/strategy-engine.js +0 -421
  59. package/dist/strategy-engine.js.map +0 -1
  60. package/dist/strategy-executor.d.ts +0 -55
  61. package/dist/strategy-executor.d.ts.map +0 -1
  62. package/dist/strategy-executor.js +0 -519
  63. package/dist/strategy-executor.js.map +0 -1
  64. package/dist/strategy-lifecycle.d.ts +0 -61
  65. package/dist/strategy-lifecycle.d.ts.map +0 -1
  66. package/dist/strategy-lifecycle.js +0 -544
  67. package/dist/strategy-lifecycle.js.map +0 -1
  68. package/dist/strategy-merge.d.ts +0 -77
  69. package/dist/strategy-merge.d.ts.map +0 -1
  70. package/dist/strategy-merge.js +0 -378
  71. package/dist/strategy-merge.js.map +0 -1
  72. package/dist/strategy-prompt-builder.d.ts +0 -24
  73. package/dist/strategy-prompt-builder.d.ts.map +0 -1
  74. package/dist/strategy-prompt-builder.js +0 -87
  75. package/dist/strategy-prompt-builder.js.map +0 -1
  76. package/dist/strategy-provisioning.d.ts +0 -16
  77. package/dist/strategy-provisioning.d.ts.map +0 -1
  78. package/dist/strategy-provisioning.js +0 -119
  79. package/dist/strategy-provisioning.js.map +0 -1
  80. package/dist/strategy-spawn-helpers.d.ts +0 -67
  81. package/dist/strategy-spawn-helpers.d.ts.map +0 -1
  82. package/dist/strategy-spawn-helpers.js +0 -160
  83. package/dist/strategy-spawn-helpers.js.map +0 -1
  84. package/dist/strategy-team-lifecycle.d.ts +0 -50
  85. package/dist/strategy-team-lifecycle.d.ts.map +0 -1
  86. package/dist/strategy-team-lifecycle.js +0 -256
  87. package/dist/strategy-team-lifecycle.js.map +0 -1
  88. package/dist/strategy-team-state.d.ts +0 -24
  89. package/dist/strategy-team-state.d.ts.map +0 -1
  90. package/dist/strategy-team-state.js +0 -43
  91. package/dist/strategy-team-state.js.map +0 -1
  92. package/dist/strategy-teardown.d.ts +0 -24
  93. package/dist/strategy-teardown.d.ts.map +0 -1
  94. package/dist/strategy-teardown.js +0 -158
  95. package/dist/strategy-teardown.js.map +0 -1
  96. package/dist/strategy-worktree-state.d.ts +0 -47
  97. package/dist/strategy-worktree-state.d.ts.map +0 -1
  98. package/dist/strategy-worktree-state.js +0 -104
  99. package/dist/strategy-worktree-state.js.map +0 -1
  100. package/dist/team-prompt-variants.d.ts +0 -17
  101. package/dist/team-prompt-variants.d.ts.map +0 -1
  102. package/dist/team-prompt-variants.js +0 -79
  103. package/dist/team-prompt-variants.js.map +0 -1
  104. package/dist/types/strategy.d.ts +0 -180
  105. package/dist/types/strategy.d.ts.map +0 -1
  106. package/dist/types/strategy.js +0 -5
  107. package/dist/types/strategy.js.map +0 -1
  108. package/dist/worktree-merge.d.ts +0 -23
  109. package/dist/worktree-merge.d.ts.map +0 -1
  110. package/dist/worktree-merge.js +0 -57
  111. package/dist/worktree-merge.js.map +0 -1
  112. package/dist/worktree-strategy.d.ts +0 -69
  113. package/dist/worktree-strategy.d.ts.map +0 -1
  114. package/dist/worktree-strategy.js +0 -214
  115. package/dist/worktree-strategy.js.map +0 -1
@@ -1,37 +0,0 @@
1
- /**
2
- * Review request handling and auto-review for strategies.
3
- *
4
- * Handles manual review requests (review_requested_at) and
5
- * automatic review triggering when all deliveries reach verify status.
6
- */
7
- import type { DaemonConfig, AgentRole } from './types.js';
8
- /** Mark a delivery as having been auto-reviewed. */
9
- export declare function markDeliveryReviewed(deliveryId: string): void;
10
- /** Check if a delivery has already been auto-reviewed. */
11
- export declare function hasDeliveryBeenReviewed(deliveryId: string): boolean;
12
- /**
13
- * Spawn a review team for a strategy that has no active team.
14
- *
15
- * Looks up the strategy via getActiveStrategies() to get the agent role
16
- * and pipeline config, then spawns a team in review mode. The spawned
17
- * team receives the review directive as its initial work.
18
- */
19
- export declare function spawnReviewTeamForStrategy(config: DaemonConfig, roles: Map<string, AgentRole>, strategyId: string, strategyName: string): Promise<void>;
20
- /**
21
- * Check for auto-review conditions across all strategies.
22
- *
23
- * Iterates strategies with persistent worktrees but no active team.
24
- * When all non-terminal deliveries are in verify and review is enabled,
25
- * spawns a fresh review team. Active teams are skipped -- they will
26
- * terminate on completion, and the next poll cycle picks them up.
27
- */
28
- export declare function checkAutoReview(config: DaemonConfig, roles: Map<string, AgentRole>): Promise<void>;
29
- /**
30
- * Check for pending review requests and spawn fresh review teams.
31
- *
32
- * Polls for strategies with review_requested_at set. For each request,
33
- * spawns a fresh review team (skipped if a team is already active) and
34
- * clears the flag.
35
- */
36
- export declare function checkReviewRequests(config: DaemonConfig, roles: Map<string, AgentRole>): Promise<void>;
37
- //# sourceMappingURL=listener-review.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"listener-review.d.ts","sourceRoot":"","sources":["../src/listener-review.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAS1D,oDAAoD;AACpD,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAE7D;AAED,0DAA0D;AAC1D,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAEnE;AAED;;;;;;GAMG;AACH,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,EAC7B,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CA+Df;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,GAC5B,OAAO,CAAC,IAAI,CAAC,CAuFf;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,GAC5B,OAAO,CAAC,IAAI,CAAC,CAuBf"}
@@ -1,217 +0,0 @@
1
- /**
2
- * Review request handling and auto-review for strategies.
3
- *
4
- * Handles manual review requests (review_requested_at) and
5
- * automatic review triggering when all deliveries reach verify status.
6
- */
7
- import { getActiveStrategies, getReviewRequests, getStrategyDeliveries, updateDeliveryStatus, fetchEffectiveWorkflow } from './supabase.js';
8
- import { spawnStrategyTeam, hasActiveTeam, getActiveTeamCount } from './strategy-executor.js';
9
- import { hasStrategyWorktree } from './strategy-worktree-state.js';
10
- import { configForProduct, findProduct } from './config.js';
11
- /** Track which deliveries have already had an auto-review. */
12
- const reviewedDeliveries = new Set();
13
- /** Mark a delivery as having been auto-reviewed. */
14
- export function markDeliveryReviewed(deliveryId) {
15
- reviewedDeliveries.add(deliveryId);
16
- }
17
- /** Check if a delivery has already been auto-reviewed. */
18
- export function hasDeliveryBeenReviewed(deliveryId) {
19
- return reviewedDeliveries.has(deliveryId);
20
- }
21
- /**
22
- * Spawn a review team for a strategy that has no active team.
23
- *
24
- * Looks up the strategy via getActiveStrategies() to get the agent role
25
- * and pipeline config, then spawns a team in review mode. The spawned
26
- * team receives the review directive as its initial work.
27
- */
28
- export async function spawnReviewTeamForStrategy(config, roles, strategyId, strategyName) {
29
- // Check capacity
30
- if (getActiveTeamCount() >= config.maxTotalSessions) {
31
- console.log(`[listener] Cannot spawn review team for "${strategyName}" -- session limit reached`);
32
- return;
33
- }
34
- // Look up strategy details (role, pipeline config) across all products
35
- let strategy;
36
- try {
37
- for (const product of config.products) {
38
- const activeStrategies = await getActiveStrategies(config.organizationId, product.id);
39
- strategy = activeStrategies.find(s => s.strategy_id === strategyId);
40
- if (strategy)
41
- break;
42
- }
43
- }
44
- catch (err) {
45
- console.warn(`[listener] Failed to look up strategy for review spawn: ${err.message}`);
46
- return;
47
- }
48
- if (!strategy) {
49
- console.warn(`[listener] Strategy "${strategyName}" not found in active strategies -- cannot spawn review team`);
50
- return;
51
- }
52
- // Review-only strategies may have no assigned agent role. Fall back to first available role.
53
- const role = strategy.assigned_agent_role_id
54
- ? roles.get(strategy.assigned_agent_role_id)
55
- : roles.values().next().value;
56
- if (!role) {
57
- console.warn(`[listener] No agent role available for review spawn of "${strategyName}"`);
58
- return;
59
- }
60
- // Use product-scoped config for the review team
61
- const productEntry = strategy.product_id ? findProduct(config, strategy.product_id) : undefined;
62
- const spawnConfig = productEntry ? configForProduct(config, productEntry) : config;
63
- // Safety-net: verify that at least one delivery is in in_review before spawning.
64
- // The frontend/API moves verify→in_review atomically when the user clicks Review.
65
- // If no deliveries are in in_review, the transition failed or no deliveries were in verify.
66
- try {
67
- const deliveries = await getStrategyDeliveries(strategyId);
68
- const inReviewCount = deliveries.filter(d => d.executionStatus === 'in_review').length;
69
- if (inReviewCount === 0) {
70
- console.warn(`[listener] Review requested for "${strategyName}" but no deliveries in in_review -- skipping spawn`);
71
- return;
72
- }
73
- console.log(`[listener] Spawning review team for "${strategyName}" (${inReviewCount} deliveries in in_review)`);
74
- }
75
- catch (err) {
76
- console.warn(`[listener] Failed to check deliveries for review spawn of "${strategyName}":`, err.message);
77
- // Proceed anyway -- the team spawner will fetch deliveries and handle the empty case
78
- }
79
- await spawnStrategyTeam({
80
- config: spawnConfig,
81
- strategyId,
82
- strategyName,
83
- role,
84
- pipelineConfig: strategy.pipeline_config,
85
- readOnly: strategy.read_only,
86
- reviewMode: true,
87
- });
88
- }
89
- /**
90
- * Check for auto-review conditions across all strategies.
91
- *
92
- * Iterates strategies with persistent worktrees but no active team.
93
- * When all non-terminal deliveries are in verify and review is enabled,
94
- * spawns a fresh review team. Active teams are skipped -- they will
95
- * terminate on completion, and the next poll cycle picks them up.
96
- */
97
- export async function checkAutoReview(config, roles) {
98
- const TERMINAL_STATUSES = new Set(['done', 'cancelled']);
99
- // Aggregate active strategies across all products
100
- const activeStrategies = [];
101
- try {
102
- for (const product of config.products) {
103
- const strategies = await getActiveStrategies(config.organizationId, product.id);
104
- activeStrategies.push(...strategies);
105
- }
106
- }
107
- catch (err) {
108
- console.warn(`[listener] Auto-review: failed to fetch active strategies: ${err.message}`);
109
- return;
110
- }
111
- for (const strategy of activeStrategies) {
112
- // Skip strategies with an active team -- they will terminate on completion,
113
- // and the next poll cycle will spawn a review team if needed.
114
- if (hasActiveTeam(strategy.strategy_id))
115
- continue;
116
- // Skip strategies without a persistent worktree (no work has been done yet)
117
- if (!hasStrategyWorktree(strategy.strategy_id))
118
- continue;
119
- // Skip if review not enabled in pipeline config
120
- const pipelineConfig = strategy.pipeline_config;
121
- if (!pipelineConfig?.review?.enabled)
122
- continue;
123
- try {
124
- const deliveries = await getStrategyDeliveries(strategy.strategy_id);
125
- // Filter to non-terminal deliveries
126
- const nonTerminal = deliveries.filter(d => !TERMINAL_STATUSES.has(d.executionStatus ?? ''));
127
- if (nonTerminal.length === 0)
128
- continue;
129
- // Check if ALL non-terminal deliveries are in verify or in_review
130
- const allReviewReady = nonTerminal.every(d => d.executionStatus === 'verify' || d.executionStatus === 'in_review');
131
- if (!allReviewReady)
132
- continue;
133
- // Separate deliveries into first-time review vs already-reviewed
134
- const verifyDeliveries = nonTerminal.filter(d => d.executionStatus === 'verify');
135
- const needsReview = verifyDeliveries.filter(d => !hasDeliveryBeenReviewed(d.id));
136
- const alreadyReviewed = verifyDeliveries.filter(d => hasDeliveryBeenReviewed(d.id));
137
- // Advance already-reviewed deliveries straight to done
138
- for (const delivery of alreadyReviewed) {
139
- try {
140
- const workflow = await fetchEffectiveWorkflow(delivery.id);
141
- const doneStage = workflow.stages.find(s => s.name === 'done');
142
- if (doneStage) {
143
- await updateDeliveryStatus(delivery.id, 'done', doneStage.id);
144
- }
145
- else {
146
- await updateDeliveryStatus(delivery.id, 'done');
147
- }
148
- console.log(`[auto-review] Advanced delivery "${delivery.name}" to done (already reviewed once)`);
149
- }
150
- catch (err) {
151
- console.warn(`[auto-review] Failed to advance delivery "${delivery.name}" to done:`, err.message);
152
- }
153
- }
154
- // If no deliveries need a first review, we're done with this strategy
155
- if (needsReview.length === 0)
156
- continue;
157
- // Transition first-time verify deliveries to in_review before spawning
158
- for (const delivery of needsReview) {
159
- try {
160
- const workflow = await fetchEffectiveWorkflow(delivery.id);
161
- const inReviewStage = workflow.stages.find(s => s.name === 'in_review');
162
- if (inReviewStage) {
163
- await updateDeliveryStatus(delivery.id, 'in_review', inReviewStage.id);
164
- }
165
- else {
166
- await updateDeliveryStatus(delivery.id, 'in_review');
167
- }
168
- markDeliveryReviewed(delivery.id);
169
- console.log(`[auto-review] Moved delivery "${delivery.name}" from verify to in_review`);
170
- }
171
- catch (err) {
172
- console.warn(`[auto-review] Failed to transition delivery "${delivery.name}" to in_review:`, err.message);
173
- }
174
- }
175
- // Spawn a review team for this strategy
176
- console.log(`[listener] Auto-review: spawning review team for "${strategy.strategy_name}" (${needsReview.length} deliveries for review)`);
177
- await spawnReviewTeamForStrategy(config, roles, strategy.strategy_id, strategy.strategy_name);
178
- }
179
- catch (err) {
180
- console.warn(`[listener] Auto-review check failed for "${strategy.strategy_name}":`, err.message);
181
- }
182
- }
183
- }
184
- /**
185
- * Check for pending review requests and spawn fresh review teams.
186
- *
187
- * Polls for strategies with review_requested_at set. For each request,
188
- * spawns a fresh review team (skipped if a team is already active) and
189
- * clears the flag.
190
- */
191
- export async function checkReviewRequests(config, roles) {
192
- try {
193
- // Aggregate review requests across all products
194
- const requests = [];
195
- for (const product of config.products) {
196
- const productRequests = await getReviewRequests(product.id);
197
- requests.push(...productRequests);
198
- }
199
- if (requests.length === 0)
200
- return;
201
- for (const request of requests) {
202
- try {
203
- await spawnReviewTeamForStrategy(config, roles, request.strategyId, request.strategyName);
204
- // Flag stays set while review is in progress (UI reads it).
205
- // The activeTeams guard in spawnStrategyTeam prevents double-spawning.
206
- // Flag is cleared in strategy-completion.ts when the review team exits.
207
- }
208
- catch (err) {
209
- console.warn(`[listener] Failed to process review request for "${request.strategyName}":`, err.message);
210
- }
211
- }
212
- }
213
- catch (err) {
214
- console.warn('[listener] Failed to check review requests:', err.message);
215
- }
216
- }
217
- //# sourceMappingURL=listener-review.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"listener-review.js","sourceRoot":"","sources":["../src/listener-review.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAC5I,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE5D,8DAA8D;AAC9D,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAU,CAAC;AAE7C,oDAAoD;AACpD,MAAM,UAAU,oBAAoB,CAAC,UAAkB;IACrD,kBAAkB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AACrC,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,uBAAuB,CAAC,UAAkB;IACxD,OAAO,kBAAkB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAC5C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,MAAoB,EACpB,KAA6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CAAC,CAAC;QAC/G,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,MAAoB,EACpB,KAA6B;IAE7B,IAAI,CAAC;QACH,gDAAgD;QAChD,MAAM,QAAQ,GAAkD,EAAE,CAAC;QACnE,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACtC,MAAM,eAAe,GAAG,MAAM,iBAAiB,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YAC5D,QAAQ,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,CAAC;QACpC,CAAC;QACD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO;QAElC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,IAAI,CAAC;gBACH,MAAM,0BAA0B,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;gBAC1F,4DAA4D;gBAC5D,uEAAuE;gBACvE,wEAAwE;YAC1E,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,CAAC,IAAI,CAAC,oDAAoD,OAAO,CAAC,YAAY,IAAI,EAAG,GAAa,CAAC,OAAO,CAAC,CAAC;YACrH,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,IAAI,CAAC,6CAA6C,EAAG,GAAa,CAAC,OAAO,CAAC,CAAC;IACtF,CAAC;AACH,CAAC"}
@@ -1,97 +0,0 @@
1
- /**
2
- * Strategy-level queries for team execution.
3
- *
4
- * Fetches all deliveries and issues for a strategy so the team lead
5
- * can build a complete task DAG.
6
- */
7
- import type { StrategyDeliveryInfo, StrategyIssueInfo, StageDirective, Workflow } from '../types.js';
8
- /**
9
- * A wiki page providing background information for AI agents.
10
- *
11
- * Currently returned as an empty list; the next delivery wires the
12
- * resolver into wiki_search.
13
- */
14
- export interface ProductContextDoc {
15
- title: string;
16
- content: string;
17
- }
18
- /**
19
- * Fetch all deliveries for a strategy, ordered by priority rank.
20
- */
21
- export declare function getStrategyDeliveries(strategyId: string): Promise<StrategyDeliveryInfo[]>;
22
- /**
23
- * Fetch all issues across all deliveries for a strategy.
24
- */
25
- export declare function getStrategyIssues(strategyId: string): Promise<StrategyIssueInfo[]>;
26
- /**
27
- * Fetch wiki pages relevant to a strategy.
28
- *
29
- * Stub: returns no pages. Wired up to wiki_search in the next delivery
30
- * (Retrieval and Assembly API).
31
- */
32
- export declare function getProductContextForStrategy(_productId: string, _strategyId: string): Promise<ProductContextDoc[]>;
33
- /**
34
- * Persist the Claude Code session ID on the strategy row for --resume support.
35
- */
36
- export declare function updateStrategyClaudeSessionId(strategyId: string, claudeSessionId: string): Promise<void>;
37
- /**
38
- * The deployment profile snapshot stored on a product.
39
- *
40
- * Derived from the deployment_profiles record at the time the profile was linked.
41
- * Used to inject operating context into agent prompts without live lookups.
42
- */
43
- export interface DeploymentProfileSnapshot {
44
- name: string;
45
- inceptionPrompt: string | null;
46
- guidelines: string | null;
47
- protectedPaths?: string[] | null;
48
- }
49
- /**
50
- * Fetch the deployment profile snapshot for a product.
51
- *
52
- * Returns null if the product has no linked deployment profile or
53
- * if the snapshot has not been stored yet.
54
- */
55
- export declare function getProductDeploymentProfileSnapshot(productId: string): Promise<DeploymentProfileSnapshot | null>;
56
- /**
57
- * Update a strategy's status and/or workflow stage.
58
- * Used by the cascade engine to advance strategy stages.
59
- */
60
- export declare function updateStrategyStatus(strategyId: string, status: string, currentWorkflowStageId?: string | null, extraFields?: {
61
- reviewRequestedAt?: string | null;
62
- }): Promise<void>;
63
- /** Clear review_requested_at without changing strategy status or stage. */
64
- export declare function clearReviewRequestedAt(strategyId: string): Promise<void>;
65
- /**
66
- * A workflow stage with its optional agent directive.
67
- * Mirrors WorkflowStage fields plus the directive payload used by the directive executor.
68
- */
69
- export interface WorkflowStageWithDirective {
70
- id: string;
71
- name: string;
72
- description: string | null;
73
- sort_order: number;
74
- is_terminal?: boolean;
75
- is_agent_actionable?: boolean;
76
- meta_bucket?: 'backlog' | 'active' | 'done' | null;
77
- agentDirective: StageDirective | null;
78
- }
79
- /**
80
- * Workflow with stages that include agent directives.
81
- */
82
- export interface WorkflowWithDirectives {
83
- id: string;
84
- stages: WorkflowStageWithDirective[];
85
- }
86
- /**
87
- * Fetch the effective workflow for a strategy, including ordered stages.
88
- * Uses resolve_effective_workflow RPC to walk the assignment hierarchy.
89
- * Returns stages with agentDirective for use by the directive executor.
90
- */
91
- export declare function fetchStrategyWorkflow(strategyId: string): Promise<WorkflowWithDirectives>;
92
- /**
93
- * Fetch the effective workflow for a strategy with transitions included.
94
- * Used by the cascade engine for transition resolution.
95
- */
96
- export declare function fetchStrategyWorkflowWithTransitions(strategyId: string): Promise<Workflow>;
97
- //# sourceMappingURL=strategies.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"strategies.d.ts","sourceRoot":"","sources":["../../src/queries/strategies.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,cAAc,EAAE,QAAQ,EAAqC,MAAM,aAAa,CAAC;AAOxI;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAoB/F;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAQxF;AAED;;;;;GAKG;AACH,wBAAsB,4BAA4B,CAChD,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAE9B;AAED;;G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,0BAA0B,EAAE,CAAC;CACtC;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAgC/F;AAED;;;GAGG;AACH,wBAAsB,oCAAoC,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CA8ChG"}
@@ -1,136 +0,0 @@
1
- /**
2
- * Strategy-level queries for team execution.
3
- *
4
- * Fetches all deliveries and issues for a strategy so the team lead
5
- * can build a complete task DAG.
6
- */
7
- import { callApi, callApiValidated } from './shared.js';
8
- import { StrategyDeliveriesResponseSchema, StrategyIssuesResponseSchema, } from './schemas.js';
9
- /**
10
- * Fetch all deliveries for a strategy, ordered by priority rank.
11
- */
12
- export async function getStrategyDeliveries(strategyId) {
13
- const result = await callApiValidated('daemon_get_strategy_deliveries', StrategyDeliveriesResponseSchema, { strategyId });
14
- return result.deliveries.map((d) => ({
15
- id: d.id,
16
- name: d.name,
17
- description: d.description,
18
- priorityRank: d.priorityRank ?? 999,
19
- executionStatus: d.executionStatus,
20
- acceptanceCriteria: d.acceptanceCriteria,
21
- techContext: d.techContext,
22
- currentWorkflowStageId: d.currentWorkflowStageId ?? null,
23
- mergeCommitSha: d.mergeCommitSha ?? null,
24
- gitState: d.gitState ?? null,
25
- stageDescription: d.stageDescription ?? null,
26
- }));
27
- }
28
- /**
29
- * Fetch all issues across all deliveries for a strategy.
30
- */
31
- export async function getStrategyIssues(strategyId) {
32
- const result = await callApiValidated('daemon_get_strategy_issues', StrategyIssuesResponseSchema, { strategyId });
33
- return result.issues;
34
- }
35
- /**
36
- * Fetch wiki pages relevant to a strategy.
37
- *
38
- * Stub: returns no pages. Wired up to wiki_search in the next delivery
39
- * (Retrieval and Assembly API).
40
- */
41
- export async function getProductContextForStrategy(_productId, _strategyId) {
42
- return [];
43
- }
44
- /**
45
- * Persist the Claude Code session ID on the strategy row for --resume support.
46
- */
47
- export async function updateStrategyClaudeSessionId(strategyId, claudeSessionId) {
48
- await callApi('daemon_update_strategy_session_id', {
49
- strategyId,
50
- claudeSessionId,
51
- });
52
- }
53
- /**
54
- * Fetch the deployment profile snapshot for a product.
55
- *
56
- * Returns null if the product has no linked deployment profile or
57
- * if the snapshot has not been stored yet.
58
- */
59
- export async function getProductDeploymentProfileSnapshot(productId) {
60
- const result = await callApi('get_product_deployment_profile_snapshot', { productId });
61
- return result.snapshot ?? null;
62
- }
63
- /**
64
- * Update a strategy's status and/or workflow stage.
65
- * Used by the cascade engine to advance strategy stages.
66
- */
67
- export async function updateStrategyStatus(strategyId, status, currentWorkflowStageId, extraFields) {
68
- const fields = { status };
69
- if (currentWorkflowStageId !== undefined) {
70
- fields.currentWorkflowStageId = currentWorkflowStageId;
71
- }
72
- if (extraFields?.reviewRequestedAt !== undefined) {
73
- fields.reviewRequestedAt = extraFields.reviewRequestedAt;
74
- }
75
- await callApi('daemon_update_strategy_status', {
76
- strategyId,
77
- fields,
78
- });
79
- }
80
- /** Clear review_requested_at without changing strategy status or stage. */
81
- export async function clearReviewRequestedAt(strategyId) {
82
- await callApi('daemon_update_strategy_status', {
83
- strategyId,
84
- fields: { reviewRequestedAt: null },
85
- });
86
- }
87
- /**
88
- * Fetch the effective workflow for a strategy, including ordered stages.
89
- * Uses resolve_effective_workflow RPC to walk the assignment hierarchy.
90
- * Returns stages with agentDirective for use by the directive executor.
91
- */
92
- export async function fetchStrategyWorkflow(strategyId) {
93
- const result = await callApi('daemon_get_strategy_workflow', { strategyId });
94
- return {
95
- id: result.workflow.id,
96
- stages: result.workflow.stages.map((s) => ({
97
- id: s.id,
98
- name: s.name,
99
- description: s.description,
100
- sort_order: s.sortOrder,
101
- is_terminal: s.isTerminal,
102
- is_agent_actionable: s.isAgentActionable,
103
- meta_bucket: s.metaBucket ?? null,
104
- agentDirective: s.agentDirective ?? null,
105
- })),
106
- };
107
- }
108
- /**
109
- * Fetch the effective workflow for a strategy with transitions included.
110
- * Used by the cascade engine for transition resolution.
111
- */
112
- export async function fetchStrategyWorkflowWithTransitions(strategyId) {
113
- const result = await callApi('daemon_get_strategy_workflow', { strategyId, includeTransitions: true });
114
- return {
115
- id: result.workflow.id,
116
- stages: result.workflow.stages.map((s) => ({
117
- id: s.id,
118
- name: s.name,
119
- description: s.description,
120
- sort_order: s.sortOrder,
121
- is_terminal: s.isTerminal,
122
- is_agent_actionable: s.isAgentActionable,
123
- meta_bucket: s.metaBucket ?? undefined,
124
- })),
125
- transitions: (result.workflow.transitions ?? []).map((t) => ({
126
- id: t.id,
127
- workflow_id: t.workflowId,
128
- from_stage_id: t.fromStageId,
129
- to_stage_id: t.toStageId,
130
- name: t.name,
131
- is_automatic: t.isAutomatic,
132
- sort_order: t.sortOrder,
133
- })),
134
- };
135
- }
136
- //# sourceMappingURL=strategies.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"strategies.js","sourceRoot":"","sources":["../../src/queries/strategies.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EACL,gCAAgC,EAChC,4BAA4B,GAC7B,MAAM,cAAc,CAAC;AAatB;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,UAAkB;IAC5D,MAAM,MAAM,GAAG,MAAM,gBAAgB,CACnC,gCAAgC,EAChC,gCAAgC,EAChC,EAAE,UAAU,EAAE,CACf,CAAC;IAEF,OAAO,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACnC,EAAE,EAAE,CAAC,CAAC,EAAE;QACR,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,YAAY,EAAE,CAAC,CAAC,YAAY,IAAI,GAAG;QACnC,eAAe,EAAE,CAAC,CAAC,eAAe;QAClC,kBAAkB,EAAE,CAAC,CAAC,kBAAkB;QACxC,WAAW,EAA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UAAU,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAC;IAE7E,OAAO;QACL,EAAE,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE;QACtB,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAiB,EAAE,CAAC,CAAC;YACxD,EAAE,EAAE,CAAC,CAAC,EAAE;YACR,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,WAAW,EAAE,CAAC,CAAC,WAAW;YAC1B,UAAU,EAAE,CAAC,CAAC,SAAS;YACvB,WAAW,EAAE,CAAC,CAAC,UAAU;YACzB,mBAAmB,EAAE,CAAC,CAAC,iBAAiB;YACxC,WAAW,EAAG,CAAC,CAAC,UAAmD,IAAI,SAAS;SACjF,CAAC,CAAC;QACH,WAAW,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAsB,EAAE,CAAC,CAAC;YAC/E,EAAE,EAAE,CAAC,CAAC,EAAE;YACR,WAAW,EAAE,CAAC,CAAC,UAAU;YACzB,aAAa,EAAE,CAAC,CAAC,WAAW;YAC5B,WAAW,EAAE,CAAC,CAAC,SAAS;YACxB,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,YAAY,EAAE,CAAC,CAAC,WAAW;YAC3B,UAAU,EAAE,CAAC,CAAC,SAAS;SACxB,CAAC,CAAC;KACJ,CAAC;AACJ,CAAC"}
@@ -1,32 +0,0 @@
1
- /**
2
- * Review spawner.
3
- *
4
- * First-class review handling in the poll loop. Detects strategies
5
- * in `in_review` status and spawns a review team directly -- no
6
- * directive executor, no pending spawn directives, no special seeding.
7
- *
8
- * The review team examines diffs against acceptance criteria and creates
9
- * issues on specific deliveries where it finds gaps. When the team exits,
10
- * the exit handler moves the strategy back to verify. The existing
11
- * checkVerifyDeliveriesForOpenIssues poll handles delivery-level routing
12
- * to iterating.
13
- */
14
- import type { DaemonConfig, AgentRole } from './types.js';
15
- import './assembly-resolvers.js';
16
- /**
17
- * Consume a pending review message for a strategy.
18
- * Returns the message and removes it from the map.
19
- */
20
- export declare function consumePendingReviewMessage(strategyId: string): string | undefined;
21
- /**
22
- * Check if a strategy has a pending review message.
23
- */
24
- export declare function hasPendingReview(strategyId: string): boolean;
25
- /**
26
- * Detect strategies in `in_review` status and spawn review teams.
27
- *
28
- * Called from the daemon poll loop. For each in_review strategy without
29
- * an active team, assembles the review prompt and spawns a review team.
30
- */
31
- export declare function processReviewStrategies(config: DaemonConfig, roles: ReadonlyMap<string, AgentRole>): Promise<void>;
32
- //# sourceMappingURL=review-spawner.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"review-spawner.d.ts","sourceRoot":"","sources":["../src/review-spawner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAM1D,OAAO,yBAAyB,CAAC;AAsFjC;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMlF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,GACpC,OAAO,CAAC,IAAI,CAAC,CAqDf"}