@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: { ...view.cards, [id]: { ...current, condition: BoardCondition.Finished } },
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 || isChildRun || terminal.condition === 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 ? {} : { condition: BoardCondition.Active }),
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 {
@@ -108,4 +108,4 @@ export function resolveWakeVersion(options = {}) {
108
108
  return `g${headHash.slice(0, 7)}`;
109
109
  return '0.1.0-dev';
110
110
  }
111
- export const wakeVersion = "g2b6df21";
111
+ export const wakeVersion = "gc813fba";
@@ -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(first, second);
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(first, second) {
37
- const allowed = first === undefined || first === '--rebuild-projections';
38
- if (!allowed || second !== undefined)
39
- throw new Error('validate-state accepts only --rebuild-projections');
40
- return { kind: 'validate-state', rebuildProjections: first === '--rebuild-projections' };
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atolis-hq/wake",
3
- "version": "0.3.49",
3
+ "version": "0.3.51",
4
4
  "description": "Local autonomous agent control plane for software development",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {