@markjaquith/agency 3.10.0 → 3.10.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markjaquith/agency",
3
- "version": "3.10.0",
3
+ "version": "3.10.2",
4
4
  "description": "Manage agentic work across repositories with durable workbases",
5
5
  "keywords": [
6
6
  "agents",
@@ -161,6 +161,32 @@ const shellCommand = (argv: readonly string[]) =>
161
161
  )
162
162
  .join(" ")
163
163
  const available = (action: ActAction) => !action.blockedReason
164
+ const checkoutState = (inspection: {
165
+ readonly checkouts: readonly {
166
+ readonly exists: boolean
167
+ readonly path: string
168
+ readonly registeredPath: string | null
169
+ readonly dirty: boolean | null
170
+ }[]
171
+ readonly conflicts: readonly {
172
+ readonly kind: string
173
+ readonly message: string
174
+ }[]
175
+ }): ActCheckoutState => ({
176
+ paths: inspection.checkouts.flatMap((checkout) =>
177
+ checkout.exists
178
+ ? [checkout.path]
179
+ : checkout.registeredPath
180
+ ? [checkout.registeredPath]
181
+ : [],
182
+ ),
183
+ conflicts: inspection.conflicts
184
+ .filter((conflict) => conflict.kind !== "stale-registration")
185
+ .map((conflict) => conflict.message),
186
+ dirty: inspection.checkouts.some(
187
+ (checkout) => checkout.exists && checkout.dirty !== false,
188
+ ),
189
+ })
164
190
  const entitySummary = (node: ActEntity) => ({
165
191
  kind: node.kind,
166
192
  id: node.id,
@@ -329,32 +355,31 @@ const actStep = (
329
355
  include: ["workspace"],
330
356
  })
331
357
  const checkoutStates = new Map<string, ActCheckoutState>()
332
- const materialized = graph.nodes.some(
333
- (node) => node.kind === "execution-unit" && node.workspace?.materialized,
334
- )
335
- for (const inspection of materialized
336
- ? yield* worktrees.list(root, { materializedOnly: true })
337
- : []) {
358
+ for (const node of graph.nodes) {
359
+ if (node.kind !== "execution-unit" || !node.workspace?.materialized)
360
+ continue
338
361
  const id =
339
- inspection.owner.kind === "phase"
340
- ? `phase:${inspection.owner.taskId}/${inspection.owner.phaseId}`
341
- : `task:${inspection.owner.taskId}`
362
+ "phaseId" in node.data
363
+ ? `phase:${node.data.taskId}/${node.data.phaseId}`
364
+ : `task:${node.data.taskId}`
342
365
  checkoutStates.set(id, {
343
- paths: inspection.checkouts.flatMap((checkout) =>
344
- checkout.exists
345
- ? [checkout.path]
346
- : checkout.registeredPath
347
- ? [checkout.registeredPath]
348
- : [],
349
- ),
350
- conflicts: inspection.conflicts
351
- .filter((conflict) => conflict.kind !== "stale-registration")
352
- .map((conflict) => conflict.message),
353
- dirty: inspection.checkouts.some(
354
- (checkout) => checkout.exists && checkout.dirty !== false,
355
- ),
366
+ paths: [node.workspace.checkoutPath],
367
+ conflicts: [],
368
+ dirty: false,
356
369
  })
357
370
  }
371
+ if (options.json && checkoutStates.size > 0) {
372
+ checkoutStates.clear()
373
+ for (const inspection of yield* worktrees.list(root, {
374
+ materializedOnly: true,
375
+ })) {
376
+ const id =
377
+ inspection.owner.kind === "phase"
378
+ ? `phase:${inspection.owner.taskId}/${inspection.owner.phaseId}`
379
+ : `task:${inspection.owner.taskId}`
380
+ checkoutStates.set(id, checkoutState(inspection))
381
+ }
382
+ }
358
383
  const nodes = graph.nodes.filter(
359
384
  (node): node is ActEntity =>
360
385
  node.kind === "epic" || node.kind === "task" || node.kind === "phase",
@@ -580,7 +605,7 @@ const actStep = (
580
605
  state.item = selected.id
581
606
  session.activateTab("workstream")
582
607
  }
583
- const actions = selected ? catalog.get(selected.id)! : globals
608
+ let actions = selected ? catalog.get(selected.id)! : globals
584
609
  if (!actionId) {
585
610
  state.view = "item-menu"
586
611
  const menuActions = actions.filter(
@@ -595,6 +620,24 @@ const actStep = (
595
620
  )
596
621
  state.view = "flow"
597
622
  }
623
+ if (
624
+ selected &&
625
+ selected.kind !== "epic" &&
626
+ actionId === "worktree-remove" &&
627
+ !options.json
628
+ ) {
629
+ const inspection = yield* worktrees.inspect(
630
+ selected.kind === "phase"
631
+ ? selected.key.slice(0, selected.key.lastIndexOf("/"))
632
+ : selected.key,
633
+ selected.kind === "phase"
634
+ ? selected.key.slice(selected.key.lastIndexOf("/") + 1)
635
+ : undefined,
636
+ root,
637
+ )
638
+ checkoutStates.set(selected.id, checkoutState(inspection))
639
+ actions = actActions(graph.nodes, nativeOptions, runWork, selected)
640
+ }
598
641
  const action = actions.find((action) => action.id === actionId)
599
642
  if (!action || action.blockedReason)
600
643
  return yield* Effect.fail(
@@ -81,6 +81,8 @@ var createReadlineEditing = (getInput, onInput) => {
81
81
  };
82
82
  var InteractiveTextPrompt = (props) => {
83
83
  let input;
84
+ const dimensions = useTerminalDimensions();
85
+ const inputWidth = () => dimensions().width + 1;
84
86
  const editing = createReadlineEditing(() => input);
85
87
  useKeyboard((key) => {
86
88
  if (key.propagationStopped)
@@ -110,6 +112,7 @@ var InteractiveTextPrompt = (props) => {
110
112
  _$setProp(_el$, "flexDirection", "column");
111
113
  _$setProp(_el$, "width", "100%");
112
114
  _$setProp(_el$, "height", "100%");
115
+ _$setProp(_el$, "overflow", "hidden");
113
116
  _$insert(_el$, (() => {
114
117
  var _c$ = _$memo(() => !!(props.fullScreen && !props.embedded));
115
118
  return () => _c$() && [(() => {
@@ -152,17 +155,18 @@ var InteractiveTextPrompt = (props) => {
152
155
  _$setProp(_el$4, "flexShrink", 0);
153
156
  _$insert(_el$4, () => props.embedded ? "enter submit | shift-enter newline | esc clear/back" : "enter submit | shift-enter newline | esc cancel");
154
157
  _$effect((_p$) => {
155
- var _v$ = macchiato.base, _v$2 = macchiato.blue, _v$3 = props.fullScreen ? 0 : 2, _v$4 = props.fullScreen ? 1 : 0, _v$5 = macchiato.mantle, _v$6 = macchiato.surface0, _v$7 = macchiato.text, _v$8 = macchiato.text, _v$9 = macchiato.blue, _v$0 = macchiato.overlay1;
158
+ var _v$ = macchiato.base, _v$2 = macchiato.blue, _v$3 = inputWidth(), _v$4 = props.fullScreen ? 0 : 2, _v$5 = props.fullScreen ? 1 : 0, _v$6 = macchiato.mantle, _v$7 = macchiato.surface0, _v$8 = macchiato.text, _v$9 = macchiato.text, _v$0 = macchiato.blue, _v$1 = macchiato.overlay1;
156
159
  _v$ !== _p$.e && (_p$.e = _$setProp(_el$, "backgroundColor", _v$, _p$.e));
157
160
  _v$2 !== _p$.t && (_p$.t = _$setProp(_el$2, "fg", _v$2, _p$.t));
158
- _v$3 !== _p$.a && (_p$.a = _$setProp(_el$3, "height", _v$3, _p$.a));
159
- _v$4 !== _p$.o && (_p$.o = _$setProp(_el$3, "flexGrow", _v$4, _p$.o));
160
- _v$5 !== _p$.i && (_p$.i = _$setProp(_el$3, "backgroundColor", _v$5, _p$.i));
161
- _v$6 !== _p$.n && (_p$.n = _$setProp(_el$3, "focusedBackgroundColor", _v$6, _p$.n));
162
- _v$7 !== _p$.s && (_p$.s = _$setProp(_el$3, "textColor", _v$7, _p$.s));
163
- _v$8 !== _p$.h && (_p$.h = _$setProp(_el$3, "focusedTextColor", _v$8, _p$.h));
164
- _v$9 !== _p$.r && (_p$.r = _$setProp(_el$3, "cursorColor", _v$9, _p$.r));
165
- _v$0 !== _p$.d && (_p$.d = _$setProp(_el$4, "fg", _v$0, _p$.d));
161
+ _v$3 !== _p$.a && (_p$.a = _$setProp(_el$3, "width", _v$3, _p$.a));
162
+ _v$4 !== _p$.o && (_p$.o = _$setProp(_el$3, "height", _v$4, _p$.o));
163
+ _v$5 !== _p$.i && (_p$.i = _$setProp(_el$3, "flexGrow", _v$5, _p$.i));
164
+ _v$6 !== _p$.n && (_p$.n = _$setProp(_el$3, "backgroundColor", _v$6, _p$.n));
165
+ _v$7 !== _p$.s && (_p$.s = _$setProp(_el$3, "focusedBackgroundColor", _v$7, _p$.s));
166
+ _v$8 !== _p$.h && (_p$.h = _$setProp(_el$3, "textColor", _v$8, _p$.h));
167
+ _v$9 !== _p$.r && (_p$.r = _$setProp(_el$3, "focusedTextColor", _v$9, _p$.r));
168
+ _v$0 !== _p$.d && (_p$.d = _$setProp(_el$3, "cursorColor", _v$0, _p$.d));
169
+ _v$1 !== _p$.l && (_p$.l = _$setProp(_el$4, "fg", _v$1, _p$.l));
166
170
  return _p$;
167
171
  }, {
168
172
  e: undefined,
@@ -174,7 +178,8 @@ var InteractiveTextPrompt = (props) => {
174
178
  s: undefined,
175
179
  h: undefined,
176
180
  r: undefined,
177
- d: undefined
181
+ d: undefined,
182
+ l: undefined
178
183
  });
179
184
  return _el$;
180
185
  })();
@@ -497,15 +502,15 @@ var InteractiveSelectPrompt = (props) => {
497
502
  })()
498
503
  }), null);
499
504
  _$effect((_p$) => {
500
- var _v$24 = index === selected() ? macchiato.text : macchiato.subtext0, _v$25 = index === selected() ? macchiato.surface1 : background(), _v$26 = {
505
+ var _v$25 = index === selected() ? macchiato.text : macchiato.subtext0, _v$26 = index === selected() ? macchiato.surface1 : background(), _v$27 = {
501
506
  fg: index === selected() ? macchiato.blue : undefined
502
- }, _v$27 = {
507
+ }, _v$28 = {
503
508
  fg: macchiato.overlay1
504
509
  };
505
- _v$24 !== _p$.e && (_p$.e = _$setProp(_el$26, "fg", _v$24, _p$.e));
506
- _v$25 !== _p$.t && (_p$.t = _$setProp(_el$26, "bg", _v$25, _p$.t));
507
- _v$26 !== _p$.a && (_p$.a = _$setProp(_el$27, "style", _v$26, _p$.a));
508
- _v$27 !== _p$.o && (_p$.o = _$setProp(_el$28, "style", _v$27, _p$.o));
510
+ _v$25 !== _p$.e && (_p$.e = _$setProp(_el$26, "fg", _v$25, _p$.e));
511
+ _v$26 !== _p$.t && (_p$.t = _$setProp(_el$26, "bg", _v$26, _p$.t));
512
+ _v$27 !== _p$.a && (_p$.a = _$setProp(_el$27, "style", _v$27, _p$.a));
513
+ _v$28 !== _p$.o && (_p$.o = _$setProp(_el$28, "style", _v$28, _p$.o));
509
514
  return _p$;
510
515
  }, {
511
516
  e: undefined,
@@ -517,9 +522,9 @@ var InteractiveSelectPrompt = (props) => {
517
522
  })();
518
523
  })());
519
524
  _$effect((_p$) => {
520
- var _v$22 = rowHeight(), _v$23 = index === selected() ? macchiato.surface1 : background();
521
- _v$22 !== _p$.e && (_p$.e = _$setProp(_el$19, "height", _v$22, _p$.e));
522
- _v$23 !== _p$.t && (_p$.t = _$setProp(_el$19, "backgroundColor", _v$23, _p$.t));
525
+ var _v$23 = rowHeight(), _v$24 = index === selected() ? macchiato.surface1 : background();
526
+ _v$23 !== _p$.e && (_p$.e = _$setProp(_el$19, "height", _v$23, _p$.e));
527
+ _v$24 !== _p$.t && (_p$.t = _$setProp(_el$19, "backgroundColor", _v$24, _p$.t));
523
528
  return _p$;
524
529
  }, {
525
530
  e: undefined,
@@ -529,20 +534,20 @@ var InteractiveSelectPrompt = (props) => {
529
534
  })()
530
535
  }));
531
536
  _$effect((_p$) => {
532
- var _v$1 = background(), _v$10 = brandHeight(), _v$11 = macchiato.blue, _v$12 = macchiato.blue, _v$13 = props.active === false ? macchiato.mantle : props.embedded ? macchiato.surface1 : macchiato.surface0, _v$14 = props.active !== false, _v$15 = macchiato.overlay0, _v$16 = macchiato.mantle, _v$17 = props.embedded ? macchiato.surface1 : macchiato.surface0, _v$18 = macchiato.text, _v$19 = macchiato.text, _v$20 = macchiato.blue, _v$21 = gapHeight();
533
- _v$1 !== _p$.e && (_p$.e = _$setProp(_el$8, "backgroundColor", _v$1, _p$.e));
534
- _v$10 !== _p$.t && (_p$.t = _$setProp(_el$9, "height", _v$10, _p$.t));
535
- _v$11 !== _p$.a && (_p$.a = _$setProp(_el$0, "fg", _v$11, _p$.a));
536
- _v$12 !== _p$.o && (_p$.o = _$setProp(_el$10, "fg", _v$12, _p$.o));
537
- _v$13 !== _p$.i && (_p$.i = _$setProp(_el$12, "backgroundColor", _v$13, _p$.i));
538
- _v$14 !== _p$.n && (_p$.n = _$setProp(_el$13, "focused", _v$14, _p$.n));
539
- _v$15 !== _p$.s && (_p$.s = _$setProp(_el$13, "placeholderColor", _v$15, _p$.s));
540
- _v$16 !== _p$.h && (_p$.h = _$setProp(_el$13, "backgroundColor", _v$16, _p$.h));
541
- _v$17 !== _p$.r && (_p$.r = _$setProp(_el$13, "focusedBackgroundColor", _v$17, _p$.r));
542
- _v$18 !== _p$.d && (_p$.d = _$setProp(_el$13, "textColor", _v$18, _p$.d));
543
- _v$19 !== _p$.l && (_p$.l = _$setProp(_el$13, "focusedTextColor", _v$19, _p$.l));
544
- _v$20 !== _p$.u && (_p$.u = _$setProp(_el$13, "cursorColor", _v$20, _p$.u));
545
- _v$21 !== _p$.c && (_p$.c = _$setProp(_el$14, "height", _v$21, _p$.c));
537
+ var _v$10 = background(), _v$11 = brandHeight(), _v$12 = macchiato.blue, _v$13 = macchiato.blue, _v$14 = props.active === false ? macchiato.mantle : props.embedded ? macchiato.surface1 : macchiato.surface0, _v$15 = props.active !== false, _v$16 = macchiato.overlay0, _v$17 = macchiato.mantle, _v$18 = props.embedded ? macchiato.surface1 : macchiato.surface0, _v$19 = macchiato.text, _v$20 = macchiato.text, _v$21 = macchiato.blue, _v$22 = gapHeight();
538
+ _v$10 !== _p$.e && (_p$.e = _$setProp(_el$8, "backgroundColor", _v$10, _p$.e));
539
+ _v$11 !== _p$.t && (_p$.t = _$setProp(_el$9, "height", _v$11, _p$.t));
540
+ _v$12 !== _p$.a && (_p$.a = _$setProp(_el$0, "fg", _v$12, _p$.a));
541
+ _v$13 !== _p$.o && (_p$.o = _$setProp(_el$10, "fg", _v$13, _p$.o));
542
+ _v$14 !== _p$.i && (_p$.i = _$setProp(_el$12, "backgroundColor", _v$14, _p$.i));
543
+ _v$15 !== _p$.n && (_p$.n = _$setProp(_el$13, "focused", _v$15, _p$.n));
544
+ _v$16 !== _p$.s && (_p$.s = _$setProp(_el$13, "placeholderColor", _v$16, _p$.s));
545
+ _v$17 !== _p$.h && (_p$.h = _$setProp(_el$13, "backgroundColor", _v$17, _p$.h));
546
+ _v$18 !== _p$.r && (_p$.r = _$setProp(_el$13, "focusedBackgroundColor", _v$18, _p$.r));
547
+ _v$19 !== _p$.d && (_p$.d = _$setProp(_el$13, "textColor", _v$19, _p$.d));
548
+ _v$20 !== _p$.l && (_p$.l = _$setProp(_el$13, "focusedTextColor", _v$20, _p$.l));
549
+ _v$21 !== _p$.u && (_p$.u = _$setProp(_el$13, "cursorColor", _v$21, _p$.u));
550
+ _v$22 !== _p$.c && (_p$.c = _$setProp(_el$14, "height", _v$22, _p$.c));
546
551
  return _p$;
547
552
  }, {
548
553
  e: undefined,
@@ -605,12 +610,12 @@ var InteractiveTabbedPrompt = (props) => {
605
610
  _$insert(_el$38, () => index() === active() ? "\u258E" : " ");
606
611
  _$insert(_el$37, () => ` ${tab.label} `, null);
607
612
  _$effect((_p$) => {
608
- var _v$30 = index() === active() ? macchiato.text : macchiato.overlay1, _v$31 = index() === active() ? macchiato.base : macchiato.surface0, _v$32 = {
613
+ var _v$31 = index() === active() ? macchiato.text : macchiato.overlay1, _v$32 = index() === active() ? macchiato.base : macchiato.surface0, _v$33 = {
609
614
  fg: macchiato.blue
610
615
  };
611
- _v$30 !== _p$.e && (_p$.e = _$setProp(_el$37, "fg", _v$30, _p$.e));
612
- _v$31 !== _p$.t && (_p$.t = _$setProp(_el$37, "bg", _v$31, _p$.t));
613
- _v$32 !== _p$.a && (_p$.a = _$setProp(_el$38, "style", _v$32, _p$.a));
616
+ _v$31 !== _p$.e && (_p$.e = _$setProp(_el$37, "fg", _v$31, _p$.e));
617
+ _v$32 !== _p$.t && (_p$.t = _$setProp(_el$37, "bg", _v$32, _p$.t));
618
+ _v$33 !== _p$.a && (_p$.a = _$setProp(_el$38, "style", _v$33, _p$.a));
614
619
  return _p$;
615
620
  }, {
616
621
  e: undefined,
@@ -702,9 +707,9 @@ var InteractiveTabbedPrompt = (props) => {
702
707
  });
703
708
  })(), null);
704
709
  _$effect((_p$) => {
705
- var _v$28 = macchiato.surface0, _v$29 = macchiato.base;
706
- _v$28 !== _p$.e && (_p$.e = _$setProp(_el$30, "backgroundColor", _v$28, _p$.e));
707
- _v$29 !== _p$.t && (_p$.t = _$setProp(_el$35, "backgroundColor", _v$29, _p$.t));
710
+ var _v$29 = macchiato.surface0, _v$30 = macchiato.base;
711
+ _v$29 !== _p$.e && (_p$.e = _$setProp(_el$30, "backgroundColor", _v$29, _p$.e));
712
+ _v$30 !== _p$.t && (_p$.t = _$setProp(_el$35, "backgroundColor", _v$30, _p$.t));
708
713
  return _p$;
709
714
  }, {
710
715
  e: undefined,
@@ -769,9 +774,9 @@ var createInteractiveSession = async (onCancel = () => {}, initialTabs = []) =>
769
774
  _$setProp(_el$40, "height", "100%");
770
775
  _$insert(_el$41, () => props.prompt);
771
776
  _$effect((_p$) => {
772
- var _v$33 = macchiato.base, _v$34 = macchiato.text;
773
- _v$33 !== _p$.e && (_p$.e = _$setProp(_el$40, "backgroundColor", _v$33, _p$.e));
774
- _v$34 !== _p$.t && (_p$.t = _$setProp(_el$41, "fg", _v$34, _p$.t));
777
+ var _v$34 = macchiato.base, _v$35 = macchiato.text;
778
+ _v$34 !== _p$.e && (_p$.e = _$setProp(_el$40, "backgroundColor", _v$34, _p$.e));
779
+ _v$35 !== _p$.t && (_p$.t = _$setProp(_el$41, "fg", _v$35, _p$.t));
775
780
  return _p$;
776
781
  }, {
777
782
  e: undefined,