oh-my-opencode-slim 2.2.1 → 2.2.3

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/dist/index.js CHANGED
@@ -184,7 +184,7 @@ var init_zip_extractor = __esm(() => {
184
184
  init_compat();
185
185
  });
186
186
 
187
- // node_modules/@mozilla/readability/Readability.js
187
+ // node_modules/.pnpm/@mozilla+readability@0.6.0/node_modules/@mozilla/readability/Readability.js
188
188
  var require_Readability = __commonJS((exports, module) => {
189
189
  function Readability(doc, options) {
190
190
  if (options && options.documentElement) {
@@ -1755,7 +1755,7 @@ var require_Readability = __commonJS((exports, module) => {
1755
1755
  }
1756
1756
  });
1757
1757
 
1758
- // node_modules/@mozilla/readability/Readability-readerable.js
1758
+ // node_modules/.pnpm/@mozilla+readability@0.6.0/node_modules/@mozilla/readability/Readability-readerable.js
1759
1759
  var require_Readability_readerable = __commonJS((exports, module) => {
1760
1760
  var REGEXPS = {
1761
1761
  unlikelyCandidates: /-ad-|ai2html|banner|breadcrumbs|combx|comment|community|cover-wrap|disqus|extra|footer|gdpr|header|legends|menu|related|remark|replies|rss|shoutbox|sidebar|skyscraper|social|sponsor|supplemental|ad-break|agegate|pagination|pager|popup|yom-remote/i,
@@ -1811,7 +1811,7 @@ var require_Readability_readerable = __commonJS((exports, module) => {
1811
1811
  }
1812
1812
  });
1813
1813
 
1814
- // node_modules/@mozilla/readability/index.js
1814
+ // node_modules/.pnpm/@mozilla+readability@0.6.0/node_modules/@mozilla/readability/index.js
1815
1815
  var require_readability = __commonJS((exports, module) => {
1816
1816
  var Readability = require_Readability();
1817
1817
  var isProbablyReaderable = require_Readability_readerable();
@@ -1821,7 +1821,7 @@ var require_readability = __commonJS((exports, module) => {
1821
1821
  };
1822
1822
  });
1823
1823
 
1824
- // node_modules/@mixmark-io/domino/lib/Event.js
1824
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/Event.js
1825
1825
  var require_Event = __commonJS((exports, module) => {
1826
1826
  module.exports = Event;
1827
1827
  Event.CAPTURING_PHASE = 1;
@@ -1878,7 +1878,7 @@ var require_Event = __commonJS((exports, module) => {
1878
1878
  });
1879
1879
  });
1880
1880
 
1881
- // node_modules/@mixmark-io/domino/lib/UIEvent.js
1881
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/UIEvent.js
1882
1882
  var require_UIEvent = __commonJS((exports, module) => {
1883
1883
  var Event = require_Event();
1884
1884
  module.exports = UIEvent;
@@ -1897,7 +1897,7 @@ var require_UIEvent = __commonJS((exports, module) => {
1897
1897
  });
1898
1898
  });
1899
1899
 
1900
- // node_modules/@mixmark-io/domino/lib/MouseEvent.js
1900
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/MouseEvent.js
1901
1901
  var require_MouseEvent = __commonJS((exports, module) => {
1902
1902
  var UIEvent = require_UIEvent();
1903
1903
  module.exports = MouseEvent;
@@ -1955,7 +1955,7 @@ var require_MouseEvent = __commonJS((exports, module) => {
1955
1955
  });
1956
1956
  });
1957
1957
 
1958
- // node_modules/@mixmark-io/domino/lib/DOMException.js
1958
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/DOMException.js
1959
1959
  var require_DOMException = __commonJS((exports, module) => {
1960
1960
  module.exports = DOMException;
1961
1961
  var INDEX_SIZE_ERR = 1;
@@ -2079,12 +2079,12 @@ var require_DOMException = __commonJS((exports, module) => {
2079
2079
  var c;
2080
2080
  });
2081
2081
 
2082
- // node_modules/@mixmark-io/domino/lib/config.js
2082
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/config.js
2083
2083
  var require_config = __commonJS((exports) => {
2084
2084
  exports.isApiWritable = !globalThis.__domino_frozen__;
2085
2085
  });
2086
2086
 
2087
- // node_modules/@mixmark-io/domino/lib/utils.js
2087
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/utils.js
2088
2088
  var require_utils = __commonJS((exports) => {
2089
2089
  var DOMException = require_DOMException();
2090
2090
  var ERR = DOMException;
@@ -2197,7 +2197,7 @@ var require_utils = __commonJS((exports) => {
2197
2197
  };
2198
2198
  });
2199
2199
 
2200
- // node_modules/@mixmark-io/domino/lib/EventTarget.js
2200
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/EventTarget.js
2201
2201
  var require_EventTarget = __commonJS((exports, module) => {
2202
2202
  var Event = require_Event();
2203
2203
  var MouseEvent = require_MouseEvent();
@@ -2385,7 +2385,7 @@ var require_EventTarget = __commonJS((exports, module) => {
2385
2385
  };
2386
2386
  });
2387
2387
 
2388
- // node_modules/@mixmark-io/domino/lib/LinkedList.js
2388
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/LinkedList.js
2389
2389
  var require_LinkedList = __commonJS((exports, module) => {
2390
2390
  var utils = require_utils();
2391
2391
  var LinkedList = module.exports = {
@@ -2428,7 +2428,7 @@ var require_LinkedList = __commonJS((exports, module) => {
2428
2428
  };
2429
2429
  });
2430
2430
 
2431
- // node_modules/@mixmark-io/domino/lib/NodeUtils.js
2431
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/NodeUtils.js
2432
2432
  var require_NodeUtils = __commonJS((exports, module) => {
2433
2433
  module.exports = {
2434
2434
  serializeOne,
@@ -2604,7 +2604,7 @@ var require_NodeUtils = __commonJS((exports, module) => {
2604
2604
  }
2605
2605
  });
2606
2606
 
2607
- // node_modules/@mixmark-io/domino/lib/Node.js
2607
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/Node.js
2608
2608
  var require_Node = __commonJS((exports, module) => {
2609
2609
  module.exports = Node;
2610
2610
  var EventTarget = require_EventTarget();
@@ -3165,7 +3165,7 @@ var require_Node = __commonJS((exports, module) => {
3165
3165
  });
3166
3166
  });
3167
3167
 
3168
- // node_modules/@mixmark-io/domino/lib/NodeList.es6.js
3168
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/NodeList.es6.js
3169
3169
  var require_NodeList_es6 = __commonJS((exports, module) => {
3170
3170
  module.exports = class NodeList extends Array {
3171
3171
  constructor(a) {
@@ -3182,7 +3182,7 @@ var require_NodeList_es6 = __commonJS((exports, module) => {
3182
3182
  };
3183
3183
  });
3184
3184
 
3185
- // node_modules/@mixmark-io/domino/lib/NodeList.es5.js
3185
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/NodeList.es5.js
3186
3186
  var require_NodeList_es5 = __commonJS((exports, module) => {
3187
3187
  function item(i) {
3188
3188
  return this[i] || null;
@@ -3196,7 +3196,7 @@ var require_NodeList_es5 = __commonJS((exports, module) => {
3196
3196
  module.exports = NodeList;
3197
3197
  });
3198
3198
 
3199
- // node_modules/@mixmark-io/domino/lib/NodeList.js
3199
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/NodeList.js
3200
3200
  var require_NodeList = __commonJS((exports, module) => {
3201
3201
  var NodeList;
3202
3202
  try {
@@ -3207,7 +3207,7 @@ var require_NodeList = __commonJS((exports, module) => {
3207
3207
  module.exports = NodeList;
3208
3208
  });
3209
3209
 
3210
- // node_modules/@mixmark-io/domino/lib/ContainerNode.js
3210
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/ContainerNode.js
3211
3211
  var require_ContainerNode = __commonJS((exports, module) => {
3212
3212
  module.exports = ContainerNode;
3213
3213
  var Node = require_Node();
@@ -3275,7 +3275,7 @@ var require_ContainerNode = __commonJS((exports, module) => {
3275
3275
  });
3276
3276
  });
3277
3277
 
3278
- // node_modules/@mixmark-io/domino/lib/xmlnames.js
3278
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/xmlnames.js
3279
3279
  var require_xmlnames = __commonJS((exports) => {
3280
3280
  exports.isValidName = isValidName;
3281
3281
  exports.isValidQName = isValidQName;
@@ -3324,7 +3324,7 @@ var require_xmlnames = __commonJS((exports) => {
3324
3324
  }
3325
3325
  });
3326
3326
 
3327
- // node_modules/@mixmark-io/domino/lib/attributes.js
3327
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/attributes.js
3328
3328
  var require_attributes = __commonJS((exports) => {
3329
3329
  var utils = require_utils();
3330
3330
  exports.property = function(attr) {
@@ -3460,7 +3460,7 @@ var require_attributes = __commonJS((exports) => {
3460
3460
  };
3461
3461
  });
3462
3462
 
3463
- // node_modules/@mixmark-io/domino/lib/FilteredElementList.js
3463
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/FilteredElementList.js
3464
3464
  var require_FilteredElementList = __commonJS((exports, module) => {
3465
3465
  module.exports = FilteredElementList;
3466
3466
  var Node = require_Node();
@@ -3526,7 +3526,7 @@ var require_FilteredElementList = __commonJS((exports, module) => {
3526
3526
  });
3527
3527
  });
3528
3528
 
3529
- // node_modules/@mixmark-io/domino/lib/DOMTokenList.js
3529
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/DOMTokenList.js
3530
3530
  var require_DOMTokenList = __commonJS((exports, module) => {
3531
3531
  var utils = require_utils();
3532
3532
  module.exports = DOMTokenList;
@@ -3688,7 +3688,7 @@ var require_DOMTokenList = __commonJS((exports, module) => {
3688
3688
  }
3689
3689
  });
3690
3690
 
3691
- // node_modules/@mixmark-io/domino/lib/select.js
3691
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/select.js
3692
3692
  var require_select = __commonJS((exports, module) => {
3693
3693
  var window2 = Object.create(null, {
3694
3694
  location: { get: function() {
@@ -4431,7 +4431,7 @@ var require_select = __commonJS((exports, module) => {
4431
4431
  };
4432
4432
  });
4433
4433
 
4434
- // node_modules/@mixmark-io/domino/lib/ChildNode.js
4434
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/ChildNode.js
4435
4435
  var require_ChildNode = __commonJS((exports, module) => {
4436
4436
  var Node = require_Node();
4437
4437
  var LinkedList = require_LinkedList();
@@ -4521,7 +4521,7 @@ var require_ChildNode = __commonJS((exports, module) => {
4521
4521
  module.exports = ChildNode;
4522
4522
  });
4523
4523
 
4524
- // node_modules/@mixmark-io/domino/lib/NonDocumentTypeChildNode.js
4524
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/NonDocumentTypeChildNode.js
4525
4525
  var require_NonDocumentTypeChildNode = __commonJS((exports, module) => {
4526
4526
  var Node = require_Node();
4527
4527
  var NonDocumentTypeChildNode = {
@@ -4547,7 +4547,7 @@ var require_NonDocumentTypeChildNode = __commonJS((exports, module) => {
4547
4547
  module.exports = NonDocumentTypeChildNode;
4548
4548
  });
4549
4549
 
4550
- // node_modules/@mixmark-io/domino/lib/NamedNodeMap.js
4550
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/NamedNodeMap.js
4551
4551
  var require_NamedNodeMap = __commonJS((exports, module) => {
4552
4552
  module.exports = NamedNodeMap;
4553
4553
  var utils = require_utils();
@@ -4584,7 +4584,7 @@ var require_NamedNodeMap = __commonJS((exports, module) => {
4584
4584
  });
4585
4585
  });
4586
4586
 
4587
- // node_modules/@mixmark-io/domino/lib/Element.js
4587
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/Element.js
4588
4588
  var require_Element = __commonJS((exports, module) => {
4589
4589
  module.exports = Element;
4590
4590
  var xml = require_xmlnames();
@@ -5485,7 +5485,7 @@ var require_Element = __commonJS((exports, module) => {
5485
5485
  }
5486
5486
  });
5487
5487
 
5488
- // node_modules/@mixmark-io/domino/lib/Leaf.js
5488
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/Leaf.js
5489
5489
  var require_Leaf = __commonJS((exports, module) => {
5490
5490
  module.exports = Leaf;
5491
5491
  var Node = require_Node();
@@ -5526,7 +5526,7 @@ var require_Leaf = __commonJS((exports, module) => {
5526
5526
  });
5527
5527
  });
5528
5528
 
5529
- // node_modules/@mixmark-io/domino/lib/CharacterData.js
5529
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/CharacterData.js
5530
5530
  var require_CharacterData = __commonJS((exports, module) => {
5531
5531
  module.exports = CharacterData;
5532
5532
  var Leaf = require_Leaf();
@@ -5583,7 +5583,7 @@ var require_CharacterData = __commonJS((exports, module) => {
5583
5583
  Object.defineProperties(CharacterData.prototype, NonDocumentTypeChildNode);
5584
5584
  });
5585
5585
 
5586
- // node_modules/@mixmark-io/domino/lib/Text.js
5586
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/Text.js
5587
5587
  var require_Text = __commonJS((exports, module) => {
5588
5588
  module.exports = Text;
5589
5589
  var utils = require_utils();
@@ -5653,7 +5653,7 @@ var require_Text = __commonJS((exports, module) => {
5653
5653
  });
5654
5654
  });
5655
5655
 
5656
- // node_modules/@mixmark-io/domino/lib/Comment.js
5656
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/Comment.js
5657
5657
  var require_Comment = __commonJS((exports, module) => {
5658
5658
  module.exports = Comment;
5659
5659
  var Node = require_Node();
@@ -5696,7 +5696,7 @@ var require_Comment = __commonJS((exports, module) => {
5696
5696
  });
5697
5697
  });
5698
5698
 
5699
- // node_modules/@mixmark-io/domino/lib/DocumentFragment.js
5699
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/DocumentFragment.js
5700
5700
  var require_DocumentFragment = __commonJS((exports, module) => {
5701
5701
  module.exports = DocumentFragment;
5702
5702
  var Node = require_Node();
@@ -5753,7 +5753,7 @@ var require_DocumentFragment = __commonJS((exports, module) => {
5753
5753
  });
5754
5754
  });
5755
5755
 
5756
- // node_modules/@mixmark-io/domino/lib/ProcessingInstruction.js
5756
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/ProcessingInstruction.js
5757
5757
  var require_ProcessingInstruction = __commonJS((exports, module) => {
5758
5758
  module.exports = ProcessingInstruction;
5759
5759
  var Node = require_Node();
@@ -5802,7 +5802,7 @@ var require_ProcessingInstruction = __commonJS((exports, module) => {
5802
5802
  });
5803
5803
  });
5804
5804
 
5805
- // node_modules/@mixmark-io/domino/lib/NodeFilter.js
5805
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/NodeFilter.js
5806
5806
  var require_NodeFilter = __commonJS((exports, module) => {
5807
5807
  var NodeFilter = {
5808
5808
  FILTER_ACCEPT: 1,
@@ -5825,7 +5825,7 @@ var require_NodeFilter = __commonJS((exports, module) => {
5825
5825
  module.exports = NodeFilter.constructor = NodeFilter.prototype = NodeFilter;
5826
5826
  });
5827
5827
 
5828
- // node_modules/@mixmark-io/domino/lib/NodeTraversal.js
5828
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/NodeTraversal.js
5829
5829
  var require_NodeTraversal = __commonJS((exports, module) => {
5830
5830
  var NodeTraversal = module.exports = {
5831
5831
  nextSkippingChildren,
@@ -5889,7 +5889,7 @@ var require_NodeTraversal = __commonJS((exports, module) => {
5889
5889
  }
5890
5890
  });
5891
5891
 
5892
- // node_modules/@mixmark-io/domino/lib/TreeWalker.js
5892
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/TreeWalker.js
5893
5893
  var require_TreeWalker = __commonJS((exports, module) => {
5894
5894
  module.exports = TreeWalker;
5895
5895
  var Node = require_Node();
@@ -6119,7 +6119,7 @@ var require_TreeWalker = __commonJS((exports, module) => {
6119
6119
  });
6120
6120
  });
6121
6121
 
6122
- // node_modules/@mixmark-io/domino/lib/NodeIterator.js
6122
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/NodeIterator.js
6123
6123
  var require_NodeIterator = __commonJS((exports, module) => {
6124
6124
  module.exports = NodeIterator;
6125
6125
  var NodeFilter = require_NodeFilter();
@@ -6260,7 +6260,7 @@ var require_NodeIterator = __commonJS((exports, module) => {
6260
6260
  });
6261
6261
  });
6262
6262
 
6263
- // node_modules/@mixmark-io/domino/lib/URL.js
6263
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/URL.js
6264
6264
  var require_URL = __commonJS((exports, module) => {
6265
6265
  module.exports = URL4;
6266
6266
  function URL4(url) {
@@ -6433,7 +6433,7 @@ var require_URL = __commonJS((exports, module) => {
6433
6433
  };
6434
6434
  });
6435
6435
 
6436
- // node_modules/@mixmark-io/domino/lib/CustomEvent.js
6436
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/CustomEvent.js
6437
6437
  var require_CustomEvent = __commonJS((exports, module) => {
6438
6438
  module.exports = CustomEvent;
6439
6439
  var Event = require_Event();
@@ -6445,7 +6445,7 @@ var require_CustomEvent = __commonJS((exports, module) => {
6445
6445
  });
6446
6446
  });
6447
6447
 
6448
- // node_modules/@mixmark-io/domino/lib/events.js
6448
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/events.js
6449
6449
  var require_events = __commonJS((exports, module) => {
6450
6450
  module.exports = {
6451
6451
  Event: require_Event(),
@@ -6455,7 +6455,7 @@ var require_events = __commonJS((exports, module) => {
6455
6455
  };
6456
6456
  });
6457
6457
 
6458
- // node_modules/@mixmark-io/domino/lib/style_parser.js
6458
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/style_parser.js
6459
6459
  var require_style_parser = __commonJS((exports) => {
6460
6460
  Object.defineProperty(exports, "__esModule", { value: true });
6461
6461
  exports.hyphenate = exports.parse = undefined;
@@ -6522,7 +6522,7 @@ var require_style_parser = __commonJS((exports) => {
6522
6522
  exports.hyphenate = hyphenate;
6523
6523
  });
6524
6524
 
6525
- // node_modules/@mixmark-io/domino/lib/CSSStyleDeclaration.js
6525
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/CSSStyleDeclaration.js
6526
6526
  var require_CSSStyleDeclaration = __commonJS((exports, module) => {
6527
6527
  var { parse } = require_style_parser();
6528
6528
  module.exports = function(elt) {
@@ -6698,7 +6698,7 @@ var require_CSSStyleDeclaration = __commonJS((exports, module) => {
6698
6698
  });
6699
6699
  });
6700
6700
 
6701
- // node_modules/@mixmark-io/domino/lib/URLUtils.js
6701
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/URLUtils.js
6702
6702
  var require_URLUtils = __commonJS((exports, module) => {
6703
6703
  var URL4 = require_URL();
6704
6704
  module.exports = URLUtils;
@@ -6932,7 +6932,7 @@ var require_URLUtils = __commonJS((exports, module) => {
6932
6932
  };
6933
6933
  });
6934
6934
 
6935
- // node_modules/@mixmark-io/domino/lib/defineElement.js
6935
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/defineElement.js
6936
6936
  var require_defineElement = __commonJS((exports, module) => {
6937
6937
  var attributes = require_attributes();
6938
6938
  var isApiWritable = require_config().isApiWritable;
@@ -6994,7 +6994,7 @@ var require_defineElement = __commonJS((exports, module) => {
6994
6994
  }
6995
6995
  });
6996
6996
 
6997
- // node_modules/@mixmark-io/domino/lib/htmlelts.js
6997
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/htmlelts.js
6998
6998
  var require_htmlelts = __commonJS((exports) => {
6999
6999
  var Node = require_Node();
7000
7000
  var Element = require_Element();
@@ -8458,7 +8458,7 @@ var require_htmlelts = __commonJS((exports) => {
8458
8458
  });
8459
8459
  });
8460
8460
 
8461
- // node_modules/@mixmark-io/domino/lib/svg.js
8461
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/svg.js
8462
8462
  var require_svg = __commonJS((exports) => {
8463
8463
  var Element = require_Element();
8464
8464
  var defineElement = require_defineElement();
@@ -8584,7 +8584,7 @@ var require_svg = __commonJS((exports) => {
8584
8584
  });
8585
8585
  });
8586
8586
 
8587
- // node_modules/@mixmark-io/domino/lib/MutationConstants.js
8587
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/MutationConstants.js
8588
8588
  var require_MutationConstants = __commonJS((exports, module) => {
8589
8589
  module.exports = {
8590
8590
  VALUE: 1,
@@ -8596,7 +8596,7 @@ var require_MutationConstants = __commonJS((exports, module) => {
8596
8596
  };
8597
8597
  });
8598
8598
 
8599
- // node_modules/@mixmark-io/domino/lib/Document.js
8599
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/Document.js
8600
8600
  var require_Document = __commonJS((exports, module) => {
8601
8601
  module.exports = Document;
8602
8602
  var Node = require_Node();
@@ -9308,7 +9308,7 @@ var require_Document = __commonJS((exports, module) => {
9308
9308
  };
9309
9309
  });
9310
9310
 
9311
- // node_modules/@mixmark-io/domino/lib/DocumentType.js
9311
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/DocumentType.js
9312
9312
  var require_DocumentType = __commonJS((exports, module) => {
9313
9313
  module.exports = DocumentType;
9314
9314
  var Node = require_Node();
@@ -9342,7 +9342,7 @@ var require_DocumentType = __commonJS((exports, module) => {
9342
9342
  Object.defineProperties(DocumentType.prototype, ChildNode);
9343
9343
  });
9344
9344
 
9345
- // node_modules/@mixmark-io/domino/lib/HTMLParser.js
9345
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/HTMLParser.js
9346
9346
  var require_HTMLParser = __commonJS((exports, module) => {
9347
9347
  module.exports = HTMLParser;
9348
9348
  var Document = require_Document();
@@ -17393,7 +17393,7 @@ var require_HTMLParser = __commonJS((exports, module) => {
17393
17393
  }
17394
17394
  });
17395
17395
 
17396
- // node_modules/@mixmark-io/domino/lib/DOMImplementation.js
17396
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/DOMImplementation.js
17397
17397
  var require_DOMImplementation = __commonJS((exports, module) => {
17398
17398
  module.exports = DOMImplementation;
17399
17399
  var Document = require_Document();
@@ -17467,7 +17467,7 @@ var require_DOMImplementation = __commonJS((exports, module) => {
17467
17467
  };
17468
17468
  });
17469
17469
 
17470
- // node_modules/@mixmark-io/domino/lib/Location.js
17470
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/Location.js
17471
17471
  var require_Location = __commonJS((exports, module) => {
17472
17472
  var URL4 = require_URL();
17473
17473
  var URLUtils = require_URLUtils();
@@ -17503,7 +17503,7 @@ var require_Location = __commonJS((exports, module) => {
17503
17503
  });
17504
17504
  });
17505
17505
 
17506
- // node_modules/@mixmark-io/domino/lib/NavigatorID.js
17506
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/NavigatorID.js
17507
17507
  var require_NavigatorID = __commonJS((exports, module) => {
17508
17508
  var NavigatorID = Object.create(null, {
17509
17509
  appCodeName: { value: "Mozilla" },
@@ -17522,7 +17522,7 @@ var require_NavigatorID = __commonJS((exports, module) => {
17522
17522
  module.exports = NavigatorID;
17523
17523
  });
17524
17524
 
17525
- // node_modules/@mixmark-io/domino/lib/WindowTimers.js
17525
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/WindowTimers.js
17526
17526
  var require_WindowTimers = __commonJS((exports, module) => {
17527
17527
  var WindowTimers = {
17528
17528
  setTimeout,
@@ -17533,7 +17533,7 @@ var require_WindowTimers = __commonJS((exports, module) => {
17533
17533
  module.exports = WindowTimers;
17534
17534
  });
17535
17535
 
17536
- // node_modules/@mixmark-io/domino/lib/impl.js
17536
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/impl.js
17537
17537
  var require_impl = __commonJS((exports, module) => {
17538
17538
  var utils = require_utils();
17539
17539
  exports = module.exports = {
@@ -17561,7 +17561,7 @@ var require_impl = __commonJS((exports, module) => {
17561
17561
  utils.merge(exports, require_svg().elements);
17562
17562
  });
17563
17563
 
17564
- // node_modules/@mixmark-io/domino/lib/Window.js
17564
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/Window.js
17565
17565
  var require_Window = __commonJS((exports, module) => {
17566
17566
  var DOMImplementation = require_DOMImplementation();
17567
17567
  var EventTarget = require_EventTarget();
@@ -17616,7 +17616,7 @@ var require_Window = __commonJS((exports, module) => {
17616
17616
  utils.expose(require_impl(), Window);
17617
17617
  });
17618
17618
 
17619
- // node_modules/@mixmark-io/domino/lib/index.js
17619
+ // node_modules/.pnpm/@mixmark-io+domino@2.2.0/node_modules/@mixmark-io/domino/lib/index.js
17620
17620
  var require_lib = __commonJS((exports) => {
17621
17621
  var DOMImplementation = require_DOMImplementation();
17622
17622
  var HTMLParser = require_HTMLParser();
@@ -17666,7 +17666,7 @@ var require_lib = __commonJS((exports) => {
17666
17666
  exports.impl = impl;
17667
17667
  });
17668
17668
 
17669
- // node_modules/turndown/lib/turndown.cjs.js
17669
+ // node_modules/.pnpm/turndown@7.2.4/node_modules/turndown/lib/turndown.cjs.js
17670
17670
  var require_turndown_cjs = __commonJS((exports, module) => {
17671
17671
  function extend(destination) {
17672
17672
  for (var i = 1;i < arguments.length; i++) {
@@ -18495,7 +18495,6 @@ var DEFAULT_MODELS = {
18495
18495
  };
18496
18496
  var POLL_INTERVAL_BACKGROUND_MS = 2000;
18497
18497
  var MAX_POLL_TIME_MS = 5 * 60 * 1000;
18498
- var DEFAULT_MAX_SUBAGENT_DEPTH = 3;
18499
18498
  var PHASE_REMINDER_TEXT = `!IMPORTANT! Scheduler workflow: First choose the lightest workflow that fits the work. If direct execution is justified, complete it and verify proportionately. Otherwise: plan lanes/dependencies → dispatch background specialists → track task IDs → wait for hook-driven completion → reconcile terminal results → verify. Do not poll running jobs, consume running-job output, or advance dependent work. !END!`;
18500
18499
  function formatSystemReminder(text) {
18501
18500
  return `<system-reminder>
@@ -18746,6 +18745,7 @@ var MultiplexerTypeSchema = z2.enum([
18746
18745
  "tmux",
18747
18746
  "zellij",
18748
18747
  "herdr",
18748
+ "kitty",
18749
18749
  "cmux",
18750
18750
  "none"
18751
18751
  ]);
@@ -19188,7 +19188,7 @@ async function promptWithTimeout(client, args, timeoutMs, signal) {
19188
19188
  }
19189
19189
  await Promise.race(racers);
19190
19190
  } catch (error) {
19191
- if (error instanceof OperationTimeoutError) {
19191
+ if (isPromptCancellationError(error)) {
19192
19192
  try {
19193
19193
  await abortSessionWithTimeout(client, sessionId);
19194
19194
  } catch {}
@@ -19200,6 +19200,11 @@ async function promptWithTimeout(client, args, timeoutMs, signal) {
19200
19200
  signal?.removeEventListener("abort", onAbort);
19201
19201
  }
19202
19202
  }
19203
+ function isPromptCancellationError(error) {
19204
+ if (error instanceof OperationTimeoutError)
19205
+ return true;
19206
+ return error instanceof Error && error.message === "Prompt cancelled";
19207
+ }
19203
19208
  async function extractSessionResult(client, sessionId, options) {
19204
19209
  const includeReasoning = options?.includeReasoning ?? true;
19205
19210
  const messagesResult = await client.session.messages({
@@ -21287,17 +21292,15 @@ class CouncilManager {
21287
21292
  client;
21288
21293
  directory;
21289
21294
  config;
21290
- depthTracker;
21291
21295
  tmuxEnabled;
21292
21296
  deprecatedFields;
21293
21297
  legacyMasterModel;
21294
- constructor(ctx, config, depthTracker, tmuxEnabled = false) {
21298
+ constructor(ctx, config, tmuxEnabled = false) {
21295
21299
  this.client = ctx.client;
21296
21300
  this.directory = ctx.directory;
21297
21301
  this.config = config;
21298
21302
  this.deprecatedFields = config?.council?._deprecated;
21299
21303
  this.legacyMasterModel = config?.council?._legacyMasterModel;
21300
- this.depthTracker = depthTracker;
21301
21304
  this.tmuxEnabled = tmuxEnabled;
21302
21305
  }
21303
21306
  getDeprecatedFields() {
@@ -21307,21 +21310,6 @@ class CouncilManager {
21307
21310
  return this.legacyMasterModel;
21308
21311
  }
21309
21312
  async runCouncil(prompt, presetName, parentSessionId) {
21310
- if (this.depthTracker) {
21311
- const parentDepth = this.depthTracker.getDepth(parentSessionId);
21312
- if (parentDepth + 1 > this.depthTracker.maxDepth) {
21313
- log("[council-manager] spawn blocked: max depth exceeded", {
21314
- parentSessionId,
21315
- parentDepth,
21316
- maxDepth: this.depthTracker.maxDepth
21317
- });
21318
- return {
21319
- success: false,
21320
- error: "Subagent depth exceeded",
21321
- councillorResults: []
21322
- };
21323
- }
21324
- }
21325
21313
  const councilConfig = this.config?.council;
21326
21314
  if (!councilConfig) {
21327
21315
  log("[council-manager] Council configuration not found");
@@ -21413,12 +21401,6 @@ class CouncilManager {
21413
21401
  throw new Error("Failed to create session");
21414
21402
  }
21415
21403
  sessionId = session.data.id;
21416
- if (this.depthTracker) {
21417
- const registered = this.depthTracker.registerChild(options.parentSessionId, sessionId);
21418
- if (!registered) {
21419
- throw new Error("Subagent depth exceeded");
21420
- }
21421
- }
21422
21404
  if (this.tmuxEnabled) {
21423
21405
  await new Promise((r) => setTimeout(r, TMUX_SPAWN_DELAY_MS));
21424
21406
  }
@@ -21457,9 +21439,6 @@ class CouncilManager {
21457
21439
  } finally {
21458
21440
  if (sessionId) {
21459
21441
  this.client.session.abort({ path: { id: sessionId } }).catch(() => {});
21460
- if (this.depthTracker) {
21461
- this.depthTracker.cleanup(sessionId);
21462
- }
21463
21442
  }
21464
21443
  }
21465
21444
  }
@@ -25089,7 +25068,7 @@ class BackgroundJobBoard {
25089
25068
  const timeouts = job.timeoutCount ?? 0;
25090
25069
  return errors >= threshold || timeouts >= threshold;
25091
25070
  }
25092
- formatForPrompt(parentSessionID, now = Date.now()) {
25071
+ formatForPrompt(parentSessionID, _now) {
25093
25072
  const active = this.list(parentSessionID).filter((job) => job.state === "running" || job.terminalUnreconciled);
25094
25073
  const reusable = this.list(parentSessionID).filter(isReusable);
25095
25074
  if (active.length === 0 && reusable.length === 0)
@@ -25103,7 +25082,7 @@ class BackgroundJobBoard {
25103
25082
  "Cancelled or errored sessions are not reusable.",
25104
25083
  "",
25105
25084
  "#### Active / Unreconciled",
25106
- ...active.length > 0 ? active.map((job) => formatJob(job, now)) : ["- none"],
25085
+ ...active.length > 0 ? active.map(formatJob) : ["- none"],
25107
25086
  "",
25108
25087
  "#### Reusable Sessions",
25109
25088
  ...reusable.length > 0 ? reusable.map((job) => this.formatReusableJob(job)) : ["- none"]
@@ -25180,11 +25159,10 @@ function formatContextFiles(files, maxFiles) {
25180
25159
  function normalizeWhitespace(value) {
25181
25160
  return value.replace(/\s+/g, " ").trim();
25182
25161
  }
25183
- function formatJob(job, now = Date.now()) {
25184
- const ageMs = now - job.lastLaunchedAt;
25162
+ function formatJob(job) {
25185
25163
  const isResume = job.lastLaunchedAt !== job.launchedAt;
25186
- const ageLabel = job.state === "running" && ageMs < 30000 ? ` [${isResume ? "resumed" : "just launched"}, ${Math.floor(ageMs / 1000)}s ago]` : "";
25187
- const status = job.terminalUnreconciled ? `${job.state}, unreconciled` : job.statusUncertain ? `${job.state}, status uncertain` : job.timedOut ? `${job.state}, timed out` : `${job.state}${ageLabel}`;
25164
+ const displayState = job.state === "running" && isResume ? "running [resumed]" : job.state;
25165
+ const status = job.terminalUnreconciled ? `${job.state}, unreconciled` : job.statusUncertain ? `${job.state}, status uncertain` : job.timedOut ? `${job.state}, timed out` : displayState;
25188
25166
  const lines = [
25189
25167
  `- ${promptSafe(job.alias)} / ${promptSafe(job.taskID)} / ${promptSafe(job.agent)} / ${promptSafe(status)}`,
25190
25168
  ` Objective: ${promptSafe(job.objective || job.description)}`
@@ -25435,6 +25413,7 @@ function activationPrompt(task2) {
25435
25413
  "Deepwork requirements:",
25436
25414
  "- before planning, delegation, or creating state, inspect existing `.gitignore` and `.ignore`; add only missing entries without duplicates: `.gitignore` must contain `.slim/deepwork/`, and `.ignore` must contain `!.slim/deepwork/` and `!.slim/deepwork/**`; this keeps state git-local yet OpenCode-readable;",
25437
25415
  "- create/update a `.slim/deepwork/` progress file;",
25416
+ "- save code/doc deliverables to project paths (e.g. `src/`, `docs/`); reserve `.slim/deepwork/` strictly for progress files;",
25438
25417
  "- keep OpenCode todos synced with the current phase;",
25439
25418
  "- draft a plan and get `@oracle` review before implementation;",
25440
25419
  "- create and review a phased implementation/delegation plan;",
@@ -25584,6 +25563,15 @@ function isMessageWithParts(message) {
25584
25563
  function isUserMessageWithParts(message) {
25585
25564
  return isMessageWithParts(message) && message.info.role === "user";
25586
25565
  }
25566
+ function findLatestUserMessage(messages) {
25567
+ for (let index = messages.length - 1;index >= 0; index--) {
25568
+ const message = messages[index];
25569
+ if (isUserMessageWithParts(message)) {
25570
+ return message;
25571
+ }
25572
+ }
25573
+ return;
25574
+ }
25587
25575
 
25588
25576
  // src/hooks/filter-available-skills/index.ts
25589
25577
  var AVAILABLE_SKILLS_BLOCK_REGEX = /<available_skills>\s*([\s\S]*?)\s*<\/available_skills>/g;
@@ -26398,52 +26386,36 @@ function createLoopCommandHook() {
26398
26386
  }
26399
26387
  // src/hooks/phase-reminder/index.ts
26400
26388
  var PHASE_REMINDER_METADATA_KEY = "oh-my-opencode-slim.phaseReminder";
26401
- function createPhaseReminderHook(coordinator) {
26389
+ function hasPhaseReminder(part) {
26390
+ return part.synthetic === true && isRecord2(part.metadata) && part.metadata[PHASE_REMINDER_METADATA_KEY] === true;
26391
+ }
26392
+ function createPhaseReminderHook(options = {}) {
26402
26393
  return {
26403
26394
  "experimental.chat.messages.transform": async (_input, output) => {
26404
26395
  const messages = Array.isArray(output.messages) ? output.messages : [];
26405
- if (messages.length === 0) {
26406
- return;
26407
- }
26408
- let lastUserMessageIndex = -1;
26409
- for (let i = messages.length - 1;i >= 0; i--) {
26410
- if (isUserMessageWithParts(messages[i])) {
26411
- lastUserMessageIndex = i;
26412
- break;
26413
- }
26414
- }
26415
- if (lastUserMessageIndex === -1) {
26416
- return;
26417
- }
26418
- const lastUserMessage = messages[lastUserMessageIndex];
26419
- if (!isUserMessageWithParts(lastUserMessage)) {
26420
- return;
26421
- }
26422
- const agent = lastUserMessage.info.agent;
26423
- if (agent && agent !== "orchestrator") {
26424
- return;
26425
- }
26426
- const sessionId = lastUserMessage?.info?.sessionID;
26427
- if (sessionId && coordinator?.hasPendingSession(sessionId)) {
26396
+ const lastUserMessage = findLatestUserMessage(messages);
26397
+ if (!lastUserMessage) {
26428
26398
  return;
26429
26399
  }
26430
- const textPartIndex = lastUserMessage.parts.findIndex((p) => p.type === "text" && p.text !== undefined);
26431
- if (textPartIndex === -1) {
26400
+ const { agent, sessionID } = lastUserMessage.info;
26401
+ if (agent !== "orchestrator" || !sessionID || options.shouldInject && !options.shouldInject(sessionID)) {
26432
26402
  return;
26433
26403
  }
26434
- const originalPart = lastUserMessage.parts[textPartIndex];
26435
- if (isInternalInitiatorPart(originalPart)) {
26436
- return;
26437
- }
26438
- if (lastUserMessage.parts.some((part) => part.synthetic === true && isRecord2(part.metadata) && part.metadata[PHASE_REMINDER_METADATA_KEY] === true)) {
26439
- return;
26404
+ for (const message of messages) {
26405
+ if (!isUserMessageWithParts(message) || message.info.agent !== "orchestrator" || message.info.sessionID !== sessionID) {
26406
+ continue;
26407
+ }
26408
+ const textPart = message.parts.find((part) => part.type === "text" && part.text !== undefined);
26409
+ if (!textPart || isInternalInitiatorPart(textPart) || message.parts.some(hasPhaseReminder)) {
26410
+ continue;
26411
+ }
26412
+ message.parts.push({
26413
+ type: "text",
26414
+ synthetic: true,
26415
+ text: PHASE_REMINDER,
26416
+ metadata: { [PHASE_REMINDER_METADATA_KEY]: true }
26417
+ });
26440
26418
  }
26441
- lastUserMessage.parts.push({
26442
- type: "text",
26443
- synthetic: true,
26444
- text: PHASE_REMINDER,
26445
- metadata: { [PHASE_REMINDER_METADATA_KEY]: true }
26446
- });
26447
26419
  }
26448
26420
  };
26449
26421
  }
@@ -26460,17 +26432,43 @@ function createPostFileToolNudgeHook(options = {}) {
26460
26432
  return;
26461
26433
  coordinator?.markPending(input.sessionID);
26462
26434
  },
26463
- "experimental.chat.system.transform": async (input, output) => {
26464
- if (!input.sessionID || !coordinator?.consumePending(input.sessionID)) {
26435
+ "experimental.chat.messages.transform": async (_input, output) => {
26436
+ if (!coordinator) {
26437
+ return;
26438
+ }
26439
+ const messages = Array.isArray(output.messages) ? output.messages : [];
26440
+ const eligible = getEligibleMessage(findLatestUserMessage(messages));
26441
+ if (!eligible) {
26465
26442
  return;
26466
26443
  }
26467
- if (options.shouldInject && !options.shouldInject(input.sessionID)) {
26444
+ const { message, sessionID } = eligible;
26445
+ const hasReminder = message.parts.some(hasPhaseReminder);
26446
+ if (options.shouldInject && !options.shouldInject(sessionID)) {
26468
26447
  return;
26469
26448
  }
26470
- output.system.push(PHASE_REMINDER);
26449
+ if (!coordinator.consumePending(sessionID))
26450
+ return;
26451
+ if (hasReminder)
26452
+ return;
26453
+ message.parts.push({
26454
+ type: "text",
26455
+ synthetic: true,
26456
+ text: PHASE_REMINDER,
26457
+ metadata: { [PHASE_REMINDER_METADATA_KEY]: true }
26458
+ });
26471
26459
  }
26472
26460
  };
26473
26461
  }
26462
+ function getEligibleMessage(message) {
26463
+ if (!isUserMessageWithParts(message) || !message.info.sessionID || message.info.agent !== "orchestrator") {
26464
+ return;
26465
+ }
26466
+ const textPart = message.parts.find((part) => part.type === "text" && part.text !== undefined);
26467
+ if (!textPart || isInternalInitiatorPart(textPart)) {
26468
+ return;
26469
+ }
26470
+ return { message, sessionID: message.info.sessionID };
26471
+ }
26474
26472
  // src/hooks/reflect/index.ts
26475
26473
  var COMMAND_NAME3 = "reflect";
26476
26474
  function activationPrompt3(focus, isSessionMode = false, lastN = 50) {
@@ -26531,7 +26529,6 @@ function createReflectCommandHook() {
26531
26529
  class SessionLifecycle {
26532
26530
  #cleanupCallbacks = [];
26533
26531
  #pendingSessionIds = new Set;
26534
- #everPendingSessionIds = new Set;
26535
26532
  #log;
26536
26533
  constructor(log2) {
26537
26534
  this.#log = log2;
@@ -26550,19 +26547,14 @@ class SessionLifecycle {
26550
26547
  }
26551
26548
  markPending(sessionId) {
26552
26549
  this.#pendingSessionIds.add(sessionId);
26553
- this.#everPendingSessionIds.add(sessionId);
26554
26550
  }
26555
26551
  consumePending(sessionId) {
26556
26552
  const had = this.#pendingSessionIds.has(sessionId);
26557
26553
  this.#pendingSessionIds.delete(sessionId);
26558
26554
  return had;
26559
26555
  }
26560
- hasPendingSession(sessionId) {
26561
- return this.#everPendingSessionIds.has(sessionId) && !this.#pendingSessionIds.has(sessionId);
26562
- }
26563
26556
  clearSession(sessionId) {
26564
26557
  this.#pendingSessionIds.delete(sessionId);
26565
- this.#everPendingSessionIds.delete(sessionId);
26566
26558
  }
26567
26559
  }
26568
26560
  // src/hooks/task-session-manager/pending-call-tracker.ts
@@ -26597,6 +26589,13 @@ function createPendingCallTracker() {
26597
26589
  pendingCalls.delete(callId);
26598
26590
  return pending;
26599
26591
  },
26592
+ peekByParent(parentSessionId) {
26593
+ for (const call of pendingCalls.values()) {
26594
+ if (call.parentSessionId === parentSessionId)
26595
+ return call;
26596
+ }
26597
+ return;
26598
+ },
26600
26599
  clearSession(sessionId) {
26601
26600
  for (const [callId, pending] of pendingCalls.entries()) {
26602
26601
  if (pending.parentSessionId === sessionId) {
@@ -26692,7 +26691,7 @@ var BACKGROUND_COMPLETION_FAILED = /^Background task failed: /;
26692
26691
  var MAX_PROCESSED_INJECTED_COMPLETIONS = 500;
26693
26692
  var RAW_SESSION_ID_PATTERN = /^ses_[A-Za-z0-9_-]+$/;
26694
26693
  var IDLE_RECONCILE_DELAY_MS = 2000;
26695
- var idleReconcileTimers = new Map;
26694
+ var CONTINUATION_NUDGE = "Continue coordinating the remaining incomplete todos. Do not finalize while work remains.";
26696
26695
  function djb2Hash(str) {
26697
26696
  let hash = 5381;
26698
26697
  for (let i = 0;i < str.length; i++) {
@@ -26733,8 +26732,137 @@ function createTaskSessionManagerHook(_ctx, options) {
26733
26732
  const processedInjectedCompletions = new Set;
26734
26733
  const processedInjectedCompletionOrder = [];
26735
26734
  const terminalJobsInjectedByParent = new Map;
26735
+ const idleReconcileTimers = new Map;
26736
+ const continuationSessionTokens = new Map;
26737
+ const activeContinuationEvaluations = new Map;
26738
+ const continuationConsumed = new Set;
26739
+ const idleReconcileDelayMs = options.idleReconcileDelayMs ?? IDLE_RECONCILE_DELAY_MS;
26740
+ const sessionSdk = _ctx.client.session;
26741
+ function getContinuationSessionToken(sessionID) {
26742
+ const existing = continuationSessionTokens.get(sessionID);
26743
+ if (existing)
26744
+ return existing;
26745
+ const token = Symbol(sessionID);
26746
+ continuationSessionTokens.set(sessionID, token);
26747
+ return token;
26748
+ }
26749
+ function isCurrentContinuation(sessionID, sessionToken, evaluationToken) {
26750
+ return continuationSessionTokens.get(sessionID) === sessionToken && (evaluationToken === undefined || activeContinuationEvaluations.get(sessionID)?.has(evaluationToken) === true);
26751
+ }
26752
+ function invalidateContinuation(sessionID) {
26753
+ const timer = idleReconcileTimers.get(sessionID);
26754
+ if (timer) {
26755
+ clearTimeout(timer);
26756
+ idleReconcileTimers.delete(sessionID);
26757
+ }
26758
+ continuationSessionTokens.delete(sessionID);
26759
+ activeContinuationEvaluations.delete(sessionID);
26760
+ }
26761
+ function clearContinuation(sessionID) {
26762
+ invalidateContinuation(sessionID);
26763
+ continuationConsumed.delete(sessionID);
26764
+ }
26765
+ function isActiveStatus(status, sessionID) {
26766
+ return Object.hasOwn(status, sessionID);
26767
+ }
26768
+ async function evaluateContinuation(parentSessionID, sessionToken) {
26769
+ const evaluationToken = Symbol(parentSessionID);
26770
+ const activeEvaluations = activeContinuationEvaluations.get(parentSessionID) ?? new Set;
26771
+ activeEvaluations.add(evaluationToken);
26772
+ activeContinuationEvaluations.set(parentSessionID, activeEvaluations);
26773
+ if (continuationConsumed.has(parentSessionID) || !isCurrentContinuation(parentSessionID, sessionToken, evaluationToken) || options.isFallbackInProgress?.(parentSessionID) || backgroundJobBoard.hasTerminalUnreconciled(parentSessionID) || !sessionSdk?.todo || !sessionSdk.children || !sessionSdk.status || !sessionSdk.promptAsync) {
26774
+ activeEvaluations.delete(evaluationToken);
26775
+ if (activeEvaluations.size === 0) {
26776
+ activeContinuationEvaluations.delete(parentSessionID);
26777
+ }
26778
+ return;
26779
+ }
26780
+ try {
26781
+ const [todoResponse, childrenResponse, statusResponse] = await Promise.all([
26782
+ sessionSdk.todo({
26783
+ path: { id: parentSessionID },
26784
+ throwOnError: true
26785
+ }),
26786
+ sessionSdk.children({
26787
+ path: { id: parentSessionID },
26788
+ throwOnError: true
26789
+ }),
26790
+ sessionSdk.status({ throwOnError: true })
26791
+ ]);
26792
+ if (!Array.isArray(todoResponse.data) || !Array.isArray(childrenResponse.data) || !isRecord2(statusResponse.data)) {
26793
+ return;
26794
+ }
26795
+ const todos = todoResponse.data;
26796
+ const children = childrenResponse.data;
26797
+ const status = statusResponse.data;
26798
+ if (!todos.every((todo) => isRecord2(todo) && typeof todo.status === "string") || !children.every((child) => isRecord2(child) && typeof child.id === "string")) {
26799
+ return;
26800
+ }
26801
+ if (!todos.some((todo) => todo.status !== "completed" && todo.status !== "cancelled")) {
26802
+ return;
26803
+ }
26804
+ const childIDs = children.map((child) => child.id);
26805
+ if (isActiveStatus(status, parentSessionID) || childIDs.some((childID) => isActiveStatus(status, childID))) {
26806
+ return;
26807
+ }
26808
+ const [latestChildrenResponse, latestStatusResponse] = await Promise.all([
26809
+ sessionSdk.children({
26810
+ path: { id: parentSessionID },
26811
+ throwOnError: true
26812
+ }),
26813
+ sessionSdk.status({ throwOnError: true })
26814
+ ]);
26815
+ if (!Array.isArray(latestChildrenResponse.data) || !isRecord2(latestStatusResponse.data) || !latestChildrenResponse.data.every((child) => isRecord2(child) && typeof child.id === "string") || continuationConsumed.has(parentSessionID) || !isCurrentContinuation(parentSessionID, sessionToken, evaluationToken) || options.isFallbackInProgress?.(parentSessionID) || backgroundJobBoard.hasTerminalUnreconciled(parentSessionID)) {
26816
+ return;
26817
+ }
26818
+ const latestChildIDs = latestChildrenResponse.data.map((child) => child.id);
26819
+ const latestStatus = latestStatusResponse.data;
26820
+ if (isActiveStatus(latestStatus, parentSessionID) || latestChildIDs.some((childID) => isActiveStatus(latestStatus, childID))) {
26821
+ return;
26822
+ }
26823
+ if (continuationConsumed.has(parentSessionID) || !isCurrentContinuation(parentSessionID, sessionToken, evaluationToken) || options.isFallbackInProgress?.(parentSessionID) || backgroundJobBoard.hasTerminalUnreconciled(parentSessionID)) {
26824
+ return;
26825
+ }
26826
+ continuationConsumed.add(parentSessionID);
26827
+ await sessionSdk.promptAsync({
26828
+ path: { id: parentSessionID },
26829
+ body: { parts: [createInternalAgentTextPart(CONTINUATION_NUDGE)] },
26830
+ throwOnError: true
26831
+ });
26832
+ } catch (error) {
26833
+ log("[task-session-manager] continuation nudge suppressed after SDK error", {
26834
+ parentSessionID,
26835
+ error: error instanceof Error ? error.message : String(error)
26836
+ });
26837
+ } finally {
26838
+ const evaluations = activeContinuationEvaluations.get(parentSessionID);
26839
+ evaluations?.delete(evaluationToken);
26840
+ if (evaluations?.size === 0) {
26841
+ activeContinuationEvaluations.delete(parentSessionID);
26842
+ }
26843
+ }
26844
+ }
26845
+ function scheduleIdleReconciliation(parentSessionID) {
26846
+ if (idleReconcileTimers.has(parentSessionID) || options.isFallbackInProgress?.(parentSessionID)) {
26847
+ return;
26848
+ }
26849
+ const sessionToken = getContinuationSessionToken(parentSessionID);
26850
+ const timer = setTimeout(() => {
26851
+ idleReconcileTimers.delete(parentSessionID);
26852
+ if (!isCurrentContinuation(parentSessionID, sessionToken)) {
26853
+ return;
26854
+ }
26855
+ const hadTerminalUnreconciled = backgroundJobBoard.hasTerminalUnreconciled(parentSessionID);
26856
+ reconcileInjectedTerminalJobs(parentSessionID);
26857
+ if (!hadTerminalUnreconciled) {
26858
+ evaluateContinuation(parentSessionID, sessionToken);
26859
+ }
26860
+ }, idleReconcileDelayMs).unref?.();
26861
+ idleReconcileTimers.set(parentSessionID, timer);
26862
+ }
26736
26863
  if (options.coordinator) {
26737
26864
  options.coordinator.onSessionDeleted((sessionId) => {
26865
+ clearContinuation(sessionId);
26738
26866
  if (!options.isFallbackInProgress?.(sessionId)) {
26739
26867
  backgroundJobBoard.drop(sessionId);
26740
26868
  backgroundJobBoard.clearParent(sessionId);
@@ -26894,6 +27022,18 @@ function createTaskSessionManagerHook(_ctx, options) {
26894
27022
  terminalJobsInjectedByParent.delete(parentSessionID);
26895
27023
  }
26896
27024
  return {
27025
+ observeChatMessage: (input, output) => {
27026
+ const inputMessage = isRecord2(input) ? input : undefined;
27027
+ const outputRecord = isRecord2(output) ? output : undefined;
27028
+ const outputMessage = isRecord2(outputRecord?.message) ? outputRecord.message : undefined;
27029
+ const sessionID = typeof outputMessage?.sessionID === "string" ? outputMessage.sessionID : typeof inputMessage?.sessionID === "string" ? inputMessage.sessionID : undefined;
27030
+ const parts = Array.isArray(outputRecord?.parts) ? outputRecord.parts : inputMessage?.parts;
27031
+ if (!sessionID || typeof outputMessage?.role === "string" && outputMessage.role !== "user" || !options.shouldManageSession(sessionID) || !Array.isArray(parts) || !parts.some((part) => isRecord2(part) && part.type === "text" && typeof part.text === "string" && part.synthetic !== true && !isInternalInitiatorPart(part))) {
27032
+ return;
27033
+ }
27034
+ invalidateContinuation(sessionID);
27035
+ continuationConsumed.delete(sessionID);
27036
+ },
26897
27037
  "tool.execute.before": async (input, output) => {
26898
27038
  const toolName = input.tool.toLowerCase();
26899
27039
  if (toolName !== "task")
@@ -27119,6 +27259,34 @@ function createTaskSessionManagerHook(_ctx, options) {
27119
27259
  });
27120
27260
  if (info?.id && info.parentID && options.shouldManageSession(info.parentID)) {
27121
27261
  taskContextTracker.pendingManagedTaskIds.add(info.id);
27262
+ const pending = pendingCallTracker.peekByParent(info.parentID);
27263
+ if (pending && !pending.resumedTaskId && !backgroundJobBoard.get(info.id)) {
27264
+ const record = backgroundJobBoard.registerLaunch({
27265
+ taskID: info.id,
27266
+ parentSessionID: pending.parentSessionId,
27267
+ agent: pending.agentType,
27268
+ description: pending.label,
27269
+ objective: pending.label
27270
+ });
27271
+ log("[task-session-manager] early board registration from session.created", {
27272
+ taskID: record.taskID,
27273
+ alias: record.alias,
27274
+ parentSessionID: record.parentSessionID,
27275
+ agent: record.agent
27276
+ });
27277
+ }
27278
+ }
27279
+ return;
27280
+ }
27281
+ if (input.event.type === "server.instance.disposed") {
27282
+ const continuationSessionIDs = new Set([
27283
+ ...idleReconcileTimers.keys(),
27284
+ ...continuationSessionTokens.keys(),
27285
+ ...activeContinuationEvaluations.keys(),
27286
+ ...continuationConsumed
27287
+ ]);
27288
+ for (const sessionID of continuationSessionIDs) {
27289
+ clearContinuation(sessionID);
27122
27290
  }
27123
27291
  return;
27124
27292
  }
@@ -27132,11 +27300,7 @@ function createTaskSessionManagerHook(_ctx, options) {
27132
27300
  runningJobForSession: job?.state === "running" || false
27133
27301
  });
27134
27302
  if (sessionId2 && options.shouldManageSession(sessionId2)) {
27135
- const timer2 = setTimeout(() => {
27136
- idleReconcileTimers.delete(sessionId2);
27137
- reconcileInjectedTerminalJobs(sessionId2);
27138
- }, IDLE_RECONCILE_DELAY_MS).unref?.();
27139
- idleReconcileTimers.set(sessionId2, timer2);
27303
+ scheduleIdleReconciliation(sessionId2);
27140
27304
  }
27141
27305
  if (job && sessionId2 && job.state === "running" && !options.isFallbackInProgress?.(sessionId2)) {
27142
27306
  log("[task-session-manager] reconciled running job from idle", {
@@ -27158,13 +27322,8 @@ function createTaskSessionManagerHook(_ctx, options) {
27158
27322
  }
27159
27323
  if (input.event.type === "session.error") {
27160
27324
  const sessionId2 = input.event.properties?.info?.id || input.event.properties?.sessionID;
27161
- if (sessionId2) {
27162
- const timer2 = idleReconcileTimers.get(sessionId2);
27163
- if (timer2) {
27164
- clearTimeout(timer2);
27165
- idleReconcileTimers.delete(sessionId2);
27166
- }
27167
- }
27325
+ if (sessionId2)
27326
+ invalidateContinuation(sessionId2);
27168
27327
  if (sessionId2 && options.shouldManageSession(sessionId2)) {
27169
27328
  const props = input.event.properties;
27170
27329
  if (!props?.error || !isFailoverError(props.error)) {
@@ -27173,14 +27332,13 @@ function createTaskSessionManagerHook(_ctx, options) {
27173
27332
  }
27174
27333
  return;
27175
27334
  }
27176
- if (input.event.type === "session.status" && input.event.properties?.status?.type === "busy") {
27335
+ if (input.event.type === "session.status") {
27177
27336
  const sessionId2 = input.event.properties?.info?.id || input.event.properties?.sessionID;
27178
- if (sessionId2) {
27179
- const timer2 = idleReconcileTimers.get(sessionId2);
27180
- if (timer2) {
27181
- clearTimeout(timer2);
27182
- idleReconcileTimers.delete(sessionId2);
27183
- }
27337
+ const statusType = input.event.properties?.status?.type;
27338
+ if (sessionId2)
27339
+ invalidateContinuation(sessionId2);
27340
+ if (statusType !== "busy") {
27341
+ return;
27184
27342
  }
27185
27343
  const before = sessionId2 ? backgroundJobBoard.get(sessionId2) : undefined;
27186
27344
  const updated = sessionId2 ? backgroundJobBoard.markRunningFromLiveSession(sessionId2) : undefined;
@@ -27211,11 +27369,7 @@ function createTaskSessionManagerHook(_ctx, options) {
27211
27369
  const sessionId = input.event.properties?.info?.id || input.event.properties?.sessionID;
27212
27370
  if (!sessionId)
27213
27371
  return;
27214
- const timer = idleReconcileTimers.get(sessionId);
27215
- if (timer) {
27216
- clearTimeout(timer);
27217
- idleReconcileTimers.delete(sessionId);
27218
- }
27372
+ clearContinuation(sessionId);
27219
27373
  log("[task-session-manager] session.deleted observed", {
27220
27374
  sessionID: sessionId
27221
27375
  });
@@ -27261,6 +27415,15 @@ function formatCancelledTaskStatusOutput(taskID, summary = "cancelled") {
27261
27415
  ].join(`
27262
27416
  `);
27263
27417
  }
27418
+ // src/index-event.ts
27419
+ async function handleTaskSessionEvent(input, invalidateTaskSessions, handleMultiplexerEvent, cleanupInstance) {
27420
+ await invalidateTaskSessions(input);
27421
+ await handleMultiplexerEvent();
27422
+ if (input.event.type === "server.instance.disposed") {
27423
+ await cleanupInstance();
27424
+ }
27425
+ }
27426
+
27264
27427
  // src/interview/dashboard.ts
27265
27428
  import crypto2 from "node:crypto";
27266
27429
  import * as fsSync2 from "node:fs";
@@ -32303,6 +32466,42 @@ function buildOpencodeAttachCommand(sessionId, serverUrl, directory, executable
32303
32466
  quoteShellArg(attachDir)
32304
32467
  ].join(" ");
32305
32468
  }
32469
+ function resolveOpencodeExecutable() {
32470
+ return resolveHostOpencodeBinary() ?? "opencode";
32471
+ }
32472
+ function buildShellLaunchArgs(command) {
32473
+ const shell = process.env.SHELL || "/bin/sh";
32474
+ const name = (shell.split(/[/\\]/).at(-1) ?? "sh").replace(/\.(exe|EXE)$/, "");
32475
+ if (name === "nu" || name === "fish") {
32476
+ return [shell, "-c", command];
32477
+ }
32478
+ if (name === "zsh") {
32479
+ return [
32480
+ shell,
32481
+ "-l",
32482
+ "-c",
32483
+ `[[ -f "\${ZDOTDIR:-$HOME}/.zshrc" ]] && source "\${ZDOTDIR:-$HOME}/.zshrc" >/dev/null 2>&1
32484
+ ${command}`
32485
+ ];
32486
+ }
32487
+ if (name === "bash") {
32488
+ return [
32489
+ shell,
32490
+ "-l",
32491
+ "-c",
32492
+ `shopt -s expand_aliases
32493
+ [[ -f ~/.bashrc ]] && source ~/.bashrc >/dev/null 2>&1 || true
32494
+ ${command}`
32495
+ ];
32496
+ }
32497
+ if (name === "cmd") {
32498
+ return [shell, "/c", command];
32499
+ }
32500
+ if (name === "pwsh" || name === "powershell") {
32501
+ return [shell, "-NoProfile", "-Command", command];
32502
+ }
32503
+ return [shell, "-c", command];
32504
+ }
32306
32505
  function resolveHostOpencodeBinary(options = {}) {
32307
32506
  const pathExists = options.pathExists ?? existsSync9;
32308
32507
  for (const candidate of [
@@ -32379,13 +32578,15 @@ async function gracefulClosePane(binary, paneId, options) {
32379
32578
  try {
32380
32579
  const ctrlCProc = crossSpawn([binary, ...options.ctrlC], {
32381
32580
  stdout: "ignore",
32382
- stderr: "ignore"
32581
+ stderr: "ignore",
32582
+ env: options.env
32383
32583
  });
32384
32584
  await ctrlCProc.exited;
32385
32585
  await new Promise((r) => setTimeout(r, GRACEFUL_SHUTDOWN_DELAY_MS));
32386
32586
  const proc = crossSpawn([binary, ...options.close], {
32387
32587
  stdout: "ignore",
32388
- stderr: "ignore"
32588
+ stderr: "ignore",
32589
+ env: options.env
32389
32590
  });
32390
32591
  const exitCode = await proc.exited;
32391
32592
  if (exitCode === 0)
@@ -33116,6 +33317,189 @@ function getPaneDirection(layout) {
33116
33317
  }
33117
33318
  }
33118
33319
 
33320
+ // src/multiplexer/kitty/index.ts
33321
+ init_compat();
33322
+ class KittyMultiplexer {
33323
+ type = "kitty";
33324
+ binaryPath = null;
33325
+ hasChecked = false;
33326
+ storedLayout;
33327
+ appliedLayout = null;
33328
+ constructor(layout = "main-vertical", mainPaneSize = 60) {
33329
+ this.storedLayout = layout;
33330
+ }
33331
+ async isAvailable() {
33332
+ if (this.hasChecked) {
33333
+ return this.binaryPath !== null;
33334
+ }
33335
+ this.binaryPath = await findBinary("kitten") ?? await findBinary("kitty");
33336
+ this.hasChecked = true;
33337
+ return this.binaryPath !== null;
33338
+ }
33339
+ isInsideSession() {
33340
+ return !!process.env.KITTY_PID || !!process.env.KITTY_WINDOW_ID;
33341
+ }
33342
+ hasListenOn() {
33343
+ return !!process.env.KITTY_LISTEN_ON;
33344
+ }
33345
+ async spawnPane(sessionId, description, serverUrl, directory) {
33346
+ const kitten = await this.getBinary();
33347
+ if (!kitten) {
33348
+ log("[kitty] spawnPane: kitten/kitty binary not found");
33349
+ return { success: false };
33350
+ }
33351
+ if (!this.isInsideSession()) {
33352
+ log("[kitty] spawnPane: OpenCode is not running inside a kitty session; " + "set multiplexer.type to a different backend or run OpenCode inside kitty");
33353
+ return { success: false };
33354
+ }
33355
+ if (!this.hasListenOn()) {
33356
+ log("[kitty] spawnPane: KITTY_LISTEN_ON is not set. Add `listen_on " + "unix:/tmp/kitty-rc-$(USER)` to kitty.conf and restart kitty so the " + "plugin can drive kitty via the socket.");
33357
+ return { success: false };
33358
+ }
33359
+ const { kittyLayout, location } = getKittyLayoutConfig(this.storedLayout);
33360
+ await this.ensureLayout(kittyLayout);
33361
+ try {
33362
+ const opencodeCmd = buildOpencodeAttachCommand(sessionId, serverUrl, directory, resolveOpencodeExecutable());
33363
+ const attachDir = normalizePathForShell(directory);
33364
+ const shellArgs = buildShellLaunchArgs(opencodeCmd);
33365
+ const args = [
33366
+ "@",
33367
+ "launch",
33368
+ "--type=window",
33369
+ `--location=${location}`,
33370
+ `--title=${description.slice(0, 60)}`,
33371
+ `--cwd=${attachDir}`,
33372
+ "--keep-focus",
33373
+ "--",
33374
+ ...shellArgs
33375
+ ];
33376
+ log("[kitty] spawnPane: executing", { kitten, args });
33377
+ const proc = crossSpawn([kitten, ...args], {
33378
+ stdout: "pipe",
33379
+ stderr: "pipe",
33380
+ env: this.kittyEnv()
33381
+ });
33382
+ const exitCode = await proc.exited;
33383
+ const stdout = await proc.stdout();
33384
+ const stderr = await proc.stderr();
33385
+ const lines = stdout.trim().split(`
33386
+ `).map((l) => l.trim()).filter(Boolean);
33387
+ const windowId = lines.length > 0 ? lines[lines.length - 1] : "";
33388
+ log("[kitty] spawnPane: result", {
33389
+ exitCode,
33390
+ windowId,
33391
+ stderr: stderr.trim()
33392
+ });
33393
+ if (exitCode === 0 && windowId) {
33394
+ log("[kitty] spawnPane: SUCCESS", { windowId });
33395
+ return { success: true, paneId: windowId };
33396
+ }
33397
+ return { success: false };
33398
+ } catch (err) {
33399
+ log("[kitty] spawnPane: exception", { error: String(err) });
33400
+ return { success: false };
33401
+ }
33402
+ }
33403
+ async closePane(paneId) {
33404
+ if (!this.isInsideSession()) {
33405
+ log("[kitty] closePane: OpenCode is not running inside a kitty session; " + "cannot target a kitty instance");
33406
+ return false;
33407
+ }
33408
+ if (!this.hasListenOn()) {
33409
+ log("[kitty] closePane: KITTY_LISTEN_ON is not set; cannot target kitty. " + "Add `listen_on` to kitty.conf and restart kitty.");
33410
+ return false;
33411
+ }
33412
+ const kitten = await this.getBinary();
33413
+ return await gracefulClosePane(kitten, paneId, {
33414
+ ctrlC: ["@", "send-key", "--match", `id:${paneId}`, "ctrl+c"],
33415
+ close: ["@", "close-window", "--match", `id:${paneId}`],
33416
+ acceptExitCode1: true,
33417
+ emptyPaneReturnsTrue: true,
33418
+ env: this.kittyEnv()
33419
+ });
33420
+ }
33421
+ async applyLayout(layout, mainPaneSize) {
33422
+ if (!this.isInsideSession()) {
33423
+ log("[kitty] applyLayout: OpenCode is not running inside a kitty session; " + "cannot target a kitty instance");
33424
+ return;
33425
+ }
33426
+ if (!this.hasListenOn()) {
33427
+ log("[kitty] applyLayout: KITTY_LISTEN_ON is not set; cannot target kitty. " + "Add `listen_on` to kitty.conf and restart kitty.");
33428
+ return;
33429
+ }
33430
+ this.storedLayout = layout;
33431
+ const { kittyLayout } = getKittyLayoutConfig(layout);
33432
+ await this.ensureLayout(kittyLayout);
33433
+ }
33434
+ async runKitty(kitten, args) {
33435
+ const proc = crossSpawn([kitten, ...args], {
33436
+ stdout: "pipe",
33437
+ stderr: "pipe",
33438
+ env: this.kittyEnv()
33439
+ });
33440
+ const [exitCode, , stderr] = await Promise.all([
33441
+ proc.exited,
33442
+ proc.stdout(),
33443
+ proc.stderr()
33444
+ ]);
33445
+ if (exitCode !== 0) {
33446
+ log("[kitty] command failed", {
33447
+ command: args[1],
33448
+ args: [kitten, ...args],
33449
+ exitCode,
33450
+ stderr: stderr.trim()
33451
+ });
33452
+ }
33453
+ return exitCode;
33454
+ }
33455
+ async ensureLayout(kittyLayout) {
33456
+ if (this.appliedLayout === kittyLayout)
33457
+ return;
33458
+ const kitten = await this.getBinary();
33459
+ if (!kitten)
33460
+ return;
33461
+ try {
33462
+ const exitCode = await this.runKitty(kitten, [
33463
+ "@",
33464
+ "goto-layout",
33465
+ kittyLayout
33466
+ ]);
33467
+ if (exitCode === 0)
33468
+ this.appliedLayout = kittyLayout;
33469
+ } catch (err) {
33470
+ log("[kitty] ensureLayout: exception", { error: String(err) });
33471
+ }
33472
+ }
33473
+ async getBinary() {
33474
+ await this.isAvailable();
33475
+ return this.binaryPath;
33476
+ }
33477
+ kittyEnv() {
33478
+ const listenOn = process.env.KITTY_LISTEN_ON;
33479
+ if (!listenOn)
33480
+ return;
33481
+ return { ...process.env, KITTY_LISTEN_ON: listenOn };
33482
+ }
33483
+ }
33484
+ function getKittyLayoutConfig(layout) {
33485
+ switch (layout) {
33486
+ case "main-vertical":
33487
+ return { kittyLayout: "tall", location: "after" };
33488
+ case "main-horizontal":
33489
+ return { kittyLayout: "fat", location: "after" };
33490
+ case "tiled":
33491
+ return { kittyLayout: "grid", location: "after" };
33492
+ case "even-horizontal":
33493
+ return { kittyLayout: "horizontal", location: "after" };
33494
+ case "even-vertical":
33495
+ return { kittyLayout: "vertical", location: "after" };
33496
+ default: {
33497
+ const _exhaustive = layout;
33498
+ return _exhaustive;
33499
+ }
33500
+ }
33501
+ }
33502
+
33119
33503
  // src/multiplexer/tmux/index.ts
33120
33504
  init_compat();
33121
33505
  var TMUX_LAYOUT_DEBOUNCE_MS = 150;
@@ -33663,6 +34047,10 @@ function getMultiplexer(config) {
33663
34047
  multiplexer = new CmuxMultiplexer;
33664
34048
  actualType = "cmux";
33665
34049
  break;
34050
+ case "kitty":
34051
+ multiplexer = new KittyMultiplexer(config.layout, config.main_pane_size);
34052
+ actualType = "kitty";
34053
+ break;
33666
34054
  case "auto": {
33667
34055
  if (process.env.CMUX_SOCKET_PATH && process.env.CMUX_WORKSPACE_ID && process.env.CMUX_SURFACE_ID) {
33668
34056
  multiplexer = new CmuxMultiplexer;
@@ -33676,6 +34064,9 @@ function getMultiplexer(config) {
33676
34064
  } else if (process.env.HERDR_ENV || process.env.HERDR_PANE_ID) {
33677
34065
  multiplexer = new HerdrMultiplexer(config.layout, config.main_pane_size);
33678
34066
  actualType = "herdr";
34067
+ } else if (process.env.KITTY_PID || process.env.KITTY_WINDOW_ID) {
34068
+ multiplexer = new KittyMultiplexer(config.layout, config.main_pane_size);
34069
+ actualType = "kitty";
33679
34070
  } else {
33680
34071
  log("[multiplexer] auto: not inside any session, disabling");
33681
34072
  return null;
@@ -38820,47 +39211,6 @@ function isPluginDisabledByEnv(env = process.env) {
38820
39211
  return isTruthyEnvValue(env[PLUGIN_DISABLE_ENV]);
38821
39212
  }
38822
39213
 
38823
- // src/utils/subagent-depth.ts
38824
- class SubagentDepthTracker {
38825
- depthBySession = new Map;
38826
- _maxDepth;
38827
- constructor(maxDepth = DEFAULT_MAX_SUBAGENT_DEPTH) {
38828
- this._maxDepth = maxDepth;
38829
- }
38830
- get maxDepth() {
38831
- return this._maxDepth;
38832
- }
38833
- getDepth(sessionId) {
38834
- return this.depthBySession.get(sessionId) ?? 0;
38835
- }
38836
- registerChild(parentSessionId, childSessionId) {
38837
- const parentDepth = this.getDepth(parentSessionId);
38838
- const childDepth = parentDepth + 1;
38839
- if (childDepth > this.maxDepth) {
38840
- log("[subagent-depth] spawn blocked: max depth exceeded", {
38841
- parentSessionId,
38842
- parentDepth,
38843
- childDepth,
38844
- maxDepth: this.maxDepth
38845
- });
38846
- return false;
38847
- }
38848
- this.depthBySession.set(childSessionId, childDepth);
38849
- log("[subagent-depth] child registered", {
38850
- parentSessionId,
38851
- childSessionId,
38852
- childDepth
38853
- });
38854
- return true;
38855
- }
38856
- cleanup(sessionId) {
38857
- this.depthBySession.delete(sessionId);
38858
- }
38859
- cleanupAll() {
38860
- this.depthBySession.clear();
38861
- }
38862
- }
38863
-
38864
39214
  // src/utils/system-collapse.ts
38865
39215
  function collapseSystemInPlace(system2) {
38866
39216
  if (system2.length === 0) {
@@ -38924,7 +39274,6 @@ var OhMyOpenCodeLite = async (ctx) => {
38924
39274
  let runtimeChains;
38925
39275
  let multiplexerConfig;
38926
39276
  let multiplexerEnabled;
38927
- let depthTracker;
38928
39277
  let multiplexerSessionManager;
38929
39278
  let autoUpdateChecker;
38930
39279
  let sessionAgentMap;
@@ -38996,8 +39345,7 @@ var OhMyOpenCodeLite = async (ctx) => {
38996
39345
  if (multiplexerEnabled) {
38997
39346
  startAvailabilityCheck(multiplexerConfig);
38998
39347
  }
38999
- depthTracker = new SubagentDepthTracker;
39000
- councilTools = config.council ? createCouncilTool(ctx, new CouncilManager(ctx, config, depthTracker, multiplexerEnabled)) : {};
39348
+ councilTools = config.council ? createCouncilTool(ctx, new CouncilManager(ctx, config, multiplexerEnabled)) : {};
39001
39349
  mcps = createBuiltinMcps(config.disabled_mcps, config.websearch);
39002
39350
  acpRunTools = Object.keys(config.acpAgents ?? {}).length > 0 ? { acp_run: createAcpRunTool(config.acpAgents) } : {};
39003
39351
  webfetch = createWebfetchTool(ctx);
@@ -39050,10 +39398,13 @@ var OhMyOpenCodeLite = async (ctx) => {
39050
39398
  }
39051
39399
  };
39052
39400
  };
39053
- phaseReminder = createPhaseReminderHook(sessionLifecycle);
39401
+ const shouldInjectOrchestratorReminder = (sessionID) => sessionAgentMap.get(sessionID) === "orchestrator";
39402
+ phaseReminder = createPhaseReminderHook({
39403
+ shouldInject: shouldInjectOrchestratorReminder
39404
+ });
39054
39405
  filterAvailableSkills = createFilterAvailableSkillsHook(ctx, config);
39055
39406
  postFileToolNudge = createPostFileToolNudgeHook({
39056
- shouldInject: (sessionID) => sessionAgentMap.get(sessionID) === "orchestrator",
39407
+ shouldInject: shouldInjectOrchestratorReminder,
39057
39408
  coordinator: sessionLifecycle
39058
39409
  });
39059
39410
  delegateTaskRetry = createDelegateTaskRetryHook(ctx);
@@ -39366,27 +39717,22 @@ var OhMyOpenCodeLite = async (ctx) => {
39366
39717
  }
39367
39718
  }
39368
39719
  if (event.type === "session.created") {
39369
- const childSessionId = event.properties?.info?.id;
39370
- const parentSessionId = event.properties?.info?.parentID;
39371
- if (depthTracker && childSessionId && parentSessionId) {
39372
- depthTracker.registerChild(parentSessionId, childSessionId);
39373
- }
39374
39720
  const createdSessionId = event.properties?.info?.id;
39375
39721
  const createdSessionDir = event.properties?.info?.directory;
39376
39722
  if (createdSessionId && createdSessionDir) {
39377
39723
  sessionDirectories.set(createdSessionId, createdSessionDir);
39378
39724
  }
39379
39725
  }
39380
- await multiplexerSessionManager.onSessionCreated(event);
39381
- await multiplexerSessionManager.onSessionStatus(event);
39382
- await multiplexerSessionManager.onSessionDeleted(event);
39383
- if (event.type === "server.instance.disposed") {
39726
+ await handleTaskSessionEvent(input, taskSessionManagerHook.event, async () => {
39727
+ await multiplexerSessionManager.onSessionCreated(event);
39728
+ await multiplexerSessionManager.onSessionStatus(event);
39729
+ await multiplexerSessionManager.onSessionDeleted(event);
39730
+ }, async () => {
39384
39731
  await multiplexerSessionManager.cleanupOnInstanceDisposed();
39385
- }
39732
+ });
39386
39733
  await foregroundFallback.handleEvent(input.event);
39387
39734
  await autoUpdateChecker.event(input);
39388
39735
  await interviewManager.handleEvent(input);
39389
- await taskSessionManagerHook.event(input);
39390
39736
  if (event.type === "permission.asked" || event.type === "question.asked") {
39391
39737
  companionManager.onWaitingInput();
39392
39738
  }
@@ -39409,9 +39755,6 @@ var OhMyOpenCodeLite = async (ctx) => {
39409
39755
  sessionLifecycle.dispatchSessionDeleted(sessionID);
39410
39756
  }
39411
39757
  companionManager.onSessionDeleted(sessionID);
39412
- if (depthTracker && sessionID) {
39413
- depthTracker.cleanup(sessionID);
39414
- }
39415
39758
  if (sessionID) {
39416
39759
  sessionAgentMap.delete(sessionID);
39417
39760
  sessionDirectories.delete(sessionID);
@@ -39445,6 +39788,7 @@ var OhMyOpenCodeLite = async (ctx) => {
39445
39788
  status: "busy"
39446
39789
  });
39447
39790
  }
39791
+ taskSessionManagerHook.observeChatMessage(input, output);
39448
39792
  },
39449
39793
  "experimental.chat.system.transform": async (input, output) => {
39450
39794
  const agentName = input.sessionID ? sessionAgentMap.get(input.sessionID) : undefined;
@@ -39458,7 +39802,6 @@ var OhMyOpenCodeLite = async (ctx) => {
39458
39802
  ${output.system[0]}` : "");
39459
39803
  }
39460
39804
  }
39461
- await postFileToolNudge["experimental.chat.system.transform"](input, output);
39462
39805
  collapseSystemInPlace(output.system);
39463
39806
  },
39464
39807
  "experimental.chat.messages.transform": async (input, output) => {
@@ -39484,9 +39827,10 @@ ${output.system[0]}` : "");
39484
39827
  disabledAgents,
39485
39828
  log
39486
39829
  });
39830
+ await taskSessionManagerHook["experimental.chat.messages.transform"](input, typedOutput);
39831
+ await postFileToolNudge["experimental.chat.messages.transform"](input, typedOutput);
39487
39832
  await phaseReminder["experimental.chat.messages.transform"](input, typedOutput);
39488
39833
  await filterAvailableSkills["experimental.chat.messages.transform"](input, typedOutput);
39489
- await taskSessionManagerHook["experimental.chat.messages.transform"](input, typedOutput);
39490
39834
  },
39491
39835
  "tool.execute.after": async (input, output) => {
39492
39836
  await postFileToolNudgeAfter(input, output);