@atolis-hq/wake 0.3.49 → 0.3.51
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.
|
@@ -78,7 +78,10 @@ function projectWork(view, event, occurredAt) {
|
|
|
78
78
|
event.eventType === WorkEventType.ItemCancelled) {
|
|
79
79
|
return {
|
|
80
80
|
...view,
|
|
81
|
-
cards: {
|
|
81
|
+
cards: {
|
|
82
|
+
...view.cards,
|
|
83
|
+
[id]: { ...withoutAwaitingApproval(current), condition: BoardCondition.Finished },
|
|
84
|
+
},
|
|
82
85
|
};
|
|
83
86
|
}
|
|
84
87
|
// Deletion is a purge, not a lifecycle outcome — the card must disappear
|
|
@@ -265,7 +268,10 @@ function projectRunTerminal(view, event, workId, card) {
|
|
|
265
268
|
...withoutLegacyActiveRun(card),
|
|
266
269
|
activeRuns: withoutActiveRun(activeRuns, event.stream.id),
|
|
267
270
|
...(terminal === undefined ? {} : { lastRunOutcome: terminal.lastRunOutcome }),
|
|
268
|
-
...(terminal === undefined ||
|
|
271
|
+
...(terminal === undefined ||
|
|
272
|
+
isChildRun ||
|
|
273
|
+
card.condition === BoardCondition.Finished ||
|
|
274
|
+
terminal.condition === undefined
|
|
269
275
|
? {}
|
|
270
276
|
: { condition: terminal.condition }),
|
|
271
277
|
totalDurationMs: card.totalDurationMs + runDurationMs,
|
|
@@ -295,7 +301,7 @@ function projectRunStarted(view, event) {
|
|
|
295
301
|
? withoutLegacyActiveRun(card)
|
|
296
302
|
: withoutLegacyActiveRun(withoutLastRunOutcome(withoutAwaitingApproval(card)))),
|
|
297
303
|
runCount: card.runCount + 1,
|
|
298
|
-
...(isChildRun ? {
|
|
304
|
+
...(shouldSetCardActive(card, isChildRun) ? { condition: BoardCondition.Active } : {}),
|
|
299
305
|
lastRunAt: event.payload.startedAt,
|
|
300
306
|
activeRuns: {
|
|
301
307
|
...activeRuns,
|
|
@@ -311,6 +317,9 @@ function projectRunStarted(view, event) {
|
|
|
311
317
|
},
|
|
312
318
|
};
|
|
313
319
|
}
|
|
320
|
+
function shouldSetCardActive(card, isChildRun) {
|
|
321
|
+
return !isChildRun && card.condition !== BoardCondition.Finished;
|
|
322
|
+
}
|
|
314
323
|
function projectRunnerResult(view, workId, card, metadata) {
|
|
315
324
|
const usage = agentTokenUsage(metadata);
|
|
316
325
|
return {
|
|
@@ -13,7 +13,7 @@ export function parseWakeCommand(arguments_) {
|
|
|
13
13
|
workItemId: requiredArgument(second, 'correlate work item'),
|
|
14
14
|
};
|
|
15
15
|
case 'validate-state':
|
|
16
|
-
return parseValidateState(
|
|
16
|
+
return parseValidateState(arguments_.slice(1));
|
|
17
17
|
case 'api':
|
|
18
18
|
case 'ui':
|
|
19
19
|
return { kind: command, ...parseHostOptions(arguments_.slice(1)) };
|
|
@@ -33,11 +33,27 @@ export function parseWakeCommand(arguments_) {
|
|
|
33
33
|
throw new Error(`Unknown wake command: ${command ?? ''}`);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
function parseValidateState(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
function parseValidateState(arguments_) {
|
|
37
|
+
let rebuildProjections = false;
|
|
38
|
+
let wakeRoot;
|
|
39
|
+
for (let index = 0; index < arguments_.length; index += 1) {
|
|
40
|
+
const argument = arguments_[index];
|
|
41
|
+
if (argument === '--rebuild-projections' && !rebuildProjections) {
|
|
42
|
+
rebuildProjections = true;
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (argument === '--wake-root') {
|
|
46
|
+
wakeRoot = requiredArgument(arguments_[index + 1], 'value for --wake-root');
|
|
47
|
+
index += 1;
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
throw new Error('validate-state accepts only --rebuild-projections and --wake-root <path>');
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
kind: 'validate-state',
|
|
54
|
+
rebuildProjections,
|
|
55
|
+
...(wakeRoot === undefined ? {} : { wakeRoot }),
|
|
56
|
+
};
|
|
41
57
|
}
|
|
42
58
|
function parseResidentCommand(kind, arguments_) {
|
|
43
59
|
const options = parseHostOptions(arguments_, false);
|