llm-party-cli 0.10.1 → 0.11.0

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 (2) hide show
  1. package/dist/index.js +233 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -39882,6 +39882,22 @@ class AgentQueueManager {
39882
39882
  if (queue)
39883
39883
  queue.controller = controller;
39884
39884
  }
39885
+ cancelled = new Set;
39886
+ abortAgent(agentName) {
39887
+ const queue = this.queues.get(agentName);
39888
+ if (!queue)
39889
+ return;
39890
+ this.cancelled.add(agentName);
39891
+ queue.controller?.abort();
39892
+ queue.pending = [];
39893
+ queue.processing = false;
39894
+ }
39895
+ wasCancelled(agentName) {
39896
+ return this.cancelled.has(agentName);
39897
+ }
39898
+ clearCancelled(agentName) {
39899
+ this.cancelled.delete(agentName);
39900
+ }
39885
39901
  abortAll() {
39886
39902
  for (const q2 of this.queues.values()) {
39887
39903
  q2.controller?.abort();
@@ -40041,6 +40057,7 @@ class Orchestrator {
40041
40057
  const agent = this.agents.get(agentName);
40042
40058
  if (!agent)
40043
40059
  return;
40060
+ this.queueManager.clearCancelled(agentName);
40044
40061
  this.queueManager.setProcessing(agentName, true);
40045
40062
  this.onActivity(agentName, "thinking");
40046
40063
  const historyMaxId = this.messageId;
@@ -40055,6 +40072,12 @@ class Orchestrator {
40055
40072
  }
40056
40073
  const inputMessages = this.buildInputForAgent(agentName, unseen);
40057
40074
  const responseText = await this.streamWithTimeout(agentName, agent, inputMessages, this.timeoutFor(agentName));
40075
+ if (this.queueManager.wasCancelled(agentName)) {
40076
+ this.lastSeenByAgent.set(agentName, historyMaxId);
40077
+ this.queueManager.setProcessing(agentName, false);
40078
+ this.onActivity(agentName, "idle");
40079
+ return;
40080
+ }
40058
40081
  const response = {
40059
40082
  id: ++this.messageId,
40060
40083
  from: agentName.toUpperCase(),
@@ -40254,6 +40277,12 @@ class Orchestrator {
40254
40277
  console.error("[manifest] load failed (agents start fresh):", err);
40255
40278
  }
40256
40279
  }
40280
+ cancelAgents(names) {
40281
+ for (const name of names) {
40282
+ this.queueManager.abortAgent(name);
40283
+ this.onActivity(name, "idle");
40284
+ }
40285
+ }
40257
40286
  async abortAll() {
40258
40287
  this.queueManager.abortAll();
40259
40288
  await this.saveManifest();
@@ -42687,6 +42716,178 @@ function InfoPanel(props) {
42687
42716
  })();
42688
42717
  }
42689
42718
 
42719
+ // src/ui/CancelPanel.tsx
42720
+ function CancelPanel(props) {
42721
+ const items = () => props.activeAgents;
42722
+ const [cursor, setCursor] = createSignal(0);
42723
+ const [selected, setSelected] = createSignal(new Set);
42724
+ createEffect(() => {
42725
+ if (props.activeAgents.length === 0) {
42726
+ props.onClose();
42727
+ }
42728
+ });
42729
+ useKeyboard((key) => {
42730
+ if (key.name === "escape") {
42731
+ props.onClose();
42732
+ return;
42733
+ }
42734
+ if (key.name === "return") {
42735
+ const sel = selected();
42736
+ if (sel.size === 0) {
42737
+ props.onClose();
42738
+ return;
42739
+ }
42740
+ const names = [...sel];
42741
+ props.onCancel(names);
42742
+ return;
42743
+ }
42744
+ if (key.name === "up") {
42745
+ setCursor((c) => Math.max(0, c - 1));
42746
+ return;
42747
+ }
42748
+ if (key.name === "down") {
42749
+ setCursor((c) => Math.min(items().length - 1, c + 1));
42750
+ return;
42751
+ }
42752
+ if (key.name === "space" || key.sequence === " ") {
42753
+ const item = items()[cursor()];
42754
+ if (!item)
42755
+ return;
42756
+ setSelected((prev) => {
42757
+ const next = new Set(prev);
42758
+ if (next.has(item)) {
42759
+ next.delete(item);
42760
+ } else {
42761
+ next.add(item);
42762
+ }
42763
+ return next;
42764
+ });
42765
+ return;
42766
+ }
42767
+ });
42768
+ const totalW = 40;
42769
+ return (() => {
42770
+ var _el$ = createElement("box"), _el$2 = createElement("box"), _el$3 = createElement("box"), _el$4 = createElement("text"), _el$5 = createElement("strong"), _el$7 = createElement("text"), _el$9 = createElement("text"), _el$1 = createElement("text"), _el$10 = createElement("span"), _el$12 = createElement("span"), _el$14 = createElement("span"), _el$16 = createElement("span"), _el$18 = createElement("span"), _el$20 = createElement("span");
42771
+ insertNode(_el$, _el$2);
42772
+ setProp(_el$, "position", "absolute");
42773
+ setProp(_el$, "width", "100%");
42774
+ setProp(_el$, "height", "100%");
42775
+ setProp(_el$, "justifyContent", "center");
42776
+ setProp(_el$, "alignItems", "center");
42777
+ setProp(_el$, "zIndex", 10);
42778
+ insertNode(_el$2, _el$3);
42779
+ setProp(_el$2, "border", true);
42780
+ setProp(_el$2, "borderStyle", "rounded");
42781
+ setProp(_el$2, "paddingX", 3);
42782
+ setProp(_el$2, "paddingY", 1);
42783
+ insertNode(_el$3, _el$4);
42784
+ insertNode(_el$3, _el$7);
42785
+ insertNode(_el$3, _el$9);
42786
+ insertNode(_el$3, _el$1);
42787
+ setProp(_el$3, "flexDirection", "column");
42788
+ insertNode(_el$4, _el$5);
42789
+ setProp(_el$4, "alignSelf", "center");
42790
+ insertNode(_el$5, createTextNode(`Cancel Agents`));
42791
+ insertNode(_el$7, createTextNode(`\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`));
42792
+ setProp(_el$7, "marginTop", 1);
42793
+ insert(_el$3, createComponent2(For, {
42794
+ get each() {
42795
+ return items();
42796
+ },
42797
+ children: (item, i) => {
42798
+ const isSelected = () => selected().has(item);
42799
+ const isCursor = () => cursor() === i();
42800
+ const bullet = () => isSelected() ? "\u25A0" : "\u25A1";
42801
+ const bulletColor = () => isSelected() ? COLORS.error : COLORS.textDim;
42802
+ const labelColor = () => isCursor() ? COLORS.textPrimary : COLORS.textMuted;
42803
+ const bgColor = () => isCursor() ? COLORS.bgFocus : undefined;
42804
+ return (() => {
42805
+ var _el$22 = createElement("text"), _el$23 = createElement("span"), _el$24 = createTextNode(` `), _el$25 = createTextNode(` `), _el$26 = createElement("span");
42806
+ insertNode(_el$22, _el$23);
42807
+ insertNode(_el$22, _el$26);
42808
+ setProp(_el$22, "selectable", false);
42809
+ insertNode(_el$23, _el$24);
42810
+ insertNode(_el$23, _el$25);
42811
+ insert(_el$23, bullet, _el$25);
42812
+ insert(_el$26, item);
42813
+ effect((_p$) => {
42814
+ var _v$10 = bgColor(), _v$11 = {
42815
+ fg: bulletColor()
42816
+ }, _v$12 = {
42817
+ fg: labelColor()
42818
+ };
42819
+ _v$10 !== _p$.e && (_p$.e = setProp(_el$22, "bg", _v$10, _p$.e));
42820
+ _v$11 !== _p$.t && (_p$.t = setProp(_el$23, "style", _v$11, _p$.t));
42821
+ _v$12 !== _p$.a && (_p$.a = setProp(_el$26, "style", _v$12, _p$.a));
42822
+ return _p$;
42823
+ }, {
42824
+ e: undefined,
42825
+ t: undefined,
42826
+ a: undefined
42827
+ });
42828
+ return _el$22;
42829
+ })();
42830
+ }
42831
+ }), _el$9);
42832
+ insertNode(_el$9, createTextNode(`\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`));
42833
+ setProp(_el$9, "marginTop", 1);
42834
+ insertNode(_el$1, _el$10);
42835
+ insertNode(_el$1, _el$12);
42836
+ insertNode(_el$1, _el$14);
42837
+ insertNode(_el$1, _el$16);
42838
+ insertNode(_el$1, _el$18);
42839
+ insertNode(_el$1, _el$20);
42840
+ setProp(_el$1, "marginTop", 1);
42841
+ setProp(_el$1, "alignSelf", "center");
42842
+ insertNode(_el$10, createTextNode(`Space`));
42843
+ insertNode(_el$12, createTextNode(` toggle `));
42844
+ insertNode(_el$14, createTextNode(`Enter`));
42845
+ insertNode(_el$16, createTextNode(` kill `));
42846
+ insertNode(_el$18, createTextNode(`Esc`));
42847
+ insertNode(_el$20, createTextNode(` back`));
42848
+ effect((_p$) => {
42849
+ var _v$ = COLORS.error, _v$2 = COLORS.bgPanel, _v$3 = COLORS.error, _v$4 = COLORS.borderStrong, _v$5 = COLORS.borderStrong, _v$6 = {
42850
+ fg: COLORS.textFaint
42851
+ }, _v$7 = {
42852
+ fg: COLORS.textDim
42853
+ }, _v$8 = {
42854
+ fg: COLORS.error
42855
+ }, _v$9 = {
42856
+ fg: COLORS.textDim
42857
+ }, _v$0 = {
42858
+ fg: COLORS.textFaint
42859
+ }, _v$1 = {
42860
+ fg: COLORS.textDim
42861
+ };
42862
+ _v$ !== _p$.e && (_p$.e = setProp(_el$2, "borderColor", _v$, _p$.e));
42863
+ _v$2 !== _p$.t && (_p$.t = setProp(_el$2, "backgroundColor", _v$2, _p$.t));
42864
+ _v$3 !== _p$.a && (_p$.a = setProp(_el$4, "fg", _v$3, _p$.a));
42865
+ _v$4 !== _p$.o && (_p$.o = setProp(_el$7, "fg", _v$4, _p$.o));
42866
+ _v$5 !== _p$.i && (_p$.i = setProp(_el$9, "fg", _v$5, _p$.i));
42867
+ _v$6 !== _p$.n && (_p$.n = setProp(_el$10, "style", _v$6, _p$.n));
42868
+ _v$7 !== _p$.s && (_p$.s = setProp(_el$12, "style", _v$7, _p$.s));
42869
+ _v$8 !== _p$.h && (_p$.h = setProp(_el$14, "style", _v$8, _p$.h));
42870
+ _v$9 !== _p$.r && (_p$.r = setProp(_el$16, "style", _v$9, _p$.r));
42871
+ _v$0 !== _p$.d && (_p$.d = setProp(_el$18, "style", _v$0, _p$.d));
42872
+ _v$1 !== _p$.l && (_p$.l = setProp(_el$20, "style", _v$1, _p$.l));
42873
+ return _p$;
42874
+ }, {
42875
+ e: undefined,
42876
+ t: undefined,
42877
+ a: undefined,
42878
+ o: undefined,
42879
+ i: undefined,
42880
+ n: undefined,
42881
+ s: undefined,
42882
+ h: undefined,
42883
+ r: undefined,
42884
+ d: undefined,
42885
+ l: undefined
42886
+ });
42887
+ return _el$;
42888
+ })();
42889
+ }
42890
+
42690
42891
  // src/ui/App.tsx
42691
42892
  function copyToClipboard(text) {
42692
42893
  const proc = spawn4("pbcopy", [], {
@@ -42727,6 +42928,7 @@ function App(props) {
42727
42928
  const [freshConfig, setFreshConfig] = createSignal(props.config);
42728
42929
  const [showAgents, setShowAgents] = createSignal(false);
42729
42930
  const [showInfo, setShowInfo] = createSignal(false);
42931
+ const [showCancel, setShowCancel] = createSignal(false);
42730
42932
  const resumeSession = async (sessionId) => {
42731
42933
  try {
42732
42934
  const restored = await props.orchestrator.loadTranscript(sessionId);
@@ -42775,8 +42977,18 @@ function App(props) {
42775
42977
  setShowAgents((v2) => !v2);
42776
42978
  return;
42777
42979
  }
42778
- if (showAgents())
42980
+ if (showAgents() || showCancel() || showInfo())
42779
42981
  return;
42982
+ if (key.name === "escape") {
42983
+ const active = agents.filter((a) => {
42984
+ const state = agentStates().get(a.name);
42985
+ return state && state !== "idle" && state !== "error";
42986
+ }).map((a) => a.name);
42987
+ if (active.length > 0) {
42988
+ setShowCancel(true);
42989
+ }
42990
+ return;
42991
+ }
42780
42992
  if (key.ctrl && key.name === "c") {
42781
42993
  if (!copySelection(renderer)) {
42782
42994
  gracefulExit();
@@ -42933,10 +43145,10 @@ ${lines.join(`
42933
43145
  humanName,
42934
43146
  onSubmit: handleSubmit,
42935
43147
  get disabled() {
42936
- return showAgents() || showInfo();
43148
+ return showAgents() || showInfo() || showCancel();
42937
43149
  },
42938
43150
  get disabledMessage() {
42939
- return showAgents() ? "" : undefined;
43151
+ return showAgents() || showCancel() ? "" : undefined;
42940
43152
  }
42941
43153
  }), null);
42942
43154
  insert(_el$, (() => {
@@ -42959,6 +43171,24 @@ ${lines.join(`
42959
43171
  onClose: () => setShowInfo(false)
42960
43172
  });
42961
43173
  })(), null);
43174
+ insert(_el$, (() => {
43175
+ var _c$3 = memo2(() => !!showCancel());
43176
+ return () => _c$3() && createComponent2(CancelPanel, {
43177
+ get activeAgents() {
43178
+ return agents.filter((a) => {
43179
+ const state = agentStates().get(a.name);
43180
+ return state && state !== "idle" && state !== "error";
43181
+ }).map((a) => a.name);
43182
+ },
43183
+ onCancel: (names) => {
43184
+ props.orchestrator.cancelAgents(names);
43185
+ const label = names.length === agents.length ? "all agents" : names.join(", ");
43186
+ addSystemMessage(`Cancelled ${label}`);
43187
+ setShowCancel(false);
43188
+ },
43189
+ onClose: () => setShowCancel(false)
43190
+ });
43191
+ })(), null);
42962
43192
  effect((_$p) => setProp(_el$3, "fg", COLORS.primary, _$p));
42963
43193
  return _el$;
42964
43194
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "llm-party-cli",
3
- "version": "0.10.1",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "llm-party": "dist/index.js"