@primeinc/swarm 0.57.8-beta.0 → 0.57.10-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/swarm.ts +3 -3
- package/claude-plugin/dist/index.js +1419 -693
- package/claude-plugin/dist/utils/arg-normalizer.d.ts +9 -0
- package/claude-plugin/dist/utils/arg-normalizer.d.ts.map +1 -0
- package/dist/bin/swarm.js +3563 -1632
- package/dist/dashboard.d.ts +2 -6
- package/dist/dashboard.d.ts.map +1 -1
- package/dist/hive.d.ts +7 -2
- package/dist/hive.d.ts.map +1 -1
- package/dist/hive.js +545 -76
- package/dist/index.js +781 -302
- package/dist/marketplace/index.js +1419 -693
- package/dist/plugin.js +781 -288
- package/dist/swarm-mail.d.ts.map +1 -1
- package/dist/swarm-prompts.js +593 -118
- package/dist/swarm-research.d.ts +1 -2
- package/dist/swarm-research.d.ts.map +1 -1
- package/dist/utils/arg-normalizer.d.ts +9 -0
- package/dist/utils/arg-normalizer.d.ts.map +1 -0
- package/package.json +6 -5
- package/claude-plugin/dist/utils/normalize-path.d.ts +0 -75
- package/claude-plugin/dist/utils/normalize-path.d.ts.map +0 -1
- package/dist/utils/normalize-path.d.ts +0 -75
- package/dist/utils/normalize-path.d.ts.map +0 -1
package/dist/plugin.js
CHANGED
|
@@ -12774,7 +12774,7 @@ __export(exports_util2, {
|
|
|
12774
12774
|
promiseAllObject: () => promiseAllObject2,
|
|
12775
12775
|
primitiveTypes: () => primitiveTypes2,
|
|
12776
12776
|
prefixIssues: () => prefixIssues2,
|
|
12777
|
-
pick: () =>
|
|
12777
|
+
pick: () => pick3,
|
|
12778
12778
|
partial: () => partial2,
|
|
12779
12779
|
optionalKeys: () => optionalKeys2,
|
|
12780
12780
|
omit: () => omit2,
|
|
@@ -12925,10 +12925,10 @@ function mergeDefs2(...defs) {
|
|
|
12925
12925
|
function cloneDef2(schema) {
|
|
12926
12926
|
return mergeDefs2(schema._zod.def);
|
|
12927
12927
|
}
|
|
12928
|
-
function getElementAtPath2(obj,
|
|
12929
|
-
if (!
|
|
12928
|
+
function getElementAtPath2(obj, path3) {
|
|
12929
|
+
if (!path3)
|
|
12930
12930
|
return obj;
|
|
12931
|
-
return
|
|
12931
|
+
return path3.reduce((acc, key) => acc?.[key], obj);
|
|
12932
12932
|
}
|
|
12933
12933
|
function promiseAllObject2(promisesObj) {
|
|
12934
12934
|
const keys = Object.keys(promisesObj);
|
|
@@ -13055,7 +13055,7 @@ function optionalKeys2(shape) {
|
|
|
13055
13055
|
return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
|
|
13056
13056
|
});
|
|
13057
13057
|
}
|
|
13058
|
-
function
|
|
13058
|
+
function pick3(schema, mask) {
|
|
13059
13059
|
const currDef = schema._zod.def;
|
|
13060
13060
|
const def = mergeDefs2(schema._zod.def, {
|
|
13061
13061
|
get shape() {
|
|
@@ -13217,11 +13217,11 @@ function aborted2(x, startIndex = 0) {
|
|
|
13217
13217
|
}
|
|
13218
13218
|
return false;
|
|
13219
13219
|
}
|
|
13220
|
-
function prefixIssues2(
|
|
13220
|
+
function prefixIssues2(path3, issues) {
|
|
13221
13221
|
return issues.map((iss) => {
|
|
13222
13222
|
var _a;
|
|
13223
13223
|
(_a = iss).path ?? (_a.path = []);
|
|
13224
|
-
iss.path.unshift(
|
|
13224
|
+
iss.path.unshift(path3);
|
|
13225
13225
|
return iss;
|
|
13226
13226
|
});
|
|
13227
13227
|
}
|
|
@@ -13444,7 +13444,7 @@ function treeifyError2(error45, _mapper) {
|
|
|
13444
13444
|
return issue3.message;
|
|
13445
13445
|
};
|
|
13446
13446
|
const result = { errors: [] };
|
|
13447
|
-
const processError = (error46,
|
|
13447
|
+
const processError = (error46, path3 = []) => {
|
|
13448
13448
|
var _a, _b;
|
|
13449
13449
|
for (const issue3 of error46.issues) {
|
|
13450
13450
|
if (issue3.code === "invalid_union" && issue3.errors.length) {
|
|
@@ -13454,7 +13454,7 @@ function treeifyError2(error45, _mapper) {
|
|
|
13454
13454
|
} else if (issue3.code === "invalid_element") {
|
|
13455
13455
|
processError({ issues: issue3.issues }, issue3.path);
|
|
13456
13456
|
} else {
|
|
13457
|
-
const fullpath = [...
|
|
13457
|
+
const fullpath = [...path3, ...issue3.path];
|
|
13458
13458
|
if (fullpath.length === 0) {
|
|
13459
13459
|
result.errors.push(mapper(issue3));
|
|
13460
13460
|
continue;
|
|
@@ -13486,8 +13486,8 @@ function treeifyError2(error45, _mapper) {
|
|
|
13486
13486
|
}
|
|
13487
13487
|
function toDotPath2(_path) {
|
|
13488
13488
|
const segs = [];
|
|
13489
|
-
const
|
|
13490
|
-
for (const seg of
|
|
13489
|
+
const path3 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
13490
|
+
for (const seg of path3) {
|
|
13491
13491
|
if (typeof seg === "number")
|
|
13492
13492
|
segs.push(`[${seg}]`);
|
|
13493
13493
|
else if (typeof seg === "symbol")
|
|
@@ -25372,14 +25372,14 @@ __export(exports_eval_capture, {
|
|
|
25372
25372
|
});
|
|
25373
25373
|
import * as fs from "node:fs";
|
|
25374
25374
|
import * as os from "node:os";
|
|
25375
|
-
import * as
|
|
25375
|
+
import * as path3 from "node:path";
|
|
25376
25376
|
import { getSwarmMailLibSQL } from "swarm-mail";
|
|
25377
25377
|
function getEvalDataPath(projectPath) {
|
|
25378
|
-
return
|
|
25378
|
+
return path3.join(projectPath, DEFAULT_EVAL_DATA_PATH);
|
|
25379
25379
|
}
|
|
25380
25380
|
function ensureEvalDataDir(projectPath) {
|
|
25381
25381
|
const evalPath = getEvalDataPath(projectPath);
|
|
25382
|
-
const dir =
|
|
25382
|
+
const dir = path3.dirname(evalPath);
|
|
25383
25383
|
if (!fs.existsSync(dir)) {
|
|
25384
25384
|
fs.mkdirSync(dir, { recursive: true });
|
|
25385
25385
|
}
|
|
@@ -25553,10 +25553,10 @@ function getEvalDataStats(projectPath) {
|
|
|
25553
25553
|
};
|
|
25554
25554
|
}
|
|
25555
25555
|
function getSessionDir() {
|
|
25556
|
-
return process.env.SWARM_SESSIONS_DIR ||
|
|
25556
|
+
return process.env.SWARM_SESSIONS_DIR || path3.join(os.homedir(), ".config", "swarm-tools", "sessions");
|
|
25557
25557
|
}
|
|
25558
25558
|
function getSessionPath(sessionId) {
|
|
25559
|
-
return
|
|
25559
|
+
return path3.join(getSessionDir(), `${sessionId}.jsonl`);
|
|
25560
25560
|
}
|
|
25561
25561
|
function ensureSessionDir() {
|
|
25562
25562
|
const sessionDir = getSessionDir();
|
|
@@ -30318,7 +30318,7 @@ WD9f
|
|
|
30318
30318
|
|
|
30319
30319
|
// ../../node_modules/ioredis/built/utils/index.js
|
|
30320
30320
|
var require_utils2 = __commonJS((exports) => {
|
|
30321
|
-
var __dirname = "/home/runner/work/swarm
|
|
30321
|
+
var __dirname = "/home/runner/work/swarm/swarm/node_modules/ioredis/built/utils";
|
|
30322
30322
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30323
30323
|
exports.noop = exports.defaults = exports.Debug = exports.getPackageMeta = exports.zipMap = exports.CONNECTION_CLOSED_ERROR_MSG = exports.shuffle = exports.sample = exports.resolveTLSProfile = exports.parseURL = exports.optimizeErrorStack = exports.toArg = exports.convertMapToArray = exports.convertObjectToArray = exports.timeout = exports.packObject = exports.isInt = exports.wrapMultiResult = exports.convertBufferToString = undefined;
|
|
30324
30324
|
var fs_1 = __require("fs");
|
|
@@ -30548,7 +30548,7 @@ var require_utils2 = __commonJS((exports) => {
|
|
|
30548
30548
|
|
|
30549
30549
|
// ../../node_modules/ioredis/built/Command.js
|
|
30550
30550
|
var require_Command = __commonJS((exports) => {
|
|
30551
|
-
var __dirname = "/home/runner/work/swarm
|
|
30551
|
+
var __dirname = "/home/runner/work/swarm/swarm/node_modules/ioredis/built";
|
|
30552
30552
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30553
30553
|
var commands_1 = require_built();
|
|
30554
30554
|
var calculateSlot = require_lib();
|
|
@@ -39592,7 +39592,7 @@ import {
|
|
|
39592
39592
|
dirname as dirname3,
|
|
39593
39593
|
resolve,
|
|
39594
39594
|
relative,
|
|
39595
|
-
isAbsolute,
|
|
39595
|
+
isAbsolute as isAbsolute2,
|
|
39596
39596
|
sep
|
|
39597
39597
|
} from "path";
|
|
39598
39598
|
import { fileURLToPath } from "url";
|
|
@@ -40240,7 +40240,7 @@ Use this to access supplementary skill resources.`,
|
|
|
40240
40240
|
if (!skill) {
|
|
40241
40241
|
return `Skill '${args.skill}' not found.`;
|
|
40242
40242
|
}
|
|
40243
|
-
if (
|
|
40243
|
+
if (isAbsolute2(args.file)) {
|
|
40244
40244
|
return "Invalid file path. Use a relative path.";
|
|
40245
40245
|
}
|
|
40246
40246
|
if (args.file.includes("..")) {
|
|
@@ -40454,7 +40454,7 @@ executed with skills_execute. Use for:
|
|
|
40454
40454
|
if (!skill) {
|
|
40455
40455
|
return `Skill '${args.skill}' not found.`;
|
|
40456
40456
|
}
|
|
40457
|
-
if (
|
|
40457
|
+
if (isAbsolute2(args.script_name) || args.script_name.includes("..") || args.script_name.includes("/") || args.script_name.includes("\\") || basename(args.script_name) !== args.script_name) {
|
|
40458
40458
|
return "Invalid script name. Use simple filenames without paths.";
|
|
40459
40459
|
}
|
|
40460
40460
|
const scriptsDir = join6(skill.directory, "scripts");
|
|
@@ -42705,17 +42705,17 @@ var getKeysForIndexSignature = (input, parameter) => {
|
|
|
42705
42705
|
done = true;
|
|
42706
42706
|
return a;
|
|
42707
42707
|
};
|
|
42708
|
-
}, isNonEmpty = (x) => Array.isArray(x), isSingle = (x) => !Array.isArray(x), formatPathKey = (key) => `[${formatPropertyKey(key)}]`, formatPath = (
|
|
42708
|
+
}, isNonEmpty = (x) => Array.isArray(x), isSingle = (x) => !Array.isArray(x), formatPathKey = (key) => `[${formatPropertyKey(key)}]`, formatPath = (path5) => isNonEmpty(path5) ? path5.map(formatPathKey).join("") : formatPathKey(path5);
|
|
42709
42709
|
var init_util3 = __esm(() => {
|
|
42710
42710
|
init_Inspectable();
|
|
42711
42711
|
});
|
|
42712
42712
|
|
|
42713
42713
|
// ../../node_modules/effect/dist/esm/internal/schema/errors.js
|
|
42714
|
-
var getErrorMessage = (reason, details,
|
|
42714
|
+
var getErrorMessage = (reason, details, path5, ast) => {
|
|
42715
42715
|
let out = reason;
|
|
42716
|
-
if (
|
|
42716
|
+
if (path5 && isNonEmptyReadonlyArray(path5)) {
|
|
42717
42717
|
out += `
|
|
42718
|
-
at path: ${formatPath(
|
|
42718
|
+
at path: ${formatPath(path5)}`;
|
|
42719
42719
|
}
|
|
42720
42720
|
if (details !== undefined) {
|
|
42721
42721
|
out += `
|
|
@@ -43728,7 +43728,7 @@ var TypeId3, BigDecimalProto, isBigDecimal = (u) => hasProperty(u, TypeId3), mak
|
|
|
43728
43728
|
const o = make4(value, scale);
|
|
43729
43729
|
o.normalized = o;
|
|
43730
43730
|
return o;
|
|
43731
|
-
}, bigint0, bigint10, zero,
|
|
43731
|
+
}, bigint0, bigint10, zero, normalize2 = (self) => {
|
|
43732
43732
|
if (self.normalized === undefined) {
|
|
43733
43733
|
if (self.value === bigint0) {
|
|
43734
43734
|
self.normalized = zero;
|
|
@@ -43752,7 +43752,7 @@ var TypeId3, BigDecimalProto, isBigDecimal = (u) => hasProperty(u, TypeId3), mak
|
|
|
43752
43752
|
}
|
|
43753
43753
|
return self.normalized;
|
|
43754
43754
|
}, scale, abs = (n) => n.value < bigint0 ? make4(-n.value, n.scale) : n, Equivalence, equals2, format2 = (n) => {
|
|
43755
|
-
const normalized =
|
|
43755
|
+
const normalized = normalize2(n);
|
|
43756
43756
|
if (Math.abs(normalized.scale) >= 16) {
|
|
43757
43757
|
return toExponential(normalized);
|
|
43758
43758
|
}
|
|
@@ -43780,7 +43780,7 @@ var TypeId3, BigDecimalProto, isBigDecimal = (u) => hasProperty(u, TypeId3), mak
|
|
|
43780
43780
|
if (isZero(n)) {
|
|
43781
43781
|
return "0e+0";
|
|
43782
43782
|
}
|
|
43783
|
-
const normalized =
|
|
43783
|
+
const normalized = normalize2(n);
|
|
43784
43784
|
const digits = `${abs(normalized).value}`;
|
|
43785
43785
|
const head2 = digits.slice(0, 1);
|
|
43786
43786
|
const tail = digits.slice(1);
|
|
@@ -43803,7 +43803,7 @@ var init_BigDecimal = __esm(() => {
|
|
|
43803
43803
|
BigDecimalProto = {
|
|
43804
43804
|
[TypeId3]: TypeId3,
|
|
43805
43805
|
[symbol3]() {
|
|
43806
|
-
const normalized =
|
|
43806
|
+
const normalized = normalize2(this);
|
|
43807
43807
|
return pipe3(hash3(normalized.value), combine(number8(normalized.scale)), cached3(this));
|
|
43808
43808
|
},
|
|
43809
43809
|
[symbol4](that) {
|
|
@@ -48339,64 +48339,64 @@ var ConfigErrorSymbolKey = "effect/ConfigError", ConfigErrorTypeId, proto2, And
|
|
|
48339
48339
|
}
|
|
48340
48340
|
});
|
|
48341
48341
|
return error89;
|
|
48342
|
-
}, InvalidData = (
|
|
48342
|
+
}, InvalidData = (path5, message, options2 = {
|
|
48343
48343
|
pathDelim: "."
|
|
48344
48344
|
}) => {
|
|
48345
48345
|
const error89 = Object.create(proto2);
|
|
48346
48346
|
error89._op = OP_INVALID_DATA;
|
|
48347
|
-
error89.path =
|
|
48347
|
+
error89.path = path5;
|
|
48348
48348
|
error89.message = message;
|
|
48349
48349
|
Object.defineProperty(error89, "toString", {
|
|
48350
48350
|
enumerable: false,
|
|
48351
48351
|
value() {
|
|
48352
|
-
const
|
|
48353
|
-
return `(Invalid data at ${
|
|
48352
|
+
const path6 = pipe3(this.path, join8(options2.pathDelim));
|
|
48353
|
+
return `(Invalid data at ${path6}: "${this.message}")`;
|
|
48354
48354
|
}
|
|
48355
48355
|
});
|
|
48356
48356
|
return error89;
|
|
48357
|
-
}, MissingData = (
|
|
48357
|
+
}, MissingData = (path5, message, options2 = {
|
|
48358
48358
|
pathDelim: "."
|
|
48359
48359
|
}) => {
|
|
48360
48360
|
const error89 = Object.create(proto2);
|
|
48361
48361
|
error89._op = OP_MISSING_DATA;
|
|
48362
|
-
error89.path =
|
|
48362
|
+
error89.path = path5;
|
|
48363
48363
|
error89.message = message;
|
|
48364
48364
|
Object.defineProperty(error89, "toString", {
|
|
48365
48365
|
enumerable: false,
|
|
48366
48366
|
value() {
|
|
48367
|
-
const
|
|
48368
|
-
return `(Missing data at ${
|
|
48367
|
+
const path6 = pipe3(this.path, join8(options2.pathDelim));
|
|
48368
|
+
return `(Missing data at ${path6}: "${this.message}")`;
|
|
48369
48369
|
}
|
|
48370
48370
|
});
|
|
48371
48371
|
return error89;
|
|
48372
|
-
}, SourceUnavailable = (
|
|
48372
|
+
}, SourceUnavailable = (path5, message, cause, options2 = {
|
|
48373
48373
|
pathDelim: "."
|
|
48374
48374
|
}) => {
|
|
48375
48375
|
const error89 = Object.create(proto2);
|
|
48376
48376
|
error89._op = OP_SOURCE_UNAVAILABLE;
|
|
48377
|
-
error89.path =
|
|
48377
|
+
error89.path = path5;
|
|
48378
48378
|
error89.message = message;
|
|
48379
48379
|
error89.cause = cause;
|
|
48380
48380
|
Object.defineProperty(error89, "toString", {
|
|
48381
48381
|
enumerable: false,
|
|
48382
48382
|
value() {
|
|
48383
|
-
const
|
|
48384
|
-
return `(Source unavailable at ${
|
|
48383
|
+
const path6 = pipe3(this.path, join8(options2.pathDelim));
|
|
48384
|
+
return `(Source unavailable at ${path6}: "${this.message}")`;
|
|
48385
48385
|
}
|
|
48386
48386
|
});
|
|
48387
48387
|
return error89;
|
|
48388
|
-
}, Unsupported = (
|
|
48388
|
+
}, Unsupported = (path5, message, options2 = {
|
|
48389
48389
|
pathDelim: "."
|
|
48390
48390
|
}) => {
|
|
48391
48391
|
const error89 = Object.create(proto2);
|
|
48392
48392
|
error89._op = OP_UNSUPPORTED;
|
|
48393
|
-
error89.path =
|
|
48393
|
+
error89.path = path5;
|
|
48394
48394
|
error89.message = message;
|
|
48395
48395
|
Object.defineProperty(error89, "toString", {
|
|
48396
48396
|
enumerable: false,
|
|
48397
48397
|
value() {
|
|
48398
|
-
const
|
|
48399
|
-
return `(Unsupported operation at ${
|
|
48398
|
+
const path6 = pipe3(this.path, join8(options2.pathDelim));
|
|
48399
|
+
return `(Unsupported operation at ${path6}: "${this.message}")`;
|
|
48400
48400
|
}
|
|
48401
48401
|
});
|
|
48402
48402
|
return error89;
|
|
@@ -48445,9 +48445,9 @@ var init_pathPatch = __esm(() => {
|
|
|
48445
48445
|
empty20 = {
|
|
48446
48446
|
_tag: "Empty"
|
|
48447
48447
|
};
|
|
48448
|
-
patch5 = /* @__PURE__ */ dual(2, (
|
|
48448
|
+
patch5 = /* @__PURE__ */ dual(2, (path5, patch6) => {
|
|
48449
48449
|
let input = of3(patch6);
|
|
48450
|
-
let output =
|
|
48450
|
+
let output = path5;
|
|
48451
48451
|
while (isCons(input)) {
|
|
48452
48452
|
const patch7 = input.head;
|
|
48453
48453
|
switch (patch7._tag) {
|
|
@@ -48498,7 +48498,7 @@ var concat = (l, r) => [...l, ...r], ConfigProviderSymbolKey = "effect/ConfigPro
|
|
|
48498
48498
|
}), makeFlat = (options2) => ({
|
|
48499
48499
|
[FlatConfigProviderTypeId]: FlatConfigProviderTypeId,
|
|
48500
48500
|
patch: options2.patch,
|
|
48501
|
-
load: (
|
|
48501
|
+
load: (path5, config3, split = true) => options2.load(path5, config3, split),
|
|
48502
48502
|
enumerateChildren: options2.enumerateChildren
|
|
48503
48503
|
}), fromFlat = (flat) => make22({
|
|
48504
48504
|
load: (config3) => flatMap7(fromFlatLoop(flat, empty2(), config3, false), (chunk) => match3(head(chunk), {
|
|
@@ -48514,29 +48514,29 @@ var concat = (l, r) => [...l, ...r], ConfigProviderSymbolKey = "effect/ConfigPro
|
|
|
48514
48514
|
pathDelim: "_",
|
|
48515
48515
|
seqDelim: ","
|
|
48516
48516
|
}, options2);
|
|
48517
|
-
const makePathString = (
|
|
48517
|
+
const makePathString = (path5) => pipe3(path5, join8(pathDelim));
|
|
48518
48518
|
const unmakePathString = (pathString) => pathString.split(pathDelim);
|
|
48519
48519
|
const getEnv = () => typeof process !== "undefined" && ("env" in process) && typeof process.env === "object" ? process.env : {};
|
|
48520
|
-
const load = (
|
|
48521
|
-
const pathString = makePathString(
|
|
48520
|
+
const load = (path5, primitive, split = true) => {
|
|
48521
|
+
const pathString = makePathString(path5);
|
|
48522
48522
|
const current = getEnv();
|
|
48523
48523
|
const valueOpt = pathString in current ? some2(current[pathString]) : none2();
|
|
48524
|
-
return pipe3(valueOpt, mapError(() => MissingData(
|
|
48524
|
+
return pipe3(valueOpt, mapError(() => MissingData(path5, `Expected ${pathString} to exist in the process context`)), flatMap7((value) => parsePrimitive(value, path5, primitive, seqDelim, split)));
|
|
48525
48525
|
};
|
|
48526
|
-
const enumerateChildren = (
|
|
48526
|
+
const enumerateChildren = (path5) => sync(() => {
|
|
48527
48527
|
const current = getEnv();
|
|
48528
48528
|
const keys3 = Object.keys(current);
|
|
48529
48529
|
const keyPaths = keys3.map((value) => unmakePathString(value.toUpperCase()));
|
|
48530
48530
|
const filteredKeyPaths = keyPaths.filter((keyPath) => {
|
|
48531
|
-
for (let i = 0;i <
|
|
48532
|
-
const pathComponent = pipe3(
|
|
48531
|
+
for (let i = 0;i < path5.length; i++) {
|
|
48532
|
+
const pathComponent = pipe3(path5, unsafeGet(i));
|
|
48533
48533
|
const currentElement = keyPath[i];
|
|
48534
48534
|
if (currentElement === undefined || pathComponent !== currentElement) {
|
|
48535
48535
|
return false;
|
|
48536
48536
|
}
|
|
48537
48537
|
}
|
|
48538
48538
|
return true;
|
|
48539
|
-
}).flatMap((keyPath) => keyPath.slice(
|
|
48539
|
+
}).flatMap((keyPath) => keyPath.slice(path5.length, path5.length + 1));
|
|
48540
48540
|
return fromIterable5(filteredKeyPaths);
|
|
48541
48541
|
});
|
|
48542
48542
|
return fromFlat(makeFlat({
|
|
@@ -48550,17 +48550,17 @@ var concat = (l, r) => [...l, ...r], ConfigProviderSymbolKey = "effect/ConfigPro
|
|
|
48550
48550
|
const leftExtension = concat(left3, leftPad);
|
|
48551
48551
|
const rightExtension = concat(right3, rightPad);
|
|
48552
48552
|
return [leftExtension, rightExtension];
|
|
48553
|
-
}, appendConfigPath = (
|
|
48553
|
+
}, appendConfigPath = (path5, config3) => {
|
|
48554
48554
|
let op = config3;
|
|
48555
48555
|
if (op._tag === "Nested") {
|
|
48556
|
-
const out =
|
|
48556
|
+
const out = path5.slice();
|
|
48557
48557
|
while (op._tag === "Nested") {
|
|
48558
48558
|
out.push(op.name);
|
|
48559
48559
|
op = op.config;
|
|
48560
48560
|
}
|
|
48561
48561
|
return out;
|
|
48562
48562
|
}
|
|
48563
|
-
return
|
|
48563
|
+
return path5;
|
|
48564
48564
|
}, fromFlatLoop = (flat, prefix, config3, split) => {
|
|
48565
48565
|
const op = config3;
|
|
48566
48566
|
switch (op._tag) {
|
|
@@ -48635,8 +48635,8 @@ var concat = (l, r) => [...l, ...r], ConfigProviderSymbolKey = "effect/ConfigPro
|
|
|
48635
48635
|
return fail2(right3.left);
|
|
48636
48636
|
}
|
|
48637
48637
|
if (isRight2(left3) && isRight2(right3)) {
|
|
48638
|
-
const
|
|
48639
|
-
const fail3 = fromFlatLoopFail(prefix,
|
|
48638
|
+
const path5 = pipe3(prefix, join8("."));
|
|
48639
|
+
const fail3 = fromFlatLoopFail(prefix, path5);
|
|
48640
48640
|
const [lefts, rights] = extend3(fail3, fail3, pipe3(left3.right, map6(right2)), pipe3(right3.right, map6(right2)));
|
|
48641
48641
|
return pipe3(lefts, zip(rights), forEachSequential(([left4, right4]) => pipe3(zip2(left4, right4), map12(([left5, right5]) => op.zip(left5, right5)))));
|
|
48642
48642
|
}
|
|
@@ -48644,17 +48644,17 @@ var concat = (l, r) => [...l, ...r], ConfigProviderSymbolKey = "effect/ConfigPro
|
|
|
48644
48644
|
})))));
|
|
48645
48645
|
}
|
|
48646
48646
|
}
|
|
48647
|
-
}, fromFlatLoopFail = (prefix,
|
|
48647
|
+
}, fromFlatLoopFail = (prefix, path5) => (index) => left2(MissingData(prefix, `The element at index ${index} in a sequence at path "${path5}" was missing`)), splitPathString = (text, delim) => {
|
|
48648
48648
|
const split = text.split(new RegExp(`\\s*${escape2(delim)}\\s*`));
|
|
48649
48649
|
return split;
|
|
48650
|
-
}, parsePrimitive = (text,
|
|
48650
|
+
}, parsePrimitive = (text, path5, primitive, delimiter, split) => {
|
|
48651
48651
|
if (!split) {
|
|
48652
48652
|
return pipe3(primitive.parse(text), mapBoth({
|
|
48653
|
-
onFailure: prefixed(
|
|
48653
|
+
onFailure: prefixed(path5),
|
|
48654
48654
|
onSuccess: of
|
|
48655
48655
|
}));
|
|
48656
48656
|
}
|
|
48657
|
-
return pipe3(splitPathString(text, delimiter), forEachSequential((char) => primitive.parse(char.trim())), mapError(prefixed(
|
|
48657
|
+
return pipe3(splitPathString(text, delimiter), forEachSequential((char) => primitive.parse(char.trim())), mapError(prefixed(path5)));
|
|
48658
48658
|
}, transpose = (array5) => {
|
|
48659
48659
|
return Object.keys(array5[0]).map((column) => array5.map((row) => row[column]));
|
|
48660
48660
|
}, indicesFrom = (quotedIndices) => pipe3(forEachSequential(quotedIndices, parseQuotedIndex), mapBoth({
|
|
@@ -57031,8 +57031,8 @@ class Pointer {
|
|
|
57031
57031
|
actual;
|
|
57032
57032
|
issue;
|
|
57033
57033
|
_tag = "Pointer";
|
|
57034
|
-
constructor(
|
|
57035
|
-
this.path =
|
|
57034
|
+
constructor(path5, actual, issue3) {
|
|
57035
|
+
this.path = path5;
|
|
57036
57036
|
this.actual = actual;
|
|
57037
57037
|
this.issue = issue3;
|
|
57038
57038
|
}
|
|
@@ -58937,14 +58937,14 @@ var init_memory = __esm(() => {
|
|
|
58937
58937
|
// src/memory-tools.ts
|
|
58938
58938
|
import { getSwarmMailLibSQL as getSwarmMailLibSQL5, createEvent as createEvent4, appendEvent as appendEvent3 } from "swarm-mail";
|
|
58939
58939
|
async function getMemoryAdapter(projectPath) {
|
|
58940
|
-
const
|
|
58941
|
-
if (cachedAdapter && cachedProjectPath ===
|
|
58940
|
+
const path5 = projectPath || process.cwd();
|
|
58941
|
+
if (cachedAdapter && cachedProjectPath === path5) {
|
|
58942
58942
|
return cachedAdapter;
|
|
58943
58943
|
}
|
|
58944
|
-
const swarmMail = await getSwarmMailLibSQL5(
|
|
58944
|
+
const swarmMail = await getSwarmMailLibSQL5(path5);
|
|
58945
58945
|
const dbAdapter = await swarmMail.getDatabase();
|
|
58946
58946
|
cachedAdapter = await createMemoryAdapter(dbAdapter);
|
|
58947
|
-
cachedProjectPath =
|
|
58947
|
+
cachedProjectPath = path5;
|
|
58948
58948
|
return cachedAdapter;
|
|
58949
58949
|
}
|
|
58950
58950
|
var cachedAdapter = null, cachedProjectPath = null, semantic_memory_store, semantic_memory_find, semantic_memory_get, semantic_memory_remove, semantic_memory_validate, semantic_memory_list, semantic_memory_stats, semantic_memory_check, semantic_memory_upsert;
|
|
@@ -59748,17 +59748,17 @@ var require_visit = __commonJS((exports) => {
|
|
|
59748
59748
|
visit.BREAK = BREAK;
|
|
59749
59749
|
visit.SKIP = SKIP;
|
|
59750
59750
|
visit.REMOVE = REMOVE;
|
|
59751
|
-
function visit_(key, node, visitor,
|
|
59752
|
-
const ctrl = callVisitor(key, node, visitor,
|
|
59751
|
+
function visit_(key, node, visitor, path5) {
|
|
59752
|
+
const ctrl = callVisitor(key, node, visitor, path5);
|
|
59753
59753
|
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
|
59754
|
-
replaceNode(key,
|
|
59755
|
-
return visit_(key, ctrl, visitor,
|
|
59754
|
+
replaceNode(key, path5, ctrl);
|
|
59755
|
+
return visit_(key, ctrl, visitor, path5);
|
|
59756
59756
|
}
|
|
59757
59757
|
if (typeof ctrl !== "symbol") {
|
|
59758
59758
|
if (identity2.isCollection(node)) {
|
|
59759
|
-
|
|
59759
|
+
path5 = Object.freeze(path5.concat(node));
|
|
59760
59760
|
for (let i = 0;i < node.items.length; ++i) {
|
|
59761
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
59761
|
+
const ci = visit_(i, node.items[i], visitor, path5);
|
|
59762
59762
|
if (typeof ci === "number")
|
|
59763
59763
|
i = ci - 1;
|
|
59764
59764
|
else if (ci === BREAK)
|
|
@@ -59769,13 +59769,13 @@ var require_visit = __commonJS((exports) => {
|
|
|
59769
59769
|
}
|
|
59770
59770
|
}
|
|
59771
59771
|
} else if (identity2.isPair(node)) {
|
|
59772
|
-
|
|
59773
|
-
const ck = visit_("key", node.key, visitor,
|
|
59772
|
+
path5 = Object.freeze(path5.concat(node));
|
|
59773
|
+
const ck = visit_("key", node.key, visitor, path5);
|
|
59774
59774
|
if (ck === BREAK)
|
|
59775
59775
|
return BREAK;
|
|
59776
59776
|
else if (ck === REMOVE)
|
|
59777
59777
|
node.key = null;
|
|
59778
|
-
const cv = visit_("value", node.value, visitor,
|
|
59778
|
+
const cv = visit_("value", node.value, visitor, path5);
|
|
59779
59779
|
if (cv === BREAK)
|
|
59780
59780
|
return BREAK;
|
|
59781
59781
|
else if (cv === REMOVE)
|
|
@@ -59796,17 +59796,17 @@ var require_visit = __commonJS((exports) => {
|
|
|
59796
59796
|
visitAsync.BREAK = BREAK;
|
|
59797
59797
|
visitAsync.SKIP = SKIP;
|
|
59798
59798
|
visitAsync.REMOVE = REMOVE;
|
|
59799
|
-
async function visitAsync_(key, node, visitor,
|
|
59800
|
-
const ctrl = await callVisitor(key, node, visitor,
|
|
59799
|
+
async function visitAsync_(key, node, visitor, path5) {
|
|
59800
|
+
const ctrl = await callVisitor(key, node, visitor, path5);
|
|
59801
59801
|
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
|
59802
|
-
replaceNode(key,
|
|
59803
|
-
return visitAsync_(key, ctrl, visitor,
|
|
59802
|
+
replaceNode(key, path5, ctrl);
|
|
59803
|
+
return visitAsync_(key, ctrl, visitor, path5);
|
|
59804
59804
|
}
|
|
59805
59805
|
if (typeof ctrl !== "symbol") {
|
|
59806
59806
|
if (identity2.isCollection(node)) {
|
|
59807
|
-
|
|
59807
|
+
path5 = Object.freeze(path5.concat(node));
|
|
59808
59808
|
for (let i = 0;i < node.items.length; ++i) {
|
|
59809
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
59809
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path5);
|
|
59810
59810
|
if (typeof ci === "number")
|
|
59811
59811
|
i = ci - 1;
|
|
59812
59812
|
else if (ci === BREAK)
|
|
@@ -59817,13 +59817,13 @@ var require_visit = __commonJS((exports) => {
|
|
|
59817
59817
|
}
|
|
59818
59818
|
}
|
|
59819
59819
|
} else if (identity2.isPair(node)) {
|
|
59820
|
-
|
|
59821
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
59820
|
+
path5 = Object.freeze(path5.concat(node));
|
|
59821
|
+
const ck = await visitAsync_("key", node.key, visitor, path5);
|
|
59822
59822
|
if (ck === BREAK)
|
|
59823
59823
|
return BREAK;
|
|
59824
59824
|
else if (ck === REMOVE)
|
|
59825
59825
|
node.key = null;
|
|
59826
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
59826
|
+
const cv = await visitAsync_("value", node.value, visitor, path5);
|
|
59827
59827
|
if (cv === BREAK)
|
|
59828
59828
|
return BREAK;
|
|
59829
59829
|
else if (cv === REMOVE)
|
|
@@ -59850,23 +59850,23 @@ var require_visit = __commonJS((exports) => {
|
|
|
59850
59850
|
}
|
|
59851
59851
|
return visitor;
|
|
59852
59852
|
}
|
|
59853
|
-
function callVisitor(key, node, visitor,
|
|
59853
|
+
function callVisitor(key, node, visitor, path5) {
|
|
59854
59854
|
if (typeof visitor === "function")
|
|
59855
|
-
return visitor(key, node,
|
|
59855
|
+
return visitor(key, node, path5);
|
|
59856
59856
|
if (identity2.isMap(node))
|
|
59857
|
-
return visitor.Map?.(key, node,
|
|
59857
|
+
return visitor.Map?.(key, node, path5);
|
|
59858
59858
|
if (identity2.isSeq(node))
|
|
59859
|
-
return visitor.Seq?.(key, node,
|
|
59859
|
+
return visitor.Seq?.(key, node, path5);
|
|
59860
59860
|
if (identity2.isPair(node))
|
|
59861
|
-
return visitor.Pair?.(key, node,
|
|
59861
|
+
return visitor.Pair?.(key, node, path5);
|
|
59862
59862
|
if (identity2.isScalar(node))
|
|
59863
|
-
return visitor.Scalar?.(key, node,
|
|
59863
|
+
return visitor.Scalar?.(key, node, path5);
|
|
59864
59864
|
if (identity2.isAlias(node))
|
|
59865
|
-
return visitor.Alias?.(key, node,
|
|
59865
|
+
return visitor.Alias?.(key, node, path5);
|
|
59866
59866
|
return;
|
|
59867
59867
|
}
|
|
59868
|
-
function replaceNode(key,
|
|
59869
|
-
const parent =
|
|
59868
|
+
function replaceNode(key, path5, node) {
|
|
59869
|
+
const parent = path5[path5.length - 1];
|
|
59870
59870
|
if (identity2.isCollection(parent)) {
|
|
59871
59871
|
parent.items[key] = node;
|
|
59872
59872
|
} else if (identity2.isPair(parent)) {
|
|
@@ -60423,10 +60423,10 @@ var require_Collection = __commonJS((exports) => {
|
|
|
60423
60423
|
var createNode = require_createNode();
|
|
60424
60424
|
var identity2 = require_identity();
|
|
60425
60425
|
var Node = require_Node();
|
|
60426
|
-
function collectionFromPath(schema,
|
|
60426
|
+
function collectionFromPath(schema, path5, value) {
|
|
60427
60427
|
let v = value;
|
|
60428
|
-
for (let i =
|
|
60429
|
-
const k =
|
|
60428
|
+
for (let i = path5.length - 1;i >= 0; --i) {
|
|
60429
|
+
const k = path5[i];
|
|
60430
60430
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
60431
60431
|
const a = [];
|
|
60432
60432
|
a[k] = v;
|
|
@@ -60445,7 +60445,7 @@ var require_Collection = __commonJS((exports) => {
|
|
|
60445
60445
|
sourceObjects: new Map
|
|
60446
60446
|
});
|
|
60447
60447
|
}
|
|
60448
|
-
var isEmptyPath = (
|
|
60448
|
+
var isEmptyPath = (path5) => path5 == null || typeof path5 === "object" && !!path5[Symbol.iterator]().next().done;
|
|
60449
60449
|
|
|
60450
60450
|
class Collection extends Node.NodeBase {
|
|
60451
60451
|
constructor(type, schema) {
|
|
@@ -60466,11 +60466,11 @@ var require_Collection = __commonJS((exports) => {
|
|
|
60466
60466
|
copy3.range = this.range.slice();
|
|
60467
60467
|
return copy3;
|
|
60468
60468
|
}
|
|
60469
|
-
addIn(
|
|
60470
|
-
if (isEmptyPath(
|
|
60469
|
+
addIn(path5, value) {
|
|
60470
|
+
if (isEmptyPath(path5))
|
|
60471
60471
|
this.add(value);
|
|
60472
60472
|
else {
|
|
60473
|
-
const [key, ...rest] =
|
|
60473
|
+
const [key, ...rest] = path5;
|
|
60474
60474
|
const node = this.get(key, true);
|
|
60475
60475
|
if (identity2.isCollection(node))
|
|
60476
60476
|
node.addIn(rest, value);
|
|
@@ -60480,8 +60480,8 @@ var require_Collection = __commonJS((exports) => {
|
|
|
60480
60480
|
throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
|
|
60481
60481
|
}
|
|
60482
60482
|
}
|
|
60483
|
-
deleteIn(
|
|
60484
|
-
const [key, ...rest] =
|
|
60483
|
+
deleteIn(path5) {
|
|
60484
|
+
const [key, ...rest] = path5;
|
|
60485
60485
|
if (rest.length === 0)
|
|
60486
60486
|
return this.delete(key);
|
|
60487
60487
|
const node = this.get(key, true);
|
|
@@ -60490,8 +60490,8 @@ var require_Collection = __commonJS((exports) => {
|
|
|
60490
60490
|
else
|
|
60491
60491
|
throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
|
|
60492
60492
|
}
|
|
60493
|
-
getIn(
|
|
60494
|
-
const [key, ...rest] =
|
|
60493
|
+
getIn(path5, keepScalar) {
|
|
60494
|
+
const [key, ...rest] = path5;
|
|
60495
60495
|
const node = this.get(key, true);
|
|
60496
60496
|
if (rest.length === 0)
|
|
60497
60497
|
return !keepScalar && identity2.isScalar(node) ? node.value : node;
|
|
@@ -60506,15 +60506,15 @@ var require_Collection = __commonJS((exports) => {
|
|
|
60506
60506
|
return n == null || allowScalar && identity2.isScalar(n) && n.value == null && !n.commentBefore && !n.comment && !n.tag;
|
|
60507
60507
|
});
|
|
60508
60508
|
}
|
|
60509
|
-
hasIn(
|
|
60510
|
-
const [key, ...rest] =
|
|
60509
|
+
hasIn(path5) {
|
|
60510
|
+
const [key, ...rest] = path5;
|
|
60511
60511
|
if (rest.length === 0)
|
|
60512
60512
|
return this.has(key);
|
|
60513
60513
|
const node = this.get(key, true);
|
|
60514
60514
|
return identity2.isCollection(node) ? node.hasIn(rest) : false;
|
|
60515
60515
|
}
|
|
60516
|
-
setIn(
|
|
60517
|
-
const [key, ...rest] =
|
|
60516
|
+
setIn(path5, value) {
|
|
60517
|
+
const [key, ...rest] = path5;
|
|
60518
60518
|
if (rest.length === 0) {
|
|
60519
60519
|
this.set(key, value);
|
|
60520
60520
|
} else {
|
|
@@ -62896,9 +62896,9 @@ var require_Document = __commonJS((exports) => {
|
|
|
62896
62896
|
if (assertCollection(this.contents))
|
|
62897
62897
|
this.contents.add(value);
|
|
62898
62898
|
}
|
|
62899
|
-
addIn(
|
|
62899
|
+
addIn(path5, value) {
|
|
62900
62900
|
if (assertCollection(this.contents))
|
|
62901
|
-
this.contents.addIn(
|
|
62901
|
+
this.contents.addIn(path5, value);
|
|
62902
62902
|
}
|
|
62903
62903
|
createAlias(node, name) {
|
|
62904
62904
|
if (!node.anchor) {
|
|
@@ -62947,30 +62947,30 @@ var require_Document = __commonJS((exports) => {
|
|
|
62947
62947
|
delete(key) {
|
|
62948
62948
|
return assertCollection(this.contents) ? this.contents.delete(key) : false;
|
|
62949
62949
|
}
|
|
62950
|
-
deleteIn(
|
|
62951
|
-
if (Collection.isEmptyPath(
|
|
62950
|
+
deleteIn(path5) {
|
|
62951
|
+
if (Collection.isEmptyPath(path5)) {
|
|
62952
62952
|
if (this.contents == null)
|
|
62953
62953
|
return false;
|
|
62954
62954
|
this.contents = null;
|
|
62955
62955
|
return true;
|
|
62956
62956
|
}
|
|
62957
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
62957
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path5) : false;
|
|
62958
62958
|
}
|
|
62959
62959
|
get(key, keepScalar) {
|
|
62960
62960
|
return identity2.isCollection(this.contents) ? this.contents.get(key, keepScalar) : undefined;
|
|
62961
62961
|
}
|
|
62962
|
-
getIn(
|
|
62963
|
-
if (Collection.isEmptyPath(
|
|
62962
|
+
getIn(path5, keepScalar) {
|
|
62963
|
+
if (Collection.isEmptyPath(path5))
|
|
62964
62964
|
return !keepScalar && identity2.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
62965
|
-
return identity2.isCollection(this.contents) ? this.contents.getIn(
|
|
62965
|
+
return identity2.isCollection(this.contents) ? this.contents.getIn(path5, keepScalar) : undefined;
|
|
62966
62966
|
}
|
|
62967
62967
|
has(key) {
|
|
62968
62968
|
return identity2.isCollection(this.contents) ? this.contents.has(key) : false;
|
|
62969
62969
|
}
|
|
62970
|
-
hasIn(
|
|
62971
|
-
if (Collection.isEmptyPath(
|
|
62970
|
+
hasIn(path5) {
|
|
62971
|
+
if (Collection.isEmptyPath(path5))
|
|
62972
62972
|
return this.contents !== undefined;
|
|
62973
|
-
return identity2.isCollection(this.contents) ? this.contents.hasIn(
|
|
62973
|
+
return identity2.isCollection(this.contents) ? this.contents.hasIn(path5) : false;
|
|
62974
62974
|
}
|
|
62975
62975
|
set(key, value) {
|
|
62976
62976
|
if (this.contents == null) {
|
|
@@ -62979,13 +62979,13 @@ var require_Document = __commonJS((exports) => {
|
|
|
62979
62979
|
this.contents.set(key, value);
|
|
62980
62980
|
}
|
|
62981
62981
|
}
|
|
62982
|
-
setIn(
|
|
62983
|
-
if (Collection.isEmptyPath(
|
|
62982
|
+
setIn(path5, value) {
|
|
62983
|
+
if (Collection.isEmptyPath(path5)) {
|
|
62984
62984
|
this.contents = value;
|
|
62985
62985
|
} else if (this.contents == null) {
|
|
62986
|
-
this.contents = Collection.collectionFromPath(this.schema, Array.from(
|
|
62986
|
+
this.contents = Collection.collectionFromPath(this.schema, Array.from(path5), value);
|
|
62987
62987
|
} else if (assertCollection(this.contents)) {
|
|
62988
|
-
this.contents.setIn(
|
|
62988
|
+
this.contents.setIn(path5, value);
|
|
62989
62989
|
}
|
|
62990
62990
|
}
|
|
62991
62991
|
setSchema(version3, options2 = {}) {
|
|
@@ -64874,9 +64874,9 @@ var require_cst_visit = __commonJS((exports) => {
|
|
|
64874
64874
|
visit.BREAK = BREAK;
|
|
64875
64875
|
visit.SKIP = SKIP;
|
|
64876
64876
|
visit.REMOVE = REMOVE;
|
|
64877
|
-
visit.itemAtPath = (cst,
|
|
64877
|
+
visit.itemAtPath = (cst, path5) => {
|
|
64878
64878
|
let item = cst;
|
|
64879
|
-
for (const [field, index] of
|
|
64879
|
+
for (const [field, index] of path5) {
|
|
64880
64880
|
const tok = item?.[field];
|
|
64881
64881
|
if (tok && "items" in tok) {
|
|
64882
64882
|
item = tok.items[index];
|
|
@@ -64885,23 +64885,23 @@ var require_cst_visit = __commonJS((exports) => {
|
|
|
64885
64885
|
}
|
|
64886
64886
|
return item;
|
|
64887
64887
|
};
|
|
64888
|
-
visit.parentCollection = (cst,
|
|
64889
|
-
const parent = visit.itemAtPath(cst,
|
|
64890
|
-
const field =
|
|
64888
|
+
visit.parentCollection = (cst, path5) => {
|
|
64889
|
+
const parent = visit.itemAtPath(cst, path5.slice(0, -1));
|
|
64890
|
+
const field = path5[path5.length - 1][0];
|
|
64891
64891
|
const coll = parent?.[field];
|
|
64892
64892
|
if (coll && "items" in coll)
|
|
64893
64893
|
return coll;
|
|
64894
64894
|
throw new Error("Parent collection not found");
|
|
64895
64895
|
};
|
|
64896
|
-
function _visit(
|
|
64897
|
-
let ctrl = visitor(item,
|
|
64896
|
+
function _visit(path5, item, visitor) {
|
|
64897
|
+
let ctrl = visitor(item, path5);
|
|
64898
64898
|
if (typeof ctrl === "symbol")
|
|
64899
64899
|
return ctrl;
|
|
64900
64900
|
for (const field of ["key", "value"]) {
|
|
64901
64901
|
const token = item[field];
|
|
64902
64902
|
if (token && "items" in token) {
|
|
64903
64903
|
for (let i = 0;i < token.items.length; ++i) {
|
|
64904
|
-
const ci = _visit(Object.freeze(
|
|
64904
|
+
const ci = _visit(Object.freeze(path5.concat([[field, i]])), token.items[i], visitor);
|
|
64905
64905
|
if (typeof ci === "number")
|
|
64906
64906
|
i = ci - 1;
|
|
64907
64907
|
else if (ci === BREAK)
|
|
@@ -64912,10 +64912,10 @@ var require_cst_visit = __commonJS((exports) => {
|
|
|
64912
64912
|
}
|
|
64913
64913
|
}
|
|
64914
64914
|
if (typeof ctrl === "function" && field === "key")
|
|
64915
|
-
ctrl = ctrl(item,
|
|
64915
|
+
ctrl = ctrl(item, path5);
|
|
64916
64916
|
}
|
|
64917
64917
|
}
|
|
64918
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
64918
|
+
return typeof ctrl === "function" ? ctrl(item, path5) : ctrl;
|
|
64919
64919
|
}
|
|
64920
64920
|
exports.visit = visit;
|
|
64921
64921
|
});
|
|
@@ -66832,8 +66832,8 @@ var require_req = __commonJS((exports, module) => {
|
|
|
66832
66832
|
if (req.originalUrl) {
|
|
66833
66833
|
_req.url = req.originalUrl;
|
|
66834
66834
|
} else {
|
|
66835
|
-
const
|
|
66836
|
-
_req.url = typeof
|
|
66835
|
+
const path6 = req.path;
|
|
66836
|
+
_req.url = typeof path6 === "string" ? path6 : req.url ? req.url.path || req.url : undefined;
|
|
66837
66837
|
}
|
|
66838
66838
|
if (req.query) {
|
|
66839
66839
|
_req.query = req.query;
|
|
@@ -66989,14 +66989,14 @@ var require_redact = __commonJS((exports, module) => {
|
|
|
66989
66989
|
}
|
|
66990
66990
|
return obj;
|
|
66991
66991
|
}
|
|
66992
|
-
function parsePath(
|
|
66992
|
+
function parsePath(path6) {
|
|
66993
66993
|
const parts2 = [];
|
|
66994
66994
|
let current = "";
|
|
66995
66995
|
let inBrackets = false;
|
|
66996
66996
|
let inQuotes = false;
|
|
66997
66997
|
let quoteChar = "";
|
|
66998
|
-
for (let i = 0;i <
|
|
66999
|
-
const char =
|
|
66998
|
+
for (let i = 0;i < path6.length; i++) {
|
|
66999
|
+
const char = path6[i];
|
|
67000
67000
|
if (!inBrackets && char === ".") {
|
|
67001
67001
|
if (current) {
|
|
67002
67002
|
parts2.push(current);
|
|
@@ -67127,10 +67127,10 @@ var require_redact = __commonJS((exports, module) => {
|
|
|
67127
67127
|
return current;
|
|
67128
67128
|
}
|
|
67129
67129
|
function redactPaths(obj, paths, censor, remove7 = false) {
|
|
67130
|
-
for (const
|
|
67131
|
-
const parts2 = parsePath(
|
|
67130
|
+
for (const path6 of paths) {
|
|
67131
|
+
const parts2 = parsePath(path6);
|
|
67132
67132
|
if (parts2.includes("*")) {
|
|
67133
|
-
redactWildcardPath(obj, parts2, censor,
|
|
67133
|
+
redactWildcardPath(obj, parts2, censor, path6, remove7);
|
|
67134
67134
|
} else {
|
|
67135
67135
|
if (remove7) {
|
|
67136
67136
|
removeKey(obj, parts2);
|
|
@@ -67217,8 +67217,8 @@ var require_redact = __commonJS((exports, module) => {
|
|
|
67217
67217
|
}
|
|
67218
67218
|
} else {
|
|
67219
67219
|
if (afterWildcard.includes("*")) {
|
|
67220
|
-
const wrappedCensor = typeof censor === "function" ? (value,
|
|
67221
|
-
const fullPath = [...pathArray.slice(0, pathLength), ...
|
|
67220
|
+
const wrappedCensor = typeof censor === "function" ? (value, path6) => {
|
|
67221
|
+
const fullPath = [...pathArray.slice(0, pathLength), ...path6];
|
|
67222
67222
|
return censor(value, fullPath);
|
|
67223
67223
|
} : censor;
|
|
67224
67224
|
redactWildcardPath(current, afterWildcard, wrappedCensor, originalPath, remove7);
|
|
@@ -67255,8 +67255,8 @@ var require_redact = __commonJS((exports, module) => {
|
|
|
67255
67255
|
return null;
|
|
67256
67256
|
}
|
|
67257
67257
|
const pathStructure = new Map;
|
|
67258
|
-
for (const
|
|
67259
|
-
const parts2 = parsePath(
|
|
67258
|
+
for (const path6 of pathsToClone) {
|
|
67259
|
+
const parts2 = parsePath(path6);
|
|
67260
67260
|
let current = pathStructure;
|
|
67261
67261
|
for (let i = 0;i < parts2.length; i++) {
|
|
67262
67262
|
const part = parts2[i];
|
|
@@ -67308,24 +67308,24 @@ var require_redact = __commonJS((exports, module) => {
|
|
|
67308
67308
|
}
|
|
67309
67309
|
return cloneSelectively(obj, pathStructure);
|
|
67310
67310
|
}
|
|
67311
|
-
function validatePath(
|
|
67312
|
-
if (typeof
|
|
67311
|
+
function validatePath(path6) {
|
|
67312
|
+
if (typeof path6 !== "string") {
|
|
67313
67313
|
throw new Error("Paths must be (non-empty) strings");
|
|
67314
67314
|
}
|
|
67315
|
-
if (
|
|
67315
|
+
if (path6 === "") {
|
|
67316
67316
|
throw new Error("Invalid redaction path ()");
|
|
67317
67317
|
}
|
|
67318
|
-
if (
|
|
67319
|
-
throw new Error(`Invalid redaction path (${
|
|
67318
|
+
if (path6.includes("..")) {
|
|
67319
|
+
throw new Error(`Invalid redaction path (${path6})`);
|
|
67320
67320
|
}
|
|
67321
|
-
if (
|
|
67322
|
-
throw new Error(`Invalid redaction path (${
|
|
67321
|
+
if (path6.includes(",")) {
|
|
67322
|
+
throw new Error(`Invalid redaction path (${path6})`);
|
|
67323
67323
|
}
|
|
67324
67324
|
let bracketCount = 0;
|
|
67325
67325
|
let inQuotes = false;
|
|
67326
67326
|
let quoteChar = "";
|
|
67327
|
-
for (let i = 0;i <
|
|
67328
|
-
const char =
|
|
67327
|
+
for (let i = 0;i < path6.length; i++) {
|
|
67328
|
+
const char = path6[i];
|
|
67329
67329
|
if ((char === '"' || char === "'") && bracketCount > 0) {
|
|
67330
67330
|
if (!inQuotes) {
|
|
67331
67331
|
inQuotes = true;
|
|
@@ -67339,20 +67339,20 @@ var require_redact = __commonJS((exports, module) => {
|
|
|
67339
67339
|
} else if (char === "]" && !inQuotes) {
|
|
67340
67340
|
bracketCount--;
|
|
67341
67341
|
if (bracketCount < 0) {
|
|
67342
|
-
throw new Error(`Invalid redaction path (${
|
|
67342
|
+
throw new Error(`Invalid redaction path (${path6})`);
|
|
67343
67343
|
}
|
|
67344
67344
|
}
|
|
67345
67345
|
}
|
|
67346
67346
|
if (bracketCount !== 0) {
|
|
67347
|
-
throw new Error(`Invalid redaction path (${
|
|
67347
|
+
throw new Error(`Invalid redaction path (${path6})`);
|
|
67348
67348
|
}
|
|
67349
67349
|
}
|
|
67350
67350
|
function validatePaths(paths) {
|
|
67351
67351
|
if (!Array.isArray(paths)) {
|
|
67352
67352
|
throw new TypeError("paths must be an array");
|
|
67353
67353
|
}
|
|
67354
|
-
for (const
|
|
67355
|
-
validatePath(
|
|
67354
|
+
for (const path6 of paths) {
|
|
67355
|
+
validatePath(path6);
|
|
67356
67356
|
}
|
|
67357
67357
|
}
|
|
67358
67358
|
function slowRedact(options2 = {}) {
|
|
@@ -67514,8 +67514,8 @@ var require_redaction = __commonJS((exports, module) => {
|
|
|
67514
67514
|
if (shape[k] === null) {
|
|
67515
67515
|
o[k] = (value) => topCensor(value, [k]);
|
|
67516
67516
|
} else {
|
|
67517
|
-
const wrappedCensor = typeof censor === "function" ? (value,
|
|
67518
|
-
return censor(value, [k, ...
|
|
67517
|
+
const wrappedCensor = typeof censor === "function" ? (value, path6) => {
|
|
67518
|
+
return censor(value, [k, ...path6]);
|
|
67519
67519
|
} : censor;
|
|
67520
67520
|
o[k] = Redact({
|
|
67521
67521
|
paths: shape[k],
|
|
@@ -67726,7 +67726,7 @@ var require_sonic_boom = __commonJS((exports, module) => {
|
|
|
67726
67726
|
var fs2 = __require("fs");
|
|
67727
67727
|
var EventEmitter = __require("events");
|
|
67728
67728
|
var inherits = __require("util").inherits;
|
|
67729
|
-
var
|
|
67729
|
+
var path6 = __require("path");
|
|
67730
67730
|
var sleep5 = require_atomic_sleep();
|
|
67731
67731
|
var assert3 = __require("assert");
|
|
67732
67732
|
var BUSY_WRITE_TIMEOUT = 100;
|
|
@@ -67781,7 +67781,7 @@ var require_sonic_boom = __commonJS((exports, module) => {
|
|
|
67781
67781
|
if (sonic.sync) {
|
|
67782
67782
|
try {
|
|
67783
67783
|
if (sonic.mkdir)
|
|
67784
|
-
fs2.mkdirSync(
|
|
67784
|
+
fs2.mkdirSync(path6.dirname(file3), { recursive: true });
|
|
67785
67785
|
const fd = fs2.openSync(file3, flags, mode);
|
|
67786
67786
|
fileOpened(null, fd);
|
|
67787
67787
|
} catch (err) {
|
|
@@ -67789,7 +67789,7 @@ var require_sonic_boom = __commonJS((exports, module) => {
|
|
|
67789
67789
|
throw err;
|
|
67790
67790
|
}
|
|
67791
67791
|
} else if (sonic.mkdir) {
|
|
67792
|
-
fs2.mkdir(
|
|
67792
|
+
fs2.mkdir(path6.dirname(file3), { recursive: true }, (err) => {
|
|
67793
67793
|
if (err)
|
|
67794
67794
|
return fileOpened(err);
|
|
67795
67795
|
fs2.open(file3, flags, mode, fileOpened);
|
|
@@ -68515,7 +68515,7 @@ var require_indexes = __commonJS((exports, module) => {
|
|
|
68515
68515
|
|
|
68516
68516
|
// ../../node_modules/thread-stream/index.js
|
|
68517
68517
|
var require_thread_stream = __commonJS((exports, module) => {
|
|
68518
|
-
var __dirname = "/home/runner/work/swarm
|
|
68518
|
+
var __dirname = "/home/runner/work/swarm/swarm/node_modules/thread-stream";
|
|
68519
68519
|
var { version: version3 } = require_package();
|
|
68520
68520
|
var { EventEmitter } = __require("events");
|
|
68521
68521
|
var { Worker } = __require("worker_threads");
|
|
@@ -68936,10 +68936,10 @@ var require_thread_stream = __commonJS((exports, module) => {
|
|
|
68936
68936
|
|
|
68937
68937
|
// ../../node_modules/pino/lib/transport.js
|
|
68938
68938
|
var require_transport = __commonJS((exports, module) => {
|
|
68939
|
-
var __dirname = "/home/runner/work/swarm
|
|
68939
|
+
var __dirname = "/home/runner/work/swarm/swarm/node_modules/pino/lib";
|
|
68940
68940
|
var { createRequire: createRequire2 } = __require("module");
|
|
68941
68941
|
var getCallers = require_caller();
|
|
68942
|
-
var { join: join13, isAbsolute:
|
|
68942
|
+
var { join: join13, isAbsolute: isAbsolute3, sep: sep4 } = __require("node:path");
|
|
68943
68943
|
var sleep5 = require_atomic_sleep();
|
|
68944
68944
|
var onExit4 = require_on_exit_leak_free();
|
|
68945
68945
|
var ThreadStream = require_thread_stream();
|
|
@@ -69037,7 +69037,7 @@ var require_transport = __commonJS((exports, module) => {
|
|
|
69037
69037
|
return buildStream(fixTarget(target), options2, worker, sync4);
|
|
69038
69038
|
function fixTarget(origin) {
|
|
69039
69039
|
origin = bundlerOverrides[origin] || origin;
|
|
69040
|
-
if (
|
|
69040
|
+
if (isAbsolute3(origin) || origin.indexOf("file://") === 0) {
|
|
69041
69041
|
return origin;
|
|
69042
69042
|
}
|
|
69043
69043
|
if (origin === "pino/file") {
|
|
@@ -70642,11 +70642,11 @@ var require_pino = __commonJS((exports, module) => {
|
|
|
70642
70642
|
depthLimit: 5,
|
|
70643
70643
|
edgeLimit: 100
|
|
70644
70644
|
};
|
|
70645
|
-
var
|
|
70645
|
+
var normalize3 = createArgsNormalizer(defaultOptions);
|
|
70646
70646
|
var serializers = Object.assign(Object.create(null), stdSerializers);
|
|
70647
70647
|
function pino(...args2) {
|
|
70648
70648
|
const instance = {};
|
|
70649
|
-
const { opts, stream } =
|
|
70649
|
+
const { opts, stream } = normalize3(instance, caller(), ...args2);
|
|
70650
70650
|
if (opts.level && typeof opts.level === "string" && DEFAULT_LEVELS[opts.level.toLowerCase()] !== undefined)
|
|
70651
70651
|
opts.level = opts.level.toLowerCase();
|
|
70652
70652
|
const {
|
|
@@ -70779,32 +70779,401 @@ import {
|
|
|
70779
70779
|
findCellsByPartialId
|
|
70780
70780
|
} from "swarm-mail";
|
|
70781
70781
|
|
|
70782
|
-
//
|
|
70783
|
-
|
|
70784
|
-
|
|
70785
|
-
|
|
70782
|
+
// ../cross-path/dist/normalize.js
|
|
70783
|
+
import path2 from "node:path";
|
|
70784
|
+
|
|
70785
|
+
// ../cross-path/dist/detect.js
|
|
70786
|
+
var cachedEnvironment = null;
|
|
70787
|
+
function detectEnvironment() {
|
|
70788
|
+
if (cachedEnvironment !== null) {
|
|
70789
|
+
return cachedEnvironment;
|
|
70790
|
+
}
|
|
70791
|
+
const platform = process.platform;
|
|
70792
|
+
if (platform === "win32") {
|
|
70793
|
+
cachedEnvironment = "windows";
|
|
70794
|
+
return cachedEnvironment;
|
|
70795
|
+
}
|
|
70796
|
+
if (platform === "darwin") {
|
|
70797
|
+
cachedEnvironment = "darwin";
|
|
70798
|
+
return cachedEnvironment;
|
|
70799
|
+
}
|
|
70800
|
+
if (platform === "linux") {
|
|
70801
|
+
if (process.env.WSL_DISTRO_NAME || process.env.WSLENV) {
|
|
70802
|
+
cachedEnvironment = "wsl";
|
|
70803
|
+
return cachedEnvironment;
|
|
70804
|
+
}
|
|
70805
|
+
const msystem = process.env.MSYSTEM;
|
|
70806
|
+
if (msystem && (msystem.includes("MINGW") || msystem.includes("MSYS"))) {
|
|
70807
|
+
cachedEnvironment = "git-bash";
|
|
70808
|
+
return cachedEnvironment;
|
|
70809
|
+
}
|
|
70810
|
+
if (process.env.CYGWIN) {
|
|
70811
|
+
cachedEnvironment = "cygwin";
|
|
70812
|
+
return cachedEnvironment;
|
|
70813
|
+
}
|
|
70814
|
+
cachedEnvironment = "linux";
|
|
70815
|
+
return cachedEnvironment;
|
|
70816
|
+
}
|
|
70817
|
+
cachedEnvironment = "linux";
|
|
70818
|
+
return cachedEnvironment;
|
|
70819
|
+
}
|
|
70820
|
+
|
|
70821
|
+
// ../cross-path/dist/validate.js
|
|
70822
|
+
import path from "node:path";
|
|
70823
|
+
function isAbsolute(inputPath) {
|
|
70824
|
+
return path.win32.isAbsolute(inputPath) || path.posix.isAbsolute(inputPath);
|
|
70825
|
+
}
|
|
70826
|
+
function isUNC(inputPath) {
|
|
70827
|
+
const normalized = inputPath.replace(/\\/g, "/");
|
|
70828
|
+
if (normalized.length < 3) {
|
|
70829
|
+
return false;
|
|
70830
|
+
}
|
|
70831
|
+
if (!normalized.startsWith("//")) {
|
|
70832
|
+
return false;
|
|
70833
|
+
}
|
|
70834
|
+
if (normalized[2] === "/") {
|
|
70835
|
+
return false;
|
|
70786
70836
|
}
|
|
70787
|
-
|
|
70788
|
-
|
|
70789
|
-
|
|
70790
|
-
return normalized;
|
|
70837
|
+
const afterPrefix = normalized.substring(2);
|
|
70838
|
+
const hasValidServerPart = /^[^\s\/]+/.test(afterPrefix);
|
|
70839
|
+
return hasValidServerPart;
|
|
70791
70840
|
}
|
|
70792
|
-
function
|
|
70793
|
-
|
|
70841
|
+
function isWSLMount(inputPath) {
|
|
70842
|
+
const wslMountPattern = /^\/mnt\/[a-z](\/|$)/i;
|
|
70843
|
+
return wslMountPattern.test(inputPath);
|
|
70794
70844
|
}
|
|
70795
|
-
function
|
|
70796
|
-
|
|
70845
|
+
function isGitBashMount(inputPath) {
|
|
70846
|
+
const gitBashPattern = /^\/[a-z]\//i;
|
|
70847
|
+
return gitBashPattern.test(inputPath);
|
|
70797
70848
|
}
|
|
70798
|
-
function
|
|
70799
|
-
const
|
|
70800
|
-
|
|
70801
|
-
|
|
70849
|
+
function hasDriveLetter(inputPath) {
|
|
70850
|
+
const driveLetterPattern = /^[A-Za-z]:/;
|
|
70851
|
+
return driveLetterPattern.test(inputPath);
|
|
70852
|
+
}
|
|
70853
|
+
function parseWSLUNC(inputPath) {
|
|
70854
|
+
const normalized = inputPath.replace(/\\/g, "/");
|
|
70855
|
+
const wslUNCPattern = /^\/\/(wsl\.localhost|wsl\$)\/([^/]+)(\/.*)?$/i;
|
|
70856
|
+
const match = normalized.match(wslUNCPattern);
|
|
70857
|
+
if (!match) {
|
|
70858
|
+
return null;
|
|
70859
|
+
}
|
|
70860
|
+
const distro = match[2];
|
|
70861
|
+
const restPath = match[3] || "/";
|
|
70862
|
+
return { distro, path: restPath };
|
|
70863
|
+
}
|
|
70864
|
+
function isDriveRelative(inputPath) {
|
|
70865
|
+
if (inputPath.length < 3) {
|
|
70866
|
+
return false;
|
|
70867
|
+
}
|
|
70868
|
+
const hasLetter = /^[A-Za-z]$/.test(inputPath[0]);
|
|
70869
|
+
const hasColon = inputPath[1] === ":";
|
|
70870
|
+
const notSlash = inputPath[2] !== "/" && inputPath[2] !== "\\";
|
|
70871
|
+
return hasLetter && hasColon && notSlash;
|
|
70872
|
+
}
|
|
70873
|
+
|
|
70874
|
+
// ../cross-path/dist/normalize.js
|
|
70875
|
+
function normalize(inputPath, options2) {
|
|
70876
|
+
if (inputPath === null || inputPath === undefined) {
|
|
70877
|
+
throw new TypeError("Path cannot be null or undefined");
|
|
70878
|
+
}
|
|
70879
|
+
if (typeof inputPath !== "string") {
|
|
70880
|
+
throw new TypeError(`Path must be a string, received ${typeof inputPath}`);
|
|
70881
|
+
}
|
|
70882
|
+
if (inputPath.length === 0) {
|
|
70883
|
+
throw new TypeError("Path cannot be empty");
|
|
70884
|
+
}
|
|
70885
|
+
if (inputPath.includes("\x00")) {
|
|
70886
|
+
throw new TypeError("Path cannot contain null bytes");
|
|
70887
|
+
}
|
|
70888
|
+
const env = options2?.env ?? detectEnvironment();
|
|
70889
|
+
const wslUNCInfo = parseWSLUNC(inputPath);
|
|
70890
|
+
if (wslUNCInfo) {
|
|
70891
|
+
const currentDistro = process.env.WSL_DISTRO_NAME;
|
|
70892
|
+
if (env === "wsl" && currentDistro && wslUNCInfo.distro.toLowerCase() === currentDistro.toLowerCase()) {
|
|
70893
|
+
return path2.posix.normalize(wslUNCInfo.path);
|
|
70894
|
+
}
|
|
70895
|
+
}
|
|
70896
|
+
let intermediate = inputPath.replace(/\\/g, "/");
|
|
70897
|
+
const originalIsUNC = isUNC(intermediate);
|
|
70898
|
+
if (isWSLMount(intermediate)) {
|
|
70899
|
+
const driveLetter = intermediate.charAt(5).toLowerCase();
|
|
70900
|
+
intermediate = `${driveLetter}:${intermediate.substring(6)}`;
|
|
70901
|
+
if (intermediate.length === 2) {
|
|
70902
|
+
intermediate = `${driveLetter}:/`;
|
|
70903
|
+
}
|
|
70904
|
+
} else if (isGitBashMount(intermediate)) {
|
|
70905
|
+
const driveLetter = intermediate.charAt(1).toLowerCase();
|
|
70906
|
+
intermediate = `${driveLetter}:${intermediate.substring(2)}`;
|
|
70907
|
+
}
|
|
70908
|
+
const hasWindowsDrive = hasDriveLetter(intermediate);
|
|
70909
|
+
const isAbsolutePath = isAbsolute(intermediate);
|
|
70910
|
+
const driveRelative = isDriveRelative(intermediate);
|
|
70911
|
+
if (!isAbsolutePath && !hasWindowsDrive) {
|
|
70912
|
+
const basePath = options2?.basePath ?? process.cwd();
|
|
70913
|
+
const normalizedBase = basePath.replace(/\\/g, "/");
|
|
70914
|
+
if (hasDriveLetter(normalizedBase)) {
|
|
70915
|
+
const drive = normalizedBase.substring(0, 2);
|
|
70916
|
+
const baseRest = normalizedBase.substring(2) || "/";
|
|
70917
|
+
const resolved = path2.posix.resolve(baseRest, intermediate);
|
|
70918
|
+
intermediate = drive + resolved;
|
|
70919
|
+
} else {
|
|
70920
|
+
intermediate = path2.posix.resolve(normalizedBase, intermediate);
|
|
70921
|
+
}
|
|
70922
|
+
} else if (driveRelative) {
|
|
70923
|
+
const pathDrive = intermediate.substring(0, 2).toLowerCase();
|
|
70924
|
+
const pathRest = intermediate.substring(2);
|
|
70925
|
+
const basePath = options2?.basePath ?? process.cwd();
|
|
70926
|
+
const normalizedBase = basePath.replace(/\\/g, "/");
|
|
70927
|
+
if (hasDriveLetter(normalizedBase)) {
|
|
70928
|
+
const baseDrive = normalizedBase.substring(0, 2).toLowerCase();
|
|
70929
|
+
if (baseDrive === pathDrive) {
|
|
70930
|
+
const baseRest = normalizedBase.substring(2) || "/";
|
|
70931
|
+
const resolved = path2.posix.resolve(baseRest, pathRest);
|
|
70932
|
+
intermediate = pathDrive + resolved;
|
|
70933
|
+
} else {
|
|
70934
|
+
intermediate = pathDrive + "/" + pathRest;
|
|
70935
|
+
}
|
|
70936
|
+
} else {
|
|
70937
|
+
intermediate = pathDrive + "/" + pathRest;
|
|
70938
|
+
}
|
|
70939
|
+
}
|
|
70940
|
+
if (originalIsUNC || isUNC(intermediate)) {
|
|
70941
|
+
const withoutPrefix = intermediate.substring(2);
|
|
70942
|
+
const normalizedRest = path2.posix.normalize(withoutPrefix);
|
|
70943
|
+
intermediate = "//" + normalizedRest;
|
|
70944
|
+
} else if (hasWindowsDrive || hasDriveLetter(intermediate)) {
|
|
70945
|
+
const drive = intermediate.substring(0, 2);
|
|
70946
|
+
let rest = intermediate.substring(2);
|
|
70947
|
+
if (!rest.startsWith("/")) {
|
|
70948
|
+
rest = "/" + rest;
|
|
70949
|
+
}
|
|
70950
|
+
const normalizedRest = path2.posix.normalize(rest);
|
|
70951
|
+
intermediate = drive + normalizedRest;
|
|
70802
70952
|
} else {
|
|
70803
|
-
|
|
70953
|
+
intermediate = path2.posix.normalize(intermediate);
|
|
70954
|
+
}
|
|
70955
|
+
const finalHasDrive = hasDriveLetter(intermediate);
|
|
70956
|
+
const finalIsUNC = isUNC(intermediate);
|
|
70957
|
+
if (finalHasDrive || finalIsUNC) {
|
|
70958
|
+
intermediate = intermediate.toLowerCase();
|
|
70959
|
+
const segments = intermediate.split("/");
|
|
70960
|
+
const normalizedSegments = segments.map((segment, index) => {
|
|
70961
|
+
if (index === 0 || segment === "") {
|
|
70962
|
+
return segment;
|
|
70963
|
+
}
|
|
70964
|
+
return segment.replace(/[\s.]+$/, "");
|
|
70965
|
+
});
|
|
70966
|
+
intermediate = normalizedSegments.join("/");
|
|
70967
|
+
}
|
|
70968
|
+
if (intermediate.length > 1 && intermediate.endsWith("/")) {
|
|
70969
|
+
const isWindowsRoot = finalHasDrive && intermediate.length === 3;
|
|
70970
|
+
const isPosixRoot = intermediate === "/";
|
|
70971
|
+
const isUNCRoot = finalIsUNC && intermediate.split("/").filter(Boolean).length <= 2;
|
|
70972
|
+
if (!isWindowsRoot && !isPosixRoot && !isUNCRoot) {
|
|
70973
|
+
intermediate = intermediate.slice(0, -1);
|
|
70974
|
+
}
|
|
70975
|
+
}
|
|
70976
|
+
if (finalHasDrive && intermediate.length === 2) {
|
|
70977
|
+
intermediate = intermediate + "/";
|
|
70978
|
+
}
|
|
70979
|
+
return intermediate;
|
|
70980
|
+
}
|
|
70981
|
+
function normalizePaths(paths, options2) {
|
|
70982
|
+
return paths.map((p) => normalize(p, options2));
|
|
70983
|
+
}
|
|
70984
|
+
// src/utils/arg-normalizer.ts
|
|
70985
|
+
function toPlainObject(value) {
|
|
70986
|
+
if (typeof value === "string") {
|
|
70987
|
+
try {
|
|
70988
|
+
const parsed = JSON.parse(value);
|
|
70989
|
+
if (parsed && typeof parsed === "object")
|
|
70990
|
+
return parsed;
|
|
70991
|
+
} catch {
|
|
70992
|
+
return { title: value };
|
|
70993
|
+
}
|
|
70994
|
+
}
|
|
70995
|
+
if (value && typeof value === "object")
|
|
70996
|
+
return value;
|
|
70997
|
+
return {};
|
|
70998
|
+
}
|
|
70999
|
+
function coerceBoolean(v) {
|
|
71000
|
+
if (typeof v === "boolean")
|
|
71001
|
+
return v;
|
|
71002
|
+
if (typeof v === "string") {
|
|
71003
|
+
const s = v.trim().toLowerCase();
|
|
71004
|
+
if (["true", "t", "1", "yes", "y"].includes(s))
|
|
71005
|
+
return true;
|
|
71006
|
+
if (["false", "f", "0", "no", "n"].includes(s))
|
|
71007
|
+
return false;
|
|
70804
71008
|
}
|
|
71009
|
+
if (typeof v === "number")
|
|
71010
|
+
return v !== 0;
|
|
71011
|
+
return;
|
|
70805
71012
|
}
|
|
70806
|
-
function
|
|
70807
|
-
|
|
71013
|
+
function coerceNumber(v) {
|
|
71014
|
+
if (typeof v === "number" && Number.isFinite(v))
|
|
71015
|
+
return v;
|
|
71016
|
+
if (typeof v === "string") {
|
|
71017
|
+
const n = Number(v);
|
|
71018
|
+
if (!Number.isNaN(n))
|
|
71019
|
+
return n;
|
|
71020
|
+
}
|
|
71021
|
+
return;
|
|
71022
|
+
}
|
|
71023
|
+
function normalizeStatus(v) {
|
|
71024
|
+
if (typeof v !== "string")
|
|
71025
|
+
return;
|
|
71026
|
+
const s = v.trim().toLowerCase().replace(/\s+/g, "_").replace(/-+/g, "_");
|
|
71027
|
+
const allowed = new Set(["open", "in_progress", "blocked", "closed"]);
|
|
71028
|
+
if (allowed.has(s))
|
|
71029
|
+
return s;
|
|
71030
|
+
return;
|
|
71031
|
+
}
|
|
71032
|
+
function normalizeType(v) {
|
|
71033
|
+
if (typeof v !== "string")
|
|
71034
|
+
return;
|
|
71035
|
+
const s = v.trim().toLowerCase();
|
|
71036
|
+
const allowed = new Set(["bug", "feature", "task", "epic", "chore"]);
|
|
71037
|
+
if (allowed.has(s))
|
|
71038
|
+
return s;
|
|
71039
|
+
return;
|
|
71040
|
+
}
|
|
71041
|
+
function pick2(obj, keys) {
|
|
71042
|
+
const out = {};
|
|
71043
|
+
for (const k of keys)
|
|
71044
|
+
if (k in obj)
|
|
71045
|
+
out[k] = obj[k];
|
|
71046
|
+
return out;
|
|
71047
|
+
}
|
|
71048
|
+
function aliasCommonKeys(obj) {
|
|
71049
|
+
const out = { ...obj };
|
|
71050
|
+
const move = (from, to) => {
|
|
71051
|
+
if (out[from] !== undefined && out[to] === undefined) {
|
|
71052
|
+
out[to] = out[from];
|
|
71053
|
+
delete out[from];
|
|
71054
|
+
}
|
|
71055
|
+
};
|
|
71056
|
+
move("cell_id", "id");
|
|
71057
|
+
move("bead_id", "id");
|
|
71058
|
+
move("beadId", "id");
|
|
71059
|
+
move("parentId", "parent_id");
|
|
71060
|
+
move("issue_type", "type");
|
|
71061
|
+
move("issueType", "type");
|
|
71062
|
+
move("kind", "type");
|
|
71063
|
+
move("epicTitle", "epic_title");
|
|
71064
|
+
move("epicDescription", "epic_description");
|
|
71065
|
+
move("subTasks", "subtasks");
|
|
71066
|
+
move("tasks", "subtasks");
|
|
71067
|
+
move("items", "subtasks");
|
|
71068
|
+
move("idSuffix", "id_suffix");
|
|
71069
|
+
return out;
|
|
71070
|
+
}
|
|
71071
|
+
function normalizeCreateArgs(raw) {
|
|
71072
|
+
const obj = aliasCommonKeys(toPlainObject(raw));
|
|
71073
|
+
if (typeof raw === "string" && !obj.title)
|
|
71074
|
+
obj.title = String(raw);
|
|
71075
|
+
if (obj.priority !== undefined)
|
|
71076
|
+
obj.priority = coerceNumber(obj.priority);
|
|
71077
|
+
if (obj.type !== undefined)
|
|
71078
|
+
obj.type = normalizeType(obj.type) ?? obj.type;
|
|
71079
|
+
if (obj.parent_id !== undefined)
|
|
71080
|
+
obj.parent_id = String(obj.parent_id);
|
|
71081
|
+
return pick2(obj, ["title", "type", "priority", "description", "parent_id"]);
|
|
71082
|
+
}
|
|
71083
|
+
function normalizeUpdateArgs(raw) {
|
|
71084
|
+
const obj = aliasCommonKeys(toPlainObject(raw));
|
|
71085
|
+
if (obj.status !== undefined)
|
|
71086
|
+
obj.status = normalizeStatus(obj.status) ?? obj.status;
|
|
71087
|
+
if (obj.priority !== undefined)
|
|
71088
|
+
obj.priority = coerceNumber(obj.priority);
|
|
71089
|
+
if (obj.description !== undefined && obj.description != null)
|
|
71090
|
+
obj.description = String(obj.description);
|
|
71091
|
+
if (obj.id !== undefined)
|
|
71092
|
+
obj.id = String(obj.id);
|
|
71093
|
+
return pick2(obj, ["id", "status", "description", "priority"]);
|
|
71094
|
+
}
|
|
71095
|
+
function normalizeCloseArgs(raw) {
|
|
71096
|
+
const obj = aliasCommonKeys(toPlainObject(raw));
|
|
71097
|
+
if (obj.id !== undefined)
|
|
71098
|
+
obj.id = String(obj.id);
|
|
71099
|
+
if (obj.reason !== undefined)
|
|
71100
|
+
obj.reason = String(obj.reason);
|
|
71101
|
+
return pick2(obj, ["id", "reason"]);
|
|
71102
|
+
}
|
|
71103
|
+
function normalizeQueryArgs(raw) {
|
|
71104
|
+
const obj = aliasCommonKeys(toPlainObject(raw));
|
|
71105
|
+
if (obj.status !== undefined)
|
|
71106
|
+
obj.status = normalizeStatus(obj.status) ?? obj.status;
|
|
71107
|
+
if (obj.type !== undefined)
|
|
71108
|
+
obj.type = normalizeType(obj.type) ?? obj.type;
|
|
71109
|
+
if (obj.ready !== undefined)
|
|
71110
|
+
obj.ready = coerceBoolean(obj.ready);
|
|
71111
|
+
if (obj.parent_id !== undefined)
|
|
71112
|
+
obj.parent_id = String(obj.parent_id);
|
|
71113
|
+
if (obj.limit !== undefined)
|
|
71114
|
+
obj.limit = coerceNumber(obj.limit);
|
|
71115
|
+
return pick2(obj, ["status", "type", "ready", "parent_id", "limit"]);
|
|
71116
|
+
}
|
|
71117
|
+
function normalizeCellsArgs(raw) {
|
|
71118
|
+
const obj = aliasCommonKeys(toPlainObject(raw));
|
|
71119
|
+
if (obj.id !== undefined)
|
|
71120
|
+
obj.id = String(obj.id);
|
|
71121
|
+
if (obj.status !== undefined)
|
|
71122
|
+
obj.status = normalizeStatus(obj.status) ?? obj.status;
|
|
71123
|
+
if (obj.type !== undefined)
|
|
71124
|
+
obj.type = normalizeType(obj.type) ?? obj.type;
|
|
71125
|
+
if (obj.parent_id !== undefined)
|
|
71126
|
+
obj.parent_id = String(obj.parent_id);
|
|
71127
|
+
if (obj.ready !== undefined)
|
|
71128
|
+
obj.ready = coerceBoolean(obj.ready);
|
|
71129
|
+
if (obj.limit !== undefined)
|
|
71130
|
+
obj.limit = coerceNumber(obj.limit);
|
|
71131
|
+
return pick2(obj, ["id", "status", "type", "parent_id", "ready", "limit"]);
|
|
71132
|
+
}
|
|
71133
|
+
function normalizeEpicCreateArgs(raw) {
|
|
71134
|
+
const obj0 = aliasCommonKeys(toPlainObject(raw));
|
|
71135
|
+
const obj = { ...obj0 };
|
|
71136
|
+
if (obj.subtasks !== undefined && !Array.isArray(obj.subtasks)) {
|
|
71137
|
+
if (typeof obj.subtasks === "string")
|
|
71138
|
+
obj.subtasks = obj.subtasks.split(/[,\n]/).map((s) => ({ title: s.trim() })).filter((x) => x.title);
|
|
71139
|
+
else if (obj.subtasks && typeof obj.subtasks === "object")
|
|
71140
|
+
obj.subtasks = [obj.subtasks];
|
|
71141
|
+
}
|
|
71142
|
+
if (Array.isArray(obj.subtasks)) {
|
|
71143
|
+
obj.subtasks = obj.subtasks.map((st) => {
|
|
71144
|
+
if (typeof st === "string")
|
|
71145
|
+
return { title: st };
|
|
71146
|
+
const s = aliasCommonKeys(toPlainObject(st));
|
|
71147
|
+
if (s.priority !== undefined)
|
|
71148
|
+
s.priority = coerceNumber(s.priority);
|
|
71149
|
+
if (s.files && !Array.isArray(s.files))
|
|
71150
|
+
s.files = [String(s.files)];
|
|
71151
|
+
if (Array.isArray(s.files))
|
|
71152
|
+
s.files = s.files.map((p) => String(p));
|
|
71153
|
+
return pick2(s, ["title", "priority", "files", "id_suffix"]);
|
|
71154
|
+
});
|
|
71155
|
+
}
|
|
71156
|
+
if (obj.epic_title === undefined && typeof raw === "string")
|
|
71157
|
+
obj.epic_title = String(raw);
|
|
71158
|
+
if (obj.epic_description !== undefined)
|
|
71159
|
+
obj.epic_description = String(obj.epic_description);
|
|
71160
|
+
return pick2(obj, ["epic_title", "epic_description", "epic_id", "subtasks", "strategy", "task", "project_key", "recovery_context"]);
|
|
71161
|
+
}
|
|
71162
|
+
function formatZodError(toolName, err, example) {
|
|
71163
|
+
const issues = err.issues.map((i) => `- ${i.path.join(".") || "<root>"}: ${i.message}`).join(`
|
|
71164
|
+
`);
|
|
71165
|
+
const guidance = `How to fix:
|
|
71166
|
+
1) Check field names (snake_case expected).
|
|
71167
|
+
2) Coercions allowed: booleans as 'true/false', numbers as strings, status 'in-progress' -> 'in_progress'.
|
|
71168
|
+
3) Remove unknown fields or typos.`;
|
|
71169
|
+
const sample = example ? `
|
|
71170
|
+
|
|
71171
|
+
Example:
|
|
71172
|
+
${example}` : "";
|
|
71173
|
+
return `${toolName}: Invalid arguments.
|
|
71174
|
+
${issues}
|
|
71175
|
+
|
|
71176
|
+
${guidance}${sample}`;
|
|
70808
71177
|
}
|
|
70809
71178
|
|
|
70810
71179
|
// src/hive.ts
|
|
@@ -71394,6 +71763,25 @@ async function runGitCommand(args) {
|
|
|
71394
71763
|
const exitCode = await proc.exited;
|
|
71395
71764
|
return { exitCode, stdout, stderr };
|
|
71396
71765
|
}
|
|
71766
|
+
async function withRetry(operation, retries = 3, delayMs = 100) {
|
|
71767
|
+
let lastError;
|
|
71768
|
+
for (let attempt = 0;attempt <= retries; attempt++) {
|
|
71769
|
+
try {
|
|
71770
|
+
return await operation();
|
|
71771
|
+
} catch (err) {
|
|
71772
|
+
lastError = err;
|
|
71773
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
71774
|
+
if (attempt < retries && (message.includes("SQLITE_BUSY") || message.includes("SQLITE_BUSY_RECOVERY") || message.includes("database is locked"))) {
|
|
71775
|
+
await new Promise((r) => setTimeout(r, delayMs * (attempt + 1)));
|
|
71776
|
+
continue;
|
|
71777
|
+
}
|
|
71778
|
+
break;
|
|
71779
|
+
}
|
|
71780
|
+
}
|
|
71781
|
+
if (lastError instanceof Error)
|
|
71782
|
+
throw lastError;
|
|
71783
|
+
throw new Error(String(lastError));
|
|
71784
|
+
}
|
|
71397
71785
|
|
|
71398
71786
|
class HiveError extends Error {
|
|
71399
71787
|
command;
|
|
@@ -71407,8 +71795,16 @@ class HiveError extends Error {
|
|
|
71407
71795
|
this.name = "HiveError";
|
|
71408
71796
|
}
|
|
71409
71797
|
}
|
|
71798
|
+
class HiveValidationError extends Error {
|
|
71799
|
+
zodError;
|
|
71800
|
+
constructor(message, zodError) {
|
|
71801
|
+
super(message);
|
|
71802
|
+
this.zodError = zodError;
|
|
71803
|
+
this.name = "HiveValidationError";
|
|
71804
|
+
}
|
|
71805
|
+
}
|
|
71410
71806
|
function ensureHiveDirectory(projectPath) {
|
|
71411
|
-
const hiveDir =
|
|
71807
|
+
const hiveDir = normalize(join2(projectPath, ".hive"));
|
|
71412
71808
|
if (!existsSync2(hiveDir)) {
|
|
71413
71809
|
const { mkdirSync: mkdirSync2 } = __require("node:fs");
|
|
71414
71810
|
mkdirSync2(hiveDir, { recursive: true });
|
|
@@ -71515,7 +71911,19 @@ var hive_create = tool({
|
|
|
71515
71911
|
parent_id: tool.schema.string().optional().describe("Parent cell ID for epic children")
|
|
71516
71912
|
},
|
|
71517
71913
|
async execute(args, ctx) {
|
|
71518
|
-
const
|
|
71914
|
+
const normalized = normalizeCreateArgs(args);
|
|
71915
|
+
const parsed = CellCreateArgsSchema.safeParse(normalized);
|
|
71916
|
+
if (!parsed.success) {
|
|
71917
|
+
const message = formatZodError("hive_create", parsed.error, `{
|
|
71918
|
+
"title": "Fix login bug",
|
|
71919
|
+
"type": "bug",
|
|
71920
|
+
"priority": 2,
|
|
71921
|
+
"description": "Null check on session token",
|
|
71922
|
+
"parent_id": "project-abc12"
|
|
71923
|
+
}`);
|
|
71924
|
+
throw new HiveValidationError(message, parsed.error);
|
|
71925
|
+
}
|
|
71926
|
+
const validated = parsed.data;
|
|
71519
71927
|
const projectKey = getHiveWorkingDirectory();
|
|
71520
71928
|
const adapter = await getHiveAdapter(projectKey);
|
|
71521
71929
|
try {
|
|
@@ -71571,7 +71979,20 @@ var hive_create_epic = tool({
|
|
|
71571
71979
|
}).optional().describe("Recovery context from checkpoint compaction")
|
|
71572
71980
|
},
|
|
71573
71981
|
async execute(args, ctx) {
|
|
71574
|
-
const
|
|
71982
|
+
const normalized = normalizeEpicCreateArgs(args);
|
|
71983
|
+
const parsed = EpicCreateArgsSchema.safeParse(normalized);
|
|
71984
|
+
if (!parsed.success) {
|
|
71985
|
+
const message = formatZodError("hive_create_epic", parsed.error, `{
|
|
71986
|
+
"epic_title": "Ship new Auth",
|
|
71987
|
+
"epic_description": "Auth overhaul with passwordless",
|
|
71988
|
+
"subtasks": [
|
|
71989
|
+
{ "title": "DB migration", "priority": 1 },
|
|
71990
|
+
{ "title": "Add magic links", "priority": 2 }
|
|
71991
|
+
]
|
|
71992
|
+
}`);
|
|
71993
|
+
throw new HiveValidationError(message, parsed.error);
|
|
71994
|
+
}
|
|
71995
|
+
const validated = parsed.data;
|
|
71575
71996
|
const projectKey = getHiveWorkingDirectory();
|
|
71576
71997
|
const adapter = await getHiveAdapter(projectKey);
|
|
71577
71998
|
const created = [];
|
|
@@ -71594,12 +72015,21 @@ var hive_create_epic = tool({
|
|
|
71594
72015
|
await adapter.markDirty(projectKey, subtaskCell.id);
|
|
71595
72016
|
created.push(subtaskCell);
|
|
71596
72017
|
}
|
|
72018
|
+
try {
|
|
72019
|
+
const children = await adapter.queryCells(projectKey, { parent_id: epic.id });
|
|
72020
|
+
if (children.length !== validated.subtasks.length) {
|
|
72021
|
+
throw new Error(`Post-create validation failed: expected ${validated.subtasks.length} subtasks, found ${children.length}`);
|
|
72022
|
+
}
|
|
72023
|
+
} catch (e) {
|
|
72024
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
72025
|
+
throw new Error(`Epic integrity check failed: ${msg}`);
|
|
72026
|
+
}
|
|
71597
72027
|
const result = {
|
|
71598
72028
|
success: true,
|
|
71599
72029
|
epic: formatCellForOutput(epic),
|
|
71600
72030
|
subtasks: created.slice(1).map((c) => formatCellForOutput(c))
|
|
71601
72031
|
};
|
|
71602
|
-
const effectiveProjectKey =
|
|
72032
|
+
const effectiveProjectKey = normalized.project_key || projectKey;
|
|
71603
72033
|
try {
|
|
71604
72034
|
const epicCreatedEvent = createEvent("epic_created", {
|
|
71605
72035
|
project_key: effectiveProjectKey,
|
|
@@ -71617,16 +72047,16 @@ var hive_create_epic = tool({
|
|
|
71617
72047
|
const event = createEvent("decomposition_generated", {
|
|
71618
72048
|
project_key: effectiveProjectKey,
|
|
71619
72049
|
epic_id: epic.id,
|
|
71620
|
-
task:
|
|
72050
|
+
task: normalized.task || validated.epic_title,
|
|
71621
72051
|
context: validated.epic_description,
|
|
71622
|
-
strategy:
|
|
72052
|
+
strategy: normalized.strategy || "feature-based",
|
|
71623
72053
|
epic_title: validated.epic_title,
|
|
71624
72054
|
subtasks: validated.subtasks.map((st) => ({
|
|
71625
72055
|
title: st.title,
|
|
71626
72056
|
files: st.files || [],
|
|
71627
72057
|
priority: st.priority
|
|
71628
72058
|
})),
|
|
71629
|
-
recovery_context:
|
|
72059
|
+
recovery_context: normalized.recovery_context
|
|
71630
72060
|
});
|
|
71631
72061
|
await appendEvent(event, effectiveProjectKey);
|
|
71632
72062
|
} catch (error89) {
|
|
@@ -71638,7 +72068,7 @@ var hive_create_epic = tool({
|
|
|
71638
72068
|
project_key: effectiveProjectKey,
|
|
71639
72069
|
epic_id: epic.id,
|
|
71640
72070
|
epic_title: validated.epic_title,
|
|
71641
|
-
strategy:
|
|
72071
|
+
strategy: normalized.strategy || "feature-based",
|
|
71642
72072
|
subtask_count: validated.subtasks.length,
|
|
71643
72073
|
total_files: totalFiles,
|
|
71644
72074
|
coordinator_agent: "coordinator"
|
|
@@ -71663,10 +72093,10 @@ var hive_create_epic = tool({
|
|
|
71663
72093
|
decision_type: "decomposition_complete",
|
|
71664
72094
|
payload: {
|
|
71665
72095
|
subtask_count: validated.subtasks.length,
|
|
71666
|
-
strategy_used:
|
|
72096
|
+
strategy_used: normalized.strategy || "feature-based",
|
|
71667
72097
|
files_per_subtask: filesPerSubtask,
|
|
71668
72098
|
epic_title: validated.epic_title,
|
|
71669
|
-
task:
|
|
72099
|
+
task: normalized.task
|
|
71670
72100
|
}
|
|
71671
72101
|
});
|
|
71672
72102
|
} catch (error89) {
|
|
@@ -71722,7 +72152,18 @@ var hive_query = tool({
|
|
|
71722
72152
|
limit: tool.schema.number().optional().describe("Max results to return (default: 20)")
|
|
71723
72153
|
},
|
|
71724
72154
|
async execute(args, ctx) {
|
|
71725
|
-
const
|
|
72155
|
+
const normalized = normalizeQueryArgs(args);
|
|
72156
|
+
const parsed = CellQueryArgsSchema.safeParse(normalized);
|
|
72157
|
+
if (!parsed.success) {
|
|
72158
|
+
const message = formatZodError("hive_query", parsed.error, `{
|
|
72159
|
+
"status": "in_progress",
|
|
72160
|
+
"type": "task",
|
|
72161
|
+
"parent_id": "project-abc12",
|
|
72162
|
+
"limit": 10
|
|
72163
|
+
}`);
|
|
72164
|
+
throw new HiveValidationError(message, parsed.error);
|
|
72165
|
+
}
|
|
72166
|
+
const validated = parsed.data;
|
|
71726
72167
|
const projectKey = getHiveWorkingDirectory();
|
|
71727
72168
|
const adapter = await getHiveAdapter(projectKey);
|
|
71728
72169
|
try {
|
|
@@ -71755,20 +72196,32 @@ var hive_update = tool({
|
|
|
71755
72196
|
priority: tool.schema.number().min(0).max(3).optional().describe("New priority")
|
|
71756
72197
|
},
|
|
71757
72198
|
async execute(args, ctx) {
|
|
71758
|
-
const
|
|
72199
|
+
const normalized = normalizeUpdateArgs(args);
|
|
72200
|
+
const parsed = CellUpdateArgsSchema.safeParse(normalized);
|
|
72201
|
+
if (!parsed.success) {
|
|
72202
|
+
const message = formatZodError("hive_update", parsed.error, `{
|
|
72203
|
+
"id": "project-abc12",
|
|
72204
|
+
"status": "in_progress",
|
|
72205
|
+
"priority": 1,
|
|
72206
|
+
"description": "Ready for review"
|
|
72207
|
+
}`);
|
|
72208
|
+
throw new HiveValidationError(message, parsed.error);
|
|
72209
|
+
}
|
|
72210
|
+
const validated = parsed.data;
|
|
71759
72211
|
const projectKey = getHiveWorkingDirectory();
|
|
71760
72212
|
const adapter = await getHiveAdapter(projectKey);
|
|
71761
72213
|
try {
|
|
71762
72214
|
const cellId = await resolvePartialId(adapter, projectKey, validated.id) || validated.id;
|
|
71763
72215
|
let cell;
|
|
71764
|
-
if (validated.status) {
|
|
71765
|
-
|
|
72216
|
+
if (validated.status !== undefined) {
|
|
72217
|
+
const newStatus = validated.status;
|
|
72218
|
+
cell = await withRetry(() => adapter.changeCellStatus(projectKey, cellId, newStatus));
|
|
71766
72219
|
}
|
|
71767
72220
|
if (validated.description !== undefined || validated.priority !== undefined) {
|
|
71768
|
-
cell = await adapter.updateCell(projectKey, cellId, {
|
|
72221
|
+
cell = await withRetry(() => adapter.updateCell(projectKey, cellId, {
|
|
71769
72222
|
description: validated.description,
|
|
71770
72223
|
priority: validated.priority
|
|
71771
|
-
});
|
|
72224
|
+
}));
|
|
71772
72225
|
} else if (!validated.status) {
|
|
71773
72226
|
const existingCell = await adapter.getCell(projectKey, cellId);
|
|
71774
72227
|
if (!existingCell) {
|
|
@@ -71815,14 +72268,23 @@ var hive_close = tool({
|
|
|
71815
72268
|
reason: tool.schema.string().describe("Completion reason")
|
|
71816
72269
|
},
|
|
71817
72270
|
async execute(args, ctx) {
|
|
71818
|
-
const
|
|
72271
|
+
const normalized = normalizeCloseArgs(args);
|
|
72272
|
+
const parsed = CellCloseArgsSchema.safeParse(normalized);
|
|
72273
|
+
if (!parsed.success) {
|
|
72274
|
+
const message = formatZodError("hive_close", parsed.error, `{
|
|
72275
|
+
"id": "project-abc12",
|
|
72276
|
+
"reason": "Merged in main"
|
|
72277
|
+
}`);
|
|
72278
|
+
throw new HiveValidationError(message, parsed.error);
|
|
72279
|
+
}
|
|
72280
|
+
const validated = parsed.data;
|
|
71819
72281
|
const projectKey = getHiveWorkingDirectory();
|
|
71820
72282
|
const adapter = await getHiveAdapter(projectKey);
|
|
71821
72283
|
try {
|
|
71822
72284
|
const cellId = await resolvePartialId(adapter, projectKey, validated.id) || validated.id;
|
|
71823
72285
|
const cellBeforeClose = await adapter.getCell(projectKey, cellId);
|
|
71824
72286
|
const isEpic = cellBeforeClose?.type === "epic";
|
|
71825
|
-
const cell = await adapter.closeCell(projectKey, cellId, validated.reason);
|
|
72287
|
+
const cell = await withRetry(() => adapter.closeCell(projectKey, cellId, validated.reason));
|
|
71826
72288
|
await adapter.markDirty(projectKey, cellId);
|
|
71827
72289
|
if (isEpic && cellBeforeClose) {
|
|
71828
72290
|
try {
|
|
@@ -71943,7 +72405,7 @@ var hive_start = tool({
|
|
|
71943
72405
|
const adapter = await getHiveAdapter(projectKey);
|
|
71944
72406
|
try {
|
|
71945
72407
|
const cellId = await resolvePartialId(adapter, projectKey, args.id) || args.id;
|
|
71946
|
-
const cell = await adapter.changeCellStatus(projectKey, cellId, "in_progress");
|
|
72408
|
+
const cell = await withRetry(() => adapter.changeCellStatus(projectKey, cellId, "in_progress"));
|
|
71947
72409
|
await adapter.markDirty(projectKey, cellId);
|
|
71948
72410
|
try {
|
|
71949
72411
|
const event = createEvent("cell_status_changed", {
|
|
@@ -72018,16 +72480,17 @@ PREFER THIS OVER hive_query when you need to:
|
|
|
72018
72480
|
async execute(args, ctx) {
|
|
72019
72481
|
const projectKey = getHiveWorkingDirectory();
|
|
72020
72482
|
const adapter = await getHiveAdapter(projectKey);
|
|
72483
|
+
const normalized = normalizeCellsArgs(args);
|
|
72021
72484
|
try {
|
|
72022
|
-
if (
|
|
72023
|
-
const matchingCells = await findCellsByPartialId(adapter, projectKey,
|
|
72485
|
+
if (normalized.id) {
|
|
72486
|
+
const matchingCells = await findCellsByPartialId(adapter, projectKey, normalized.id);
|
|
72024
72487
|
if (matchingCells.length === 0) {
|
|
72025
|
-
throw new HiveError(`No cell found matching ID '${
|
|
72488
|
+
throw new HiveError(`No cell found matching ID '${normalized.id}'`, "hive_cells");
|
|
72026
72489
|
}
|
|
72027
72490
|
const formatted2 = matchingCells.map((c) => formatCellForOutput(c));
|
|
72028
72491
|
return JSON.stringify(formatted2, null, 2);
|
|
72029
72492
|
}
|
|
72030
|
-
if (
|
|
72493
|
+
if (normalized.ready) {
|
|
72031
72494
|
const ready = await adapter.getNextReadyCell(projectKey);
|
|
72032
72495
|
if (!ready) {
|
|
72033
72496
|
return JSON.stringify([], null, 2);
|
|
@@ -72036,10 +72499,10 @@ PREFER THIS OVER hive_query when you need to:
|
|
|
72036
72499
|
return JSON.stringify([formatted2], null, 2);
|
|
72037
72500
|
}
|
|
72038
72501
|
const cells = await adapter.queryCells(projectKey, {
|
|
72039
|
-
status:
|
|
72040
|
-
type:
|
|
72041
|
-
parent_id:
|
|
72042
|
-
limit:
|
|
72502
|
+
status: normalized.status,
|
|
72503
|
+
type: normalized.type,
|
|
72504
|
+
parent_id: normalized.parent_id,
|
|
72505
|
+
limit: normalized.limit || 20
|
|
72043
72506
|
});
|
|
72044
72507
|
const formatted = cells.map((c) => formatCellForOutput(c));
|
|
72045
72508
|
return JSON.stringify(formatted, null, 2);
|
|
@@ -72049,7 +72512,7 @@ PREFER THIS OVER hive_query when you need to:
|
|
|
72049
72512
|
}
|
|
72050
72513
|
const message = error89 instanceof Error ? error89.message : String(error89);
|
|
72051
72514
|
if (message.includes("Bead not found") || message.includes("Cell not found")) {
|
|
72052
|
-
throw new HiveError(`No cell found matching ID '${
|
|
72515
|
+
throw new HiveError(`No cell found matching ID '${normalized.id || "unknown"}'`, "hive_cells");
|
|
72053
72516
|
}
|
|
72054
72517
|
throw new HiveError(`Failed to query cells: ${message}`, "hive_cells");
|
|
72055
72518
|
}
|
|
@@ -72118,6 +72581,14 @@ var hive_sync = tool({
|
|
|
72118
72581
|
const remoteCheckResult2 = await runGitCommand(["remote"]);
|
|
72119
72582
|
const hasRemote2 = remoteCheckResult2.stdout.trim() !== "";
|
|
72120
72583
|
if (hasRemote2) {
|
|
72584
|
+
await withTimeout(runGitCommand(["fetch", "--all", "--prune"]), TIMEOUT_MS, "git fetch");
|
|
72585
|
+
const upstreamResult = await runGitCommand([
|
|
72586
|
+
"rev-parse",
|
|
72587
|
+
"--abbrev-ref",
|
|
72588
|
+
"--symbolic-full-name",
|
|
72589
|
+
"@{u}"
|
|
72590
|
+
]);
|
|
72591
|
+
const hasUpstream = upstreamResult.exitCode === 0;
|
|
72121
72592
|
const statusResult = await runGitCommand(["status", "--porcelain"]);
|
|
72122
72593
|
const hasUnstagedChanges = statusResult.stdout.trim() !== "";
|
|
72123
72594
|
let didStash = false;
|
|
@@ -72128,9 +72599,13 @@ var hive_sync = tool({
|
|
|
72128
72599
|
}
|
|
72129
72600
|
}
|
|
72130
72601
|
try {
|
|
72131
|
-
|
|
72132
|
-
|
|
72133
|
-
|
|
72602
|
+
if (hasUpstream) {
|
|
72603
|
+
const pullResult = await withTimeout(runGitCommand(["pull", "--rebase"]), TIMEOUT_MS, "git pull --rebase");
|
|
72604
|
+
if (pullResult.exitCode !== 0) {
|
|
72605
|
+
throw new HiveError(`Failed to pull: ${pullResult.stderr}`, "git pull --rebase", pullResult.exitCode);
|
|
72606
|
+
}
|
|
72607
|
+
} else {
|
|
72608
|
+
console.warn("[hive_sync] No upstream configured for current branch. Skipping pull.");
|
|
72134
72609
|
}
|
|
72135
72610
|
} finally {
|
|
72136
72611
|
if (didStash) {
|
|
@@ -72629,7 +73104,7 @@ var createDatabase = null;
|
|
|
72629
73104
|
try {
|
|
72630
73105
|
if (typeof globalThis.Bun !== "undefined") {
|
|
72631
73106
|
const bunSqlite = await import("bun:sqlite");
|
|
72632
|
-
createDatabase = (
|
|
73107
|
+
createDatabase = (path4) => new bunSqlite.Database(path4);
|
|
72633
73108
|
sqliteAvailable = true;
|
|
72634
73109
|
}
|
|
72635
73110
|
} catch {
|
|
@@ -72979,10 +73454,10 @@ function getSessionStatePath(sessionID) {
|
|
|
72979
73454
|
return join4(SESSION_STATE_DIR, `${safeID}.json`);
|
|
72980
73455
|
}
|
|
72981
73456
|
function loadSessionState(sessionID) {
|
|
72982
|
-
const
|
|
73457
|
+
const path4 = getSessionStatePath(sessionID);
|
|
72983
73458
|
try {
|
|
72984
|
-
if (existsSync4(
|
|
72985
|
-
const data = readFileSync3(
|
|
73459
|
+
if (existsSync4(path4)) {
|
|
73460
|
+
const data = readFileSync3(path4, "utf-8");
|
|
72986
73461
|
return JSON.parse(data);
|
|
72987
73462
|
}
|
|
72988
73463
|
} catch (error89) {
|
|
@@ -72995,8 +73470,8 @@ function saveSessionState(sessionID, state) {
|
|
|
72995
73470
|
if (!existsSync4(SESSION_STATE_DIR)) {
|
|
72996
73471
|
mkdirSync3(SESSION_STATE_DIR, { recursive: true });
|
|
72997
73472
|
}
|
|
72998
|
-
const
|
|
72999
|
-
writeFileSync2(
|
|
73473
|
+
const path4 = getSessionStatePath(sessionID);
|
|
73474
|
+
writeFileSync2(path4, JSON.stringify(state, null, 2));
|
|
73000
73475
|
return true;
|
|
73001
73476
|
} catch (error89) {
|
|
73002
73477
|
console.error(`[agent-mail] CRITICAL: Could not save session state: ${error89}`);
|
|
@@ -73133,11 +73608,11 @@ async function restartServer() {
|
|
|
73133
73608
|
`${process.env.HOME}/mcp_agent_mail`
|
|
73134
73609
|
];
|
|
73135
73610
|
let serverDir = null;
|
|
73136
|
-
for (const
|
|
73611
|
+
for (const path4 of possiblePaths) {
|
|
73137
73612
|
try {
|
|
73138
|
-
const stat = await Bun.file(`${
|
|
73613
|
+
const stat = await Bun.file(`${path4}/pyproject.toml`).exists();
|
|
73139
73614
|
if (stat) {
|
|
73140
|
-
serverDir =
|
|
73615
|
+
serverDir = path4;
|
|
73141
73616
|
break;
|
|
73142
73617
|
}
|
|
73143
73618
|
} catch {
|
|
@@ -73963,10 +74438,10 @@ function getSessionStatePath2(sessionID) {
|
|
|
73963
74438
|
return join5(SESSION_STATE_DIR2, `${safeID}.json`);
|
|
73964
74439
|
}
|
|
73965
74440
|
function loadSessionState2(sessionID) {
|
|
73966
|
-
const
|
|
74441
|
+
const path4 = getSessionStatePath2(sessionID);
|
|
73967
74442
|
try {
|
|
73968
|
-
if (existsSync5(
|
|
73969
|
-
const data = readFileSync4(
|
|
74443
|
+
if (existsSync5(path4)) {
|
|
74444
|
+
const data = readFileSync4(path4, "utf-8");
|
|
73970
74445
|
return JSON.parse(data);
|
|
73971
74446
|
}
|
|
73972
74447
|
} catch (error89) {
|
|
@@ -73979,14 +74454,22 @@ function saveSessionState2(sessionID, state) {
|
|
|
73979
74454
|
if (!existsSync5(SESSION_STATE_DIR2)) {
|
|
73980
74455
|
mkdirSync4(SESSION_STATE_DIR2, { recursive: true });
|
|
73981
74456
|
}
|
|
73982
|
-
const
|
|
73983
|
-
writeFileSync3(
|
|
74457
|
+
const path4 = getSessionStatePath2(sessionID);
|
|
74458
|
+
writeFileSync3(path4, JSON.stringify(state, null, 2));
|
|
73984
74459
|
return true;
|
|
73985
74460
|
} catch (error89) {
|
|
73986
74461
|
console.warn(`[swarm-mail] Could not save session state: ${error89}`);
|
|
73987
74462
|
return false;
|
|
73988
74463
|
}
|
|
73989
74464
|
}
|
|
74465
|
+
function clearSessionState(sessionID) {
|
|
74466
|
+
const path4 = getSessionStatePath2(sessionID);
|
|
74467
|
+
try {
|
|
74468
|
+
if (existsSync5(path4)) {
|
|
74469
|
+
unlinkSync2(path4);
|
|
74470
|
+
}
|
|
74471
|
+
} catch {}
|
|
74472
|
+
}
|
|
73990
74473
|
function hasCoordinatorOverride(sessionID) {
|
|
73991
74474
|
return isInCoordinatorContext(sessionID) || isInCoordinatorContext();
|
|
73992
74475
|
}
|
|
@@ -74014,12 +74497,27 @@ var swarmmail_init = tool({
|
|
|
74014
74497
|
const sessionID = ctx.sessionID || "default";
|
|
74015
74498
|
const existingState = loadSessionState2(sessionID);
|
|
74016
74499
|
if (existingState) {
|
|
74017
|
-
|
|
74018
|
-
|
|
74019
|
-
|
|
74020
|
-
|
|
74021
|
-
|
|
74022
|
-
}
|
|
74500
|
+
const requestedAgent = args.agent_name;
|
|
74501
|
+
const projectMismatch = existingState.projectKey !== projectPath;
|
|
74502
|
+
const agentMismatch = Boolean(requestedAgent && requestedAgent !== existingState.agentName);
|
|
74503
|
+
if (args.force_reinit) {
|
|
74504
|
+
clearSessionState(sessionID);
|
|
74505
|
+
} else {
|
|
74506
|
+
return JSON.stringify({
|
|
74507
|
+
agent_name: existingState.agentName,
|
|
74508
|
+
project_key: existingState.projectKey,
|
|
74509
|
+
message: `Session already initialized as ${existingState.agentName}`,
|
|
74510
|
+
already_initialized: true,
|
|
74511
|
+
session_id: sessionID,
|
|
74512
|
+
project_mismatch: projectMismatch || undefined,
|
|
74513
|
+
agent_mismatch: agentMismatch || undefined,
|
|
74514
|
+
note: projectMismatch || agentMismatch ? "To switch project/agent, call swarmmail_init again with force_reinit: true (or end the session)." : undefined,
|
|
74515
|
+
requested: requestedAgent || args.project_path ? {
|
|
74516
|
+
agent_name: requestedAgent,
|
|
74517
|
+
project_key: args.project_path
|
|
74518
|
+
} : undefined
|
|
74519
|
+
}, null, 2);
|
|
74520
|
+
}
|
|
74023
74521
|
}
|
|
74024
74522
|
try {
|
|
74025
74523
|
const result = await initSwarmAgent({
|
|
@@ -74233,7 +74731,7 @@ var swarmmail_release = tool({
|
|
|
74233
74731
|
} else if (args.reservation_ids) {
|
|
74234
74732
|
state.reservations = state.reservations.filter((id) => !args.reservation_ids.includes(id));
|
|
74235
74733
|
} else if (normalizedPaths) {
|
|
74236
|
-
const releasedIds = currentReservations.filter((r) => normalizedPaths.
|
|
74734
|
+
const releasedIds = currentReservations.filter((r) => normalizedPaths.some((p) => p === r.path_pattern)).map((r) => r.id);
|
|
74237
74735
|
state.reservations = state.reservations.filter((id) => !releasedIds.includes(id));
|
|
74238
74736
|
}
|
|
74239
74737
|
saveSessionState2(sessionID, state);
|
|
@@ -74406,8 +74904,8 @@ class JsonExtractionError extends Error {
|
|
|
74406
74904
|
}
|
|
74407
74905
|
function formatZodErrors(error89) {
|
|
74408
74906
|
return error89.issues.map((issue3) => {
|
|
74409
|
-
const
|
|
74410
|
-
return `${
|
|
74907
|
+
const path4 = issue3.path.length > 0 ? `${issue3.path.join(".")}: ` : "";
|
|
74908
|
+
return `${path4}${issue3.message}`;
|
|
74411
74909
|
});
|
|
74412
74910
|
}
|
|
74413
74911
|
var SCHEMA_REGISTRY = {
|
|
@@ -76551,11 +77049,11 @@ var qmarksTestNoExtDot = ([$0]) => {
|
|
|
76551
77049
|
return (f) => f.length === len && f !== "." && f !== "..";
|
|
76552
77050
|
};
|
|
76553
77051
|
var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
76554
|
-
var
|
|
77052
|
+
var path4 = {
|
|
76555
77053
|
win32: { sep: "\\" },
|
|
76556
77054
|
posix: { sep: "/" }
|
|
76557
77055
|
};
|
|
76558
|
-
var sep2 = defaultPlatform === "win32" ?
|
|
77056
|
+
var sep2 = defaultPlatform === "win32" ? path4.win32.sep : path4.posix.sep;
|
|
76559
77057
|
minimatch.sep = sep2;
|
|
76560
77058
|
var GLOBSTAR = Symbol("globstar **");
|
|
76561
77059
|
minimatch.GLOBSTAR = GLOBSTAR;
|
|
@@ -76701,9 +77199,9 @@ class Minimatch {
|
|
|
76701
77199
|
this.debug(this.pattern, this.globParts);
|
|
76702
77200
|
let set3 = this.globParts.map((s, _, __) => {
|
|
76703
77201
|
if (this.isWindows && this.windowsNoMagicRoot) {
|
|
76704
|
-
const
|
|
77202
|
+
const isUNC2 = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]);
|
|
76705
77203
|
const isDrive = /^[a-z]:/i.test(s[0]);
|
|
76706
|
-
if (
|
|
77204
|
+
if (isUNC2) {
|
|
76707
77205
|
return [...s.slice(0, 4), ...s.slice(4).map((ss) => this.parse(ss))];
|
|
76708
77206
|
} else if (isDrive) {
|
|
76709
77207
|
return [s[0], ...s.slice(1).map((ss) => this.parse(ss))];
|
|
@@ -77205,10 +77703,10 @@ import { existsSync as existsSync6 } from "node:fs";
|
|
|
77205
77703
|
var WORKTREE_DIR = ".swarm/worktrees";
|
|
77206
77704
|
function getWorktreePath(projectPath, taskId) {
|
|
77207
77705
|
const safeTaskId = taskId.replace(/[^a-zA-Z0-9.-]/g, "_");
|
|
77208
|
-
return
|
|
77706
|
+
return normalize(join7(projectPath, WORKTREE_DIR, safeTaskId));
|
|
77209
77707
|
}
|
|
77210
77708
|
function parseTaskIdFromPath(worktreePath) {
|
|
77211
|
-
const normalized =
|
|
77709
|
+
const normalized = normalize(worktreePath);
|
|
77212
77710
|
const parts = normalized.split("/");
|
|
77213
77711
|
const worktreesIdx = parts.indexOf("worktrees");
|
|
77214
77712
|
if (worktreesIdx >= 0 && worktreesIdx < parts.length - 1) {
|
|
@@ -77216,18 +77714,18 @@ function parseTaskIdFromPath(worktreePath) {
|
|
|
77216
77714
|
}
|
|
77217
77715
|
return null;
|
|
77218
77716
|
}
|
|
77219
|
-
async function isGitRepo(
|
|
77220
|
-
const result = await Bun.$`git -C ${
|
|
77717
|
+
async function isGitRepo(path5) {
|
|
77718
|
+
const result = await Bun.$`git -C ${path5} rev-parse --git-dir`.quiet().nothrow();
|
|
77221
77719
|
return result.exitCode === 0;
|
|
77222
77720
|
}
|
|
77223
|
-
async function hasUncommittedChanges(
|
|
77224
|
-
const result = await Bun.$`git -C ${
|
|
77721
|
+
async function hasUncommittedChanges(path5) {
|
|
77722
|
+
const result = await Bun.$`git -C ${path5} status --porcelain`.quiet().nothrow();
|
|
77225
77723
|
if (result.exitCode !== 0)
|
|
77226
77724
|
return true;
|
|
77227
77725
|
return result.stdout.toString().trim().length > 0;
|
|
77228
77726
|
}
|
|
77229
|
-
async function getCurrentCommit(
|
|
77230
|
-
const result = await Bun.$`git -C ${
|
|
77727
|
+
async function getCurrentCommit(path5) {
|
|
77728
|
+
const result = await Bun.$`git -C ${path5} rev-parse HEAD`.quiet().nothrow();
|
|
77231
77729
|
if (result.exitCode !== 0)
|
|
77232
77730
|
return null;
|
|
77233
77731
|
return result.stdout.toString().trim();
|
|
@@ -77240,7 +77738,7 @@ async function getWorktreeCommits(worktreePath, startCommit) {
|
|
|
77240
77738
|
`).filter((c) => c.length > 0);
|
|
77241
77739
|
}
|
|
77242
77740
|
async function ensureWorktreeDir(projectPath) {
|
|
77243
|
-
const worktreeDir =
|
|
77741
|
+
const worktreeDir = normalize(join7(projectPath, WORKTREE_DIR));
|
|
77244
77742
|
await Bun.$`mkdir -p ${worktreeDir}`.quiet().nothrow();
|
|
77245
77743
|
}
|
|
77246
77744
|
var swarm_worktree_create = tool({
|
|
@@ -77452,12 +77950,12 @@ var swarm_worktree_list = tool({
|
|
|
77452
77950
|
const commitMatch = block.match(/^HEAD ([a-f0-9]+)$/m);
|
|
77453
77951
|
const branchMatch = block.match(/^branch (.+)$/m);
|
|
77454
77952
|
if (pathMatch && pathMatch[1].includes(worktreeDir)) {
|
|
77455
|
-
const
|
|
77456
|
-
const taskId = parseTaskIdFromPath(
|
|
77953
|
+
const path5 = pathMatch[1];
|
|
77954
|
+
const taskId = parseTaskIdFromPath(path5);
|
|
77457
77955
|
if (taskId) {
|
|
77458
77956
|
worktrees.push({
|
|
77459
77957
|
task_id: taskId,
|
|
77460
|
-
path:
|
|
77958
|
+
path: path5,
|
|
77461
77959
|
commit: commitMatch ? commitMatch[1] : "unknown",
|
|
77462
77960
|
branch: branchMatch ? branchMatch[1] : undefined
|
|
77463
77961
|
});
|
|
@@ -81062,11 +81560,6 @@ var TOOL_DEFINITIONS = [
|
|
|
81062
81560
|
name: "fetch",
|
|
81063
81561
|
type: "mcp",
|
|
81064
81562
|
capabilities: ["http-fetch", "markdown-conversion"]
|
|
81065
|
-
},
|
|
81066
|
-
{
|
|
81067
|
-
name: "pdf-brain",
|
|
81068
|
-
type: "mcp",
|
|
81069
|
-
capabilities: ["knowledge-base-search", "internal-docs"]
|
|
81070
81563
|
}
|
|
81071
81564
|
];
|
|
81072
81565
|
function stripSemverConstraint(versionStr) {
|
|
@@ -82460,28 +82953,28 @@ import {
|
|
|
82460
82953
|
makeOllamaLive as makeOllamaLive2
|
|
82461
82954
|
} from "swarm-mail";
|
|
82462
82955
|
import * as os2 from "node:os";
|
|
82463
|
-
import * as
|
|
82956
|
+
import * as path5 from "node:path";
|
|
82464
82957
|
import { join as join12 } from "node:path";
|
|
82465
82958
|
var cachedAdapter2 = null;
|
|
82466
82959
|
var cachedIndexer = null;
|
|
82467
82960
|
var cachedProjectPath2 = null;
|
|
82468
82961
|
async function getMemoryAdapter2(projectPath) {
|
|
82469
|
-
const
|
|
82470
|
-
if (cachedAdapter2 && cachedProjectPath2 ===
|
|
82962
|
+
const path6 = projectPath || process.cwd();
|
|
82963
|
+
if (cachedAdapter2 && cachedProjectPath2 === path6) {
|
|
82471
82964
|
return cachedAdapter2;
|
|
82472
82965
|
}
|
|
82473
|
-
const swarmMail = await getSwarmMailLibSQL6(
|
|
82966
|
+
const swarmMail = await getSwarmMailLibSQL6(path6);
|
|
82474
82967
|
const dbAdapter = await swarmMail.getDatabase();
|
|
82475
82968
|
cachedAdapter2 = await createMemoryAdapter(dbAdapter);
|
|
82476
|
-
cachedProjectPath2 =
|
|
82969
|
+
cachedProjectPath2 = path6;
|
|
82477
82970
|
return cachedAdapter2;
|
|
82478
82971
|
}
|
|
82479
82972
|
async function getSessionIndexer(projectPath) {
|
|
82480
|
-
const
|
|
82481
|
-
if (cachedIndexer && cachedProjectPath2 ===
|
|
82973
|
+
const path6 = projectPath || process.cwd();
|
|
82974
|
+
if (cachedIndexer && cachedProjectPath2 === path6) {
|
|
82482
82975
|
return cachedIndexer;
|
|
82483
82976
|
}
|
|
82484
|
-
const swarmMail = await getSwarmMailLibSQL6(
|
|
82977
|
+
const swarmMail = await getSwarmMailLibSQL6(path6);
|
|
82485
82978
|
const dbAdapter = await swarmMail.getDatabase();
|
|
82486
82979
|
const db = toSwarmDb2(dbAdapter);
|
|
82487
82980
|
const ollamaLayer = makeOllamaLive2({
|
|
@@ -82489,7 +82982,7 @@ async function getSessionIndexer(projectPath) {
|
|
|
82489
82982
|
ollamaModel: process.env.OLLAMA_MODEL || "mxbai-embed-large"
|
|
82490
82983
|
});
|
|
82491
82984
|
cachedIndexer = new SessionIndexer(db, ollamaLayer);
|
|
82492
|
-
cachedProjectPath2 =
|
|
82985
|
+
cachedProjectPath2 = path6;
|
|
82493
82986
|
return cachedIndexer;
|
|
82494
82987
|
}
|
|
82495
82988
|
var getHivemindAdapter = getMemoryAdapter2;
|
|
@@ -82505,11 +82998,11 @@ async function emitEvent(eventType, data) {
|
|
|
82505
82998
|
} catch {}
|
|
82506
82999
|
}
|
|
82507
83000
|
var AGENT_DIRECTORIES = [
|
|
82508
|
-
|
|
82509
|
-
|
|
82510
|
-
|
|
82511
|
-
|
|
82512
|
-
|
|
83001
|
+
path5.join(os2.homedir(), ".config", "swarm-tools", "sessions"),
|
|
83002
|
+
path5.join(os2.homedir(), ".opencode"),
|
|
83003
|
+
path5.join(os2.homedir(), "Cursor", "User", "History"),
|
|
83004
|
+
path5.join(os2.homedir(), ".local", "share", "Claude"),
|
|
83005
|
+
path5.join(os2.homedir(), ".aider")
|
|
82513
83006
|
];
|
|
82514
83007
|
var hivemind_store = tool({
|
|
82515
83008
|
description: "Store a memory (learning, decision, pattern) with semantic embedding. Memories are searchable by semantic similarity and organized into collections. Use collection='default' for manual learnings.",
|
|
@@ -84480,13 +84973,13 @@ import {
|
|
|
84480
84973
|
getSwarmMailLibSQL as getSwarmMailLibSQL8
|
|
84481
84974
|
} from "swarm-mail";
|
|
84482
84975
|
import * as os3 from "node:os";
|
|
84483
|
-
import * as
|
|
84976
|
+
import * as path6 from "node:path";
|
|
84484
84977
|
var AGENT_DIRECTORIES2 = [
|
|
84485
|
-
|
|
84486
|
-
|
|
84487
|
-
|
|
84488
|
-
|
|
84489
|
-
|
|
84978
|
+
path6.join(os3.homedir(), ".config", "swarm-tools", "sessions"),
|
|
84979
|
+
path6.join(os3.homedir(), ".opencode"),
|
|
84980
|
+
path6.join(os3.homedir(), "Cursor", "User", "History"),
|
|
84981
|
+
path6.join(os3.homedir(), ".local", "share", "Claude"),
|
|
84982
|
+
path6.join(os3.homedir(), ".aider")
|
|
84490
84983
|
];
|
|
84491
84984
|
async function getSessionIndexer2() {
|
|
84492
84985
|
const db = await getDb();
|