@harmonyos-arkts/opencode-acp 0.0.2 → 0.0.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.cjs CHANGED
@@ -30,9 +30,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  mod
31
31
  ));
32
32
 
33
- // node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js
33
+ // node_modules/isexe/windows.js
34
34
  var require_windows = __commonJS({
35
- "node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports2, module2) {
35
+ "node_modules/isexe/windows.js"(exports2, module2) {
36
36
  module2.exports = isexe;
37
37
  isexe.sync = sync;
38
38
  var fs = require("fs");
@@ -70,9 +70,9 @@ var require_windows = __commonJS({
70
70
  }
71
71
  });
72
72
 
73
- // node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js
73
+ // node_modules/isexe/mode.js
74
74
  var require_mode = __commonJS({
75
- "node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports2, module2) {
75
+ "node_modules/isexe/mode.js"(exports2, module2) {
76
76
  module2.exports = isexe;
77
77
  isexe.sync = sync;
78
78
  var fs = require("fs");
@@ -103,9 +103,9 @@ var require_mode = __commonJS({
103
103
  }
104
104
  });
105
105
 
106
- // node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js
106
+ // node_modules/isexe/index.js
107
107
  var require_isexe = __commonJS({
108
- "node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports2, module2) {
108
+ "node_modules/isexe/index.js"(exports2, module2) {
109
109
  var fs = require("fs");
110
110
  var core;
111
111
  if (process.platform === "win32" || global.TESTING_WINDOWS) {
@@ -158,9 +158,9 @@ var require_isexe = __commonJS({
158
158
  }
159
159
  });
160
160
 
161
- // node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
161
+ // node_modules/which/which.js
162
162
  var require_which = __commonJS({
163
- "node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports2, module2) {
163
+ "node_modules/which/which.js"(exports2, module2) {
164
164
  var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
165
165
  var path = require("path");
166
166
  var COLON = isWindows ? ";" : ":";
@@ -254,9 +254,9 @@ var require_which = __commonJS({
254
254
  }
255
255
  });
256
256
 
257
- // node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js
257
+ // node_modules/path-key/index.js
258
258
  var require_path_key = __commonJS({
259
- "node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js"(exports2, module2) {
259
+ "node_modules/path-key/index.js"(exports2, module2) {
260
260
  "use strict";
261
261
  var pathKey = (options = {}) => {
262
262
  const environment = options.env || process.env;
@@ -271,9 +271,9 @@ var require_path_key = __commonJS({
271
271
  }
272
272
  });
273
273
 
274
- // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
274
+ // node_modules/cross-spawn/lib/util/resolveCommand.js
275
275
  var require_resolveCommand = __commonJS({
276
- "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports2, module2) {
276
+ "node_modules/cross-spawn/lib/util/resolveCommand.js"(exports2, module2) {
277
277
  "use strict";
278
278
  var path = require("path");
279
279
  var which = require_which();
@@ -313,9 +313,9 @@ var require_resolveCommand = __commonJS({
313
313
  }
314
314
  });
315
315
 
316
- // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js
316
+ // node_modules/cross-spawn/lib/util/escape.js
317
317
  var require_escape = __commonJS({
318
- "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js"(exports2, module2) {
318
+ "node_modules/cross-spawn/lib/util/escape.js"(exports2, module2) {
319
319
  "use strict";
320
320
  var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
321
321
  function escapeCommand(arg) {
@@ -338,17 +338,17 @@ var require_escape = __commonJS({
338
338
  }
339
339
  });
340
340
 
341
- // node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js
341
+ // node_modules/shebang-regex/index.js
342
342
  var require_shebang_regex = __commonJS({
343
- "node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js"(exports2, module2) {
343
+ "node_modules/shebang-regex/index.js"(exports2, module2) {
344
344
  "use strict";
345
345
  module2.exports = /^#!(.*)/;
346
346
  }
347
347
  });
348
348
 
349
- // node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js
349
+ // node_modules/shebang-command/index.js
350
350
  var require_shebang_command = __commonJS({
351
- "node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js"(exports2, module2) {
351
+ "node_modules/shebang-command/index.js"(exports2, module2) {
352
352
  "use strict";
353
353
  var shebangRegex = require_shebang_regex();
354
354
  module2.exports = (string4 = "") => {
@@ -366,9 +366,9 @@ var require_shebang_command = __commonJS({
366
366
  }
367
367
  });
368
368
 
369
- // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
369
+ // node_modules/cross-spawn/lib/util/readShebang.js
370
370
  var require_readShebang = __commonJS({
371
- "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports2, module2) {
371
+ "node_modules/cross-spawn/lib/util/readShebang.js"(exports2, module2) {
372
372
  "use strict";
373
373
  var fs = require("fs");
374
374
  var shebangCommand = require_shebang_command();
@@ -388,9 +388,9 @@ var require_readShebang = __commonJS({
388
388
  }
389
389
  });
390
390
 
391
- // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
391
+ // node_modules/cross-spawn/lib/parse.js
392
392
  var require_parse = __commonJS({
393
- "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports2, module2) {
393
+ "node_modules/cross-spawn/lib/parse.js"(exports2, module2) {
394
394
  "use strict";
395
395
  var path = require("path");
396
396
  var resolveCommand = require_resolveCommand();
@@ -450,9 +450,9 @@ var require_parse = __commonJS({
450
450
  }
451
451
  });
452
452
 
453
- // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js
453
+ // node_modules/cross-spawn/lib/enoent.js
454
454
  var require_enoent = __commonJS({
455
- "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js"(exports2, module2) {
455
+ "node_modules/cross-spawn/lib/enoent.js"(exports2, module2) {
456
456
  "use strict";
457
457
  var isWin2 = process.platform === "win32";
458
458
  function notFoundError(original, syscall) {
@@ -500,9 +500,9 @@ var require_enoent = __commonJS({
500
500
  }
501
501
  });
502
502
 
503
- // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js
503
+ // node_modules/cross-spawn/index.js
504
504
  var require_cross_spawn = __commonJS({
505
- "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports2, module2) {
505
+ "node_modules/cross-spawn/index.js"(exports2, module2) {
506
506
  "use strict";
507
507
  var cp = require("child_process");
508
508
  var parse3 = require_parse();
@@ -527,7 +527,7 @@ var require_cross_spawn = __commonJS({
527
527
  }
528
528
  });
529
529
 
530
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/external.js
530
+ // node_modules/zod/v4/classic/external.js
531
531
  var external_exports = {};
532
532
  __export(external_exports, {
533
533
  $brand: () => $brand,
@@ -768,7 +768,7 @@ __export(external_exports, {
768
768
  xor: () => xor
769
769
  });
770
770
 
771
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/index.js
771
+ // node_modules/zod/v4/core/index.js
772
772
  var core_exports2 = {};
773
773
  __export(core_exports2, {
774
774
  $ZodAny: () => $ZodAny,
@@ -1046,7 +1046,7 @@ __export(core_exports2, {
1046
1046
  version: () => version
1047
1047
  });
1048
1048
 
1049
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.js
1049
+ // node_modules/zod/v4/core/core.js
1050
1050
  var NEVER = Object.freeze({
1051
1051
  status: "aborted"
1052
1052
  });
@@ -1121,7 +1121,7 @@ function config(newConfig) {
1121
1121
  return globalConfig;
1122
1122
  }
1123
1123
 
1124
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.js
1124
+ // node_modules/zod/v4/core/util.js
1125
1125
  var util_exports = {};
1126
1126
  __export(util_exports, {
1127
1127
  BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
@@ -1800,7 +1800,7 @@ var Class = class {
1800
1800
  }
1801
1801
  };
1802
1802
 
1803
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.js
1803
+ // node_modules/zod/v4/core/errors.js
1804
1804
  var initializer = (inst, def) => {
1805
1805
  inst.name = "$ZodError";
1806
1806
  Object.defineProperty(inst, "_zod", {
@@ -1936,7 +1936,7 @@ function prettifyError(error48) {
1936
1936
  return lines.join("\n");
1937
1937
  }
1938
1938
 
1939
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/parse.js
1939
+ // node_modules/zod/v4/core/parse.js
1940
1940
  var _parse = (_Err) => (schema, value, _ctx, _params) => {
1941
1941
  const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
1942
1942
  const result = schema._zod.run({ value, issues: [] }, ctx);
@@ -2024,7 +2024,7 @@ var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
2024
2024
  };
2025
2025
  var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
2026
2026
 
2027
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/regexes.js
2027
+ // node_modules/zod/v4/core/regexes.js
2028
2028
  var regexes_exports = {};
2029
2029
  __export(regexes_exports, {
2030
2030
  base64: () => base64,
@@ -2181,7 +2181,7 @@ var sha512_hex = /^[0-9a-fA-F]{128}$/;
2181
2181
  var sha512_base64 = /* @__PURE__ */ fixedBase64(86, "==");
2182
2182
  var sha512_base64url = /* @__PURE__ */ fixedBase64url(86);
2183
2183
 
2184
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.js
2184
+ // node_modules/zod/v4/core/checks.js
2185
2185
  var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
2186
2186
  var _a2;
2187
2187
  inst._zod ?? (inst._zod = {});
@@ -2729,7 +2729,7 @@ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (ins
2729
2729
  };
2730
2730
  });
2731
2731
 
2732
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/doc.js
2732
+ // node_modules/zod/v4/core/doc.js
2733
2733
  var Doc = class {
2734
2734
  constructor(args = []) {
2735
2735
  this.content = [];
@@ -2765,14 +2765,14 @@ var Doc = class {
2765
2765
  }
2766
2766
  };
2767
2767
 
2768
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.js
2768
+ // node_modules/zod/v4/core/versions.js
2769
2769
  var version = {
2770
2770
  major: 4,
2771
2771
  minor: 3,
2772
2772
  patch: 6
2773
2773
  };
2774
2774
 
2775
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.js
2775
+ // node_modules/zod/v4/core/schemas.js
2776
2776
  var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
2777
2777
  var _a2;
2778
2778
  inst ?? (inst = {});
@@ -4743,7 +4743,7 @@ function handleRefineResult(result, payload, input, inst) {
4743
4743
  }
4744
4744
  }
4745
4745
 
4746
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/index.js
4746
+ // node_modules/zod/v4/locales/index.js
4747
4747
  var locales_exports = {};
4748
4748
  __export(locales_exports, {
4749
4749
  ar: () => ar_default,
@@ -4797,7 +4797,7 @@ __export(locales_exports, {
4797
4797
  zhTW: () => zh_TW_default
4798
4798
  });
4799
4799
 
4800
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ar.js
4800
+ // node_modules/zod/v4/locales/ar.js
4801
4801
  var error = () => {
4802
4802
  const Sizable = {
4803
4803
  string: { unit: "\u062D\u0631\u0641", verb: "\u0623\u0646 \u064A\u062D\u0648\u064A" },
@@ -4904,7 +4904,7 @@ function ar_default() {
4904
4904
  };
4905
4905
  }
4906
4906
 
4907
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/az.js
4907
+ // node_modules/zod/v4/locales/az.js
4908
4908
  var error2 = () => {
4909
4909
  const Sizable = {
4910
4910
  string: { unit: "simvol", verb: "olmal\u0131d\u0131r" },
@@ -5010,7 +5010,7 @@ function az_default() {
5010
5010
  };
5011
5011
  }
5012
5012
 
5013
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/be.js
5013
+ // node_modules/zod/v4/locales/be.js
5014
5014
  function getBelarusianPlural(count, one, few, many) {
5015
5015
  const absCount = Math.abs(count);
5016
5016
  const lastDigit = absCount % 10;
@@ -5167,7 +5167,7 @@ function be_default() {
5167
5167
  };
5168
5168
  }
5169
5169
 
5170
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/bg.js
5170
+ // node_modules/zod/v4/locales/bg.js
5171
5171
  var error4 = () => {
5172
5172
  const Sizable = {
5173
5173
  string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0430", verb: "\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430" },
@@ -5288,7 +5288,7 @@ function bg_default() {
5288
5288
  };
5289
5289
  }
5290
5290
 
5291
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ca.js
5291
+ // node_modules/zod/v4/locales/ca.js
5292
5292
  var error5 = () => {
5293
5293
  const Sizable = {
5294
5294
  string: { unit: "car\xE0cters", verb: "contenir" },
@@ -5397,7 +5397,7 @@ function ca_default() {
5397
5397
  };
5398
5398
  }
5399
5399
 
5400
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/cs.js
5400
+ // node_modules/zod/v4/locales/cs.js
5401
5401
  var error6 = () => {
5402
5402
  const Sizable = {
5403
5403
  string: { unit: "znak\u016F", verb: "m\xEDt" },
@@ -5509,7 +5509,7 @@ function cs_default() {
5509
5509
  };
5510
5510
  }
5511
5511
 
5512
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/da.js
5512
+ // node_modules/zod/v4/locales/da.js
5513
5513
  var error7 = () => {
5514
5514
  const Sizable = {
5515
5515
  string: { unit: "tegn", verb: "havde" },
@@ -5625,7 +5625,7 @@ function da_default() {
5625
5625
  };
5626
5626
  }
5627
5627
 
5628
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/de.js
5628
+ // node_modules/zod/v4/locales/de.js
5629
5629
  var error8 = () => {
5630
5630
  const Sizable = {
5631
5631
  string: { unit: "Zeichen", verb: "zu haben" },
@@ -5734,7 +5734,7 @@ function de_default() {
5734
5734
  };
5735
5735
  }
5736
5736
 
5737
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/en.js
5737
+ // node_modules/zod/v4/locales/en.js
5738
5738
  var error9 = () => {
5739
5739
  const Sizable = {
5740
5740
  string: { unit: "characters", verb: "to have" },
@@ -5843,7 +5843,7 @@ function en_default() {
5843
5843
  };
5844
5844
  }
5845
5845
 
5846
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/eo.js
5846
+ // node_modules/zod/v4/locales/eo.js
5847
5847
  var error10 = () => {
5848
5848
  const Sizable = {
5849
5849
  string: { unit: "karaktrojn", verb: "havi" },
@@ -5953,7 +5953,7 @@ function eo_default() {
5953
5953
  };
5954
5954
  }
5955
5955
 
5956
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/es.js
5956
+ // node_modules/zod/v4/locales/es.js
5957
5957
  var error11 = () => {
5958
5958
  const Sizable = {
5959
5959
  string: { unit: "caracteres", verb: "tener" },
@@ -6086,7 +6086,7 @@ function es_default() {
6086
6086
  };
6087
6087
  }
6088
6088
 
6089
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/fa.js
6089
+ // node_modules/zod/v4/locales/fa.js
6090
6090
  var error12 = () => {
6091
6091
  const Sizable = {
6092
6092
  string: { unit: "\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631", verb: "\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F" },
@@ -6201,7 +6201,7 @@ function fa_default() {
6201
6201
  };
6202
6202
  }
6203
6203
 
6204
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/fi.js
6204
+ // node_modules/zod/v4/locales/fi.js
6205
6205
  var error13 = () => {
6206
6206
  const Sizable = {
6207
6207
  string: { unit: "merkki\xE4", subject: "merkkijonon" },
@@ -6314,7 +6314,7 @@ function fi_default() {
6314
6314
  };
6315
6315
  }
6316
6316
 
6317
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/fr.js
6317
+ // node_modules/zod/v4/locales/fr.js
6318
6318
  var error14 = () => {
6319
6319
  const Sizable = {
6320
6320
  string: { unit: "caract\xE8res", verb: "avoir" },
@@ -6423,7 +6423,7 @@ function fr_default() {
6423
6423
  };
6424
6424
  }
6425
6425
 
6426
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/fr-CA.js
6426
+ // node_modules/zod/v4/locales/fr-CA.js
6427
6427
  var error15 = () => {
6428
6428
  const Sizable = {
6429
6429
  string: { unit: "caract\xE8res", verb: "avoir" },
@@ -6531,7 +6531,7 @@ function fr_CA_default() {
6531
6531
  };
6532
6532
  }
6533
6533
 
6534
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/he.js
6534
+ // node_modules/zod/v4/locales/he.js
6535
6535
  var error16 = () => {
6536
6536
  const TypeNames = {
6537
6537
  string: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA", gender: "f" },
@@ -6726,7 +6726,7 @@ function he_default() {
6726
6726
  };
6727
6727
  }
6728
6728
 
6729
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/hu.js
6729
+ // node_modules/zod/v4/locales/hu.js
6730
6730
  var error17 = () => {
6731
6731
  const Sizable = {
6732
6732
  string: { unit: "karakter", verb: "legyen" },
@@ -6835,7 +6835,7 @@ function hu_default() {
6835
6835
  };
6836
6836
  }
6837
6837
 
6838
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/hy.js
6838
+ // node_modules/zod/v4/locales/hy.js
6839
6839
  function getArmenianPlural(count, one, many) {
6840
6840
  return Math.abs(count) === 1 ? one : many;
6841
6841
  }
@@ -6983,7 +6983,7 @@ function hy_default() {
6983
6983
  };
6984
6984
  }
6985
6985
 
6986
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/id.js
6986
+ // node_modules/zod/v4/locales/id.js
6987
6987
  var error19 = () => {
6988
6988
  const Sizable = {
6989
6989
  string: { unit: "karakter", verb: "memiliki" },
@@ -7090,7 +7090,7 @@ function id_default() {
7090
7090
  };
7091
7091
  }
7092
7092
 
7093
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/is.js
7093
+ // node_modules/zod/v4/locales/is.js
7094
7094
  var error20 = () => {
7095
7095
  const Sizable = {
7096
7096
  string: { unit: "stafi", verb: "a\xF0 hafa" },
@@ -7200,7 +7200,7 @@ function is_default() {
7200
7200
  };
7201
7201
  }
7202
7202
 
7203
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/it.js
7203
+ // node_modules/zod/v4/locales/it.js
7204
7204
  var error21 = () => {
7205
7205
  const Sizable = {
7206
7206
  string: { unit: "caratteri", verb: "avere" },
@@ -7309,7 +7309,7 @@ function it_default() {
7309
7309
  };
7310
7310
  }
7311
7311
 
7312
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ja.js
7312
+ // node_modules/zod/v4/locales/ja.js
7313
7313
  var error22 = () => {
7314
7314
  const Sizable = {
7315
7315
  string: { unit: "\u6587\u5B57", verb: "\u3067\u3042\u308B" },
@@ -7417,7 +7417,7 @@ function ja_default() {
7417
7417
  };
7418
7418
  }
7419
7419
 
7420
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ka.js
7420
+ // node_modules/zod/v4/locales/ka.js
7421
7421
  var error23 = () => {
7422
7422
  const Sizable = {
7423
7423
  string: { unit: "\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD", verb: "\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1" },
@@ -7530,7 +7530,7 @@ function ka_default() {
7530
7530
  };
7531
7531
  }
7532
7532
 
7533
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/km.js
7533
+ // node_modules/zod/v4/locales/km.js
7534
7534
  var error24 = () => {
7535
7535
  const Sizable = {
7536
7536
  string: { unit: "\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A", verb: "\u1782\u17BD\u179A\u1798\u17B6\u1793" },
@@ -7641,12 +7641,12 @@ function km_default() {
7641
7641
  };
7642
7642
  }
7643
7643
 
7644
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/kh.js
7644
+ // node_modules/zod/v4/locales/kh.js
7645
7645
  function kh_default() {
7646
7646
  return km_default();
7647
7647
  }
7648
7648
 
7649
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ko.js
7649
+ // node_modules/zod/v4/locales/ko.js
7650
7650
  var error25 = () => {
7651
7651
  const Sizable = {
7652
7652
  string: { unit: "\uBB38\uC790", verb: "to have" },
@@ -7758,7 +7758,7 @@ function ko_default() {
7758
7758
  };
7759
7759
  }
7760
7760
 
7761
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/lt.js
7761
+ // node_modules/zod/v4/locales/lt.js
7762
7762
  var capitalizeFirstCharacter = (text) => {
7763
7763
  return text.charAt(0).toUpperCase() + text.slice(1);
7764
7764
  };
@@ -7962,7 +7962,7 @@ function lt_default() {
7962
7962
  };
7963
7963
  }
7964
7964
 
7965
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/mk.js
7965
+ // node_modules/zod/v4/locales/mk.js
7966
7966
  var error27 = () => {
7967
7967
  const Sizable = {
7968
7968
  string: { unit: "\u0437\u043D\u0430\u0446\u0438", verb: "\u0434\u0430 \u0438\u043C\u0430\u0430\u0442" },
@@ -8072,7 +8072,7 @@ function mk_default() {
8072
8072
  };
8073
8073
  }
8074
8074
 
8075
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ms.js
8075
+ // node_modules/zod/v4/locales/ms.js
8076
8076
  var error28 = () => {
8077
8077
  const Sizable = {
8078
8078
  string: { unit: "aksara", verb: "mempunyai" },
@@ -8180,7 +8180,7 @@ function ms_default() {
8180
8180
  };
8181
8181
  }
8182
8182
 
8183
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/nl.js
8183
+ // node_modules/zod/v4/locales/nl.js
8184
8184
  var error29 = () => {
8185
8185
  const Sizable = {
8186
8186
  string: { unit: "tekens", verb: "heeft" },
@@ -8291,7 +8291,7 @@ function nl_default() {
8291
8291
  };
8292
8292
  }
8293
8293
 
8294
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/no.js
8294
+ // node_modules/zod/v4/locales/no.js
8295
8295
  var error30 = () => {
8296
8296
  const Sizable = {
8297
8297
  string: { unit: "tegn", verb: "\xE5 ha" },
@@ -8400,7 +8400,7 @@ function no_default() {
8400
8400
  };
8401
8401
  }
8402
8402
 
8403
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ota.js
8403
+ // node_modules/zod/v4/locales/ota.js
8404
8404
  var error31 = () => {
8405
8405
  const Sizable = {
8406
8406
  string: { unit: "harf", verb: "olmal\u0131d\u0131r" },
@@ -8510,7 +8510,7 @@ function ota_default() {
8510
8510
  };
8511
8511
  }
8512
8512
 
8513
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ps.js
8513
+ // node_modules/zod/v4/locales/ps.js
8514
8514
  var error32 = () => {
8515
8515
  const Sizable = {
8516
8516
  string: { unit: "\u062A\u0648\u06A9\u064A", verb: "\u0648\u0644\u0631\u064A" },
@@ -8625,7 +8625,7 @@ function ps_default() {
8625
8625
  };
8626
8626
  }
8627
8627
 
8628
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/pl.js
8628
+ // node_modules/zod/v4/locales/pl.js
8629
8629
  var error33 = () => {
8630
8630
  const Sizable = {
8631
8631
  string: { unit: "znak\xF3w", verb: "mie\u0107" },
@@ -8735,7 +8735,7 @@ function pl_default() {
8735
8735
  };
8736
8736
  }
8737
8737
 
8738
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/pt.js
8738
+ // node_modules/zod/v4/locales/pt.js
8739
8739
  var error34 = () => {
8740
8740
  const Sizable = {
8741
8741
  string: { unit: "caracteres", verb: "ter" },
@@ -8844,7 +8844,7 @@ function pt_default() {
8844
8844
  };
8845
8845
  }
8846
8846
 
8847
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ru.js
8847
+ // node_modules/zod/v4/locales/ru.js
8848
8848
  function getRussianPlural(count, one, few, many) {
8849
8849
  const absCount = Math.abs(count);
8850
8850
  const lastDigit = absCount % 10;
@@ -9001,7 +9001,7 @@ function ru_default() {
9001
9001
  };
9002
9002
  }
9003
9003
 
9004
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/sl.js
9004
+ // node_modules/zod/v4/locales/sl.js
9005
9005
  var error36 = () => {
9006
9006
  const Sizable = {
9007
9007
  string: { unit: "znakov", verb: "imeti" },
@@ -9111,7 +9111,7 @@ function sl_default() {
9111
9111
  };
9112
9112
  }
9113
9113
 
9114
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/sv.js
9114
+ // node_modules/zod/v4/locales/sv.js
9115
9115
  var error37 = () => {
9116
9116
  const Sizable = {
9117
9117
  string: { unit: "tecken", verb: "att ha" },
@@ -9222,7 +9222,7 @@ function sv_default() {
9222
9222
  };
9223
9223
  }
9224
9224
 
9225
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ta.js
9225
+ // node_modules/zod/v4/locales/ta.js
9226
9226
  var error38 = () => {
9227
9227
  const Sizable = {
9228
9228
  string: { unit: "\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD", verb: "\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD" },
@@ -9333,7 +9333,7 @@ function ta_default() {
9333
9333
  };
9334
9334
  }
9335
9335
 
9336
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/th.js
9336
+ // node_modules/zod/v4/locales/th.js
9337
9337
  var error39 = () => {
9338
9338
  const Sizable = {
9339
9339
  string: { unit: "\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
@@ -9444,7 +9444,7 @@ function th_default() {
9444
9444
  };
9445
9445
  }
9446
9446
 
9447
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/tr.js
9447
+ // node_modules/zod/v4/locales/tr.js
9448
9448
  var error40 = () => {
9449
9449
  const Sizable = {
9450
9450
  string: { unit: "karakter", verb: "olmal\u0131" },
@@ -9550,7 +9550,7 @@ function tr_default() {
9550
9550
  };
9551
9551
  }
9552
9552
 
9553
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/uk.js
9553
+ // node_modules/zod/v4/locales/uk.js
9554
9554
  var error41 = () => {
9555
9555
  const Sizable = {
9556
9556
  string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
@@ -9659,12 +9659,12 @@ function uk_default() {
9659
9659
  };
9660
9660
  }
9661
9661
 
9662
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ua.js
9662
+ // node_modules/zod/v4/locales/ua.js
9663
9663
  function ua_default() {
9664
9664
  return uk_default();
9665
9665
  }
9666
9666
 
9667
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ur.js
9667
+ // node_modules/zod/v4/locales/ur.js
9668
9668
  var error42 = () => {
9669
9669
  const Sizable = {
9670
9670
  string: { unit: "\u062D\u0631\u0648\u0641", verb: "\u06C1\u0648\u0646\u0627" },
@@ -9775,7 +9775,7 @@ function ur_default() {
9775
9775
  };
9776
9776
  }
9777
9777
 
9778
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/uz.js
9778
+ // node_modules/zod/v4/locales/uz.js
9779
9779
  var error43 = () => {
9780
9780
  const Sizable = {
9781
9781
  string: { unit: "belgi", verb: "bo\u2018lishi kerak" },
@@ -9885,7 +9885,7 @@ function uz_default() {
9885
9885
  };
9886
9886
  }
9887
9887
 
9888
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/vi.js
9888
+ // node_modules/zod/v4/locales/vi.js
9889
9889
  var error44 = () => {
9890
9890
  const Sizable = {
9891
9891
  string: { unit: "k\xFD t\u1EF1", verb: "c\xF3" },
@@ -9994,7 +9994,7 @@ function vi_default() {
9994
9994
  };
9995
9995
  }
9996
9996
 
9997
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/zh-CN.js
9997
+ // node_modules/zod/v4/locales/zh-CN.js
9998
9998
  var error45 = () => {
9999
9999
  const Sizable = {
10000
10000
  string: { unit: "\u5B57\u7B26", verb: "\u5305\u542B" },
@@ -10104,7 +10104,7 @@ function zh_CN_default() {
10104
10104
  };
10105
10105
  }
10106
10106
 
10107
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/zh-TW.js
10107
+ // node_modules/zod/v4/locales/zh-TW.js
10108
10108
  var error46 = () => {
10109
10109
  const Sizable = {
10110
10110
  string: { unit: "\u5B57\u5143", verb: "\u64C1\u6709" },
@@ -10212,7 +10212,7 @@ function zh_TW_default() {
10212
10212
  };
10213
10213
  }
10214
10214
 
10215
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/yo.js
10215
+ // node_modules/zod/v4/locales/yo.js
10216
10216
  var error47 = () => {
10217
10217
  const Sizable = {
10218
10218
  string: { unit: "\xE0mi", verb: "n\xED" },
@@ -10320,7 +10320,7 @@ function yo_default() {
10320
10320
  };
10321
10321
  }
10322
10322
 
10323
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.js
10323
+ // node_modules/zod/v4/core/registries.js
10324
10324
  var _a;
10325
10325
  var $output = Symbol("ZodOutput");
10326
10326
  var $input = Symbol("ZodInput");
@@ -10370,7 +10370,7 @@ function registry() {
10370
10370
  (_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
10371
10371
  var globalRegistry = globalThis.__zod_globalRegistry;
10372
10372
 
10373
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.js
10373
+ // node_modules/zod/v4/core/api.js
10374
10374
  // @__NO_SIDE_EFFECTS__
10375
10375
  function _string(Class2, params) {
10376
10376
  return new Class2({
@@ -11409,7 +11409,7 @@ function _stringFormat(Class2, format, fnOrRegex, _params = {}) {
11409
11409
  return inst;
11410
11410
  }
11411
11411
 
11412
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.js
11412
+ // node_modules/zod/v4/core/to-json-schema.js
11413
11413
  function initializeContext(params) {
11414
11414
  let target = params?.target ?? "draft-2020-12";
11415
11415
  if (target === "draft-4")
@@ -11761,7 +11761,7 @@ var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) =
11761
11761
  return finalize(ctx, schema);
11762
11762
  };
11763
11763
 
11764
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema-processors.js
11764
+ // node_modules/zod/v4/core/json-schema-processors.js
11765
11765
  var formatMap = {
11766
11766
  guid: "uuid",
11767
11767
  url: "uri",
@@ -12312,7 +12312,7 @@ function toJSONSchema(input, params) {
12312
12312
  return finalize(ctx, input);
12313
12313
  }
12314
12314
 
12315
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema-generator.js
12315
+ // node_modules/zod/v4/core/json-schema-generator.js
12316
12316
  var JSONSchemaGenerator = class {
12317
12317
  /** @deprecated Access via ctx instead */
12318
12318
  get metadataRegistry() {
@@ -12387,10 +12387,10 @@ var JSONSchemaGenerator = class {
12387
12387
  }
12388
12388
  };
12389
12389
 
12390
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema.js
12390
+ // node_modules/zod/v4/core/json-schema.js
12391
12391
  var json_schema_exports = {};
12392
12392
 
12393
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/schemas.js
12393
+ // node_modules/zod/v4/classic/schemas.js
12394
12394
  var schemas_exports2 = {};
12395
12395
  __export(schemas_exports2, {
12396
12396
  ZodAny: () => ZodAny,
@@ -12559,7 +12559,7 @@ __export(schemas_exports2, {
12559
12559
  xor: () => xor
12560
12560
  });
12561
12561
 
12562
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/checks.js
12562
+ // node_modules/zod/v4/classic/checks.js
12563
12563
  var checks_exports2 = {};
12564
12564
  __export(checks_exports2, {
12565
12565
  endsWith: () => _endsWith,
@@ -12593,7 +12593,7 @@ __export(checks_exports2, {
12593
12593
  uppercase: () => _uppercase
12594
12594
  });
12595
12595
 
12596
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/iso.js
12596
+ // node_modules/zod/v4/classic/iso.js
12597
12597
  var iso_exports = {};
12598
12598
  __export(iso_exports, {
12599
12599
  ZodISODate: () => ZodISODate,
@@ -12634,7 +12634,7 @@ function duration2(params) {
12634
12634
  return _isoDuration(ZodISODuration, params);
12635
12635
  }
12636
12636
 
12637
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/errors.js
12637
+ // node_modules/zod/v4/classic/errors.js
12638
12638
  var initializer2 = (inst, issues) => {
12639
12639
  $ZodError.init(inst, issues);
12640
12640
  inst.name = "ZodError";
@@ -12674,7 +12674,7 @@ var ZodRealError = $constructor("ZodError", initializer2, {
12674
12674
  Parent: Error
12675
12675
  });
12676
12676
 
12677
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/parse.js
12677
+ // node_modules/zod/v4/classic/parse.js
12678
12678
  var parse2 = /* @__PURE__ */ _parse(ZodRealError);
12679
12679
  var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
12680
12680
  var safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError);
@@ -12688,7 +12688,7 @@ var safeDecode2 = /* @__PURE__ */ _safeDecode(ZodRealError);
12688
12688
  var safeEncodeAsync2 = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
12689
12689
  var safeDecodeAsync2 = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
12690
12690
 
12691
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/schemas.js
12691
+ // node_modules/zod/v4/classic/schemas.js
12692
12692
  var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
12693
12693
  $ZodType.init(inst, def);
12694
12694
  Object.assign(inst["~standard"], {
@@ -13767,7 +13767,7 @@ function preprocess(fn, schema) {
13767
13767
  return pipe(transform(fn), schema);
13768
13768
  }
13769
13769
 
13770
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/compat.js
13770
+ // node_modules/zod/v4/classic/compat.js
13771
13771
  var ZodIssueCode = {
13772
13772
  invalid_type: "invalid_type",
13773
13773
  too_big: "too_big",
@@ -13793,7 +13793,7 @@ var ZodFirstPartyTypeKind;
13793
13793
  /* @__PURE__ */ (function(ZodFirstPartyTypeKind2) {
13794
13794
  })(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
13795
13795
 
13796
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/from-json-schema.js
13796
+ // node_modules/zod/v4/classic/from-json-schema.js
13797
13797
  var z = {
13798
13798
  ...schemas_exports2,
13799
13799
  ...checks_exports2,
@@ -14267,7 +14267,7 @@ function fromJSONSchema(schema, params) {
14267
14267
  return convertSchema(schema, ctx);
14268
14268
  }
14269
14269
 
14270
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/coerce.js
14270
+ // node_modules/zod/v4/classic/coerce.js
14271
14271
  var coerce_exports = {};
14272
14272
  __export(coerce_exports, {
14273
14273
  bigint: () => bigint3,
@@ -14292,10 +14292,10 @@ function date4(params) {
14292
14292
  return _coercedDate(ZodDate, params);
14293
14293
  }
14294
14294
 
14295
- // node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/external.js
14295
+ // node_modules/zod/v4/classic/external.js
14296
14296
  config(en_default());
14297
14297
 
14298
- // node_modules/.pnpm/@agentclientprotocol+sdk@0.16.1_zod@4.3.6/node_modules/@agentclientprotocol/sdk/dist/schema/index.js
14298
+ // node_modules/@agentclientprotocol/sdk/dist/schema/index.js
14299
14299
  var AGENT_METHODS = {
14300
14300
  authenticate: "authenticate",
14301
14301
  initialize: "initialize",
@@ -14323,7 +14323,7 @@ var CLIENT_METHODS = {
14323
14323
  terminal_wait_for_exit: "terminal/wait_for_exit"
14324
14324
  };
14325
14325
 
14326
- // node_modules/.pnpm/@agentclientprotocol+sdk@0.16.1_zod@4.3.6/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js
14326
+ // node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js
14327
14327
  var zAuthCapabilities = external_exports.object({
14328
14328
  _meta: external_exports.record(external_exports.string(), external_exports.unknown()).nullish(),
14329
14329
  terminal: external_exports.boolean().optional().default(false)
@@ -15186,7 +15186,7 @@ var zClientResponse = external_exports.union([
15186
15186
  })
15187
15187
  ]);
15188
15188
 
15189
- // node_modules/.pnpm/@agentclientprotocol+sdk@0.16.1_zod@4.3.6/node_modules/@agentclientprotocol/sdk/dist/stream.js
15189
+ // node_modules/@agentclientprotocol/sdk/dist/stream.js
15190
15190
  function ndJsonStream(output, input) {
15191
15191
  const textEncoder = new TextEncoder();
15192
15192
  const textDecoder = new TextDecoder();
@@ -15238,7 +15238,7 @@ function ndJsonStream(output, input) {
15238
15238
  return { readable, writable };
15239
15239
  }
15240
15240
 
15241
- // node_modules/.pnpm/@agentclientprotocol+sdk@0.16.1_zod@4.3.6/node_modules/@agentclientprotocol/sdk/dist/acp.js
15241
+ // node_modules/@agentclientprotocol/sdk/dist/acp.js
15242
15242
  var AgentSideConnection = class {
15243
15243
  #connection;
15244
15244
  /**
@@ -15811,7 +15811,7 @@ var RequestError = class _RequestError extends Error {
15811
15811
  }
15812
15812
  };
15813
15813
 
15814
- // node_modules/.pnpm/@opencode-ai+sdk@1.14.21/node_modules/@opencode-ai/sdk/dist/v2/gen/core/serverSentEvents.gen.js
15814
+ // node_modules/@opencode-ai/sdk/dist/v2/gen/core/serverSentEvents.gen.js
15815
15815
  var createSseClient = ({ onRequest, onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url: url2, ...options }) => {
15816
15816
  let lastEventId;
15817
15817
  const sleep = sseSleepFn ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
@@ -15930,7 +15930,7 @@ var createSseClient = ({ onRequest, onSseError, onSseEvent, responseTransformer,
15930
15930
  return { stream };
15931
15931
  };
15932
15932
 
15933
- // node_modules/.pnpm/@opencode-ai+sdk@1.14.21/node_modules/@opencode-ai/sdk/dist/v2/gen/core/pathSerializer.gen.js
15933
+ // node_modules/@opencode-ai/sdk/dist/v2/gen/core/pathSerializer.gen.js
15934
15934
  var separatorArrayExplode = (style) => {
15935
15935
  switch (style) {
15936
15936
  case "label":
@@ -16033,7 +16033,7 @@ var serializeObjectParam = ({ allowReserved, explode, name, style, value, valueO
16033
16033
  return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
16034
16034
  };
16035
16035
 
16036
- // node_modules/.pnpm/@opencode-ai+sdk@1.14.21/node_modules/@opencode-ai/sdk/dist/v2/gen/core/utils.gen.js
16036
+ // node_modules/@opencode-ai/sdk/dist/v2/gen/core/utils.gen.js
16037
16037
  var PATH_PARAM_RE = /\{[^{}]+\}/g;
16038
16038
  var defaultPathSerializer = ({ path, url: _url2 }) => {
16039
16039
  let url2 = _url2;
@@ -16116,7 +16116,7 @@ function getValidRequestBody(options) {
16116
16116
  return void 0;
16117
16117
  }
16118
16118
 
16119
- // node_modules/.pnpm/@opencode-ai+sdk@1.14.21/node_modules/@opencode-ai/sdk/dist/v2/gen/core/auth.gen.js
16119
+ // node_modules/@opencode-ai/sdk/dist/v2/gen/core/auth.gen.js
16120
16120
  var getAuthToken = async (auth, callback) => {
16121
16121
  const token = typeof callback === "function" ? await callback(auth) : callback;
16122
16122
  if (!token) {
@@ -16131,12 +16131,12 @@ var getAuthToken = async (auth, callback) => {
16131
16131
  return token;
16132
16132
  };
16133
16133
 
16134
- // node_modules/.pnpm/@opencode-ai+sdk@1.14.21/node_modules/@opencode-ai/sdk/dist/v2/gen/core/bodySerializer.gen.js
16134
+ // node_modules/@opencode-ai/sdk/dist/v2/gen/core/bodySerializer.gen.js
16135
16135
  var jsonBodySerializer = {
16136
16136
  bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value)
16137
16137
  };
16138
16138
 
16139
- // node_modules/.pnpm/@opencode-ai+sdk@1.14.21/node_modules/@opencode-ai/sdk/dist/v2/gen/client/utils.gen.js
16139
+ // node_modules/@opencode-ai/sdk/dist/v2/gen/client/utils.gen.js
16140
16140
  var createQuerySerializer = ({ parameters = {}, ...args } = {}) => {
16141
16141
  const querySerializer = (queryParams) => {
16142
16142
  const search = [];
@@ -16346,7 +16346,7 @@ var createConfig = (override = {}) => ({
16346
16346
  ...override
16347
16347
  });
16348
16348
 
16349
- // node_modules/.pnpm/@opencode-ai+sdk@1.14.21/node_modules/@opencode-ai/sdk/dist/v2/gen/client/client.gen.js
16349
+ // node_modules/@opencode-ai/sdk/dist/v2/gen/client/client.gen.js
16350
16350
  var createClient = (config2 = {}) => {
16351
16351
  let _config = mergeConfigs(createConfig(), config2);
16352
16352
  const getConfig = () => ({ ..._config });
@@ -16554,7 +16554,7 @@ var createClient = (config2 = {}) => {
16554
16554
  };
16555
16555
  };
16556
16556
 
16557
- // node_modules/.pnpm/@opencode-ai+sdk@1.14.21/node_modules/@opencode-ai/sdk/dist/v2/gen/core/params.gen.js
16557
+ // node_modules/@opencode-ai/sdk/dist/v2/gen/core/params.gen.js
16558
16558
  var extraPrefixesMap = {
16559
16559
  $body_: "body",
16560
16560
  $headers_: "headers",
@@ -16650,10 +16650,10 @@ var buildClientParams = (args, fields) => {
16650
16650
  return params;
16651
16651
  };
16652
16652
 
16653
- // node_modules/.pnpm/@opencode-ai+sdk@1.14.21/node_modules/@opencode-ai/sdk/dist/v2/gen/client.gen.js
16653
+ // node_modules/@opencode-ai/sdk/dist/v2/gen/client.gen.js
16654
16654
  var client = createClient(createConfig({ baseUrl: "http://localhost:4096" }));
16655
16655
 
16656
- // node_modules/.pnpm/@opencode-ai+sdk@1.14.21/node_modules/@opencode-ai/sdk/dist/v2/gen/sdk.gen.js
16656
+ // node_modules/@opencode-ai/sdk/dist/v2/gen/sdk.gen.js
16657
16657
  var HeyApiClient = class {
16658
16658
  client;
16659
16659
  constructor(args) {
@@ -19510,7 +19510,7 @@ var OpencodeClient = class _OpencodeClient extends HeyApiClient {
19510
19510
  }
19511
19511
  };
19512
19512
 
19513
- // node_modules/.pnpm/@opencode-ai+sdk@1.14.21/node_modules/@opencode-ai/sdk/dist/v2/client.js
19513
+ // node_modules/@opencode-ai/sdk/dist/v2/client.js
19514
19514
  function pick2(value, fallback, encode3) {
19515
19515
  if (!value)
19516
19516
  return;
@@ -19583,7 +19583,7 @@ function createOpencodeClient(config2) {
19583
19583
  return new OpencodeClient({ client: client2 });
19584
19584
  }
19585
19585
 
19586
- // node_modules/.pnpm/@opencode-ai+sdk@1.14.21/node_modules/@opencode-ai/sdk/dist/v2/server.js
19586
+ // node_modules/@opencode-ai/sdk/dist/v2/server.js
19587
19587
  var import_cross_spawn = __toESM(require_cross_spawn(), 1);
19588
19588
 
19589
19589
  // src/agent.ts
@@ -19616,10 +19616,7 @@ var SessionManager = class {
19616
19616
  * Called by agent.newSession() / agent.loadSession().
19617
19617
  */
19618
19618
  async create(cwd, mcpServers, model) {
19619
- const response = await this.sdk.session.create(
19620
- { directory: cwd },
19621
- { throwOnError: true }
19622
- );
19619
+ const response = await this.sdk.session.create({ directory: cwd }, { throwOnError: true });
19623
19620
  const session = response.data;
19624
19621
  const state = {
19625
19622
  id: session.id,
@@ -19636,10 +19633,7 @@ var SessionManager = class {
19636
19633
  * Called by agent.loadSession() / agent.unstable_resumeSession().
19637
19634
  */
19638
19635
  async load(sessionId, cwd, mcpServers, model) {
19639
- await this.sdk.session.get(
19640
- { sessionID: sessionId, directory: cwd },
19641
- { throwOnError: true }
19642
- );
19636
+ await this.sdk.session.get({ sessionID: sessionId, directory: cwd }, { throwOnError: true });
19643
19637
  const state = {
19644
19638
  id: sessionId,
19645
19639
  cwd,
@@ -19727,7 +19721,7 @@ var SessionManager = class {
19727
19721
  }
19728
19722
  };
19729
19723
 
19730
- // node_modules/.pnpm/diff@9.0.0/node_modules/diff/libesm/util/string.js
19724
+ // node_modules/diff/libesm/util/string.js
19731
19725
  function hasOnlyWinLineEndings(string4) {
19732
19726
  return string4.includes("\r\n") && !string4.startsWith("\n") && !string4.match(/[^\r]\n/);
19733
19727
  }
@@ -19735,7 +19729,7 @@ function hasOnlyUnixLineEndings(string4) {
19735
19729
  return !string4.includes("\r\n") && string4.includes("\n");
19736
19730
  }
19737
19731
 
19738
- // node_modules/.pnpm/diff@9.0.0/node_modules/diff/libesm/patch/line-endings.js
19732
+ // node_modules/diff/libesm/patch/line-endings.js
19739
19733
  function unixToWin(patch) {
19740
19734
  if (Array.isArray(patch)) {
19741
19735
  return patch.map((p) => unixToWin(p));
@@ -19767,7 +19761,7 @@ function isWin(patch) {
19767
19761
  })));
19768
19762
  }
19769
19763
 
19770
- // node_modules/.pnpm/diff@9.0.0/node_modules/diff/libesm/patch/parse.js
19764
+ // node_modules/diff/libesm/patch/parse.js
19771
19765
  function parsePatch(uniDiff) {
19772
19766
  const diffstr = uniDiff.split(/\n/), list = [];
19773
19767
  let i = 0;
@@ -20103,7 +20097,7 @@ function parsePatch(uniDiff) {
20103
20097
  return list;
20104
20098
  }
20105
20099
 
20106
- // node_modules/.pnpm/diff@9.0.0/node_modules/diff/libesm/util/distance-iterator.js
20100
+ // node_modules/diff/libesm/util/distance-iterator.js
20107
20101
  function distance_iterator_default(start, minLine, maxLine) {
20108
20102
  let wantForward = true, backwardExhausted = false, forwardExhausted = false, localOffset = 1;
20109
20103
  return function iterator() {
@@ -20132,7 +20126,7 @@ function distance_iterator_default(start, minLine, maxLine) {
20132
20126
  };
20133
20127
  }
20134
20128
 
20135
- // node_modules/.pnpm/diff@9.0.0/node_modules/diff/libesm/patch/apply.js
20129
+ // node_modules/diff/libesm/patch/apply.js
20136
20130
  function applyPatch(source, patch, options = {}) {
20137
20131
  let patches;
20138
20132
  if (typeof patch === "string") {
@@ -20363,7 +20357,11 @@ function setLogEnabled(v) {
20363
20357
  }
20364
20358
  function cleanOldLogs() {
20365
20359
  try {
20366
- const files = (0, import_fs.readdirSync)(LOG_DIR).filter((f) => f.endsWith(".log")).map((f) => ({ name: f, path: (0, import_path.join)(LOG_DIR, f), mtime: (0, import_fs.statSync)((0, import_path.join)(LOG_DIR, f)).mtime.getTime() })).sort((a, b) => b.mtime - a.mtime);
20360
+ const files = (0, import_fs.readdirSync)(LOG_DIR).filter((f) => f.endsWith(".log")).map((f) => ({
20361
+ name: f,
20362
+ path: (0, import_path.join)(LOG_DIR, f),
20363
+ mtime: (0, import_fs.statSync)((0, import_path.join)(LOG_DIR, f)).mtime.getTime()
20364
+ })).sort((a, b) => b.mtime - a.mtime);
20367
20365
  for (let i = MAX_LOG_FILES; i < files.length; i++) {
20368
20366
  try {
20369
20367
  const { unlinkSync } = require("fs");
@@ -20462,6 +20460,11 @@ var EventHandler = class {
20462
20460
  questionQueues = /* @__PURE__ */ new Map();
20463
20461
  started = false;
20464
20462
  messageBuffers = /* @__PURE__ */ new Map();
20463
+ /** Index: sessionId → Set<messageId> for O(1) flush lookup. */
20464
+ sessionBufferIndex = /* @__PURE__ */ new Map();
20465
+ messageMetaCache = /* @__PURE__ */ new Map();
20466
+ /** Track tool call counts per child session to detect completion. */
20467
+ childToolCounts = /* @__PURE__ */ new Map();
20465
20468
  /**
20466
20469
  * Wrapper around connection.sessionUpdate that logs what's sent to the ACP client.
20467
20470
  * This is the single point where we record all outgoing traffic.
@@ -20472,7 +20475,15 @@ var EventHandler = class {
20472
20475
  this.flushMessageBuffer(params.sessionId, `boundary:${updateType}`);
20473
20476
  acpOut(`sessionUpdate.${updateType}`, {
20474
20477
  sessionId: params.sessionId.slice(0, 12),
20475
- ...updateType === "tool_call" || updateType === "tool_call_update" ? { toolCallId: params.update.toolCallId, tool: params.update.title, kind: params.update.kind, status: params.update.status } : updateType === "session_info_update" ? { title: params.update.title, _meta: params.update._meta } : {}
20478
+ ...updateType === "tool_call" || updateType === "tool_call_update" ? {
20479
+ toolCallId: params.update.toolCallId,
20480
+ tool: params.update.title,
20481
+ kind: params.update.kind,
20482
+ status: params.update.status
20483
+ } : updateType === "session_info_update" ? {
20484
+ title: params.update.title,
20485
+ _meta: params.update._meta
20486
+ } : {}
20476
20487
  });
20477
20488
  }
20478
20489
  return this.connection.sessionUpdate(params);
@@ -20487,6 +20498,12 @@ var EventHandler = class {
20487
20498
  if (!buf) {
20488
20499
  buf = { sessionId, text: "", thought: "" };
20489
20500
  this.messageBuffers.set(messageId, buf);
20501
+ const msgSet = this.sessionBufferIndex.get(sessionId);
20502
+ if (msgSet) {
20503
+ msgSet.add(messageId);
20504
+ } else {
20505
+ this.sessionBufferIndex.set(sessionId, /* @__PURE__ */ new Set([messageId]));
20506
+ }
20490
20507
  }
20491
20508
  buf[kind] += delta;
20492
20509
  }
@@ -20496,8 +20513,11 @@ var EventHandler = class {
20496
20513
  * text/thought phase is complete.
20497
20514
  */
20498
20515
  flushMessageBuffer(sessionId, reason) {
20499
- for (const [messageId, buf] of this.messageBuffers) {
20500
- if (buf.sessionId !== sessionId) continue;
20516
+ const msgIds = this.sessionBufferIndex.get(sessionId);
20517
+ if (!msgIds) return;
20518
+ for (const messageId of msgIds) {
20519
+ const buf = this.messageBuffers.get(messageId);
20520
+ if (!buf) continue;
20501
20521
  if (!buf.text && !buf.thought) {
20502
20522
  this.messageBuffers.delete(messageId);
20503
20523
  continue;
@@ -20522,11 +20542,46 @@ var EventHandler = class {
20522
20542
  }
20523
20543
  this.messageBuffers.delete(messageId);
20524
20544
  }
20545
+ this.sessionBufferIndex.delete(sessionId);
20525
20546
  }
20526
20547
  /** Flush all remaining buffers (e.g. on stop) */
20527
20548
  flushAllBuffers() {
20528
- for (const [messageId, buf] of this.messageBuffers) {
20529
- this.flushMessageBuffer(buf.sessionId, "stop");
20549
+ for (const sessionId of this.sessionBufferIndex.keys()) {
20550
+ this.flushMessageBuffer(sessionId, "stop");
20551
+ }
20552
+ }
20553
+ /**
20554
+ * Get or cache message metadata (role + parts) for a message.
20555
+ * Fetches from SDK only on first delta for a message, then serves from cache.
20556
+ */
20557
+ async getOrCacheMessageMeta(sessionID, messageID, cwd) {
20558
+ const cached2 = this.messageMetaCache.get(messageID);
20559
+ if (cached2) return cached2;
20560
+ const message = await this.sdk.session.message({ sessionID, messageID, directory: cwd }, { throwOnError: true }).then((x) => x.data).catch(() => void 0);
20561
+ if (!message) return void 0;
20562
+ const parts = /* @__PURE__ */ new Map();
20563
+ for (const p of message.parts) {
20564
+ parts.set(p.id, { type: p.type, ignored: p.ignored });
20565
+ }
20566
+ const meta3 = { role: message.info.role, parts };
20567
+ this.messageMetaCache.set(messageID, meta3);
20568
+ if (this.messageMetaCache.size > 50) {
20569
+ const oldest = this.messageMetaCache.keys().next().value;
20570
+ if (oldest) this.messageMetaCache.delete(oldest);
20571
+ }
20572
+ return meta3;
20573
+ }
20574
+ /**
20575
+ * Flush previous message buffer for a session when messageId changes.
20576
+ */
20577
+ flushPreviousBuffer(sessionId, currentMessageId) {
20578
+ const msgIds = this.sessionBufferIndex.get(sessionId);
20579
+ if (!msgIds) return;
20580
+ for (const messageId of msgIds) {
20581
+ if (messageId !== currentMessageId) {
20582
+ this.flushMessageBuffer(sessionId, "new_message");
20583
+ return;
20584
+ }
20530
20585
  }
20531
20586
  }
20532
20587
  constructor(deps) {
@@ -20570,12 +20625,8 @@ var EventHandler = class {
20570
20625
  */
20571
20626
  resolveSession(sessionId) {
20572
20627
  const session = this.sessionManager.tryGet(sessionId);
20573
- if (session) return { sessionId: session.id, cwd: session.cwd };
20574
- const root = this.sessionManager.findRootSession(sessionId);
20575
- if (!root) return void 0;
20576
- const child = this.sessionManager.tryGet(sessionId);
20577
- if (child) return { sessionId: child.id, cwd: child.cwd };
20578
- return void 0;
20628
+ if (!session) return void 0;
20629
+ return { sessionId: session.id, cwd: session.cwd };
20579
20630
  }
20580
20631
  // ─── Event Handling ──────────────────────────────────────────────
20581
20632
  async handleEvent(event) {
@@ -20592,7 +20643,13 @@ var EventHandler = class {
20592
20643
  this.sessionManager.registerDiscovered(id, parentID, title);
20593
20644
  if (isNew) {
20594
20645
  ocEvent("session.created.child", { id, parentID, title });
20595
- await this.announceChildSession(id, parentID, title);
20646
+ const agentMatch = title?.match(/@(\w+)\s+subagent/);
20647
+ const agentType = agentMatch?.[1];
20648
+ const description = title?.replace(/\s*\(@\w+\s+subagent\)\s*$/, "") ?? title;
20649
+ await this.announceChildSession(id, parentID, title, {
20650
+ agentType,
20651
+ description
20652
+ });
20596
20653
  }
20597
20654
  return;
20598
20655
  }
@@ -20670,7 +20727,11 @@ var EventHandler = class {
20670
20727
  if (!resolved) return;
20671
20728
  const directory = resolved.cwd;
20672
20729
  const sessionId = resolved.sessionId;
20673
- ocEvent("question.asked", { id: q.id, sessionID: q.sessionID, questions: q.questions.length });
20730
+ ocEvent("question.asked", {
20731
+ id: q.id,
20732
+ sessionID: q.sessionID,
20733
+ questions: q.questions.length
20734
+ });
20674
20735
  const prev = this.questionQueues.get(q.sessionID) ?? Promise.resolve();
20675
20736
  const next = prev.then(async () => {
20676
20737
  const extResult = await Promise.race([
@@ -20698,7 +20759,10 @@ var EventHandler = class {
20698
20759
  console.error("[event-handler] invalid answers shape from client:", JSON.stringify(answers));
20699
20760
  await this.sdk.question.reject({ requestID: q.id, directory }).catch(() => {
20700
20761
  });
20701
- ocEvent("question.rejected", { requestID: q.id, reason: "invalid_answers" });
20762
+ ocEvent("question.rejected", {
20763
+ requestID: q.id,
20764
+ reason: "invalid_answers"
20765
+ });
20702
20766
  return;
20703
20767
  }
20704
20768
  await this.sdk.question.reply({
@@ -20732,24 +20796,12 @@ var EventHandler = class {
20732
20796
  const resolved = this.resolveSession(props.sessionID);
20733
20797
  if (!resolved) return;
20734
20798
  const sessionId = resolved.sessionId;
20735
- const currentBufKey = [...this.messageBuffers.keys()].find(
20736
- (k) => this.messageBuffers.get(k)?.sessionId === sessionId && k !== props.messageID
20737
- );
20738
- if (currentBufKey) {
20739
- this.flushMessageBuffer(sessionId, "new_message");
20740
- }
20741
- const message = await this.sdk.session.message(
20742
- {
20743
- sessionID: props.sessionID,
20744
- messageID: props.messageID,
20745
- directory: resolved.cwd
20746
- },
20747
- { throwOnError: true }
20748
- ).then((x) => x.data).catch(() => void 0);
20749
- if (!message || message.info.role !== "assistant") return;
20750
- const part = message.parts.find((p) => p.id === props.partID);
20751
- if (!part) return;
20752
- if (part.type === "text" && props.field === "text" && part.ignored !== true) {
20799
+ this.flushPreviousBuffer(sessionId, props.messageID);
20800
+ const meta3 = await this.getOrCacheMessageMeta(props.sessionID, props.messageID, resolved.cwd);
20801
+ if (!meta3 || meta3.role !== "assistant") return;
20802
+ const partMeta = meta3.parts.get(props.partID);
20803
+ if (!partMeta) return;
20804
+ if (partMeta.type === "text" && props.field === "text" && partMeta.ignored !== true) {
20753
20805
  this.accumulateDelta(props.messageID, sessionId, "text", props.delta);
20754
20806
  await this.sendToClient({
20755
20807
  sessionId,
@@ -20762,7 +20814,7 @@ var EventHandler = class {
20762
20814
  });
20763
20815
  return;
20764
20816
  }
20765
- if (part.type === "reasoning" && props.field === "text") {
20817
+ if (partMeta.type === "reasoning" && props.field === "text") {
20766
20818
  this.accumulateDelta(props.messageID, sessionId, "thought", props.delta);
20767
20819
  await this.sendToClient({
20768
20820
  sessionId,
@@ -20783,19 +20835,20 @@ var EventHandler = class {
20783
20835
  * Announce a child session to the ACP client.
20784
20836
  *
20785
20837
  * Sends a session_info_update with the child's own sessionId,
20786
- * and _meta containing the parent relationship so the client
20787
- * can display it as a linked sub-session.
20838
+ * and _meta containing structured metadata about the subagent.
20788
20839
  */
20789
- async announceChildSession(childSessionId, parentSessionId, title) {
20840
+ async announceChildSession(childSessionId, parentSessionId, title, meta3) {
20790
20841
  await this.sendToClient({
20791
20842
  sessionId: childSessionId,
20792
20843
  update: {
20793
20844
  sessionUpdate: "session_info_update",
20794
- title,
20845
+ title: title ?? "Subagent",
20795
20846
  updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
20796
20847
  _meta: {
20797
20848
  parentSessionId,
20798
- isSubagent: true
20849
+ isSubagent: true,
20850
+ ...meta3?.agentType && { agentType: meta3.agentType },
20851
+ ...meta3?.description && { description: meta3.description }
20799
20852
  }
20800
20853
  }
20801
20854
  }).catch(() => {
@@ -20805,6 +20858,19 @@ var EventHandler = class {
20805
20858
  async handleToolPart(sessionId, part) {
20806
20859
  if (!this.toolStarts.has(part.callID)) {
20807
20860
  this.toolStarts.add(part.callID);
20861
+ const session = this.sessionManager.tryGet(sessionId);
20862
+ if (session?.parentID) {
20863
+ const tracker = this.childToolCounts.get(sessionId);
20864
+ if (tracker) {
20865
+ tracker.total++;
20866
+ } else {
20867
+ this.childToolCounts.set(sessionId, {
20868
+ completed: 0,
20869
+ total: 1,
20870
+ startTime: Date.now()
20871
+ });
20872
+ }
20873
+ }
20808
20874
  await this.sendToClient({
20809
20875
  sessionId,
20810
20876
  update: {
@@ -20856,6 +20922,27 @@ var EventHandler = class {
20856
20922
  case "completed": {
20857
20923
  this.toolStarts.delete(part.callID);
20858
20924
  this.bashSnapshots.delete(part.callID);
20925
+ if (part.tool === "task" && part.state.metadata) {
20926
+ const childSessionId = typeof part.state.metadata["sessionId"] === "string" ? part.state.metadata["sessionId"] : void 0;
20927
+ if (childSessionId && this.sessionManager.tryGet(childSessionId)) {
20928
+ const tracker = this.childToolCounts.get(childSessionId);
20929
+ await this.sendChildSessionCompleted(
20930
+ childSessionId,
20931
+ sessionId,
20932
+ tracker?.completed ?? 0,
20933
+ tracker ? Date.now() - tracker.startTime : 0
20934
+ ).catch(() => {
20935
+ });
20936
+ this.childToolCounts.delete(childSessionId);
20937
+ }
20938
+ }
20939
+ const session = this.sessionManager.tryGet(sessionId);
20940
+ if (session?.parentID) {
20941
+ const tracker = this.childToolCounts.get(sessionId);
20942
+ if (tracker) {
20943
+ tracker.completed++;
20944
+ }
20945
+ }
20859
20946
  const kind = toToolKind(part.tool);
20860
20947
  const content = [
20861
20948
  {
@@ -20938,6 +21025,32 @@ var EventHandler = class {
20938
21025
  }
20939
21026
  }
20940
21027
  }
21028
+ /**
21029
+ * Notify the ACP client that a child session has completed.
21030
+ */
21031
+ async sendChildSessionCompleted(childSessionId, parentSessionId, toolCallCount, durationMs) {
21032
+ const child = this.sessionManager.tryGet(childSessionId);
21033
+ const title = child?.title ?? "Subagent";
21034
+ const agentMatch = title.match(/@(\w+)\s+subagent/);
21035
+ const agentType = agentMatch?.[1];
21036
+ const description = title.replace(/\s*\(@\w+\s+subagent\)\s*$/, "");
21037
+ await this.sendToClient({
21038
+ sessionId: childSessionId,
21039
+ update: {
21040
+ sessionUpdate: "session_info_update",
21041
+ title,
21042
+ status: "completed",
21043
+ _meta: {
21044
+ parentSessionId,
21045
+ isSubagent: true,
21046
+ toolCallCount,
21047
+ durationMs,
21048
+ ...agentType && { agentType },
21049
+ ...description && { description }
21050
+ }
21051
+ }
21052
+ });
21053
+ }
20941
21054
  bashOutput(part) {
20942
21055
  if (part.tool !== "bash") return;
20943
21056
  if (!("metadata" in part.state) || !part.state.metadata || typeof part.state.metadata !== "object") return;
@@ -20955,6 +21068,44 @@ function simpleHash(str) {
20955
21068
  return hash2.toString(36);
20956
21069
  }
20957
21070
 
21071
+ // src/auth-provider.ts
21072
+ var AuthProviderManager = class {
21073
+ sdk;
21074
+ constructor(sdk) {
21075
+ this.sdk = sdk;
21076
+ }
21077
+ async listProviders(directory) {
21078
+ ocCall("provider.list", { directory });
21079
+ const res = await this.sdk.provider.list({ directory });
21080
+ return res.data;
21081
+ }
21082
+ async authMethods(directory) {
21083
+ ocCall("provider.auth", { directory });
21084
+ const res = await this.sdk.provider.auth({ directory });
21085
+ return res.data;
21086
+ }
21087
+ async setApiKey(providerID, auth) {
21088
+ ocCall("auth.set", { providerID });
21089
+ const res = await this.sdk.auth.set({ providerID, auth });
21090
+ return res.data;
21091
+ }
21092
+ async removeAuth(providerID) {
21093
+ ocCall("auth.remove", { providerID });
21094
+ const res = await this.sdk.auth.remove({ providerID });
21095
+ return res.data;
21096
+ }
21097
+ async oauthAuthorize(providerID, method, inputs, directory) {
21098
+ ocCall("provider.oauth.authorize", { providerID, method });
21099
+ const res = await this.sdk.provider.oauth.authorize({ providerID, method, inputs, directory });
21100
+ return res.data;
21101
+ }
21102
+ async oauthCallback(providerID, method, code, directory) {
21103
+ ocCall("provider.oauth.callback", { providerID, method });
21104
+ const res = await this.sdk.provider.oauth.callback({ providerID, method, code, directory });
21105
+ return res.data;
21106
+ }
21107
+ };
21108
+
20958
21109
  // src/agent.ts
20959
21110
  function isApiKeyError(err) {
20960
21111
  return err instanceof Error && err.name === "AI_LoadAPIKeyError";
@@ -20965,6 +21116,7 @@ var Agent = class {
20965
21116
  sdk;
20966
21117
  sessionManager;
20967
21118
  eventHandler;
21119
+ authProvider;
20968
21120
  /**
20969
21121
  * Wrapper around connection.sessionUpdate that logs what's sent to the ACP client.
20970
21122
  */
@@ -20973,7 +21125,12 @@ var Agent = class {
20973
21125
  if (updateType !== "agent_message_chunk" && updateType !== "agent_thought_chunk") {
20974
21126
  acpOut(`sessionUpdate.${updateType}`, {
20975
21127
  sessionId: params.sessionId.slice(0, 12),
20976
- ...updateType === "tool_call" || updateType === "tool_call_update" ? { toolCallId: params.update.toolCallId, tool: params.update.title, kind: params.update.kind, status: params.update.status } : {}
21128
+ ...updateType === "tool_call" || updateType === "tool_call_update" ? {
21129
+ toolCallId: params.update.toolCallId,
21130
+ tool: params.update.title,
21131
+ kind: params.update.kind,
21132
+ status: params.update.status
21133
+ } : {}
20977
21134
  });
20978
21135
  }
20979
21136
  return this.connection.sessionUpdate(params);
@@ -20982,6 +21139,7 @@ var Agent = class {
20982
21139
  this.config = config2;
20983
21140
  this.sdk = config2.sdk;
20984
21141
  this.sessionManager = new SessionManager(config2.sdk);
21142
+ this.authProvider = new AuthProviderManager(config2.sdk);
20985
21143
  }
20986
21144
  init(connection) {
20987
21145
  this.connection = connection;
@@ -21021,12 +21179,89 @@ var Agent = class {
21021
21179
  agentInfo: {
21022
21180
  name: "Harmony-ACP",
21023
21181
  version: "0.1.0"
21024
- }
21182
+ },
21183
+ _meta: await this.buildProviderMeta()
21025
21184
  };
21026
21185
  }
21027
21186
  async authenticate(_params) {
21028
21187
  throw new Error("Authentication not implemented");
21029
21188
  }
21189
+ // ─── Extension Methods ────────────────────────────────────────────
21190
+ async extMethod(method, params) {
21191
+ acpIn("extMethod", { method });
21192
+ if (!method.startsWith("provider/")) {
21193
+ throw new Error(`Unknown extMethod: ${method}`);
21194
+ }
21195
+ return this.handleProviderMethod(method, params);
21196
+ }
21197
+ async handleProviderMethod(method, params) {
21198
+ const sessionId = params.sessionId;
21199
+ const cwd = sessionId ? this.sessionManager.get(sessionId)?.cwd : this.config.cwd;
21200
+ switch (method) {
21201
+ case "provider/list": {
21202
+ if (!cwd) throw new Error("Session not found");
21203
+ const data = await this.authProvider.listProviders(cwd);
21204
+ acpOut("extMethod.response", { method: "provider/list" });
21205
+ return data;
21206
+ }
21207
+ case "provider/auth/methods": {
21208
+ if (!cwd) throw new Error("Session not found");
21209
+ const data = await this.authProvider.authMethods(cwd);
21210
+ acpOut("extMethod.response", { method: "provider/auth/methods" });
21211
+ return data;
21212
+ }
21213
+ case "provider/auth/set": {
21214
+ const providerID = params.providerID;
21215
+ const auth = params.auth;
21216
+ if (!providerID) throw new Error("Missing required parameter: providerID");
21217
+ if (!auth?.key) throw new Error("Missing required parameter: auth.key");
21218
+ await this.authProvider.setApiKey(providerID, auth);
21219
+ acpOut("extMethod.response", { method: "provider/auth/set", providerID });
21220
+ return { success: true };
21221
+ }
21222
+ case "provider/auth/remove": {
21223
+ const providerID = params.providerID;
21224
+ if (!providerID) throw new Error("Missing required parameter: providerID");
21225
+ await this.authProvider.removeAuth(providerID);
21226
+ acpOut("extMethod.response", { method: "provider/auth/remove", providerID });
21227
+ return { success: true };
21228
+ }
21229
+ case "provider/oauth/authorize": {
21230
+ const providerID = params.providerID;
21231
+ const oauthMethod = params.method;
21232
+ if (!providerID) throw new Error("Missing required parameter: providerID");
21233
+ const inputs = params.inputs;
21234
+ const data = await this.authProvider.oauthAuthorize(providerID, oauthMethod ?? 0, inputs, cwd);
21235
+ acpOut("extMethod.response", { method: "provider/oauth/authorize", providerID });
21236
+ return data;
21237
+ }
21238
+ case "provider/oauth/callback": {
21239
+ const providerID = params.providerID;
21240
+ const oauthMethod = params.method;
21241
+ const code = params.code;
21242
+ if (!providerID) throw new Error("Missing required parameter: providerID");
21243
+ await this.authProvider.oauthCallback(providerID, oauthMethod ?? 0, code, cwd);
21244
+ acpOut("extMethod.response", { method: "provider/oauth/callback", providerID });
21245
+ return { success: true };
21246
+ }
21247
+ default:
21248
+ throw new Error(`Unknown provider extMethod: ${method}`);
21249
+ }
21250
+ }
21251
+ async buildProviderMeta() {
21252
+ try {
21253
+ const data = await this.authProvider.listProviders(this.config.cwd);
21254
+ if (!data?.all) return void 0;
21255
+ const providers = data.all.map((p) => ({
21256
+ id: p.id,
21257
+ name: p.name,
21258
+ connected: data.connected?.includes(p.id) ?? false
21259
+ }));
21260
+ return { providers };
21261
+ } catch {
21262
+ return void 0;
21263
+ }
21264
+ }
21030
21265
  // ─── Session Management ───────────────────────────────────────────
21031
21266
  async newSession(params) {
21032
21267
  acpIn("newSession", { cwd: params.cwd, mcpServers: params.mcpServers.length });
@@ -21034,11 +21269,7 @@ var Agent = class {
21034
21269
  const directory = params.cwd;
21035
21270
  ocCall("session.create", { directory });
21036
21271
  const model = await this.defaultModel(directory);
21037
- const state = await this.sessionManager.create(
21038
- params.cwd,
21039
- params.mcpServers,
21040
- model
21041
- );
21272
+ const state = await this.sessionManager.create(params.cwd, params.mcpServers, model);
21042
21273
  const sessionId = state.id;
21043
21274
  const result = await this.loadSessionMode({
21044
21275
  cwd: directory,
@@ -21078,13 +21309,18 @@ var Agent = class {
21078
21309
  modelID: lastUser.model.modelID
21079
21310
  });
21080
21311
  if (result.modes?.availableModes.some((m) => m.id === lastUser.agent)) {
21081
- ;
21082
21312
  result.modes.currentModeId = lastUser.agent;
21083
21313
  this.sessionManager.setMode(sessionId, lastUser.agent);
21084
21314
  }
21085
21315
  }
21086
21316
  for (const msg of messages ?? []) {
21087
21317
  await this.processMessage(msg);
21318
+ for (const part of msg.parts ?? []) {
21319
+ if (part.type === "tool" && part.tool === "task" && part.state?.status === "completed" && part.state?.metadata?.sessionId) {
21320
+ const childSessionId = part.state.metadata.sessionId;
21321
+ await this.replayChildSession(childSessionId, sessionId, directory);
21322
+ }
21323
+ }
21088
21324
  }
21089
21325
  await this.sendUsageUpdate(sessionId, directory);
21090
21326
  return result;
@@ -21366,6 +21602,32 @@ var Agent = class {
21366
21602
  return { configOptions };
21367
21603
  }
21368
21604
  // ─── Internal Helpers ─────────────────────────────────────────────
21605
+ /**
21606
+ * Replay a child subagent session by fetching its messages and sending
21607
+ * them to the ACP client. Registers the child with the session manager.
21608
+ */
21609
+ async replayChildSession(childSessionId, parentSessionId, directory) {
21610
+ if (this.sessionManager.tryGet(childSessionId)) return;
21611
+ const childMessages = await this.sdk.session.messages({ sessionID: childSessionId, directory }).then((x) => x.data).catch(() => void 0);
21612
+ if (!childMessages?.length) return;
21613
+ const title = `Subagent (${childSessionId.slice(0, 8)})`;
21614
+ this.sessionManager.registerDiscovered(childSessionId, parentSessionId, title);
21615
+ await this.sendToClient({
21616
+ sessionId: childSessionId,
21617
+ update: {
21618
+ sessionUpdate: "session_info_update",
21619
+ title,
21620
+ _meta: {
21621
+ parentSessionId,
21622
+ isSubagent: true
21623
+ }
21624
+ }
21625
+ }).catch(() => {
21626
+ });
21627
+ for (const msg of childMessages) {
21628
+ await this.processMessage({ ...msg, info: { ...msg.info, sessionID: childSessionId } });
21629
+ }
21630
+ }
21369
21631
  async defaultModel(cwd) {
21370
21632
  const configured = this.config.defaultModel;
21371
21633
  if (configured) return configured;
@@ -21384,9 +21646,7 @@ var Agent = class {
21384
21646
  return { providerID: "opencode", modelID: models[0] };
21385
21647
  }
21386
21648
  }
21387
- const allModels = providers.flatMap(
21388
- (p) => Object.keys(p.models).map((m) => ({ providerID: p.id, modelID: m }))
21389
- );
21649
+ const allModels = providers.flatMap((p) => Object.keys(p.models).map((m) => ({ providerID: p.id, modelID: m })));
21390
21650
  if (allModels.length > 0) return allModels[0];
21391
21651
  return { providerID: "opencode", modelID: "big-pickle" };
21392
21652
  }
@@ -21572,7 +21832,11 @@ var Agent = class {
21572
21832
  } else {
21573
21833
  const isText = effectiveMime.startsWith("text/") || effectiveMime === "application/json";
21574
21834
  const fileUri = (0, import_url2.pathToFileURL)(filename).href;
21575
- const resource = isText ? { uri: fileUri, mimeType: effectiveMime, text: Buffer.from(base64Data, "base64").toString("utf-8") } : { uri: fileUri, mimeType: effectiveMime, blob: base64Data };
21835
+ const resource = isText ? {
21836
+ uri: fileUri,
21837
+ mimeType: effectiveMime,
21838
+ text: Buffer.from(base64Data, "base64").toString("utf-8")
21839
+ } : { uri: fileUri, mimeType: effectiveMime, blob: base64Data };
21576
21840
  await this.sendToClient({
21577
21841
  sessionId,
21578
21842
  update: {
@@ -21614,9 +21878,7 @@ var Agent = class {
21614
21878
  switch (part.state.status) {
21615
21879
  case "completed": {
21616
21880
  const kind = toToolKind(part.tool);
21617
- const content = [
21618
- { type: "content", content: { type: "text", text: part.state.output } }
21619
- ];
21881
+ const content = [{ type: "content", content: { type: "text", text: part.state.output } }];
21620
21882
  if (kind === "edit") {
21621
21883
  const input = part.state.input;
21622
21884
  content.push({
@@ -21691,6 +21953,14 @@ var Agent = class {
21691
21953
  const msg = lastAssistant.info;
21692
21954
  if (!msg.providerID || !msg.modelID) return;
21693
21955
  const totalCost = assistantMessages.reduce((sum, m) => sum + m.info.cost, 0);
21956
+ const children = this.sessionManager.getChildren(sessionId);
21957
+ let childCost = 0;
21958
+ for (const childId of children) {
21959
+ const childMessages = await this.sdk.session.messages({ sessionID: childId, directory }).then((x) => x.data).catch(() => void 0);
21960
+ if (childMessages) {
21961
+ childCost += childMessages.filter((m) => m.info.role === "assistant").reduce((sum, m) => sum + (m.info.cost ?? 0), 0);
21962
+ }
21963
+ }
21694
21964
  const providers = await this.sdk.config.providers({ directory }).then((x) => x.data?.providers ?? []).catch(() => []);
21695
21965
  const provider = providers.find((p) => p.id === msg.providerID);
21696
21966
  const model = provider?.models[msg.modelID];
@@ -21701,7 +21971,14 @@ var Agent = class {
21701
21971
  sessionUpdate: "usage_update",
21702
21972
  used: msg.tokens.input + (msg.tokens.cache?.read ?? 0),
21703
21973
  size,
21704
- cost: { amount: totalCost, currency: "USD" }
21974
+ cost: { amount: totalCost + childCost, currency: "USD" },
21975
+ ...childCost > 0 && {
21976
+ _meta: {
21977
+ parentCost: totalCost,
21978
+ childCost,
21979
+ childSessionCount: children.length
21980
+ }
21981
+ }
21705
21982
  }
21706
21983
  }).catch(() => {
21707
21984
  });