opencode-hive 1.3.4 → 1.3.5
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/README.md +35 -0
- package/dist/hive-core/src/services/sessionService.d.ts +8 -1
- package/dist/hive-core/src/types.d.ts +8 -0
- package/dist/hive-core/src/utils/paths.d.ts +1 -0
- package/dist/index.js +682 -270
- package/dist/opencode-hive/src/hooks/variant-hook.d.ts +14 -2
- package/dist/opencode-hive/src/utils/compaction-anchor.d.ts +14 -0
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -45,7 +45,7 @@ var __export = (target, all) => {
|
|
|
45
45
|
};
|
|
46
46
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
47
47
|
|
|
48
|
-
// ../../node_modules
|
|
48
|
+
// ../../node_modules/ms/index.js
|
|
49
49
|
var require_ms = __commonJS((exports, module) => {
|
|
50
50
|
var s = 1000;
|
|
51
51
|
var m = s * 60;
|
|
@@ -155,7 +155,7 @@ var require_ms = __commonJS((exports, module) => {
|
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
157
|
|
|
158
|
-
// ../../node_modules
|
|
158
|
+
// ../../node_modules/debug/src/common.js
|
|
159
159
|
var require_common = __commonJS((exports, module) => {
|
|
160
160
|
function setup(env) {
|
|
161
161
|
createDebug.debug = createDebug;
|
|
@@ -330,7 +330,7 @@ var require_common = __commonJS((exports, module) => {
|
|
|
330
330
|
module.exports = setup;
|
|
331
331
|
});
|
|
332
332
|
|
|
333
|
-
// ../../node_modules
|
|
333
|
+
// ../../node_modules/debug/src/browser.js
|
|
334
334
|
var require_browser = __commonJS((exports, module) => {
|
|
335
335
|
exports.formatArgs = formatArgs;
|
|
336
336
|
exports.save = save;
|
|
@@ -490,7 +490,7 @@ var require_browser = __commonJS((exports, module) => {
|
|
|
490
490
|
};
|
|
491
491
|
});
|
|
492
492
|
|
|
493
|
-
// ../../node_modules
|
|
493
|
+
// ../../node_modules/has-flag/index.js
|
|
494
494
|
var require_has_flag = __commonJS((exports, module) => {
|
|
495
495
|
module.exports = (flag, argv = process.argv) => {
|
|
496
496
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
@@ -500,7 +500,7 @@ var require_has_flag = __commonJS((exports, module) => {
|
|
|
500
500
|
};
|
|
501
501
|
});
|
|
502
502
|
|
|
503
|
-
// ../../node_modules
|
|
503
|
+
// ../../node_modules/supports-color/index.js
|
|
504
504
|
var require_supports_color = __commonJS((exports, module) => {
|
|
505
505
|
var os = __require("os");
|
|
506
506
|
var tty = __require("tty");
|
|
@@ -599,7 +599,7 @@ var require_supports_color = __commonJS((exports, module) => {
|
|
|
599
599
|
};
|
|
600
600
|
});
|
|
601
601
|
|
|
602
|
-
// ../../node_modules
|
|
602
|
+
// ../../node_modules/debug/src/node.js
|
|
603
603
|
var require_node = __commonJS((exports, module) => {
|
|
604
604
|
var tty = __require("tty");
|
|
605
605
|
var util = __require("util");
|
|
@@ -770,7 +770,7 @@ var require_node = __commonJS((exports, module) => {
|
|
|
770
770
|
};
|
|
771
771
|
});
|
|
772
772
|
|
|
773
|
-
// ../../node_modules
|
|
773
|
+
// ../../node_modules/debug/src/index.js
|
|
774
774
|
var require_src = __commonJS((exports, module) => {
|
|
775
775
|
if (typeof process === "undefined" || process.type === "renderer" || false || process.__nwjs) {
|
|
776
776
|
module.exports = require_browser();
|
|
@@ -779,7 +779,7 @@ var require_src = __commonJS((exports, module) => {
|
|
|
779
779
|
}
|
|
780
780
|
});
|
|
781
781
|
|
|
782
|
-
// ../../node_modules
|
|
782
|
+
// ../../node_modules/@kwsites/file-exists/dist/src/index.js
|
|
783
783
|
var require_src2 = __commonJS((exports) => {
|
|
784
784
|
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
785
785
|
return mod && mod.__esModule ? mod : { default: mod };
|
|
@@ -820,7 +820,7 @@ var require_src2 = __commonJS((exports) => {
|
|
|
820
820
|
exports.READABLE = exports.FILE + exports.FOLDER;
|
|
821
821
|
});
|
|
822
822
|
|
|
823
|
-
// ../../node_modules
|
|
823
|
+
// ../../node_modules/@kwsites/file-exists/dist/index.js
|
|
824
824
|
var require_dist = __commonJS((exports) => {
|
|
825
825
|
function __export2(m) {
|
|
826
826
|
for (var p in m)
|
|
@@ -831,7 +831,7 @@ var require_dist = __commonJS((exports) => {
|
|
|
831
831
|
__export2(require_src2());
|
|
832
832
|
});
|
|
833
833
|
|
|
834
|
-
// ../../node_modules
|
|
834
|
+
// ../../node_modules/@kwsites/promise-deferred/dist/index.js
|
|
835
835
|
var require_dist2 = __commonJS((exports) => {
|
|
836
836
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
837
837
|
exports.createDeferred = exports.deferred = undefined;
|
|
@@ -871,11 +871,11 @@ var require_dist2 = __commonJS((exports) => {
|
|
|
871
871
|
});
|
|
872
872
|
|
|
873
873
|
// src/index.ts
|
|
874
|
-
import * as
|
|
875
|
-
import * as
|
|
874
|
+
import * as path11 from "path";
|
|
875
|
+
import * as fs13 from "fs";
|
|
876
876
|
import * as os from "os";
|
|
877
877
|
|
|
878
|
-
// ../../node_modules
|
|
878
|
+
// ../../node_modules/zod/v4/classic/external.js
|
|
879
879
|
var exports_external = {};
|
|
880
880
|
__export(exports_external, {
|
|
881
881
|
xid: () => xid2,
|
|
@@ -1105,7 +1105,7 @@ __export(exports_external, {
|
|
|
1105
1105
|
$brand: () => $brand
|
|
1106
1106
|
});
|
|
1107
1107
|
|
|
1108
|
-
// ../../node_modules
|
|
1108
|
+
// ../../node_modules/zod/v4/core/index.js
|
|
1109
1109
|
var exports_core2 = {};
|
|
1110
1110
|
__export(exports_core2, {
|
|
1111
1111
|
version: () => version,
|
|
@@ -1369,7 +1369,7 @@ __export(exports_core2, {
|
|
|
1369
1369
|
$ZodAny: () => $ZodAny
|
|
1370
1370
|
});
|
|
1371
1371
|
|
|
1372
|
-
// ../../node_modules
|
|
1372
|
+
// ../../node_modules/zod/v4/core/core.js
|
|
1373
1373
|
var NEVER = Object.freeze({
|
|
1374
1374
|
status: "aborted"
|
|
1375
1375
|
});
|
|
@@ -1436,7 +1436,7 @@ function config(newConfig) {
|
|
|
1436
1436
|
Object.assign(globalConfig, newConfig);
|
|
1437
1437
|
return globalConfig;
|
|
1438
1438
|
}
|
|
1439
|
-
// ../../node_modules
|
|
1439
|
+
// ../../node_modules/zod/v4/core/util.js
|
|
1440
1440
|
var exports_util = {};
|
|
1441
1441
|
__export(exports_util, {
|
|
1442
1442
|
unwrapMessage: () => unwrapMessage,
|
|
@@ -2065,7 +2065,7 @@ class Class {
|
|
|
2065
2065
|
constructor(..._args) {}
|
|
2066
2066
|
}
|
|
2067
2067
|
|
|
2068
|
-
// ../../node_modules
|
|
2068
|
+
// ../../node_modules/zod/v4/core/errors.js
|
|
2069
2069
|
var initializer = (inst, def) => {
|
|
2070
2070
|
inst.name = "$ZodError";
|
|
2071
2071
|
Object.defineProperty(inst, "_zod", {
|
|
@@ -2208,7 +2208,7 @@ function prettifyError(error) {
|
|
|
2208
2208
|
`);
|
|
2209
2209
|
}
|
|
2210
2210
|
|
|
2211
|
-
// ../../node_modules
|
|
2211
|
+
// ../../node_modules/zod/v4/core/parse.js
|
|
2212
2212
|
var _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
2213
2213
|
const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
|
|
2214
2214
|
const result = schema._zod.run({ value, issues: [] }, ctx);
|
|
@@ -2295,7 +2295,7 @@ var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
2295
2295
|
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
2296
2296
|
};
|
|
2297
2297
|
var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
|
|
2298
|
-
// ../../node_modules
|
|
2298
|
+
// ../../node_modules/zod/v4/core/regexes.js
|
|
2299
2299
|
var exports_regexes = {};
|
|
2300
2300
|
__export(exports_regexes, {
|
|
2301
2301
|
xid: () => xid,
|
|
@@ -2447,7 +2447,7 @@ var sha512_hex = /^[0-9a-fA-F]{128}$/;
|
|
|
2447
2447
|
var sha512_base64 = /* @__PURE__ */ fixedBase64(86, "==");
|
|
2448
2448
|
var sha512_base64url = /* @__PURE__ */ fixedBase64url(86);
|
|
2449
2449
|
|
|
2450
|
-
// ../../node_modules
|
|
2450
|
+
// ../../node_modules/zod/v4/core/checks.js
|
|
2451
2451
|
var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
2452
2452
|
var _a;
|
|
2453
2453
|
inst._zod ?? (inst._zod = {});
|
|
@@ -2988,7 +2988,7 @@ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (ins
|
|
|
2988
2988
|
};
|
|
2989
2989
|
});
|
|
2990
2990
|
|
|
2991
|
-
// ../../node_modules
|
|
2991
|
+
// ../../node_modules/zod/v4/core/doc.js
|
|
2992
2992
|
class Doc {
|
|
2993
2993
|
constructor(args = []) {
|
|
2994
2994
|
this.content = [];
|
|
@@ -3026,14 +3026,14 @@ class Doc {
|
|
|
3026
3026
|
}
|
|
3027
3027
|
}
|
|
3028
3028
|
|
|
3029
|
-
// ../../node_modules
|
|
3029
|
+
// ../../node_modules/zod/v4/core/versions.js
|
|
3030
3030
|
var version = {
|
|
3031
3031
|
major: 4,
|
|
3032
3032
|
minor: 1,
|
|
3033
3033
|
patch: 8
|
|
3034
3034
|
};
|
|
3035
3035
|
|
|
3036
|
-
// ../../node_modules
|
|
3036
|
+
// ../../node_modules/zod/v4/core/schemas.js
|
|
3037
3037
|
var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
3038
3038
|
var _a;
|
|
3039
3039
|
inst ?? (inst = {});
|
|
@@ -4856,7 +4856,7 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
4856
4856
|
payload.issues.push(issue(_iss));
|
|
4857
4857
|
}
|
|
4858
4858
|
}
|
|
4859
|
-
// ../../node_modules
|
|
4859
|
+
// ../../node_modules/zod/v4/locales/index.js
|
|
4860
4860
|
var exports_locales = {};
|
|
4861
4861
|
__export(exports_locales, {
|
|
4862
4862
|
zhTW: () => zh_TW_default,
|
|
@@ -4907,7 +4907,7 @@ __export(exports_locales, {
|
|
|
4907
4907
|
ar: () => ar_default
|
|
4908
4908
|
});
|
|
4909
4909
|
|
|
4910
|
-
// ../../node_modules
|
|
4910
|
+
// ../../node_modules/zod/v4/locales/ar.js
|
|
4911
4911
|
var error = () => {
|
|
4912
4912
|
const Sizable = {
|
|
4913
4913
|
string: { unit: "حرف", verb: "أن يحوي" },
|
|
@@ -5023,7 +5023,7 @@ function ar_default() {
|
|
|
5023
5023
|
localeError: error()
|
|
5024
5024
|
};
|
|
5025
5025
|
}
|
|
5026
|
-
// ../../node_modules
|
|
5026
|
+
// ../../node_modules/zod/v4/locales/az.js
|
|
5027
5027
|
var error2 = () => {
|
|
5028
5028
|
const Sizable = {
|
|
5029
5029
|
string: { unit: "simvol", verb: "olmalıdır" },
|
|
@@ -5138,7 +5138,7 @@ function az_default() {
|
|
|
5138
5138
|
localeError: error2()
|
|
5139
5139
|
};
|
|
5140
5140
|
}
|
|
5141
|
-
// ../../node_modules
|
|
5141
|
+
// ../../node_modules/zod/v4/locales/be.js
|
|
5142
5142
|
function getBelarusianPlural(count, one, few, many) {
|
|
5143
5143
|
const absCount = Math.abs(count);
|
|
5144
5144
|
const lastDigit = absCount % 10;
|
|
@@ -5302,7 +5302,7 @@ function be_default() {
|
|
|
5302
5302
|
localeError: error3()
|
|
5303
5303
|
};
|
|
5304
5304
|
}
|
|
5305
|
-
// ../../node_modules
|
|
5305
|
+
// ../../node_modules/zod/v4/locales/ca.js
|
|
5306
5306
|
var error4 = () => {
|
|
5307
5307
|
const Sizable = {
|
|
5308
5308
|
string: { unit: "caràcters", verb: "contenir" },
|
|
@@ -5419,7 +5419,7 @@ function ca_default() {
|
|
|
5419
5419
|
localeError: error4()
|
|
5420
5420
|
};
|
|
5421
5421
|
}
|
|
5422
|
-
// ../../node_modules
|
|
5422
|
+
// ../../node_modules/zod/v4/locales/cs.js
|
|
5423
5423
|
var error5 = () => {
|
|
5424
5424
|
const Sizable = {
|
|
5425
5425
|
string: { unit: "znaků", verb: "mít" },
|
|
@@ -5554,7 +5554,7 @@ function cs_default() {
|
|
|
5554
5554
|
localeError: error5()
|
|
5555
5555
|
};
|
|
5556
5556
|
}
|
|
5557
|
-
// ../../node_modules
|
|
5557
|
+
// ../../node_modules/zod/v4/locales/da.js
|
|
5558
5558
|
var error6 = () => {
|
|
5559
5559
|
const Sizable = {
|
|
5560
5560
|
string: { unit: "tegn", verb: "havde" },
|
|
@@ -5685,7 +5685,7 @@ function da_default() {
|
|
|
5685
5685
|
localeError: error6()
|
|
5686
5686
|
};
|
|
5687
5687
|
}
|
|
5688
|
-
// ../../node_modules
|
|
5688
|
+
// ../../node_modules/zod/v4/locales/de.js
|
|
5689
5689
|
var error7 = () => {
|
|
5690
5690
|
const Sizable = {
|
|
5691
5691
|
string: { unit: "Zeichen", verb: "zu haben" },
|
|
@@ -5801,7 +5801,7 @@ function de_default() {
|
|
|
5801
5801
|
localeError: error7()
|
|
5802
5802
|
};
|
|
5803
5803
|
}
|
|
5804
|
-
// ../../node_modules
|
|
5804
|
+
// ../../node_modules/zod/v4/locales/en.js
|
|
5805
5805
|
var parsedType = (data) => {
|
|
5806
5806
|
const t = typeof data;
|
|
5807
5807
|
switch (t) {
|
|
@@ -5918,7 +5918,7 @@ function en_default() {
|
|
|
5918
5918
|
localeError: error8()
|
|
5919
5919
|
};
|
|
5920
5920
|
}
|
|
5921
|
-
// ../../node_modules
|
|
5921
|
+
// ../../node_modules/zod/v4/locales/eo.js
|
|
5922
5922
|
var parsedType2 = (data) => {
|
|
5923
5923
|
const t = typeof data;
|
|
5924
5924
|
switch (t) {
|
|
@@ -6034,7 +6034,7 @@ function eo_default() {
|
|
|
6034
6034
|
localeError: error9()
|
|
6035
6035
|
};
|
|
6036
6036
|
}
|
|
6037
|
-
// ../../node_modules
|
|
6037
|
+
// ../../node_modules/zod/v4/locales/es.js
|
|
6038
6038
|
var error10 = () => {
|
|
6039
6039
|
const Sizable = {
|
|
6040
6040
|
string: { unit: "caracteres", verb: "tener" },
|
|
@@ -6182,7 +6182,7 @@ function es_default() {
|
|
|
6182
6182
|
localeError: error10()
|
|
6183
6183
|
};
|
|
6184
6184
|
}
|
|
6185
|
-
// ../../node_modules
|
|
6185
|
+
// ../../node_modules/zod/v4/locales/fa.js
|
|
6186
6186
|
var error11 = () => {
|
|
6187
6187
|
const Sizable = {
|
|
6188
6188
|
string: { unit: "کاراکتر", verb: "داشته باشد" },
|
|
@@ -6304,7 +6304,7 @@ function fa_default() {
|
|
|
6304
6304
|
localeError: error11()
|
|
6305
6305
|
};
|
|
6306
6306
|
}
|
|
6307
|
-
// ../../node_modules
|
|
6307
|
+
// ../../node_modules/zod/v4/locales/fi.js
|
|
6308
6308
|
var error12 = () => {
|
|
6309
6309
|
const Sizable = {
|
|
6310
6310
|
string: { unit: "merkkiä", subject: "merkkijonon" },
|
|
@@ -6426,7 +6426,7 @@ function fi_default() {
|
|
|
6426
6426
|
localeError: error12()
|
|
6427
6427
|
};
|
|
6428
6428
|
}
|
|
6429
|
-
// ../../node_modules
|
|
6429
|
+
// ../../node_modules/zod/v4/locales/fr.js
|
|
6430
6430
|
var error13 = () => {
|
|
6431
6431
|
const Sizable = {
|
|
6432
6432
|
string: { unit: "caractères", verb: "avoir" },
|
|
@@ -6542,7 +6542,7 @@ function fr_default() {
|
|
|
6542
6542
|
localeError: error13()
|
|
6543
6543
|
};
|
|
6544
6544
|
}
|
|
6545
|
-
// ../../node_modules
|
|
6545
|
+
// ../../node_modules/zod/v4/locales/fr-CA.js
|
|
6546
6546
|
var error14 = () => {
|
|
6547
6547
|
const Sizable = {
|
|
6548
6548
|
string: { unit: "caractères", verb: "avoir" },
|
|
@@ -6659,7 +6659,7 @@ function fr_CA_default() {
|
|
|
6659
6659
|
localeError: error14()
|
|
6660
6660
|
};
|
|
6661
6661
|
}
|
|
6662
|
-
// ../../node_modules
|
|
6662
|
+
// ../../node_modules/zod/v4/locales/he.js
|
|
6663
6663
|
var error15 = () => {
|
|
6664
6664
|
const Sizable = {
|
|
6665
6665
|
string: { unit: "אותיות", verb: "לכלול" },
|
|
@@ -6775,7 +6775,7 @@ function he_default() {
|
|
|
6775
6775
|
localeError: error15()
|
|
6776
6776
|
};
|
|
6777
6777
|
}
|
|
6778
|
-
// ../../node_modules
|
|
6778
|
+
// ../../node_modules/zod/v4/locales/hu.js
|
|
6779
6779
|
var error16 = () => {
|
|
6780
6780
|
const Sizable = {
|
|
6781
6781
|
string: { unit: "karakter", verb: "legyen" },
|
|
@@ -6891,7 +6891,7 @@ function hu_default() {
|
|
|
6891
6891
|
localeError: error16()
|
|
6892
6892
|
};
|
|
6893
6893
|
}
|
|
6894
|
-
// ../../node_modules
|
|
6894
|
+
// ../../node_modules/zod/v4/locales/id.js
|
|
6895
6895
|
var error17 = () => {
|
|
6896
6896
|
const Sizable = {
|
|
6897
6897
|
string: { unit: "karakter", verb: "memiliki" },
|
|
@@ -7007,7 +7007,7 @@ function id_default() {
|
|
|
7007
7007
|
localeError: error17()
|
|
7008
7008
|
};
|
|
7009
7009
|
}
|
|
7010
|
-
// ../../node_modules
|
|
7010
|
+
// ../../node_modules/zod/v4/locales/is.js
|
|
7011
7011
|
var parsedType3 = (data) => {
|
|
7012
7012
|
const t = typeof data;
|
|
7013
7013
|
switch (t) {
|
|
@@ -7124,7 +7124,7 @@ function is_default() {
|
|
|
7124
7124
|
localeError: error18()
|
|
7125
7125
|
};
|
|
7126
7126
|
}
|
|
7127
|
-
// ../../node_modules
|
|
7127
|
+
// ../../node_modules/zod/v4/locales/it.js
|
|
7128
7128
|
var error19 = () => {
|
|
7129
7129
|
const Sizable = {
|
|
7130
7130
|
string: { unit: "caratteri", verb: "avere" },
|
|
@@ -7240,7 +7240,7 @@ function it_default() {
|
|
|
7240
7240
|
localeError: error19()
|
|
7241
7241
|
};
|
|
7242
7242
|
}
|
|
7243
|
-
// ../../node_modules
|
|
7243
|
+
// ../../node_modules/zod/v4/locales/ja.js
|
|
7244
7244
|
var error20 = () => {
|
|
7245
7245
|
const Sizable = {
|
|
7246
7246
|
string: { unit: "文字", verb: "である" },
|
|
@@ -7355,7 +7355,7 @@ function ja_default() {
|
|
|
7355
7355
|
localeError: error20()
|
|
7356
7356
|
};
|
|
7357
7357
|
}
|
|
7358
|
-
// ../../node_modules
|
|
7358
|
+
// ../../node_modules/zod/v4/locales/ka.js
|
|
7359
7359
|
var parsedType4 = (data) => {
|
|
7360
7360
|
const t = typeof data;
|
|
7361
7361
|
switch (t) {
|
|
@@ -7480,7 +7480,7 @@ function ka_default() {
|
|
|
7480
7480
|
localeError: error21()
|
|
7481
7481
|
};
|
|
7482
7482
|
}
|
|
7483
|
-
// ../../node_modules
|
|
7483
|
+
// ../../node_modules/zod/v4/locales/km.js
|
|
7484
7484
|
var error22 = () => {
|
|
7485
7485
|
const Sizable = {
|
|
7486
7486
|
string: { unit: "តួអក្សរ", verb: "គួរមាន" },
|
|
@@ -7598,11 +7598,11 @@ function km_default() {
|
|
|
7598
7598
|
};
|
|
7599
7599
|
}
|
|
7600
7600
|
|
|
7601
|
-
// ../../node_modules
|
|
7601
|
+
// ../../node_modules/zod/v4/locales/kh.js
|
|
7602
7602
|
function kh_default() {
|
|
7603
7603
|
return km_default();
|
|
7604
7604
|
}
|
|
7605
|
-
// ../../node_modules
|
|
7605
|
+
// ../../node_modules/zod/v4/locales/ko.js
|
|
7606
7606
|
var error23 = () => {
|
|
7607
7607
|
const Sizable = {
|
|
7608
7608
|
string: { unit: "문자", verb: "to have" },
|
|
@@ -7723,7 +7723,7 @@ function ko_default() {
|
|
|
7723
7723
|
localeError: error23()
|
|
7724
7724
|
};
|
|
7725
7725
|
}
|
|
7726
|
-
// ../../node_modules
|
|
7726
|
+
// ../../node_modules/zod/v4/locales/lt.js
|
|
7727
7727
|
var parsedType5 = (data) => {
|
|
7728
7728
|
const t = typeof data;
|
|
7729
7729
|
return parsedTypeFromType(t, data);
|
|
@@ -7952,7 +7952,7 @@ function lt_default() {
|
|
|
7952
7952
|
localeError: error24()
|
|
7953
7953
|
};
|
|
7954
7954
|
}
|
|
7955
|
-
// ../../node_modules
|
|
7955
|
+
// ../../node_modules/zod/v4/locales/mk.js
|
|
7956
7956
|
var error25 = () => {
|
|
7957
7957
|
const Sizable = {
|
|
7958
7958
|
string: { unit: "знаци", verb: "да имаат" },
|
|
@@ -8069,7 +8069,7 @@ function mk_default() {
|
|
|
8069
8069
|
localeError: error25()
|
|
8070
8070
|
};
|
|
8071
8071
|
}
|
|
8072
|
-
// ../../node_modules
|
|
8072
|
+
// ../../node_modules/zod/v4/locales/ms.js
|
|
8073
8073
|
var error26 = () => {
|
|
8074
8074
|
const Sizable = {
|
|
8075
8075
|
string: { unit: "aksara", verb: "mempunyai" },
|
|
@@ -8185,7 +8185,7 @@ function ms_default() {
|
|
|
8185
8185
|
localeError: error26()
|
|
8186
8186
|
};
|
|
8187
8187
|
}
|
|
8188
|
-
// ../../node_modules
|
|
8188
|
+
// ../../node_modules/zod/v4/locales/nl.js
|
|
8189
8189
|
var error27 = () => {
|
|
8190
8190
|
const Sizable = {
|
|
8191
8191
|
string: { unit: "tekens" },
|
|
@@ -8302,7 +8302,7 @@ function nl_default() {
|
|
|
8302
8302
|
localeError: error27()
|
|
8303
8303
|
};
|
|
8304
8304
|
}
|
|
8305
|
-
// ../../node_modules
|
|
8305
|
+
// ../../node_modules/zod/v4/locales/no.js
|
|
8306
8306
|
var error28 = () => {
|
|
8307
8307
|
const Sizable = {
|
|
8308
8308
|
string: { unit: "tegn", verb: "å ha" },
|
|
@@ -8418,7 +8418,7 @@ function no_default() {
|
|
|
8418
8418
|
localeError: error28()
|
|
8419
8419
|
};
|
|
8420
8420
|
}
|
|
8421
|
-
// ../../node_modules
|
|
8421
|
+
// ../../node_modules/zod/v4/locales/ota.js
|
|
8422
8422
|
var error29 = () => {
|
|
8423
8423
|
const Sizable = {
|
|
8424
8424
|
string: { unit: "harf", verb: "olmalıdır" },
|
|
@@ -8534,7 +8534,7 @@ function ota_default() {
|
|
|
8534
8534
|
localeError: error29()
|
|
8535
8535
|
};
|
|
8536
8536
|
}
|
|
8537
|
-
// ../../node_modules
|
|
8537
|
+
// ../../node_modules/zod/v4/locales/ps.js
|
|
8538
8538
|
var error30 = () => {
|
|
8539
8539
|
const Sizable = {
|
|
8540
8540
|
string: { unit: "توکي", verb: "ولري" },
|
|
@@ -8656,7 +8656,7 @@ function ps_default() {
|
|
|
8656
8656
|
localeError: error30()
|
|
8657
8657
|
};
|
|
8658
8658
|
}
|
|
8659
|
-
// ../../node_modules
|
|
8659
|
+
// ../../node_modules/zod/v4/locales/pl.js
|
|
8660
8660
|
var error31 = () => {
|
|
8661
8661
|
const Sizable = {
|
|
8662
8662
|
string: { unit: "znaków", verb: "mieć" },
|
|
@@ -8773,7 +8773,7 @@ function pl_default() {
|
|
|
8773
8773
|
localeError: error31()
|
|
8774
8774
|
};
|
|
8775
8775
|
}
|
|
8776
|
-
// ../../node_modules
|
|
8776
|
+
// ../../node_modules/zod/v4/locales/pt.js
|
|
8777
8777
|
var error32 = () => {
|
|
8778
8778
|
const Sizable = {
|
|
8779
8779
|
string: { unit: "caracteres", verb: "ter" },
|
|
@@ -8889,7 +8889,7 @@ function pt_default() {
|
|
|
8889
8889
|
localeError: error32()
|
|
8890
8890
|
};
|
|
8891
8891
|
}
|
|
8892
|
-
// ../../node_modules
|
|
8892
|
+
// ../../node_modules/zod/v4/locales/ru.js
|
|
8893
8893
|
function getRussianPlural(count, one, few, many) {
|
|
8894
8894
|
const absCount = Math.abs(count);
|
|
8895
8895
|
const lastDigit = absCount % 10;
|
|
@@ -9053,7 +9053,7 @@ function ru_default() {
|
|
|
9053
9053
|
localeError: error33()
|
|
9054
9054
|
};
|
|
9055
9055
|
}
|
|
9056
|
-
// ../../node_modules
|
|
9056
|
+
// ../../node_modules/zod/v4/locales/sl.js
|
|
9057
9057
|
var error34 = () => {
|
|
9058
9058
|
const Sizable = {
|
|
9059
9059
|
string: { unit: "znakov", verb: "imeti" },
|
|
@@ -9170,7 +9170,7 @@ function sl_default() {
|
|
|
9170
9170
|
localeError: error34()
|
|
9171
9171
|
};
|
|
9172
9172
|
}
|
|
9173
|
-
// ../../node_modules
|
|
9173
|
+
// ../../node_modules/zod/v4/locales/sv.js
|
|
9174
9174
|
var error35 = () => {
|
|
9175
9175
|
const Sizable = {
|
|
9176
9176
|
string: { unit: "tecken", verb: "att ha" },
|
|
@@ -9288,7 +9288,7 @@ function sv_default() {
|
|
|
9288
9288
|
localeError: error35()
|
|
9289
9289
|
};
|
|
9290
9290
|
}
|
|
9291
|
-
// ../../node_modules
|
|
9291
|
+
// ../../node_modules/zod/v4/locales/ta.js
|
|
9292
9292
|
var error36 = () => {
|
|
9293
9293
|
const Sizable = {
|
|
9294
9294
|
string: { unit: "எழுத்துக்கள்", verb: "கொண்டிருக்க வேண்டும்" },
|
|
@@ -9405,7 +9405,7 @@ function ta_default() {
|
|
|
9405
9405
|
localeError: error36()
|
|
9406
9406
|
};
|
|
9407
9407
|
}
|
|
9408
|
-
// ../../node_modules
|
|
9408
|
+
// ../../node_modules/zod/v4/locales/th.js
|
|
9409
9409
|
var error37 = () => {
|
|
9410
9410
|
const Sizable = {
|
|
9411
9411
|
string: { unit: "ตัวอักษร", verb: "ควรมี" },
|
|
@@ -9522,7 +9522,7 @@ function th_default() {
|
|
|
9522
9522
|
localeError: error37()
|
|
9523
9523
|
};
|
|
9524
9524
|
}
|
|
9525
|
-
// ../../node_modules
|
|
9525
|
+
// ../../node_modules/zod/v4/locales/tr.js
|
|
9526
9526
|
var parsedType6 = (data) => {
|
|
9527
9527
|
const t = typeof data;
|
|
9528
9528
|
switch (t) {
|
|
@@ -9637,7 +9637,7 @@ function tr_default() {
|
|
|
9637
9637
|
localeError: error38()
|
|
9638
9638
|
};
|
|
9639
9639
|
}
|
|
9640
|
-
// ../../node_modules
|
|
9640
|
+
// ../../node_modules/zod/v4/locales/uk.js
|
|
9641
9641
|
var error39 = () => {
|
|
9642
9642
|
const Sizable = {
|
|
9643
9643
|
string: { unit: "символів", verb: "матиме" },
|
|
@@ -9754,11 +9754,11 @@ function uk_default() {
|
|
|
9754
9754
|
};
|
|
9755
9755
|
}
|
|
9756
9756
|
|
|
9757
|
-
// ../../node_modules
|
|
9757
|
+
// ../../node_modules/zod/v4/locales/ua.js
|
|
9758
9758
|
function ua_default() {
|
|
9759
9759
|
return uk_default();
|
|
9760
9760
|
}
|
|
9761
|
-
// ../../node_modules
|
|
9761
|
+
// ../../node_modules/zod/v4/locales/ur.js
|
|
9762
9762
|
var error40 = () => {
|
|
9763
9763
|
const Sizable = {
|
|
9764
9764
|
string: { unit: "حروف", verb: "ہونا" },
|
|
@@ -9875,7 +9875,7 @@ function ur_default() {
|
|
|
9875
9875
|
localeError: error40()
|
|
9876
9876
|
};
|
|
9877
9877
|
}
|
|
9878
|
-
// ../../node_modules
|
|
9878
|
+
// ../../node_modules/zod/v4/locales/vi.js
|
|
9879
9879
|
var error41 = () => {
|
|
9880
9880
|
const Sizable = {
|
|
9881
9881
|
string: { unit: "ký tự", verb: "có" },
|
|
@@ -9991,7 +9991,7 @@ function vi_default() {
|
|
|
9991
9991
|
localeError: error41()
|
|
9992
9992
|
};
|
|
9993
9993
|
}
|
|
9994
|
-
// ../../node_modules
|
|
9994
|
+
// ../../node_modules/zod/v4/locales/zh-CN.js
|
|
9995
9995
|
var error42 = () => {
|
|
9996
9996
|
const Sizable = {
|
|
9997
9997
|
string: { unit: "字符", verb: "包含" },
|
|
@@ -10107,7 +10107,7 @@ function zh_CN_default() {
|
|
|
10107
10107
|
localeError: error42()
|
|
10108
10108
|
};
|
|
10109
10109
|
}
|
|
10110
|
-
// ../../node_modules
|
|
10110
|
+
// ../../node_modules/zod/v4/locales/zh-TW.js
|
|
10111
10111
|
var error43 = () => {
|
|
10112
10112
|
const Sizable = {
|
|
10113
10113
|
string: { unit: "字元", verb: "擁有" },
|
|
@@ -10224,7 +10224,7 @@ function zh_TW_default() {
|
|
|
10224
10224
|
localeError: error43()
|
|
10225
10225
|
};
|
|
10226
10226
|
}
|
|
10227
|
-
// ../../node_modules
|
|
10227
|
+
// ../../node_modules/zod/v4/locales/yo.js
|
|
10228
10228
|
var error44 = () => {
|
|
10229
10229
|
const Sizable = {
|
|
10230
10230
|
string: { unit: "àmi", verb: "ní" },
|
|
@@ -10339,7 +10339,7 @@ function yo_default() {
|
|
|
10339
10339
|
localeError: error44()
|
|
10340
10340
|
};
|
|
10341
10341
|
}
|
|
10342
|
-
// ../../node_modules
|
|
10342
|
+
// ../../node_modules/zod/v4/core/registries.js
|
|
10343
10343
|
var $output = Symbol("ZodOutput");
|
|
10344
10344
|
var $input = Symbol("ZodInput");
|
|
10345
10345
|
|
|
@@ -10390,7 +10390,7 @@ function registry() {
|
|
|
10390
10390
|
return new $ZodRegistry;
|
|
10391
10391
|
}
|
|
10392
10392
|
var globalRegistry = /* @__PURE__ */ registry();
|
|
10393
|
-
// ../../node_modules
|
|
10393
|
+
// ../../node_modules/zod/v4/core/api.js
|
|
10394
10394
|
function _string(Class2, params) {
|
|
10395
10395
|
return new Class2({
|
|
10396
10396
|
type: "string",
|
|
@@ -11268,7 +11268,7 @@ function _stringFormat(Class2, format, fnOrRegex, _params = {}) {
|
|
|
11268
11268
|
const inst = new Class2(def);
|
|
11269
11269
|
return inst;
|
|
11270
11270
|
}
|
|
11271
|
-
// ../../node_modules
|
|
11271
|
+
// ../../node_modules/zod/v4/core/to-json-schema.js
|
|
11272
11272
|
class JSONSchemaGenerator {
|
|
11273
11273
|
constructor(params) {
|
|
11274
11274
|
this.counter = 0;
|
|
@@ -12072,9 +12072,9 @@ function isTransforming(_schema, _ctx) {
|
|
|
12072
12072
|
}
|
|
12073
12073
|
throw new Error(`Unknown schema type: ${def.type}`);
|
|
12074
12074
|
}
|
|
12075
|
-
// ../../node_modules
|
|
12075
|
+
// ../../node_modules/zod/v4/core/json-schema.js
|
|
12076
12076
|
var exports_json_schema = {};
|
|
12077
|
-
// ../../node_modules
|
|
12077
|
+
// ../../node_modules/zod/v4/classic/iso.js
|
|
12078
12078
|
var exports_iso = {};
|
|
12079
12079
|
__export(exports_iso, {
|
|
12080
12080
|
time: () => time2,
|
|
@@ -12115,7 +12115,7 @@ function duration2(params) {
|
|
|
12115
12115
|
return _isoDuration(ZodISODuration, params);
|
|
12116
12116
|
}
|
|
12117
12117
|
|
|
12118
|
-
// ../../node_modules
|
|
12118
|
+
// ../../node_modules/zod/v4/classic/errors.js
|
|
12119
12119
|
var initializer2 = (inst, issues) => {
|
|
12120
12120
|
$ZodError.init(inst, issues);
|
|
12121
12121
|
inst.name = "ZodError";
|
|
@@ -12150,7 +12150,7 @@ var ZodRealError = $constructor("ZodError", initializer2, {
|
|
|
12150
12150
|
Parent: Error
|
|
12151
12151
|
});
|
|
12152
12152
|
|
|
12153
|
-
// ../../node_modules
|
|
12153
|
+
// ../../node_modules/zod/v4/classic/parse.js
|
|
12154
12154
|
var parse3 = /* @__PURE__ */ _parse(ZodRealError);
|
|
12155
12155
|
var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
12156
12156
|
var safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -12164,7 +12164,7 @@ var safeDecode2 = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
|
12164
12164
|
var safeEncodeAsync2 = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
12165
12165
|
var safeDecodeAsync2 = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
12166
12166
|
|
|
12167
|
-
// ../../node_modules
|
|
12167
|
+
// ../../node_modules/zod/v4/classic/schemas.js
|
|
12168
12168
|
var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
12169
12169
|
$ZodType.init(inst, def);
|
|
12170
12170
|
inst.def = def;
|
|
@@ -13139,7 +13139,7 @@ function json(params) {
|
|
|
13139
13139
|
function preprocess(fn, schema) {
|
|
13140
13140
|
return pipe(transform(fn), schema);
|
|
13141
13141
|
}
|
|
13142
|
-
// ../../node_modules
|
|
13142
|
+
// ../../node_modules/zod/v4/classic/compat.js
|
|
13143
13143
|
var ZodIssueCode = {
|
|
13144
13144
|
invalid_type: "invalid_type",
|
|
13145
13145
|
too_big: "too_big",
|
|
@@ -13163,7 +13163,7 @@ function getErrorMap() {
|
|
|
13163
13163
|
}
|
|
13164
13164
|
var ZodFirstPartyTypeKind;
|
|
13165
13165
|
(function(ZodFirstPartyTypeKind2) {})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
|
13166
|
-
// ../../node_modules
|
|
13166
|
+
// ../../node_modules/zod/v4/classic/coerce.js
|
|
13167
13167
|
var exports_coerce = {};
|
|
13168
13168
|
__export(exports_coerce, {
|
|
13169
13169
|
string: () => string3,
|
|
@@ -13188,9 +13188,9 @@ function date4(params) {
|
|
|
13188
13188
|
return _coercedDate(ZodDate, params);
|
|
13189
13189
|
}
|
|
13190
13190
|
|
|
13191
|
-
// ../../node_modules
|
|
13191
|
+
// ../../node_modules/zod/v4/classic/external.js
|
|
13192
13192
|
config(en_default());
|
|
13193
|
-
// ../../node_modules
|
|
13193
|
+
// ../../node_modules/@opencode-ai/plugin/dist/tool.js
|
|
13194
13194
|
function tool(input) {
|
|
13195
13195
|
return input;
|
|
13196
13196
|
}
|
|
@@ -16738,6 +16738,9 @@ function getFeaturesPath(projectRoot) {
|
|
|
16738
16738
|
function getActiveFeaturePath(projectRoot) {
|
|
16739
16739
|
return path2.join(getHivePath(projectRoot), ACTIVE_FEATURE_FILE);
|
|
16740
16740
|
}
|
|
16741
|
+
function getGlobalSessionsPath(projectRoot) {
|
|
16742
|
+
return path2.join(getHivePath(projectRoot), "sessions.json");
|
|
16743
|
+
}
|
|
16741
16744
|
function parseIndexedFeatureDirectoryName(directoryName) {
|
|
16742
16745
|
const match = directoryName.match(/^(\d+)[_-](.+)$/);
|
|
16743
16746
|
if (!match) {
|
|
@@ -17865,7 +17868,7 @@ _Add detailed instructions here_
|
|
|
17865
17868
|
import * as fs7 from "fs/promises";
|
|
17866
17869
|
import * as path5 from "path";
|
|
17867
17870
|
|
|
17868
|
-
// ../../node_modules
|
|
17871
|
+
// ../../node_modules/simple-git/dist/esm/index.js
|
|
17869
17872
|
var import_file_exists = __toESM(require_dist(), 1);
|
|
17870
17873
|
var import_debug = __toESM(require_src(), 1);
|
|
17871
17874
|
var import_promise_deferred = __toESM(require_dist2(), 1);
|
|
@@ -18110,7 +18113,7 @@ var init_argument_filters = __esm({
|
|
|
18110
18113
|
return typeof input === "number";
|
|
18111
18114
|
};
|
|
18112
18115
|
filterString = (input) => {
|
|
18113
|
-
return typeof input === "string"
|
|
18116
|
+
return typeof input === "string";
|
|
18114
18117
|
};
|
|
18115
18118
|
filterStringOrStringArray = (input) => {
|
|
18116
18119
|
return filterString(input) || Array.isArray(input) && input.every(filterString);
|
|
@@ -20251,15 +20254,15 @@ function parser3(indexX, indexY, handler) {
|
|
|
20251
20254
|
return [`${indexX}${indexY}`, handler];
|
|
20252
20255
|
}
|
|
20253
20256
|
function conflicts(indexX, ...indexY) {
|
|
20254
|
-
return indexY.map((y) => parser3(indexX, y, (result, file2) => result.conflicted
|
|
20257
|
+
return indexY.map((y) => parser3(indexX, y, (result, file2) => append(result.conflicted, file2)));
|
|
20255
20258
|
}
|
|
20256
20259
|
function splitLine(result, lineStr) {
|
|
20257
20260
|
const trimmed2 = lineStr.trim();
|
|
20258
20261
|
switch (" ") {
|
|
20259
20262
|
case trimmed2.charAt(2):
|
|
20260
|
-
return data(trimmed2.charAt(0), trimmed2.charAt(1), trimmed2.
|
|
20263
|
+
return data(trimmed2.charAt(0), trimmed2.charAt(1), trimmed2.substr(3));
|
|
20261
20264
|
case trimmed2.charAt(1):
|
|
20262
|
-
return data(" ", trimmed2.charAt(0), trimmed2.
|
|
20265
|
+
return data(" ", trimmed2.charAt(0), trimmed2.substr(2));
|
|
20263
20266
|
default:
|
|
20264
20267
|
return;
|
|
20265
20268
|
}
|
|
@@ -20303,42 +20306,26 @@ var init_StatusSummary = __esm({
|
|
|
20303
20306
|
}
|
|
20304
20307
|
};
|
|
20305
20308
|
parsers6 = new Map([
|
|
20306
|
-
parser3(" ", "A", (result, file2) => result.created
|
|
20307
|
-
parser3(" ", "D", (result, file2) => result.deleted
|
|
20308
|
-
parser3(" ", "M", (result, file2) => result.modified
|
|
20309
|
-
parser3("A", " ", (result, file2) =>
|
|
20310
|
-
|
|
20311
|
-
|
|
20312
|
-
|
|
20313
|
-
parser3("
|
|
20314
|
-
result.created.push(file2);
|
|
20315
|
-
result.staged.push(file2);
|
|
20316
|
-
result.modified.push(file2);
|
|
20317
|
-
}),
|
|
20318
|
-
parser3("D", " ", (result, file2) => {
|
|
20319
|
-
result.deleted.push(file2);
|
|
20320
|
-
result.staged.push(file2);
|
|
20321
|
-
}),
|
|
20322
|
-
parser3("M", " ", (result, file2) => {
|
|
20323
|
-
result.modified.push(file2);
|
|
20324
|
-
result.staged.push(file2);
|
|
20325
|
-
}),
|
|
20326
|
-
parser3("M", "M", (result, file2) => {
|
|
20327
|
-
result.modified.push(file2);
|
|
20328
|
-
result.staged.push(file2);
|
|
20329
|
-
}),
|
|
20309
|
+
parser3(" ", "A", (result, file2) => append(result.created, file2)),
|
|
20310
|
+
parser3(" ", "D", (result, file2) => append(result.deleted, file2)),
|
|
20311
|
+
parser3(" ", "M", (result, file2) => append(result.modified, file2)),
|
|
20312
|
+
parser3("A", " ", (result, file2) => append(result.created, file2) && append(result.staged, file2)),
|
|
20313
|
+
parser3("A", "M", (result, file2) => append(result.created, file2) && append(result.staged, file2) && append(result.modified, file2)),
|
|
20314
|
+
parser3("D", " ", (result, file2) => append(result.deleted, file2) && append(result.staged, file2)),
|
|
20315
|
+
parser3("M", " ", (result, file2) => append(result.modified, file2) && append(result.staged, file2)),
|
|
20316
|
+
parser3("M", "M", (result, file2) => append(result.modified, file2) && append(result.staged, file2)),
|
|
20330
20317
|
parser3("R", " ", (result, file2) => {
|
|
20331
|
-
result.renamed
|
|
20318
|
+
append(result.renamed, renamedFile(file2));
|
|
20332
20319
|
}),
|
|
20333
20320
|
parser3("R", "M", (result, file2) => {
|
|
20334
20321
|
const renamed = renamedFile(file2);
|
|
20335
|
-
result.renamed
|
|
20336
|
-
result.modified
|
|
20322
|
+
append(result.renamed, renamed);
|
|
20323
|
+
append(result.modified, renamed.to);
|
|
20337
20324
|
}),
|
|
20338
20325
|
parser3("!", "!", (_result, _file2) => {
|
|
20339
|
-
(_result.ignored = _result.ignored || []
|
|
20326
|
+
append(_result.ignored = _result.ignored || [], _file2);
|
|
20340
20327
|
}),
|
|
20341
|
-
parser3("?", "?", (result, file2) => result.not_added
|
|
20328
|
+
parser3("?", "?", (result, file2) => append(result.not_added, file2)),
|
|
20342
20329
|
...conflicts("A", "A", "U"),
|
|
20343
20330
|
...conflicts("D", "D", "U"),
|
|
20344
20331
|
...conflicts("U", "A", "D", "U"),
|
|
@@ -20464,41 +20451,6 @@ var init_version = __esm({
|
|
|
20464
20451
|
];
|
|
20465
20452
|
}
|
|
20466
20453
|
});
|
|
20467
|
-
function createCloneTask(api2, task, repoPath, ...args) {
|
|
20468
|
-
if (!filterString(repoPath)) {
|
|
20469
|
-
return configurationErrorTask(`git.${api2}() requires a string 'repoPath'`);
|
|
20470
|
-
}
|
|
20471
|
-
return task(repoPath, filterType(args[0], filterString), getTrailingOptions(arguments));
|
|
20472
|
-
}
|
|
20473
|
-
function clone_default() {
|
|
20474
|
-
return {
|
|
20475
|
-
clone(repo, ...rest) {
|
|
20476
|
-
return this._runTask(createCloneTask("clone", cloneTask, filterType(repo, filterString), ...rest), trailingFunctionArgument(arguments));
|
|
20477
|
-
},
|
|
20478
|
-
mirror(repo, ...rest) {
|
|
20479
|
-
return this._runTask(createCloneTask("mirror", cloneMirrorTask, filterType(repo, filterString), ...rest), trailingFunctionArgument(arguments));
|
|
20480
|
-
}
|
|
20481
|
-
};
|
|
20482
|
-
}
|
|
20483
|
-
var cloneTask;
|
|
20484
|
-
var cloneMirrorTask;
|
|
20485
|
-
var init_clone = __esm({
|
|
20486
|
-
"src/lib/tasks/clone.ts"() {
|
|
20487
|
-
init_task();
|
|
20488
|
-
init_utils();
|
|
20489
|
-
init_pathspec();
|
|
20490
|
-
cloneTask = (repo, directory, customArgs) => {
|
|
20491
|
-
const commands = ["clone", ...customArgs];
|
|
20492
|
-
filterString(repo) && commands.push(pathspec(repo));
|
|
20493
|
-
filterString(directory) && commands.push(pathspec(directory));
|
|
20494
|
-
return straightThroughStringTask(commands);
|
|
20495
|
-
};
|
|
20496
|
-
cloneMirrorTask = (repo, directory, customArgs) => {
|
|
20497
|
-
append(customArgs, "--mirror");
|
|
20498
|
-
return cloneTask(repo, directory, customArgs);
|
|
20499
|
-
};
|
|
20500
|
-
}
|
|
20501
|
-
});
|
|
20502
20454
|
var simple_git_api_exports = {};
|
|
20503
20455
|
__export2(simple_git_api_exports, {
|
|
20504
20456
|
SimpleGitApi: () => SimpleGitApi
|
|
@@ -20524,7 +20476,6 @@ var init_simple_git_api = __esm({
|
|
|
20524
20476
|
init_task();
|
|
20525
20477
|
init_version();
|
|
20526
20478
|
init_utils();
|
|
20527
|
-
init_clone();
|
|
20528
20479
|
SimpleGitApi = class {
|
|
20529
20480
|
constructor(_executor) {
|
|
20530
20481
|
this._executor = _executor;
|
|
@@ -20587,7 +20538,7 @@ var init_simple_git_api = __esm({
|
|
|
20587
20538
|
return this._runTask(statusTask(getTrailingOptions(arguments)), trailingFunctionArgument(arguments));
|
|
20588
20539
|
}
|
|
20589
20540
|
};
|
|
20590
|
-
Object.assign(SimpleGitApi.prototype, checkout_default(),
|
|
20541
|
+
Object.assign(SimpleGitApi.prototype, checkout_default(), commit_default(), config_default(), count_objects_default(), first_commit_default(), grep_default(), log_default(), show_default(), version_default());
|
|
20591
20542
|
}
|
|
20592
20543
|
});
|
|
20593
20544
|
var scheduler_exports = {};
|
|
@@ -20875,6 +20826,34 @@ var init_check_ignore = __esm({
|
|
|
20875
20826
|
init_CheckIgnore();
|
|
20876
20827
|
}
|
|
20877
20828
|
});
|
|
20829
|
+
var clone_exports = {};
|
|
20830
|
+
__export2(clone_exports, {
|
|
20831
|
+
cloneMirrorTask: () => cloneMirrorTask,
|
|
20832
|
+
cloneTask: () => cloneTask
|
|
20833
|
+
});
|
|
20834
|
+
function disallowedCommand(command) {
|
|
20835
|
+
return /^--upload-pack(=|$)/.test(command);
|
|
20836
|
+
}
|
|
20837
|
+
function cloneTask(repo, directory, customArgs) {
|
|
20838
|
+
const commands = ["clone", ...customArgs];
|
|
20839
|
+
filterString(repo) && commands.push(repo);
|
|
20840
|
+
filterString(directory) && commands.push(directory);
|
|
20841
|
+
const banned = commands.find(disallowedCommand);
|
|
20842
|
+
if (banned) {
|
|
20843
|
+
return configurationErrorTask(`git.fetch: potential exploit argument blocked.`);
|
|
20844
|
+
}
|
|
20845
|
+
return straightThroughStringTask(commands);
|
|
20846
|
+
}
|
|
20847
|
+
function cloneMirrorTask(repo, directory, customArgs) {
|
|
20848
|
+
append(customArgs, "--mirror");
|
|
20849
|
+
return cloneTask(repo, directory, customArgs);
|
|
20850
|
+
}
|
|
20851
|
+
var init_clone = __esm({
|
|
20852
|
+
"src/lib/tasks/clone.ts"() {
|
|
20853
|
+
init_task();
|
|
20854
|
+
init_utils();
|
|
20855
|
+
}
|
|
20856
|
+
});
|
|
20878
20857
|
function parseFetchResult(stdOut, stdErr) {
|
|
20879
20858
|
const result = {
|
|
20880
20859
|
raw: stdOut,
|
|
@@ -20926,7 +20905,7 @@ var fetch_exports = {};
|
|
|
20926
20905
|
__export2(fetch_exports, {
|
|
20927
20906
|
fetchTask: () => fetchTask
|
|
20928
20907
|
});
|
|
20929
|
-
function
|
|
20908
|
+
function disallowedCommand2(command) {
|
|
20930
20909
|
return /^--upload-pack(=|$)/.test(command);
|
|
20931
20910
|
}
|
|
20932
20911
|
function fetchTask(remote, branch, customArgs) {
|
|
@@ -20934,7 +20913,7 @@ function fetchTask(remote, branch, customArgs) {
|
|
|
20934
20913
|
if (remote && branch) {
|
|
20935
20914
|
commands.push(remote, branch);
|
|
20936
20915
|
}
|
|
20937
|
-
const banned = commands.find(
|
|
20916
|
+
const banned = commands.find(disallowedCommand2);
|
|
20938
20917
|
if (banned) {
|
|
20939
20918
|
return configurationErrorTask(`git.fetch: potential exploit argument blocked.`);
|
|
20940
20919
|
}
|
|
@@ -21233,7 +21212,7 @@ var require_git = __commonJS2({
|
|
|
21233
21212
|
var { GitExecutor: GitExecutor2 } = (init_git_executor(), __toCommonJS(git_executor_exports));
|
|
21234
21213
|
var { SimpleGitApi: SimpleGitApi2 } = (init_simple_git_api(), __toCommonJS(simple_git_api_exports));
|
|
21235
21214
|
var { Scheduler: Scheduler2 } = (init_scheduler(), __toCommonJS(scheduler_exports));
|
|
21236
|
-
var {
|
|
21215
|
+
var { configurationErrorTask: configurationErrorTask2 } = (init_task(), __toCommonJS(task_exports));
|
|
21237
21216
|
var {
|
|
21238
21217
|
asArray: asArray2,
|
|
21239
21218
|
filterArray: filterArray2,
|
|
@@ -21254,6 +21233,7 @@ var require_git = __commonJS2({
|
|
|
21254
21233
|
} = (init_branch(), __toCommonJS(branch_exports));
|
|
21255
21234
|
var { checkIgnoreTask: checkIgnoreTask2 } = (init_check_ignore(), __toCommonJS(check_ignore_exports));
|
|
21256
21235
|
var { checkIsRepoTask: checkIsRepoTask2 } = (init_check_is_repo(), __toCommonJS(check_is_repo_exports));
|
|
21236
|
+
var { cloneTask: cloneTask2, cloneMirrorTask: cloneMirrorTask2 } = (init_clone(), __toCommonJS(clone_exports));
|
|
21257
21237
|
var { cleanWithOptionsTask: cleanWithOptionsTask2, isCleanOptionsArray: isCleanOptionsArray2 } = (init_clean(), __toCommonJS(clean_exports));
|
|
21258
21238
|
var { diffSummaryTask: diffSummaryTask2 } = (init_diff(), __toCommonJS(diff_exports));
|
|
21259
21239
|
var { fetchTask: fetchTask2 } = (init_fetch(), __toCommonJS(fetch_exports));
|
|
@@ -21298,6 +21278,18 @@ var require_git = __commonJS2({
|
|
|
21298
21278
|
Git2.prototype.stashList = function(options) {
|
|
21299
21279
|
return this._runTask(stashListTask2(trailingOptionsArgument2(arguments) || {}, filterArray2(options) && options || []), trailingFunctionArgument2(arguments));
|
|
21300
21280
|
};
|
|
21281
|
+
function createCloneTask(api2, task, repoPath, localPath) {
|
|
21282
|
+
if (typeof repoPath !== "string") {
|
|
21283
|
+
return configurationErrorTask2(`git.${api2}() requires a string 'repoPath'`);
|
|
21284
|
+
}
|
|
21285
|
+
return task(repoPath, filterType2(localPath, filterString2), getTrailingOptions2(arguments));
|
|
21286
|
+
}
|
|
21287
|
+
Git2.prototype.clone = function() {
|
|
21288
|
+
return this._runTask(createCloneTask("clone", cloneTask2, ...arguments), trailingFunctionArgument2(arguments));
|
|
21289
|
+
};
|
|
21290
|
+
Git2.prototype.mirror = function() {
|
|
21291
|
+
return this._runTask(createCloneTask("mirror", cloneMirrorTask2, ...arguments), trailingFunctionArgument2(arguments));
|
|
21292
|
+
};
|
|
21301
21293
|
Git2.prototype.mv = function(from, to) {
|
|
21302
21294
|
return this._runTask(moveTask2(from, to), trailingFunctionArgument2(arguments));
|
|
21303
21295
|
};
|
|
@@ -21316,7 +21308,8 @@ var require_git = __commonJS2({
|
|
|
21316
21308
|
return this._runTask(fetchTask2(filterType2(remote, filterString2), filterType2(branch, filterString2), getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));
|
|
21317
21309
|
};
|
|
21318
21310
|
Git2.prototype.silent = function(silence) {
|
|
21319
|
-
|
|
21311
|
+
console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3");
|
|
21312
|
+
return this;
|
|
21320
21313
|
};
|
|
21321
21314
|
Git2.prototype.tags = function(options, then) {
|
|
21322
21315
|
return this._runTask(tagListTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));
|
|
@@ -21469,7 +21462,7 @@ var require_git = __commonJS2({
|
|
|
21469
21462
|
return this._runTask(task);
|
|
21470
21463
|
};
|
|
21471
21464
|
Git2.prototype.clearQueue = function() {
|
|
21472
|
-
return this
|
|
21465
|
+
return this;
|
|
21473
21466
|
};
|
|
21474
21467
|
Git2.prototype.checkIgnore = function(pathnames, then) {
|
|
21475
21468
|
return this._runTask(checkIgnoreTask2(asArray2(filterType2(pathnames, filterStringOrStringArray2, []))), trailingFunctionArgument2(arguments));
|
|
@@ -21533,33 +21526,20 @@ function abortPlugin(signal) {
|
|
|
21533
21526
|
function isConfigSwitch(arg) {
|
|
21534
21527
|
return typeof arg === "string" && arg.trim().toLowerCase() === "-c";
|
|
21535
21528
|
}
|
|
21536
|
-
function
|
|
21537
|
-
if (
|
|
21538
|
-
return
|
|
21529
|
+
function preventProtocolOverride(arg, next) {
|
|
21530
|
+
if (!isConfigSwitch(arg)) {
|
|
21531
|
+
return;
|
|
21539
21532
|
}
|
|
21540
|
-
|
|
21541
|
-
|
|
21542
|
-
}
|
|
21543
|
-
|
|
21544
|
-
const regex = typeof config2 === "string" ? new RegExp(`\\s*${config2}`, "i") : config2;
|
|
21545
|
-
return function preventCommand(options, arg, next) {
|
|
21546
|
-
if (options[setting] !== true && isConfigSwitch(arg) && regex.test(next)) {
|
|
21547
|
-
throw new GitPluginError(undefined, "unsafe", `Configuring ${message} is not permitted without enabling ${setting}`);
|
|
21548
|
-
}
|
|
21549
|
-
};
|
|
21533
|
+
if (!/^\s*protocol(.[a-z]+)?.allow/.test(next)) {
|
|
21534
|
+
return;
|
|
21535
|
+
}
|
|
21536
|
+
throw new GitPluginError(undefined, "unsafe", "Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol");
|
|
21550
21537
|
}
|
|
21551
|
-
var preventUnsafeConfig = [
|
|
21552
|
-
preventConfigBuilder(/^\s*protocol(.[a-z]+)?.allow/i, "allowUnsafeProtocolOverride", "protocol.allow"),
|
|
21553
|
-
preventConfigBuilder("core.sshCommand", "allowUnsafeSshCommand"),
|
|
21554
|
-
preventConfigBuilder("core.gitProxy", "allowUnsafeGitProxy"),
|
|
21555
|
-
preventConfigBuilder("core.hooksPath", "allowUnsafeHooksPath"),
|
|
21556
|
-
preventConfigBuilder("diff.external", "allowUnsafeDiffExternal")
|
|
21557
|
-
];
|
|
21558
21538
|
function preventUploadPack(arg, method) {
|
|
21559
21539
|
if (/^\s*--(upload|receive)-pack/.test(arg)) {
|
|
21560
21540
|
throw new GitPluginError(undefined, "unsafe", `Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack`);
|
|
21561
21541
|
}
|
|
21562
|
-
if (method === "clone" &&
|
|
21542
|
+
if (method === "clone" && /^\s*-u\b/.test(arg)) {
|
|
21563
21543
|
throw new GitPluginError(undefined, "unsafe", `Use of clone with option -u is not permitted without enabling allowUnsafePack`);
|
|
21564
21544
|
}
|
|
21565
21545
|
if (method === "push" && /^\s*--exec\b/.test(arg)) {
|
|
@@ -21567,16 +21547,16 @@ function preventUploadPack(arg, method) {
|
|
|
21567
21547
|
}
|
|
21568
21548
|
}
|
|
21569
21549
|
function blockUnsafeOperationsPlugin({
|
|
21570
|
-
|
|
21571
|
-
|
|
21550
|
+
allowUnsafeProtocolOverride = false,
|
|
21551
|
+
allowUnsafePack = false
|
|
21572
21552
|
} = {}) {
|
|
21573
21553
|
return {
|
|
21574
21554
|
type: "spawn.args",
|
|
21575
21555
|
action(args, context) {
|
|
21576
21556
|
args.forEach((current, index) => {
|
|
21577
21557
|
const next = index < args.length ? args[index + 1] : "";
|
|
21558
|
+
allowUnsafeProtocolOverride || preventProtocolOverride(current, next);
|
|
21578
21559
|
allowUnsafePack || preventUploadPack(current, context.method);
|
|
21579
|
-
preventUnsafeConfig.forEach((helper) => helper(options, current, next));
|
|
21580
21560
|
});
|
|
21581
21561
|
return args;
|
|
21582
21562
|
}
|
|
@@ -21660,7 +21640,7 @@ init_utils();
|
|
|
21660
21640
|
var WRONG_NUMBER_ERR = `Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings`;
|
|
21661
21641
|
var WRONG_CHARS_ERR = `Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option`;
|
|
21662
21642
|
function isBadArgument(arg) {
|
|
21663
|
-
return !arg || !/^([a-z]:)?([a-z0-9/.\\_
|
|
21643
|
+
return !arg || !/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(arg);
|
|
21664
21644
|
}
|
|
21665
21645
|
function toBinaryConfig(input, allowUnsafe) {
|
|
21666
21646
|
if (input.length < 1 || input.length > 2) {
|
|
@@ -21880,12 +21860,12 @@ function gitInstanceFactory(baseDir, options) {
|
|
|
21880
21860
|
plugins.add(commandConfigPrefixingPlugin(config2.config));
|
|
21881
21861
|
}
|
|
21882
21862
|
plugins.add(blockUnsafeOperationsPlugin(config2.unsafe));
|
|
21863
|
+
plugins.add(suffixPathsPlugin());
|
|
21883
21864
|
plugins.add(completionDetectionPlugin(config2.completion));
|
|
21884
21865
|
config2.abort && plugins.add(abortPlugin(config2.abort));
|
|
21885
21866
|
config2.progress && plugins.add(progressMonitorPlugin(config2.progress));
|
|
21886
21867
|
config2.timeout && plugins.add(timeoutPlugin(config2.timeout));
|
|
21887
21868
|
config2.spawnOptions && plugins.add(spawnOptionsPlugin(config2.spawnOptions));
|
|
21888
|
-
plugins.add(suffixPathsPlugin());
|
|
21889
21869
|
plugins.add(errorDetectionPlugin(errorDetectionHandler(true)));
|
|
21890
21870
|
config2.errors && plugins.add(errorDetectionPlugin(config2.errors));
|
|
21891
21871
|
customBinaryPlugin(plugins, config2.binary, config2.unsafe?.allowUnsafeCustomBinary);
|
|
@@ -22454,17 +22434,217 @@ ${f.content}`);
|
|
|
22454
22434
|
return `${normalized}.md`;
|
|
22455
22435
|
}
|
|
22456
22436
|
}
|
|
22457
|
-
// ../hive-core/src/services/
|
|
22437
|
+
// ../hive-core/src/services/sessionService.ts
|
|
22458
22438
|
import * as fs9 from "fs";
|
|
22459
22439
|
import * as path7 from "path";
|
|
22440
|
+
class SessionService {
|
|
22441
|
+
projectRoot;
|
|
22442
|
+
constructor(projectRoot) {
|
|
22443
|
+
this.projectRoot = projectRoot;
|
|
22444
|
+
}
|
|
22445
|
+
applySessionPatch(target, patch) {
|
|
22446
|
+
if (!patch) {
|
|
22447
|
+
return;
|
|
22448
|
+
}
|
|
22449
|
+
const { sessionId: _sessionId, ...rest } = patch;
|
|
22450
|
+
Object.assign(target, rest);
|
|
22451
|
+
}
|
|
22452
|
+
getSessionsPath(featureName) {
|
|
22453
|
+
return path7.join(getFeaturePath(this.projectRoot, featureName), "sessions.json");
|
|
22454
|
+
}
|
|
22455
|
+
getSessions(featureName) {
|
|
22456
|
+
const sessionsPath = this.getSessionsPath(featureName);
|
|
22457
|
+
return readJson(sessionsPath) || { sessions: [] };
|
|
22458
|
+
}
|
|
22459
|
+
saveSessions(featureName, data) {
|
|
22460
|
+
const sessionsPath = this.getSessionsPath(featureName);
|
|
22461
|
+
ensureDir(path7.dirname(sessionsPath));
|
|
22462
|
+
writeJson(sessionsPath, data);
|
|
22463
|
+
}
|
|
22464
|
+
getGlobalSessions() {
|
|
22465
|
+
const globalPath = getGlobalSessionsPath(this.projectRoot);
|
|
22466
|
+
return readJson(globalPath) || { sessions: [] };
|
|
22467
|
+
}
|
|
22468
|
+
saveGlobalSessions(data) {
|
|
22469
|
+
const globalPath = getGlobalSessionsPath(this.projectRoot);
|
|
22470
|
+
ensureDir(path7.dirname(globalPath));
|
|
22471
|
+
writeJson(globalPath, data);
|
|
22472
|
+
}
|
|
22473
|
+
updateGlobalSessions(mutator) {
|
|
22474
|
+
const globalPath = getGlobalSessionsPath(this.projectRoot);
|
|
22475
|
+
ensureDir(path7.dirname(globalPath));
|
|
22476
|
+
const release = acquireLockSync(globalPath);
|
|
22477
|
+
try {
|
|
22478
|
+
const data = readJson(globalPath) || { sessions: [] };
|
|
22479
|
+
const session = mutator(data);
|
|
22480
|
+
writeJsonAtomic(globalPath, data);
|
|
22481
|
+
return session;
|
|
22482
|
+
} finally {
|
|
22483
|
+
release();
|
|
22484
|
+
}
|
|
22485
|
+
}
|
|
22486
|
+
trackGlobal(sessionId, patch) {
|
|
22487
|
+
return this.updateGlobalSessions((data) => {
|
|
22488
|
+
const now = new Date().toISOString();
|
|
22489
|
+
let session = data.sessions.find((s) => s.sessionId === sessionId);
|
|
22490
|
+
if (session) {
|
|
22491
|
+
session.lastActiveAt = now;
|
|
22492
|
+
this.applySessionPatch(session, patch);
|
|
22493
|
+
} else {
|
|
22494
|
+
session = {
|
|
22495
|
+
sessionId,
|
|
22496
|
+
startedAt: now,
|
|
22497
|
+
lastActiveAt: now
|
|
22498
|
+
};
|
|
22499
|
+
this.applySessionPatch(session, patch);
|
|
22500
|
+
data.sessions.push(session);
|
|
22501
|
+
}
|
|
22502
|
+
return session;
|
|
22503
|
+
});
|
|
22504
|
+
}
|
|
22505
|
+
bindFeature(sessionId, featureName, patch) {
|
|
22506
|
+
const session = this.updateGlobalSessions((data) => {
|
|
22507
|
+
let current = data.sessions.find((s) => s.sessionId === sessionId);
|
|
22508
|
+
const now = new Date().toISOString();
|
|
22509
|
+
if (!current) {
|
|
22510
|
+
current = {
|
|
22511
|
+
sessionId,
|
|
22512
|
+
startedAt: now,
|
|
22513
|
+
lastActiveAt: now
|
|
22514
|
+
};
|
|
22515
|
+
data.sessions.push(current);
|
|
22516
|
+
}
|
|
22517
|
+
current.featureName = featureName;
|
|
22518
|
+
current.lastActiveAt = now;
|
|
22519
|
+
this.applySessionPatch(current, patch);
|
|
22520
|
+
return current;
|
|
22521
|
+
});
|
|
22522
|
+
const featureData = this.getSessions(featureName);
|
|
22523
|
+
let featureSession = featureData.sessions.find((s) => s.sessionId === sessionId);
|
|
22524
|
+
if (featureSession) {
|
|
22525
|
+
Object.assign(featureSession, session);
|
|
22526
|
+
} else {
|
|
22527
|
+
featureData.sessions.push({ ...session });
|
|
22528
|
+
}
|
|
22529
|
+
this.saveSessions(featureName, featureData);
|
|
22530
|
+
return session;
|
|
22531
|
+
}
|
|
22532
|
+
getGlobal(sessionId) {
|
|
22533
|
+
const data = this.getGlobalSessions();
|
|
22534
|
+
return data.sessions.find((s) => s.sessionId === sessionId);
|
|
22535
|
+
}
|
|
22536
|
+
track(featureName, sessionId, taskFolder) {
|
|
22537
|
+
const data = this.getSessions(featureName);
|
|
22538
|
+
const now = new Date().toISOString();
|
|
22539
|
+
let session = data.sessions.find((s) => s.sessionId === sessionId);
|
|
22540
|
+
if (session) {
|
|
22541
|
+
session.lastActiveAt = now;
|
|
22542
|
+
if (taskFolder)
|
|
22543
|
+
session.taskFolder = taskFolder;
|
|
22544
|
+
} else {
|
|
22545
|
+
session = {
|
|
22546
|
+
sessionId,
|
|
22547
|
+
taskFolder,
|
|
22548
|
+
startedAt: now,
|
|
22549
|
+
lastActiveAt: now
|
|
22550
|
+
};
|
|
22551
|
+
data.sessions.push(session);
|
|
22552
|
+
}
|
|
22553
|
+
if (!data.master) {
|
|
22554
|
+
data.master = sessionId;
|
|
22555
|
+
}
|
|
22556
|
+
this.saveSessions(featureName, data);
|
|
22557
|
+
return session;
|
|
22558
|
+
}
|
|
22559
|
+
setMaster(featureName, sessionId) {
|
|
22560
|
+
const data = this.getSessions(featureName);
|
|
22561
|
+
data.master = sessionId;
|
|
22562
|
+
this.saveSessions(featureName, data);
|
|
22563
|
+
}
|
|
22564
|
+
getMaster(featureName) {
|
|
22565
|
+
return this.getSessions(featureName).master;
|
|
22566
|
+
}
|
|
22567
|
+
list(featureName) {
|
|
22568
|
+
return this.getSessions(featureName).sessions;
|
|
22569
|
+
}
|
|
22570
|
+
get(featureName, sessionId) {
|
|
22571
|
+
return this.getSessions(featureName).sessions.find((s) => s.sessionId === sessionId);
|
|
22572
|
+
}
|
|
22573
|
+
getByTask(featureName, taskFolder) {
|
|
22574
|
+
return this.getSessions(featureName).sessions.find((s) => s.taskFolder === taskFolder);
|
|
22575
|
+
}
|
|
22576
|
+
remove(featureName, sessionId) {
|
|
22577
|
+
const data = this.getSessions(featureName);
|
|
22578
|
+
const index = data.sessions.findIndex((s) => s.sessionId === sessionId);
|
|
22579
|
+
if (index === -1)
|
|
22580
|
+
return false;
|
|
22581
|
+
data.sessions.splice(index, 1);
|
|
22582
|
+
if (data.master === sessionId) {
|
|
22583
|
+
data.master = data.sessions[0]?.sessionId;
|
|
22584
|
+
}
|
|
22585
|
+
this.saveSessions(featureName, data);
|
|
22586
|
+
return true;
|
|
22587
|
+
}
|
|
22588
|
+
findFeatureBySession(sessionId) {
|
|
22589
|
+
const globalSession = this.getGlobal(sessionId);
|
|
22590
|
+
if (globalSession?.featureName) {
|
|
22591
|
+
return globalSession.featureName;
|
|
22592
|
+
}
|
|
22593
|
+
const featuresPath = path7.join(this.projectRoot, ".hive", "features");
|
|
22594
|
+
if (!fs9.existsSync(featuresPath))
|
|
22595
|
+
return null;
|
|
22596
|
+
const features = fs9.readdirSync(featuresPath, { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name);
|
|
22597
|
+
for (const feature of features) {
|
|
22598
|
+
const sessions = this.getSessions(feature);
|
|
22599
|
+
if (sessions.sessions.some((s) => s.sessionId === sessionId)) {
|
|
22600
|
+
return feature;
|
|
22601
|
+
}
|
|
22602
|
+
if (sessions.master === sessionId) {
|
|
22603
|
+
return feature;
|
|
22604
|
+
}
|
|
22605
|
+
}
|
|
22606
|
+
return null;
|
|
22607
|
+
}
|
|
22608
|
+
fork(featureName, fromSessionId) {
|
|
22609
|
+
const data = this.getSessions(featureName);
|
|
22610
|
+
const now = new Date().toISOString();
|
|
22611
|
+
const sourceSession = fromSessionId ? data.sessions.find((s) => s.sessionId === fromSessionId) : data.sessions.find((s) => s.sessionId === data.master);
|
|
22612
|
+
const newSessionId = `ses_fork_${Date.now()}`;
|
|
22613
|
+
const newSession = {
|
|
22614
|
+
sessionId: newSessionId,
|
|
22615
|
+
taskFolder: sourceSession?.taskFolder,
|
|
22616
|
+
startedAt: now,
|
|
22617
|
+
lastActiveAt: now
|
|
22618
|
+
};
|
|
22619
|
+
data.sessions.push(newSession);
|
|
22620
|
+
this.saveSessions(featureName, data);
|
|
22621
|
+
return newSession;
|
|
22622
|
+
}
|
|
22623
|
+
fresh(featureName, title) {
|
|
22624
|
+
const data = this.getSessions(featureName);
|
|
22625
|
+
const now = new Date().toISOString();
|
|
22626
|
+
const newSessionId = `ses_${title ? title.replace(/\s+/g, "_").toLowerCase() : Date.now()}`;
|
|
22627
|
+
const newSession = {
|
|
22628
|
+
sessionId: newSessionId,
|
|
22629
|
+
startedAt: now,
|
|
22630
|
+
lastActiveAt: now
|
|
22631
|
+
};
|
|
22632
|
+
data.sessions.push(newSession);
|
|
22633
|
+
this.saveSessions(featureName, data);
|
|
22634
|
+
return newSession;
|
|
22635
|
+
}
|
|
22636
|
+
}
|
|
22637
|
+
// ../hive-core/src/services/configService.ts
|
|
22638
|
+
import * as fs10 from "fs";
|
|
22639
|
+
import * as path8 from "path";
|
|
22460
22640
|
class ConfigService {
|
|
22461
22641
|
configPath;
|
|
22462
22642
|
cachedConfig = null;
|
|
22463
22643
|
cachedCustomAgentConfigs = null;
|
|
22464
22644
|
constructor() {
|
|
22465
22645
|
const homeDir = process.env.HOME || process.env.USERPROFILE || "";
|
|
22466
|
-
const configDir =
|
|
22467
|
-
this.configPath =
|
|
22646
|
+
const configDir = path8.join(homeDir, ".config", "opencode");
|
|
22647
|
+
this.configPath = path8.join(configDir, "agent_hive.json");
|
|
22468
22648
|
}
|
|
22469
22649
|
getPath() {
|
|
22470
22650
|
return this.configPath;
|
|
@@ -22474,12 +22654,12 @@ class ConfigService {
|
|
|
22474
22654
|
return this.cachedConfig;
|
|
22475
22655
|
}
|
|
22476
22656
|
try {
|
|
22477
|
-
if (!
|
|
22657
|
+
if (!fs10.existsSync(this.configPath)) {
|
|
22478
22658
|
this.cachedConfig = { ...DEFAULT_HIVE_CONFIG };
|
|
22479
22659
|
this.cachedCustomAgentConfigs = null;
|
|
22480
22660
|
return this.cachedConfig;
|
|
22481
22661
|
}
|
|
22482
|
-
const raw =
|
|
22662
|
+
const raw = fs10.readFileSync(this.configPath, "utf-8");
|
|
22483
22663
|
const stored = JSON.parse(raw);
|
|
22484
22664
|
const storedCustomAgents = this.isObjectRecord(stored.customAgents) ? stored.customAgents : {};
|
|
22485
22665
|
const mergedBuiltInAgents = BUILT_IN_AGENT_NAMES.reduce((acc, agentName) => {
|
|
@@ -22527,17 +22707,17 @@ class ConfigService {
|
|
|
22527
22707
|
...updates.customAgents
|
|
22528
22708
|
} : current.customAgents
|
|
22529
22709
|
};
|
|
22530
|
-
const configDir =
|
|
22531
|
-
if (!
|
|
22532
|
-
|
|
22710
|
+
const configDir = path8.dirname(this.configPath);
|
|
22711
|
+
if (!fs10.existsSync(configDir)) {
|
|
22712
|
+
fs10.mkdirSync(configDir, { recursive: true });
|
|
22533
22713
|
}
|
|
22534
|
-
|
|
22714
|
+
fs10.writeFileSync(this.configPath, JSON.stringify(merged, null, 2));
|
|
22535
22715
|
this.cachedConfig = merged;
|
|
22536
22716
|
this.cachedCustomAgentConfigs = null;
|
|
22537
22717
|
return merged;
|
|
22538
22718
|
}
|
|
22539
22719
|
exists() {
|
|
22540
|
-
return
|
|
22720
|
+
return fs10.existsSync(this.configPath);
|
|
22541
22721
|
}
|
|
22542
22722
|
init() {
|
|
22543
22723
|
if (!this.exists()) {
|
|
@@ -22673,8 +22853,8 @@ class ConfigService {
|
|
|
22673
22853
|
}
|
|
22674
22854
|
}
|
|
22675
22855
|
// ../hive-core/src/services/agentsMdService.ts
|
|
22676
|
-
import * as
|
|
22677
|
-
import * as
|
|
22856
|
+
import * as fs11 from "fs";
|
|
22857
|
+
import * as path9 from "path";
|
|
22678
22858
|
class AgentsMdService {
|
|
22679
22859
|
rootDir;
|
|
22680
22860
|
contextService;
|
|
@@ -22683,7 +22863,7 @@ class AgentsMdService {
|
|
|
22683
22863
|
this.contextService = contextService;
|
|
22684
22864
|
}
|
|
22685
22865
|
async init() {
|
|
22686
|
-
const agentsMdPath =
|
|
22866
|
+
const agentsMdPath = path9.join(this.rootDir, "AGENTS.md");
|
|
22687
22867
|
const existed = fileExists(agentsMdPath);
|
|
22688
22868
|
if (existed) {
|
|
22689
22869
|
const existing = readText(agentsMdPath);
|
|
@@ -22694,14 +22874,14 @@ class AgentsMdService {
|
|
|
22694
22874
|
}
|
|
22695
22875
|
async sync(featureName) {
|
|
22696
22876
|
const contexts = this.contextService.list(featureName);
|
|
22697
|
-
const agentsMdPath =
|
|
22698
|
-
const current = await
|
|
22877
|
+
const agentsMdPath = path9.join(this.rootDir, "AGENTS.md");
|
|
22878
|
+
const current = await fs11.promises.readFile(agentsMdPath, "utf-8").catch(() => "");
|
|
22699
22879
|
const findings = this.extractFindings(contexts);
|
|
22700
22880
|
const proposals = this.generateProposals(findings, current);
|
|
22701
22881
|
return { proposals, diff: this.formatDiff(current, proposals) };
|
|
22702
22882
|
}
|
|
22703
22883
|
apply(content) {
|
|
22704
|
-
const agentsMdPath =
|
|
22884
|
+
const agentsMdPath = path9.join(this.rootDir, "AGENTS.md");
|
|
22705
22885
|
const isNew = !fileExists(agentsMdPath);
|
|
22706
22886
|
writeText(agentsMdPath, content);
|
|
22707
22887
|
return { path: agentsMdPath, chars: content.length, isNew };
|
|
@@ -22761,7 +22941,7 @@ class AgentsMdService {
|
|
|
22761
22941
|
return this.generateTemplate(detections);
|
|
22762
22942
|
}
|
|
22763
22943
|
async detectProjectInfo() {
|
|
22764
|
-
const packageJsonPath =
|
|
22944
|
+
const packageJsonPath = path9.join(this.rootDir, "package.json");
|
|
22765
22945
|
let packageJson = null;
|
|
22766
22946
|
if (fileExists(packageJsonPath)) {
|
|
22767
22947
|
try {
|
|
@@ -22781,26 +22961,26 @@ class AgentsMdService {
|
|
|
22781
22961
|
return info;
|
|
22782
22962
|
}
|
|
22783
22963
|
detectPackageManager() {
|
|
22784
|
-
if (fileExists(
|
|
22964
|
+
if (fileExists(path9.join(this.rootDir, "bun.lockb")))
|
|
22785
22965
|
return "bun";
|
|
22786
|
-
if (fileExists(
|
|
22966
|
+
if (fileExists(path9.join(this.rootDir, "pnpm-lock.yaml")))
|
|
22787
22967
|
return "pnpm";
|
|
22788
|
-
if (fileExists(
|
|
22968
|
+
if (fileExists(path9.join(this.rootDir, "yarn.lock")))
|
|
22789
22969
|
return "yarn";
|
|
22790
|
-
if (fileExists(
|
|
22970
|
+
if (fileExists(path9.join(this.rootDir, "package-lock.json")))
|
|
22791
22971
|
return "npm";
|
|
22792
22972
|
return "npm";
|
|
22793
22973
|
}
|
|
22794
22974
|
detectLanguage() {
|
|
22795
|
-
if (fileExists(
|
|
22975
|
+
if (fileExists(path9.join(this.rootDir, "tsconfig.json")))
|
|
22796
22976
|
return "TypeScript";
|
|
22797
|
-
if (fileExists(
|
|
22977
|
+
if (fileExists(path9.join(this.rootDir, "package.json")))
|
|
22798
22978
|
return "JavaScript";
|
|
22799
|
-
if (fileExists(
|
|
22979
|
+
if (fileExists(path9.join(this.rootDir, "requirements.txt")))
|
|
22800
22980
|
return "Python";
|
|
22801
|
-
if (fileExists(
|
|
22981
|
+
if (fileExists(path9.join(this.rootDir, "go.mod")))
|
|
22802
22982
|
return "Go";
|
|
22803
|
-
if (fileExists(
|
|
22983
|
+
if (fileExists(path9.join(this.rootDir, "Cargo.toml")))
|
|
22804
22984
|
return "Rust";
|
|
22805
22985
|
return "Unknown";
|
|
22806
22986
|
}
|
|
@@ -22879,25 +23059,25 @@ class AgentsMdService {
|
|
|
22879
23059
|
}
|
|
22880
23060
|
}
|
|
22881
23061
|
// ../hive-core/src/services/dockerSandboxService.ts
|
|
22882
|
-
import { existsSync as
|
|
22883
|
-
import { join as
|
|
23062
|
+
import { existsSync as existsSync5 } from "fs";
|
|
23063
|
+
import { join as join10, sep } from "path";
|
|
22884
23064
|
import { execSync } from "child_process";
|
|
22885
23065
|
|
|
22886
23066
|
class DockerSandboxService {
|
|
22887
23067
|
static detectImage(worktreePath) {
|
|
22888
|
-
if (
|
|
23068
|
+
if (existsSync5(join10(worktreePath, "Dockerfile"))) {
|
|
22889
23069
|
return null;
|
|
22890
23070
|
}
|
|
22891
|
-
if (
|
|
23071
|
+
if (existsSync5(join10(worktreePath, "package.json"))) {
|
|
22892
23072
|
return "node:22-slim";
|
|
22893
23073
|
}
|
|
22894
|
-
if (
|
|
23074
|
+
if (existsSync5(join10(worktreePath, "requirements.txt")) || existsSync5(join10(worktreePath, "pyproject.toml"))) {
|
|
22895
23075
|
return "python:3.12-slim";
|
|
22896
23076
|
}
|
|
22897
|
-
if (
|
|
23077
|
+
if (existsSync5(join10(worktreePath, "go.mod"))) {
|
|
22898
23078
|
return "golang:1.22-slim";
|
|
22899
23079
|
}
|
|
22900
|
-
if (
|
|
23080
|
+
if (existsSync5(join10(worktreePath, "Cargo.toml"))) {
|
|
22901
23081
|
return "rust:1.77-slim";
|
|
22902
23082
|
}
|
|
22903
23083
|
return "ubuntu:24.04";
|
|
@@ -23467,17 +23647,17 @@ function applyContextBudget(files, config2 = {}) {
|
|
|
23467
23647
|
}
|
|
23468
23648
|
|
|
23469
23649
|
// src/utils/prompt-file.ts
|
|
23470
|
-
import * as
|
|
23471
|
-
import * as
|
|
23650
|
+
import * as fs12 from "fs";
|
|
23651
|
+
import * as path10 from "path";
|
|
23472
23652
|
function writeWorkerPromptFile(feature, task, prompt, hiveDir) {
|
|
23473
|
-
const projectRoot =
|
|
23653
|
+
const projectRoot = path10.dirname(hiveDir);
|
|
23474
23654
|
const featureDir = resolveFeatureDirectoryName(projectRoot, feature);
|
|
23475
|
-
const promptDir =
|
|
23476
|
-
const promptPath =
|
|
23477
|
-
if (!
|
|
23478
|
-
|
|
23655
|
+
const promptDir = path10.join(hiveDir, "features", featureDir, "tasks", task);
|
|
23656
|
+
const promptPath = path10.join(promptDir, "worker-prompt.md");
|
|
23657
|
+
if (!fs12.existsSync(promptDir)) {
|
|
23658
|
+
fs12.mkdirSync(promptDir, { recursive: true });
|
|
23479
23659
|
}
|
|
23480
|
-
|
|
23660
|
+
fs12.writeFileSync(promptPath, prompt, "utf-8");
|
|
23481
23661
|
return promptPath;
|
|
23482
23662
|
}
|
|
23483
23663
|
|
|
@@ -23488,9 +23668,48 @@ function normalizeVariant(variant) {
|
|
|
23488
23668
|
const trimmed2 = variant.trim();
|
|
23489
23669
|
return trimmed2.length > 0 ? trimmed2 : undefined;
|
|
23490
23670
|
}
|
|
23491
|
-
|
|
23671
|
+
var BUILT_IN_AGENTS = {
|
|
23672
|
+
"hive-master": { sessionKind: "primary", baseAgent: "hive-master" },
|
|
23673
|
+
"architect-planner": { sessionKind: "primary", baseAgent: "architect-planner" },
|
|
23674
|
+
"swarm-orchestrator": { sessionKind: "primary", baseAgent: "swarm-orchestrator" },
|
|
23675
|
+
"forager-worker": { sessionKind: "task-worker", baseAgent: "forager-worker" },
|
|
23676
|
+
"scout-researcher": { sessionKind: "subagent", baseAgent: "scout-researcher" },
|
|
23677
|
+
"hygienic-reviewer": { sessionKind: "subagent", baseAgent: "hygienic-reviewer" }
|
|
23678
|
+
};
|
|
23679
|
+
var BASE_AGENT_KIND = {
|
|
23680
|
+
"forager-worker": "task-worker",
|
|
23681
|
+
"hygienic-reviewer": "subagent"
|
|
23682
|
+
};
|
|
23683
|
+
function classifySession(agent, customAgents = {}) {
|
|
23684
|
+
const builtIn = BUILT_IN_AGENTS[agent];
|
|
23685
|
+
if (builtIn) {
|
|
23686
|
+
return { sessionKind: builtIn.sessionKind, baseAgent: builtIn.baseAgent };
|
|
23687
|
+
}
|
|
23688
|
+
const custom2 = customAgents[agent];
|
|
23689
|
+
if (custom2) {
|
|
23690
|
+
const kind = BASE_AGENT_KIND[custom2.baseAgent];
|
|
23691
|
+
if (kind) {
|
|
23692
|
+
return { sessionKind: kind, baseAgent: custom2.baseAgent };
|
|
23693
|
+
}
|
|
23694
|
+
}
|
|
23695
|
+
return { sessionKind: "unknown", baseAgent: undefined };
|
|
23696
|
+
}
|
|
23697
|
+
function createVariantHook(configService, sessionService, customAgents, taskWorkerRecovery) {
|
|
23492
23698
|
return async (input, output) => {
|
|
23493
23699
|
const { agent } = input;
|
|
23700
|
+
if (agent && sessionService) {
|
|
23701
|
+
const { sessionKind, baseAgent } = classifySession(agent, customAgents);
|
|
23702
|
+
const patch = { agent, sessionKind };
|
|
23703
|
+
if (baseAgent) {
|
|
23704
|
+
patch.baseAgent = baseAgent;
|
|
23705
|
+
}
|
|
23706
|
+
if (sessionKind === "task-worker" && taskWorkerRecovery) {
|
|
23707
|
+
patch.featureName = taskWorkerRecovery.featureName;
|
|
23708
|
+
patch.taskFolder = taskWorkerRecovery.taskFolder;
|
|
23709
|
+
patch.workerPromptPath = taskWorkerRecovery.workerPromptPath;
|
|
23710
|
+
}
|
|
23711
|
+
sessionService.trackGlobal(input.sessionID, patch);
|
|
23712
|
+
}
|
|
23494
23713
|
if (!agent)
|
|
23495
23714
|
return;
|
|
23496
23715
|
if (!configService.hasConfiguredAgent(agent))
|
|
@@ -23524,10 +23743,69 @@ var HIVE_SYSTEM_PROMPT = `
|
|
|
23524
23743
|
Use hive_merge to integrate changes into the current branch.
|
|
23525
23744
|
`;
|
|
23526
23745
|
|
|
23527
|
-
// src/utils/compaction-
|
|
23528
|
-
var
|
|
23529
|
-
|
|
23530
|
-
|
|
23746
|
+
// src/utils/compaction-anchor.ts
|
|
23747
|
+
var AGENT_ROLE_MAP = {
|
|
23748
|
+
"hive-master": "Hive",
|
|
23749
|
+
"architect-planner": "Architect",
|
|
23750
|
+
"swarm-orchestrator": "Swarm",
|
|
23751
|
+
"forager-worker": "Forager",
|
|
23752
|
+
"scout-researcher": "Scout",
|
|
23753
|
+
"hygienic-reviewer": "Hygienic"
|
|
23754
|
+
};
|
|
23755
|
+
var BASE_AGENT_ROLE_MAP = {
|
|
23756
|
+
"forager-worker": "Forager",
|
|
23757
|
+
"hygienic-reviewer": "Hygienic",
|
|
23758
|
+
"scout-researcher": "Scout"
|
|
23759
|
+
};
|
|
23760
|
+
function resolveRole(ctx) {
|
|
23761
|
+
if (ctx.agent && AGENT_ROLE_MAP[ctx.agent]) {
|
|
23762
|
+
return AGENT_ROLE_MAP[ctx.agent];
|
|
23763
|
+
}
|
|
23764
|
+
if (ctx.baseAgent && BASE_AGENT_ROLE_MAP[ctx.baseAgent]) {
|
|
23765
|
+
return BASE_AGENT_ROLE_MAP[ctx.baseAgent];
|
|
23766
|
+
}
|
|
23767
|
+
return;
|
|
23768
|
+
}
|
|
23769
|
+
function resolveWorkerPromptPath(ctx) {
|
|
23770
|
+
if (ctx.workerPromptPath) {
|
|
23771
|
+
return ctx.workerPromptPath;
|
|
23772
|
+
}
|
|
23773
|
+
if (ctx.featureName && ctx.taskFolder) {
|
|
23774
|
+
return `.hive/features/${ctx.featureName}/tasks/${ctx.taskFolder}/worker-prompt.md`;
|
|
23775
|
+
}
|
|
23776
|
+
return;
|
|
23777
|
+
}
|
|
23778
|
+
function buildCompactionReanchor(ctx) {
|
|
23779
|
+
const role = resolveRole(ctx);
|
|
23780
|
+
const kind = ctx.sessionKind ?? "unknown";
|
|
23781
|
+
const workerPromptPath = resolveWorkerPromptPath(ctx);
|
|
23782
|
+
const lines = [];
|
|
23783
|
+
const context = [];
|
|
23784
|
+
lines.push("Compaction recovery — you were compacted mid-session.");
|
|
23785
|
+
if (role) {
|
|
23786
|
+
lines.push(`Role: ${role}`);
|
|
23787
|
+
}
|
|
23788
|
+
lines.push("Do not switch roles.");
|
|
23789
|
+
lines.push("Do not call status tools to rediscover state.");
|
|
23790
|
+
lines.push("Do not re-read the full codebase.");
|
|
23791
|
+
if (kind === "task-worker") {
|
|
23792
|
+
lines.push("Do not delegate.");
|
|
23793
|
+
if (workerPromptPath) {
|
|
23794
|
+
lines.push("Re-read worker-prompt.md now to recall your assignment.");
|
|
23795
|
+
context.push(workerPromptPath);
|
|
23796
|
+
} else {
|
|
23797
|
+
lines.push("Re-read worker-prompt.md from the Hive task metadata to recall your assignment.");
|
|
23798
|
+
}
|
|
23799
|
+
}
|
|
23800
|
+
if ((kind === "primary" || kind === "subagent") && ctx.directivePrompt) {
|
|
23801
|
+
lines.push("Original directive survives via post-compaction replay.");
|
|
23802
|
+
}
|
|
23803
|
+
lines.push("Next action: resume from where you left off.");
|
|
23804
|
+
return {
|
|
23805
|
+
prompt: lines.join(`
|
|
23806
|
+
`),
|
|
23807
|
+
context
|
|
23808
|
+
};
|
|
23531
23809
|
}
|
|
23532
23810
|
|
|
23533
23811
|
// src/index.ts
|
|
@@ -23642,13 +23920,14 @@ No Hive skills available.` : base + formatSkillsXml(filteredSkills);
|
|
|
23642
23920
|
});
|
|
23643
23921
|
}
|
|
23644
23922
|
var plugin = async (ctx) => {
|
|
23645
|
-
const { directory, client } = ctx;
|
|
23923
|
+
const { directory, client, worktree } = ctx;
|
|
23646
23924
|
const featureService = new FeatureService(directory);
|
|
23647
23925
|
const planService = new PlanService(directory);
|
|
23648
23926
|
const taskService = new TaskService(directory);
|
|
23649
23927
|
const contextService = new ContextService(directory);
|
|
23650
23928
|
const agentsMdService = new AgentsMdService(directory, contextService);
|
|
23651
23929
|
const configService = new ConfigService;
|
|
23930
|
+
const sessionService = new SessionService(directory);
|
|
23652
23931
|
const disabledMcps = configService.getDisabledMcps();
|
|
23653
23932
|
const disabledSkills = configService.getDisabledSkills();
|
|
23654
23933
|
const builtinMcps = createBuiltinMcps(disabledMcps);
|
|
@@ -23656,8 +23935,15 @@ var plugin = async (ctx) => {
|
|
|
23656
23935
|
const effectiveAutoLoadSkills = configService.getAgentConfig("hive-master").autoLoadSkills ?? [];
|
|
23657
23936
|
const worktreeService = new WorktreeService({
|
|
23658
23937
|
baseDir: directory,
|
|
23659
|
-
hiveDir:
|
|
23938
|
+
hiveDir: path11.join(directory, ".hive")
|
|
23660
23939
|
});
|
|
23940
|
+
const customAgentConfigsForClassification = getCustomAgentConfigsCompat(configService);
|
|
23941
|
+
const runtimeContext = detectContext(worktree || directory);
|
|
23942
|
+
const taskWorkerRecovery = runtimeContext.isWorktree && runtimeContext.feature && runtimeContext.task ? {
|
|
23943
|
+
featureName: runtimeContext.feature,
|
|
23944
|
+
taskFolder: runtimeContext.task,
|
|
23945
|
+
workerPromptPath: path11.posix.join(".hive", "features", resolveFeatureDirectoryName(directory, runtimeContext.feature), "tasks", runtimeContext.task, "worker-prompt.md")
|
|
23946
|
+
} : undefined;
|
|
23661
23947
|
const isOmoSlimEnabled = () => {
|
|
23662
23948
|
return configService.isOmoSlimEnabled();
|
|
23663
23949
|
};
|
|
@@ -23678,12 +23964,50 @@ var plugin = async (ctx) => {
|
|
|
23678
23964
|
}
|
|
23679
23965
|
}
|
|
23680
23966
|
};
|
|
23967
|
+
const bindFeatureSession = (feature, toolContext, patch) => {
|
|
23968
|
+
const ctx2 = toolContext;
|
|
23969
|
+
if (!ctx2?.sessionID)
|
|
23970
|
+
return;
|
|
23971
|
+
sessionService.bindFeature(ctx2.sessionID, feature, patch);
|
|
23972
|
+
};
|
|
23973
|
+
const extractTextParts = (parts) => {
|
|
23974
|
+
if (!Array.isArray(parts))
|
|
23975
|
+
return [];
|
|
23976
|
+
return parts.filter((part) => {
|
|
23977
|
+
return !!part && typeof part === "object" && part.type === "text" && typeof part.text === "string";
|
|
23978
|
+
}).map((part) => part.text.trim()).filter(Boolean);
|
|
23979
|
+
};
|
|
23980
|
+
const shouldCaptureDirective = (info, parts) => {
|
|
23981
|
+
if (info.role !== "user")
|
|
23982
|
+
return false;
|
|
23983
|
+
const textParts = parts.filter((part) => {
|
|
23984
|
+
return !!part && typeof part === "object" && part.type === "text";
|
|
23985
|
+
});
|
|
23986
|
+
if (textParts.length === 0)
|
|
23987
|
+
return false;
|
|
23988
|
+
return !textParts.every((part) => part.synthetic === true);
|
|
23989
|
+
};
|
|
23990
|
+
const buildDirectiveReplayText = (session) => {
|
|
23991
|
+
if (!session.directivePrompt)
|
|
23992
|
+
return null;
|
|
23993
|
+
const role = session.agent === "scout-researcher" || session.baseAgent === "scout-researcher" ? "Scout" : session.agent === "hygienic-reviewer" || session.baseAgent === "hygienic-reviewer" ? "Hygienic" : session.agent === "architect-planner" || session.baseAgent === "architect-planner" ? "Architect" : session.agent === "swarm-orchestrator" || session.baseAgent === "swarm-orchestrator" ? "Swarm" : session.agent === "hive-master" || session.baseAgent === "hive-master" ? "Hive" : "current role";
|
|
23994
|
+
return [
|
|
23995
|
+
`Post-compaction recovery: You are still ${role}.`,
|
|
23996
|
+
"Resume the original assignment below. Do not replace it with a new goal.",
|
|
23997
|
+
"",
|
|
23998
|
+
session.directivePrompt
|
|
23999
|
+
].join(`
|
|
24000
|
+
`);
|
|
24001
|
+
};
|
|
24002
|
+
const shouldUseDirectiveReplay = (session) => {
|
|
24003
|
+
return session?.sessionKind === "primary" || session?.sessionKind === "subagent";
|
|
24004
|
+
};
|
|
23681
24005
|
const checkBlocked = (feature) => {
|
|
23682
|
-
const
|
|
24006
|
+
const fs14 = __require("fs");
|
|
23683
24007
|
const featureDir = resolveFeatureDirectoryName(directory, feature);
|
|
23684
|
-
const blockedPath =
|
|
23685
|
-
if (
|
|
23686
|
-
const reason =
|
|
24008
|
+
const blockedPath = path11.join(directory, ".hive", "features", featureDir, "BLOCKED");
|
|
24009
|
+
if (fs14.existsSync(blockedPath)) {
|
|
24010
|
+
const reason = fs14.readFileSync(blockedPath, "utf-8").trim();
|
|
23687
24011
|
return `⛔ BLOCKED by Beekeeper
|
|
23688
24012
|
|
|
23689
24013
|
${reason || "(No reason provided)"}
|
|
@@ -23736,13 +24060,13 @@ To unblock: Remove .hive/features/${featureDir}/BLOCKED`;
|
|
|
23736
24060
|
feature,
|
|
23737
24061
|
task,
|
|
23738
24062
|
taskInfo,
|
|
23739
|
-
worktree,
|
|
24063
|
+
worktree: worktree2,
|
|
23740
24064
|
continueFrom,
|
|
23741
24065
|
decision
|
|
23742
24066
|
}) => {
|
|
23743
24067
|
taskService.update(feature, task, {
|
|
23744
24068
|
status: "in_progress",
|
|
23745
|
-
baseCommit:
|
|
24069
|
+
baseCommit: worktree2.commit
|
|
23746
24070
|
});
|
|
23747
24071
|
const planResult = planService.read(feature);
|
|
23748
24072
|
const allTasks = taskService.list(feature);
|
|
@@ -23793,8 +24117,8 @@ To unblock: Remove .hive/features/${featureDir}/BLOCKED`;
|
|
|
23793
24117
|
feature,
|
|
23794
24118
|
task,
|
|
23795
24119
|
taskOrder,
|
|
23796
|
-
worktreePath:
|
|
23797
|
-
branch:
|
|
24120
|
+
worktreePath: worktree2.path,
|
|
24121
|
+
branch: worktree2.branch,
|
|
23798
24122
|
plan: planResult?.content || "No plan available",
|
|
23799
24123
|
contextFiles,
|
|
23800
24124
|
spec: specContent,
|
|
@@ -23836,9 +24160,9 @@ To unblock: Remove .hive/features/${featureDir}/BLOCKED`;
|
|
|
23836
24160
|
spec: specContent,
|
|
23837
24161
|
workerPrompt
|
|
23838
24162
|
});
|
|
23839
|
-
const hiveDir =
|
|
24163
|
+
const hiveDir = path11.join(directory, ".hive");
|
|
23840
24164
|
const workerPromptPath = writeWorkerPromptFile(feature, task, workerPrompt, hiveDir);
|
|
23841
|
-
const relativePromptPath = normalizePath(
|
|
24165
|
+
const relativePromptPath = normalizePath(path11.relative(directory, workerPromptPath));
|
|
23842
24166
|
const PREVIEW_MAX_LENGTH = 200;
|
|
23843
24167
|
const workerPromptPreview = workerPrompt.length > PREVIEW_MAX_LENGTH ? workerPrompt.slice(0, PREVIEW_MAX_LENGTH) + "..." : workerPrompt;
|
|
23844
24168
|
const taskToolPrompt = `Follow instructions in @${relativePromptPath}`;
|
|
@@ -23867,8 +24191,8 @@ Use the \`@path\` attachment syntax in the prompt to reference the file. Do not
|
|
|
23867
24191
|
const responseBase = {
|
|
23868
24192
|
success: true,
|
|
23869
24193
|
terminal: false,
|
|
23870
|
-
worktreePath:
|
|
23871
|
-
branch:
|
|
24194
|
+
worktreePath: worktree2.path,
|
|
24195
|
+
branch: worktree2.branch,
|
|
23872
24196
|
mode: "delegate",
|
|
23873
24197
|
agent,
|
|
23874
24198
|
defaultAgent,
|
|
@@ -24004,8 +24328,8 @@ Use the \`@path\` attachment syntax in the prompt to reference the file. Do not
|
|
|
24004
24328
|
]
|
|
24005
24329
|
});
|
|
24006
24330
|
}
|
|
24007
|
-
const
|
|
24008
|
-
return buildWorktreeLaunchResponse({ feature, task, taskInfo, worktree });
|
|
24331
|
+
const worktree2 = await worktreeService.create(feature, task);
|
|
24332
|
+
return buildWorktreeLaunchResponse({ feature, task, taskInfo, worktree: worktree2 });
|
|
24009
24333
|
};
|
|
24010
24334
|
const executeBlockedResume = async ({
|
|
24011
24335
|
task,
|
|
@@ -24096,8 +24420,8 @@ Use the \`@path\` attachment syntax in the prompt to reference the file. Do not
|
|
|
24096
24420
|
]
|
|
24097
24421
|
});
|
|
24098
24422
|
}
|
|
24099
|
-
const
|
|
24100
|
-
if (!
|
|
24423
|
+
const worktree2 = await worktreeService.get(feature, task);
|
|
24424
|
+
if (!worktree2) {
|
|
24101
24425
|
return respond({
|
|
24102
24426
|
success: false,
|
|
24103
24427
|
terminal: true,
|
|
@@ -24113,12 +24437,23 @@ Use the \`@path\` attachment syntax in the prompt to reference the file. Do not
|
|
|
24113
24437
|
feature,
|
|
24114
24438
|
task,
|
|
24115
24439
|
taskInfo,
|
|
24116
|
-
worktree,
|
|
24440
|
+
worktree: worktree2,
|
|
24117
24441
|
continueFrom,
|
|
24118
24442
|
decision
|
|
24119
24443
|
});
|
|
24120
24444
|
};
|
|
24121
24445
|
return {
|
|
24446
|
+
event: async (input) => {
|
|
24447
|
+
if (input.event.type !== "session.compacted") {
|
|
24448
|
+
return;
|
|
24449
|
+
}
|
|
24450
|
+
const sessionID = input.event.properties.sessionID;
|
|
24451
|
+
const existing = sessionService.getGlobal(sessionID);
|
|
24452
|
+
if (!existing?.directivePrompt || !shouldUseDirectiveReplay(existing)) {
|
|
24453
|
+
return;
|
|
24454
|
+
}
|
|
24455
|
+
sessionService.trackGlobal(sessionID, { replayDirectivePending: true });
|
|
24456
|
+
},
|
|
24122
24457
|
"experimental.chat.system.transform": async (input, output) => {
|
|
24123
24458
|
if (!shouldExecuteHook("experimental.chat.system.transform", configService, turnCounters)) {
|
|
24124
24459
|
return;
|
|
@@ -24152,9 +24487,81 @@ Use the \`@path\` attachment syntax in the prompt to reference the file. Do not
|
|
|
24152
24487
|
}
|
|
24153
24488
|
},
|
|
24154
24489
|
"experimental.session.compacting": async (_input, output) => {
|
|
24155
|
-
|
|
24490
|
+
const session = sessionService.getGlobal(_input.sessionID);
|
|
24491
|
+
if (session) {
|
|
24492
|
+
const ctx2 = {
|
|
24493
|
+
agent: session.agent,
|
|
24494
|
+
baseAgent: session.baseAgent,
|
|
24495
|
+
sessionKind: session.sessionKind,
|
|
24496
|
+
featureName: session.featureName,
|
|
24497
|
+
taskFolder: session.taskFolder,
|
|
24498
|
+
workerPromptPath: session.workerPromptPath,
|
|
24499
|
+
directivePrompt: session.directivePrompt
|
|
24500
|
+
};
|
|
24501
|
+
const reanchor = buildCompactionReanchor(ctx2);
|
|
24502
|
+
output.prompt = reanchor.prompt;
|
|
24503
|
+
output.context.push(...reanchor.context);
|
|
24504
|
+
} else {
|
|
24505
|
+
const reanchor = buildCompactionReanchor({});
|
|
24506
|
+
output.prompt = reanchor.prompt;
|
|
24507
|
+
output.context.push(...reanchor.context);
|
|
24508
|
+
}
|
|
24509
|
+
},
|
|
24510
|
+
"chat.message": createVariantHook(configService, sessionService, customAgentConfigsForClassification, taskWorkerRecovery),
|
|
24511
|
+
"experimental.chat.messages.transform": async (_input, output) => {
|
|
24512
|
+
if (!Array.isArray(output.messages) || output.messages.length === 0) {
|
|
24513
|
+
return;
|
|
24514
|
+
}
|
|
24515
|
+
const firstMessage = output.messages[0];
|
|
24516
|
+
const sessionID = firstMessage?.info?.sessionID;
|
|
24517
|
+
if (!sessionID) {
|
|
24518
|
+
return;
|
|
24519
|
+
}
|
|
24520
|
+
const session = sessionService.getGlobal(sessionID);
|
|
24521
|
+
const captureCandidates = output.messages.filter(({ info, parts }) => info.sessionID === sessionID && shouldCaptureDirective(info, parts));
|
|
24522
|
+
const latestDirective = captureCandidates.at(-1);
|
|
24523
|
+
if (latestDirective) {
|
|
24524
|
+
const directiveText = extractTextParts(latestDirective.parts).join(`
|
|
24525
|
+
|
|
24526
|
+
`);
|
|
24527
|
+
const existingDirective = session?.directivePrompt;
|
|
24528
|
+
if (directiveText && directiveText !== existingDirective && shouldUseDirectiveReplay(session ?? { sessionKind: "subagent" })) {
|
|
24529
|
+
sessionService.trackGlobal(sessionID, { directivePrompt: directiveText });
|
|
24530
|
+
}
|
|
24531
|
+
}
|
|
24532
|
+
const refreshed = sessionService.getGlobal(sessionID);
|
|
24533
|
+
if (!refreshed?.replayDirectivePending || !shouldUseDirectiveReplay(refreshed)) {
|
|
24534
|
+
if (refreshed?.replayDirectivePending && !shouldUseDirectiveReplay(refreshed)) {
|
|
24535
|
+
sessionService.trackGlobal(sessionID, { replayDirectivePending: false });
|
|
24536
|
+
}
|
|
24537
|
+
return;
|
|
24538
|
+
}
|
|
24539
|
+
const replayText = buildDirectiveReplayText(refreshed);
|
|
24540
|
+
if (!replayText) {
|
|
24541
|
+
sessionService.trackGlobal(sessionID, { replayDirectivePending: false });
|
|
24542
|
+
return;
|
|
24543
|
+
}
|
|
24544
|
+
const now = Date.now();
|
|
24545
|
+
output.messages.push({
|
|
24546
|
+
info: {
|
|
24547
|
+
id: `msg_replay_${sessionID}`,
|
|
24548
|
+
sessionID,
|
|
24549
|
+
role: "user",
|
|
24550
|
+
time: { created: now }
|
|
24551
|
+
},
|
|
24552
|
+
parts: [
|
|
24553
|
+
{
|
|
24554
|
+
id: `prt_replay_${sessionID}`,
|
|
24555
|
+
sessionID,
|
|
24556
|
+
messageID: `msg_replay_${sessionID}`,
|
|
24557
|
+
type: "text",
|
|
24558
|
+
text: replayText,
|
|
24559
|
+
synthetic: true
|
|
24560
|
+
}
|
|
24561
|
+
]
|
|
24562
|
+
});
|
|
24563
|
+
sessionService.trackGlobal(sessionID, { replayDirectivePending: false });
|
|
24156
24564
|
},
|
|
24157
|
-
"chat.message": createVariantHook(configService),
|
|
24158
24565
|
"tool.execute.before": async (input, output) => {
|
|
24159
24566
|
if (!shouldExecuteHook("tool.execute.before", configService, turnCounters, { safetyCritical: true })) {
|
|
24160
24567
|
return;
|
|
@@ -24176,7 +24583,7 @@ Use the \`@path\` attachment syntax in the prompt to reference the file. Do not
|
|
|
24176
24583
|
const workdir = output.args?.workdir;
|
|
24177
24584
|
if (!workdir)
|
|
24178
24585
|
return;
|
|
24179
|
-
const hiveWorktreeBase =
|
|
24586
|
+
const hiveWorktreeBase = path11.join(directory, ".hive", ".worktrees");
|
|
24180
24587
|
if (!workdir.startsWith(hiveWorktreeBase))
|
|
24181
24588
|
return;
|
|
24182
24589
|
const wrapped = DockerSandboxService.wrapCommand(workdir, command, sandboxConfig);
|
|
@@ -24290,6 +24697,7 @@ Expand your Discovery section and try again.`;
|
|
|
24290
24697
|
if (!feature)
|
|
24291
24698
|
return "Error: No feature specified. Create a feature or provide feature param.";
|
|
24292
24699
|
captureSession(feature, toolContext);
|
|
24700
|
+
bindFeatureSession(feature, toolContext);
|
|
24293
24701
|
const result = planService.read(feature);
|
|
24294
24702
|
if (!result)
|
|
24295
24703
|
return "Error: No plan.md found";
|
|
@@ -24413,7 +24821,7 @@ Reminder: start work with hive_worktree_start to use its worktree, and ensure an
|
|
|
24413
24821
|
}).optional().describe("Blocker info when status is blocked"),
|
|
24414
24822
|
feature: tool.schema.string().optional().describe("Feature name (defaults to detection or single feature)")
|
|
24415
24823
|
},
|
|
24416
|
-
async execute({ task, summary, message, status = "completed", blocker, feature: explicitFeature }) {
|
|
24824
|
+
async execute({ task, summary, message, status = "completed", blocker, feature: explicitFeature }, toolContext) {
|
|
24417
24825
|
const respond2 = (payload) => JSON.stringify(payload, null, 2);
|
|
24418
24826
|
const feature = resolveFeature(explicitFeature);
|
|
24419
24827
|
if (!feature) {
|
|
@@ -24455,6 +24863,9 @@ Reminder: start work with hive_worktree_start to use its worktree, and ensure an
|
|
|
24455
24863
|
nextAction: "Only in_progress or blocked tasks can be committed. Start/resume the task first."
|
|
24456
24864
|
});
|
|
24457
24865
|
}
|
|
24866
|
+
const featureDir = resolveFeatureDirectoryName(directory, feature);
|
|
24867
|
+
const workerPromptPath = path11.posix.join(".hive", "features", featureDir, "tasks", task, "worker-prompt.md");
|
|
24868
|
+
bindFeatureSession(feature, toolContext, { taskFolder: task, workerPromptPath });
|
|
24458
24869
|
let verificationNote;
|
|
24459
24870
|
if (status === "completed") {
|
|
24460
24871
|
const verificationKeywords = ["test", "build", "lint", "vitest", "jest", "npm run", "pnpm", "cargo", "pytest", "verified", "passes", "succeeds", "ast-grep", "scan"];
|
|
@@ -24470,7 +24881,7 @@ Reminder: start work with hive_worktree_start to use its worktree, and ensure an
|
|
|
24470
24881
|
summary,
|
|
24471
24882
|
blocker
|
|
24472
24883
|
});
|
|
24473
|
-
const
|
|
24884
|
+
const worktree3 = await worktreeService.get(feature, task);
|
|
24474
24885
|
return respond2({
|
|
24475
24886
|
ok: true,
|
|
24476
24887
|
terminal: true,
|
|
@@ -24481,8 +24892,8 @@ Reminder: start work with hive_worktree_start to use its worktree, and ensure an
|
|
|
24481
24892
|
taskState: "blocked",
|
|
24482
24893
|
summary,
|
|
24483
24894
|
blocker,
|
|
24484
|
-
worktreePath:
|
|
24485
|
-
branch:
|
|
24895
|
+
worktreePath: worktree3?.path,
|
|
24896
|
+
branch: worktree3?.branch,
|
|
24486
24897
|
message: 'Task blocked. Hive Master will ask user and resume with hive_worktree_create(continueFrom: "blocked", decision: answer)',
|
|
24487
24898
|
nextAction: 'Wait for orchestrator to collect user decision and resume with continueFrom: "blocked".'
|
|
24488
24899
|
});
|
|
@@ -24541,7 +24952,7 @@ Reminder: start work with hive_worktree_start to use its worktree, and ensure an
|
|
|
24541
24952
|
`));
|
|
24542
24953
|
const finalStatus = status === "completed" ? "done" : status;
|
|
24543
24954
|
taskService.update(feature, task, { status: finalStatus, summary });
|
|
24544
|
-
const
|
|
24955
|
+
const worktree2 = await worktreeService.get(feature, task);
|
|
24545
24956
|
return respond2({
|
|
24546
24957
|
ok: true,
|
|
24547
24958
|
terminal: true,
|
|
@@ -24556,8 +24967,8 @@ Reminder: start work with hive_worktree_start to use its worktree, and ensure an
|
|
|
24556
24967
|
sha: commitResult.sha,
|
|
24557
24968
|
message: commitResult.message
|
|
24558
24969
|
},
|
|
24559
|
-
worktreePath:
|
|
24560
|
-
branch:
|
|
24970
|
+
worktreePath: worktree2?.path,
|
|
24971
|
+
branch: worktree2?.branch,
|
|
24561
24972
|
reportPath,
|
|
24562
24973
|
message: `Task "${task}" ${status}.`,
|
|
24563
24974
|
nextAction: "Use hive_merge to integrate changes. Worktree is preserved for review."
|
|
@@ -24619,10 +25030,11 @@ Files changed: ${result.filesChanged?.length || 0}`;
|
|
|
24619
25030
|
content: tool.schema.string().describe("Markdown content to write"),
|
|
24620
25031
|
feature: tool.schema.string().optional().describe("Feature name (defaults to active)")
|
|
24621
25032
|
},
|
|
24622
|
-
async execute({ name, content, feature: explicitFeature }) {
|
|
25033
|
+
async execute({ name, content, feature: explicitFeature }, toolContext) {
|
|
24623
25034
|
const feature = resolveFeature(explicitFeature);
|
|
24624
25035
|
if (!feature)
|
|
24625
25036
|
return "Error: No feature specified. Create a feature or provide feature param.";
|
|
25037
|
+
bindFeatureSession(feature, toolContext);
|
|
24626
25038
|
const filePath = contextService.write(feature, name, content);
|
|
24627
25039
|
return `Context file written: ${filePath}`;
|
|
24628
25040
|
}
|
|
@@ -24672,36 +25084,36 @@ Files changed: ${result.filesChanged?.length || 0}`;
|
|
|
24672
25084
|
const contextFiles = contextService.list(feature);
|
|
24673
25085
|
const overview = contextFiles.find((file2) => file2.name === "overview") ?? null;
|
|
24674
25086
|
const readThreads = (filePath) => {
|
|
24675
|
-
if (!
|
|
25087
|
+
if (!fs13.existsSync(filePath)) {
|
|
24676
25088
|
return null;
|
|
24677
25089
|
}
|
|
24678
25090
|
try {
|
|
24679
|
-
const data = JSON.parse(
|
|
25091
|
+
const data = JSON.parse(fs13.readFileSync(filePath, "utf-8"));
|
|
24680
25092
|
return data.threads ?? [];
|
|
24681
25093
|
} catch {
|
|
24682
25094
|
return [];
|
|
24683
25095
|
}
|
|
24684
25096
|
};
|
|
24685
|
-
const featurePath =
|
|
24686
|
-
const reviewDir =
|
|
24687
|
-
const planThreads = readThreads(
|
|
24688
|
-
const overviewThreads = readThreads(
|
|
25097
|
+
const featurePath = path11.join(directory, ".hive", "features", resolveFeatureDirectoryName(directory, feature));
|
|
25098
|
+
const reviewDir = path11.join(featurePath, "comments");
|
|
25099
|
+
const planThreads = readThreads(path11.join(reviewDir, "plan.json")) ?? readThreads(path11.join(featurePath, "comments.json"));
|
|
25100
|
+
const overviewThreads = readThreads(path11.join(reviewDir, "overview.json"));
|
|
24689
25101
|
const reviewCounts = {
|
|
24690
25102
|
plan: planThreads?.length ?? 0,
|
|
24691
25103
|
overview: overviewThreads?.length ?? 0
|
|
24692
25104
|
};
|
|
24693
25105
|
const tasksSummary = await Promise.all(tasks.map(async (t) => {
|
|
24694
25106
|
const rawStatus = taskService.getRawStatus(feature, t.folder);
|
|
24695
|
-
const
|
|
24696
|
-
const hasChanges =
|
|
25107
|
+
const worktree2 = await worktreeService.get(feature, t.folder);
|
|
25108
|
+
const hasChanges = worktree2 ? await worktreeService.hasUncommittedChanges(worktree2.feature, worktree2.step) : null;
|
|
24697
25109
|
return {
|
|
24698
25110
|
folder: t.folder,
|
|
24699
25111
|
name: t.name,
|
|
24700
25112
|
status: t.status,
|
|
24701
25113
|
origin: t.origin || "plan",
|
|
24702
25114
|
dependsOn: rawStatus?.dependsOn ?? null,
|
|
24703
|
-
worktree:
|
|
24704
|
-
branch:
|
|
25115
|
+
worktree: worktree2 ? {
|
|
25116
|
+
branch: worktree2.branch,
|
|
24705
25117
|
hasChanges
|
|
24706
25118
|
} : null
|
|
24707
25119
|
};
|