@ycodium-ai/plugin-team 0.2.3377 → 0.2.3391
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/assets/ui.js +8 -8
- package/dist/index.js +611 -231
- package/locales/en.json +5 -4
- package/locales/zh-CN.json +5 -4
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,6 +1,84 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __export = (target, all3) => {
|
|
3
|
+
for (var name in all3)
|
|
4
|
+
__defProp(target, name, { get: all3[name], enumerable: true });
|
|
5
|
+
};
|
|
6
|
+
|
|
1
7
|
// src/index.ts
|
|
2
8
|
import { definePlugin } from "@ycodium-ai/plugin-api";
|
|
3
9
|
|
|
10
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.103_patch_hash=78523ded7c3dfc3efd3cec0247f4960d00eaa3d3c96a2077457694a4d8b453c6/node_modules/effect/dist/Option.js
|
|
11
|
+
var Option_exports = {};
|
|
12
|
+
__export(Option_exports, {
|
|
13
|
+
Do: () => Do,
|
|
14
|
+
all: () => all,
|
|
15
|
+
andThen: () => andThen,
|
|
16
|
+
as: () => as,
|
|
17
|
+
asVoid: () => asVoid,
|
|
18
|
+
bind: () => bind2,
|
|
19
|
+
bindTo: () => bindTo2,
|
|
20
|
+
composeK: () => composeK,
|
|
21
|
+
contains: () => contains,
|
|
22
|
+
containsWith: () => containsWith,
|
|
23
|
+
exists: () => exists,
|
|
24
|
+
filter: () => filter,
|
|
25
|
+
filterMap: () => filterMap,
|
|
26
|
+
firstSomeOf: () => firstSomeOf,
|
|
27
|
+
flatMap: () => flatMap,
|
|
28
|
+
flatMapNullishOr: () => flatMapNullishOr,
|
|
29
|
+
flatten: () => flatten,
|
|
30
|
+
fromIterable: () => fromIterable,
|
|
31
|
+
fromNullOr: () => fromNullOr,
|
|
32
|
+
fromNullishOr: () => fromNullishOr,
|
|
33
|
+
fromUndefinedOr: () => fromUndefinedOr,
|
|
34
|
+
gen: () => gen,
|
|
35
|
+
getFailure: () => getFailure2,
|
|
36
|
+
getOrElse: () => getOrElse,
|
|
37
|
+
getOrNull: () => getOrNull,
|
|
38
|
+
getOrThrow: () => getOrThrow,
|
|
39
|
+
getOrThrowWith: () => getOrThrowWith,
|
|
40
|
+
getOrUndefined: () => getOrUndefined,
|
|
41
|
+
getSuccess: () => getSuccess2,
|
|
42
|
+
isNone: () => isNone2,
|
|
43
|
+
isOption: () => isOption2,
|
|
44
|
+
isSome: () => isSome2,
|
|
45
|
+
let: () => let_2,
|
|
46
|
+
lift2: () => lift2,
|
|
47
|
+
liftNullishOr: () => liftNullishOr,
|
|
48
|
+
liftPredicate: () => liftPredicate,
|
|
49
|
+
liftThrowable: () => liftThrowable,
|
|
50
|
+
makeCombinerFailFast: () => makeCombinerFailFast,
|
|
51
|
+
makeEquivalence: () => makeEquivalence,
|
|
52
|
+
makeOrder: () => makeOrder,
|
|
53
|
+
makeReducer: () => makeReducer,
|
|
54
|
+
makeReducerFailFast: () => makeReducerFailFast,
|
|
55
|
+
map: () => map,
|
|
56
|
+
match: () => match,
|
|
57
|
+
none: () => none2,
|
|
58
|
+
orElse: () => orElse,
|
|
59
|
+
orElseResult: () => orElseResult,
|
|
60
|
+
orElseSome: () => orElseSome,
|
|
61
|
+
partitionMap: () => partitionMap,
|
|
62
|
+
product: () => product,
|
|
63
|
+
productMany: () => productMany,
|
|
64
|
+
reduceCompact: () => reduceCompact,
|
|
65
|
+
some: () => some2,
|
|
66
|
+
tap: () => tap,
|
|
67
|
+
toArray: () => toArray,
|
|
68
|
+
toRefinement: () => toRefinement,
|
|
69
|
+
void: () => void_,
|
|
70
|
+
zipLeft: () => zipLeft,
|
|
71
|
+
zipRight: () => zipRight,
|
|
72
|
+
zipWith: () => zipWith
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.103_patch_hash=78523ded7c3dfc3efd3cec0247f4960d00eaa3d3c96a2077457694a4d8b453c6/node_modules/effect/dist/Combiner.js
|
|
76
|
+
function make(combine2) {
|
|
77
|
+
return {
|
|
78
|
+
combine: combine2
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
4
82
|
// ../../node_modules/.pnpm/effect@4.0.0-beta.103_patch_hash=78523ded7c3dfc3efd3cec0247f4960d00eaa3d3c96a2077457694a4d8b453c6/node_modules/effect/dist/Pipeable.js
|
|
5
83
|
var pipeArguments = (self, args2) => {
|
|
6
84
|
switch (args2.length) {
|
|
@@ -88,6 +166,7 @@ var dual = function(arity, body) {
|
|
|
88
166
|
};
|
|
89
167
|
var identity = (a) => a;
|
|
90
168
|
var constant = (value) => () => value;
|
|
169
|
+
var constNull = /* @__PURE__ */ constant(null);
|
|
91
170
|
var constUndefined = /* @__PURE__ */ constant(void 0);
|
|
92
171
|
var constVoid = constUndefined;
|
|
93
172
|
function memoize(f) {
|
|
@@ -460,6 +539,38 @@ function makeCompareSet(equivalence) {
|
|
|
460
539
|
}
|
|
461
540
|
var compareSets = /* @__PURE__ */ makeCompareSet(compareBoth);
|
|
462
541
|
var isEqual = (u) => hasProperty(u, symbol2);
|
|
542
|
+
var asEquivalence = () => equals;
|
|
543
|
+
|
|
544
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.103_patch_hash=78523ded7c3dfc3efd3cec0247f4960d00eaa3d3c96a2077457694a4d8b453c6/node_modules/effect/dist/Reducer.js
|
|
545
|
+
function make2(combine2, initialValue, combineAll) {
|
|
546
|
+
return {
|
|
547
|
+
combine: combine2,
|
|
548
|
+
initialValue,
|
|
549
|
+
combineAll: combineAll ?? ((collection) => {
|
|
550
|
+
let out = initialValue;
|
|
551
|
+
for (const value of collection) {
|
|
552
|
+
out = combine2(out, value);
|
|
553
|
+
}
|
|
554
|
+
return out;
|
|
555
|
+
})
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.103_patch_hash=78523ded7c3dfc3efd3cec0247f4960d00eaa3d3c96a2077457694a4d8b453c6/node_modules/effect/dist/Equivalence.js
|
|
560
|
+
var make3 = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
|
|
561
|
+
|
|
562
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.103_patch_hash=78523ded7c3dfc3efd3cec0247f4960d00eaa3d3c96a2077457694a4d8b453c6/node_modules/effect/dist/internal/doNotation.js
|
|
563
|
+
var let_ = (map7) => dual(3, (self, name, f) => map7(self, (a) => ({
|
|
564
|
+
...a,
|
|
565
|
+
[name]: f(a)
|
|
566
|
+
})));
|
|
567
|
+
var bindTo = (map7) => dual(2, (self, name) => map7(self, (a) => ({
|
|
568
|
+
[name]: a
|
|
569
|
+
})));
|
|
570
|
+
var bind = (map7, flatMap4) => dual(3, (self, name, f) => flatMap4(self, (a) => map7(f(a), (b) => ({
|
|
571
|
+
...a,
|
|
572
|
+
[name]: b
|
|
573
|
+
}))));
|
|
463
574
|
|
|
464
575
|
// ../../node_modules/.pnpm/effect@4.0.0-beta.103_patch_hash=78523ded7c3dfc3efd3cec0247f4960d00eaa3d3c96a2077457694a4d8b453c6/node_modules/effect/dist/Redactable.js
|
|
465
576
|
var symbolRedactable = /* @__PURE__ */ Symbol.for("~effect/Redactable");
|
|
@@ -1180,12 +1291,14 @@ var succeed = (success) => {
|
|
|
1180
1291
|
a.success = success;
|
|
1181
1292
|
return a;
|
|
1182
1293
|
};
|
|
1294
|
+
var getFailure = (self) => isSuccess(self) ? none : some(self.failure);
|
|
1295
|
+
var getSuccess = (self) => isFailure(self) ? none : some(self.success);
|
|
1183
1296
|
|
|
1184
1297
|
// ../../node_modules/.pnpm/effect@4.0.0-beta.103_patch_hash=78523ded7c3dfc3efd3cec0247f4960d00eaa3d3c96a2077457694a4d8b453c6/node_modules/effect/dist/Order.js
|
|
1185
|
-
function
|
|
1298
|
+
function make4(compare3) {
|
|
1186
1299
|
return (self, that) => self === that ? 0 : compare3(self, that);
|
|
1187
1300
|
}
|
|
1188
|
-
var Number2 = /* @__PURE__ */
|
|
1301
|
+
var Number2 = /* @__PURE__ */ make4((self, that) => {
|
|
1189
1302
|
if (globalThis.Number.isNaN(self) && globalThis.Number.isNaN(that)) return 0;
|
|
1190
1303
|
if (globalThis.Number.isNaN(self)) return -1;
|
|
1191
1304
|
if (globalThis.Number.isNaN(that)) return 1;
|
|
@@ -1196,10 +1309,180 @@ var isGreaterThanOrEqualTo = (O) => dual(2, (self, that) => O(self, that) !== -1
|
|
|
1196
1309
|
// ../../node_modules/.pnpm/effect@4.0.0-beta.103_patch_hash=78523ded7c3dfc3efd3cec0247f4960d00eaa3d3c96a2077457694a4d8b453c6/node_modules/effect/dist/Option.js
|
|
1197
1310
|
var none2 = () => none;
|
|
1198
1311
|
var some2 = some;
|
|
1312
|
+
var isOption2 = isOption;
|
|
1199
1313
|
var isNone2 = isNone;
|
|
1200
1314
|
var isSome2 = isSome;
|
|
1315
|
+
var match = /* @__PURE__ */ dual(2, (self, {
|
|
1316
|
+
onNone,
|
|
1317
|
+
onSome: onSome2
|
|
1318
|
+
}) => isNone2(self) ? onNone() : onSome2(self.value));
|
|
1319
|
+
var toRefinement = (f) => (a) => isSome2(f(a));
|
|
1320
|
+
var fromIterable = (collection) => {
|
|
1321
|
+
for (const a of collection) {
|
|
1322
|
+
return some2(a);
|
|
1323
|
+
}
|
|
1324
|
+
return none2();
|
|
1325
|
+
};
|
|
1326
|
+
var getSuccess2 = getSuccess;
|
|
1327
|
+
var getFailure2 = getFailure;
|
|
1328
|
+
var getOrElse = /* @__PURE__ */ dual(2, (self, onNone) => isNone2(self) ? onNone() : self.value);
|
|
1329
|
+
var orElse = /* @__PURE__ */ dual(2, (self, that) => isNone2(self) ? that() : self);
|
|
1330
|
+
var orElseSome = /* @__PURE__ */ dual(2, (self, onNone) => isNone2(self) ? some2(onNone()) : self);
|
|
1331
|
+
var orElseResult = /* @__PURE__ */ dual(2, (self, that) => isNone2(self) ? map(that(), succeed) : map(self, fail));
|
|
1332
|
+
var firstSomeOf = (collection) => {
|
|
1333
|
+
let out = none2();
|
|
1334
|
+
for (out of collection) {
|
|
1335
|
+
if (isSome2(out)) {
|
|
1336
|
+
return out;
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
return out;
|
|
1340
|
+
};
|
|
1341
|
+
var fromNullishOr = (a) => a == null ? none2() : some2(a);
|
|
1342
|
+
var fromUndefinedOr = (a) => a === void 0 ? none2() : some2(a);
|
|
1343
|
+
var fromNullOr = (a) => a === null ? none2() : some2(a);
|
|
1344
|
+
var liftNullishOr = (f) => (...a) => fromNullishOr(f(...a));
|
|
1345
|
+
var getOrNull = /* @__PURE__ */ getOrElse(constNull);
|
|
1346
|
+
var getOrUndefined = /* @__PURE__ */ getOrElse(constUndefined);
|
|
1347
|
+
var liftThrowable = (f) => (...a) => {
|
|
1348
|
+
try {
|
|
1349
|
+
return some2(f(...a));
|
|
1350
|
+
} catch {
|
|
1351
|
+
return none2();
|
|
1352
|
+
}
|
|
1353
|
+
};
|
|
1354
|
+
var getOrThrowWith = /* @__PURE__ */ dual(2, (self, onNone) => {
|
|
1355
|
+
if (isSome2(self)) {
|
|
1356
|
+
return self.value;
|
|
1357
|
+
}
|
|
1358
|
+
throw onNone();
|
|
1359
|
+
});
|
|
1360
|
+
var getOrThrow = /* @__PURE__ */ getOrThrowWith(() => new Error("getOrThrow called on a None"));
|
|
1201
1361
|
var map = /* @__PURE__ */ dual(2, (self, f) => isNone2(self) ? none2() : some2(f(self.value)));
|
|
1362
|
+
var as = /* @__PURE__ */ dual(2, (self, b) => map(self, () => b));
|
|
1363
|
+
var asVoid = /* @__PURE__ */ as(void 0);
|
|
1364
|
+
var void_ = /* @__PURE__ */ some2(void 0);
|
|
1365
|
+
var flatMap = /* @__PURE__ */ dual(2, (self, f) => isNone2(self) ? none2() : f(self.value));
|
|
1366
|
+
var andThen = /* @__PURE__ */ dual(2, (self, f) => flatMap(self, (a) => {
|
|
1367
|
+
const b = isFunction(f) ? f(a) : f;
|
|
1368
|
+
return isOption2(b) ? b : some2(b);
|
|
1369
|
+
}));
|
|
1370
|
+
var flatMapNullishOr = /* @__PURE__ */ dual(2, (self, f) => isNone2(self) ? none2() : fromNullishOr(f(self.value)));
|
|
1371
|
+
var flatten = /* @__PURE__ */ flatMap(identity);
|
|
1372
|
+
var zipRight = /* @__PURE__ */ dual(2, (self, that) => flatMap(self, () => that));
|
|
1373
|
+
var zipLeft = /* @__PURE__ */ dual(2, (self, that) => tap(self, () => that));
|
|
1374
|
+
var composeK = /* @__PURE__ */ dual(2, (afb, bfc) => (a) => flatMap(afb(a), bfc));
|
|
1375
|
+
var tap = /* @__PURE__ */ dual(2, (self, f) => flatMap(self, (a) => map(f(a), () => a)));
|
|
1376
|
+
var product = (self, that) => isSome2(self) && isSome2(that) ? some2([self.value, that.value]) : none2();
|
|
1377
|
+
var productMany = (self, collection) => {
|
|
1378
|
+
if (isNone2(self)) {
|
|
1379
|
+
return none2();
|
|
1380
|
+
}
|
|
1381
|
+
const out = [self.value];
|
|
1382
|
+
for (const o of collection) {
|
|
1383
|
+
if (isNone2(o)) {
|
|
1384
|
+
return none2();
|
|
1385
|
+
}
|
|
1386
|
+
out.push(o.value);
|
|
1387
|
+
}
|
|
1388
|
+
return some2(out);
|
|
1389
|
+
};
|
|
1390
|
+
var all = (input) => {
|
|
1391
|
+
if (Symbol.iterator in input) {
|
|
1392
|
+
const out2 = [];
|
|
1393
|
+
for (const o of input) {
|
|
1394
|
+
if (isNone2(o)) {
|
|
1395
|
+
return none2();
|
|
1396
|
+
}
|
|
1397
|
+
out2.push(o.value);
|
|
1398
|
+
}
|
|
1399
|
+
return some2(out2);
|
|
1400
|
+
}
|
|
1401
|
+
const out = {};
|
|
1402
|
+
for (const key of Object.keys(input)) {
|
|
1403
|
+
const o = input[key];
|
|
1404
|
+
if (isNone2(o)) {
|
|
1405
|
+
return none2();
|
|
1406
|
+
}
|
|
1407
|
+
assignProperty(out, key, o.value);
|
|
1408
|
+
}
|
|
1409
|
+
return some2(out);
|
|
1410
|
+
};
|
|
1411
|
+
var zipWith = /* @__PURE__ */ dual(3, (self, that, f) => map(product(self, that), ([a, b]) => f(a, b)));
|
|
1412
|
+
var reduceCompact = /* @__PURE__ */ dual(3, (self, b, f) => {
|
|
1413
|
+
let out = b;
|
|
1414
|
+
for (const oa of self) {
|
|
1415
|
+
if (isSome2(oa)) {
|
|
1416
|
+
out = f(out, oa.value);
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
return out;
|
|
1420
|
+
});
|
|
1421
|
+
var toArray = (self) => isNone2(self) ? [] : [self.value];
|
|
1422
|
+
var partitionMap = /* @__PURE__ */ dual(2, (self, f) => {
|
|
1423
|
+
if (isNone2(self)) {
|
|
1424
|
+
return [none2(), none2()];
|
|
1425
|
+
}
|
|
1426
|
+
const e = f(self.value);
|
|
1427
|
+
return isFailure(e) ? [some2(e.failure), none2()] : [none2(), some2(e.success)];
|
|
1428
|
+
});
|
|
1429
|
+
var filterMap = /* @__PURE__ */ dual(2, (self, f) => {
|
|
1430
|
+
if (isNone2(self)) {
|
|
1431
|
+
return none2();
|
|
1432
|
+
}
|
|
1433
|
+
const next = f(self.value);
|
|
1434
|
+
return isSuccess(next) ? some2(next.success) : none2();
|
|
1435
|
+
});
|
|
1202
1436
|
var filter = /* @__PURE__ */ dual(2, (self, predicate) => isNone2(self) ? none2() : predicate(self.value) ? some2(self.value) : none2());
|
|
1437
|
+
var makeEquivalence = (isEquivalent) => make3((x, y) => isNone2(x) ? isNone2(y) : isNone2(y) ? false : isEquivalent(x.value, y.value));
|
|
1438
|
+
var makeOrder = (O) => make4((self, that) => isSome2(self) ? isSome2(that) ? O(self.value, that.value) : 1 : -1);
|
|
1439
|
+
var lift2 = (f) => dual(2, (self, that) => zipWith(self, that, f));
|
|
1440
|
+
var liftPredicate = /* @__PURE__ */ dual(2, (b, predicate) => predicate(b) ? some2(b) : none2());
|
|
1441
|
+
var containsWith = (isEquivalent) => dual(2, (self, a) => isNone2(self) ? false : isEquivalent(self.value, a));
|
|
1442
|
+
var contains = /* @__PURE__ */ containsWith(/* @__PURE__ */ asEquivalence());
|
|
1443
|
+
var exists = /* @__PURE__ */ dual(2, (self, refinement) => isNone2(self) ? false : refinement(self.value));
|
|
1444
|
+
var bindTo2 = /* @__PURE__ */ bindTo(map);
|
|
1445
|
+
var let_2 = /* @__PURE__ */ let_(map);
|
|
1446
|
+
var bind2 = /* @__PURE__ */ bind(map, flatMap);
|
|
1447
|
+
var Do = /* @__PURE__ */ some2({});
|
|
1448
|
+
var gen = (...args2) => {
|
|
1449
|
+
const f = args2.length === 1 ? args2[0] : args2[1].bind(args2[0]);
|
|
1450
|
+
const iterator = f();
|
|
1451
|
+
let state = iterator.next();
|
|
1452
|
+
while (!state.done) {
|
|
1453
|
+
const current = state.value;
|
|
1454
|
+
if (isNone2(current)) {
|
|
1455
|
+
return current;
|
|
1456
|
+
}
|
|
1457
|
+
state = iterator.next(current.value);
|
|
1458
|
+
}
|
|
1459
|
+
return some2(state.value);
|
|
1460
|
+
};
|
|
1461
|
+
function makeReducer(combiner) {
|
|
1462
|
+
return make2((self, that) => {
|
|
1463
|
+
if (isNone2(self)) return that;
|
|
1464
|
+
if (isNone2(that)) return self;
|
|
1465
|
+
return some2(combiner.combine(self.value, that.value));
|
|
1466
|
+
}, none2());
|
|
1467
|
+
}
|
|
1468
|
+
function makeCombinerFailFast(combiner) {
|
|
1469
|
+
return make((self, that) => {
|
|
1470
|
+
if (isNone2(self) || isNone2(that)) return none2();
|
|
1471
|
+
return some2(combiner.combine(self.value, that.value));
|
|
1472
|
+
});
|
|
1473
|
+
}
|
|
1474
|
+
function makeReducerFailFast(reducer) {
|
|
1475
|
+
const combine2 = makeCombinerFailFast(reducer).combine;
|
|
1476
|
+
const initialValue = some2(reducer.initialValue);
|
|
1477
|
+
return make2(combine2, initialValue, (collection) => {
|
|
1478
|
+
let out = initialValue;
|
|
1479
|
+
for (const value of collection) {
|
|
1480
|
+
out = combine2(out, value);
|
|
1481
|
+
if (isNone2(out)) return out;
|
|
1482
|
+
}
|
|
1483
|
+
return out;
|
|
1484
|
+
});
|
|
1485
|
+
}
|
|
1203
1486
|
|
|
1204
1487
|
// ../../node_modules/.pnpm/effect@4.0.0-beta.103_patch_hash=78523ded7c3dfc3efd3cec0247f4960d00eaa3d3c96a2077457694a4d8b453c6/node_modules/effect/dist/internal/array.js
|
|
1205
1488
|
var isArrayNonEmpty = (self) => self.length > 0;
|
|
@@ -1208,16 +1491,16 @@ var isArrayNonEmpty = (self) => self.length > 0;
|
|
|
1208
1491
|
var succeed2 = succeed;
|
|
1209
1492
|
var fail2 = fail;
|
|
1210
1493
|
var isFailure2 = isFailure;
|
|
1211
|
-
var
|
|
1494
|
+
var match2 = /* @__PURE__ */ dual(2, (self, {
|
|
1212
1495
|
onFailure,
|
|
1213
1496
|
onSuccess
|
|
1214
1497
|
}) => isFailure2(self) ? onFailure(self.failure) : onSuccess(self.success));
|
|
1215
1498
|
|
|
1216
1499
|
// ../../node_modules/.pnpm/effect@4.0.0-beta.103_patch_hash=78523ded7c3dfc3efd3cec0247f4960d00eaa3d3c96a2077457694a4d8b453c6/node_modules/effect/dist/Array.js
|
|
1217
1500
|
var Array2 = globalThis.Array;
|
|
1218
|
-
var
|
|
1501
|
+
var fromIterable2 = (collection) => Array2.isArray(collection) ? collection : Array2.from(collection);
|
|
1219
1502
|
var append = /* @__PURE__ */ dual(2, (self, last) => [...self, last]);
|
|
1220
|
-
var appendAll = /* @__PURE__ */ dual(2, (self, that) =>
|
|
1503
|
+
var appendAll = /* @__PURE__ */ dual(2, (self, that) => fromIterable2(self).concat(fromIterable2(that)));
|
|
1221
1504
|
var isArray = Array2.isArray;
|
|
1222
1505
|
var isArrayNonEmpty2 = isArrayNonEmpty;
|
|
1223
1506
|
var isReadonlyArrayNonEmpty = isArrayNonEmpty;
|
|
@@ -1237,8 +1520,8 @@ var hashBucketsAdd = (buckets, value) => {
|
|
|
1237
1520
|
return true;
|
|
1238
1521
|
};
|
|
1239
1522
|
var union = /* @__PURE__ */ dual(2, (self, that) => {
|
|
1240
|
-
const a =
|
|
1241
|
-
const b =
|
|
1523
|
+
const a = fromIterable2(self);
|
|
1524
|
+
const b = fromIterable2(that);
|
|
1242
1525
|
if (isReadonlyArrayNonEmpty(a)) {
|
|
1243
1526
|
return isReadonlyArrayNonEmpty(b) ? dedupe(appendAll(a, b)) : a;
|
|
1244
1527
|
}
|
|
@@ -1247,7 +1530,7 @@ var union = /* @__PURE__ */ dual(2, (self, that) => {
|
|
|
1247
1530
|
var empty = () => [];
|
|
1248
1531
|
var map2 = /* @__PURE__ */ dual(2, (self, f) => self.map(f));
|
|
1249
1532
|
var dedupe = (self) => {
|
|
1250
|
-
const input =
|
|
1533
|
+
const input = fromIterable2(self);
|
|
1251
1534
|
if (input.length < 2) {
|
|
1252
1535
|
return [...input];
|
|
1253
1536
|
}
|
|
@@ -1336,7 +1619,7 @@ var ServiceProto = {
|
|
|
1336
1619
|
return self;
|
|
1337
1620
|
},
|
|
1338
1621
|
context(self) {
|
|
1339
|
-
return
|
|
1622
|
+
return make5(this, self);
|
|
1340
1623
|
},
|
|
1341
1624
|
use(f) {
|
|
1342
1625
|
return withFiber((fiber2) => f(get(fiber2.context, this)));
|
|
@@ -1365,7 +1648,7 @@ var applyOverlays = (map7, overlay) => {
|
|
|
1365
1648
|
applyOverlays(map7, overlay.parent);
|
|
1366
1649
|
map7.set(overlay.key, overlay.value);
|
|
1367
1650
|
};
|
|
1368
|
-
var
|
|
1651
|
+
var flatten2 = (self) => {
|
|
1369
1652
|
if (self._flat) return self._flat;
|
|
1370
1653
|
if (!self.overlay) return self._flat = self.base;
|
|
1371
1654
|
const map7 = new Map(self.base);
|
|
@@ -1381,7 +1664,7 @@ var lookup = (self, key) => {
|
|
|
1381
1664
|
const value = impl.base.get(key);
|
|
1382
1665
|
if (value === void 0 && !impl.base.has(key)) return notFound;
|
|
1383
1666
|
if (impl.overlay && ++impl.baseHits >= FlattenAfterBaseHits) {
|
|
1384
|
-
impl.base =
|
|
1667
|
+
impl.base = flatten2(impl);
|
|
1385
1668
|
impl.overlay = void 0;
|
|
1386
1669
|
impl.depth = 0;
|
|
1387
1670
|
}
|
|
@@ -1394,7 +1677,7 @@ var Proto = {
|
|
|
1394
1677
|
_Services: (_) => _
|
|
1395
1678
|
},
|
|
1396
1679
|
get mapUnsafe() {
|
|
1397
|
-
return
|
|
1680
|
+
return flatten2(this);
|
|
1398
1681
|
},
|
|
1399
1682
|
toJSON() {
|
|
1400
1683
|
return {
|
|
@@ -1424,7 +1707,7 @@ var isContext = (u) => hasProperty(u, TypeId3);
|
|
|
1424
1707
|
var isReference = (u) => !!u[ReferenceTypeId];
|
|
1425
1708
|
var empty2 = () => emptyContext2;
|
|
1426
1709
|
var emptyContext2 = /* @__PURE__ */ makeUnsafe(/* @__PURE__ */ new Map());
|
|
1427
|
-
var
|
|
1710
|
+
var make5 = (key, service2) => makeUnsafe(/* @__PURE__ */ new Map([[key.key, service2]]));
|
|
1428
1711
|
var add = /* @__PURE__ */ dual(3, (self, key, service2) => {
|
|
1429
1712
|
const impl = self;
|
|
1430
1713
|
const cacheRoot = cacheKeys.has(key.key) ? void 0 : impl.cacheRoot;
|
|
@@ -1549,7 +1832,7 @@ var fromInputUnsafe = (input) => {
|
|
|
1549
1832
|
if (input[0] === Infinity || input[1] === Infinity) {
|
|
1550
1833
|
return infinity;
|
|
1551
1834
|
}
|
|
1552
|
-
return
|
|
1835
|
+
return make6(roundTiesAwayFromZero(input[0] * 1e9 + input[1]));
|
|
1553
1836
|
}
|
|
1554
1837
|
const obj = input;
|
|
1555
1838
|
let millis2 = 0;
|
|
@@ -1559,8 +1842,8 @@ var fromInputUnsafe = (input) => {
|
|
|
1559
1842
|
if (obj.minutes) millis2 += obj.minutes * 6e4;
|
|
1560
1843
|
if (obj.seconds) millis2 += obj.seconds * 1e3;
|
|
1561
1844
|
if (obj.milliseconds) millis2 += obj.milliseconds;
|
|
1562
|
-
if (!obj.microseconds && !obj.nanoseconds) return
|
|
1563
|
-
return
|
|
1845
|
+
if (!obj.microseconds && !obj.nanoseconds) return make6(millis2);
|
|
1846
|
+
return make6(roundTiesAwayFromZero(millis2 * 1e6 + (obj.microseconds ?? 0) * 1e3 + (obj.nanoseconds ?? 0)));
|
|
1564
1847
|
}
|
|
1565
1848
|
}
|
|
1566
1849
|
return invalid(input);
|
|
@@ -1631,7 +1914,7 @@ var DurationProto = {
|
|
|
1631
1914
|
return pipeArguments(this, arguments);
|
|
1632
1915
|
}
|
|
1633
1916
|
};
|
|
1634
|
-
var
|
|
1917
|
+
var make6 = (input) => {
|
|
1635
1918
|
const duration = Object.create(DurationProto);
|
|
1636
1919
|
if (typeof input === "number") {
|
|
1637
1920
|
if (isNaN(input) || input === 0 || Object.is(input, -0)) {
|
|
@@ -1660,17 +1943,17 @@ var make3 = (input) => {
|
|
|
1660
1943
|
return duration;
|
|
1661
1944
|
};
|
|
1662
1945
|
var isDuration = (u) => hasProperty(u, TypeId4);
|
|
1663
|
-
var zero = /* @__PURE__ */
|
|
1664
|
-
var infinity = /* @__PURE__ */
|
|
1665
|
-
var negativeInfinity = /* @__PURE__ */
|
|
1666
|
-
var nanos = (nanos2) =>
|
|
1667
|
-
var millis = (millis2) =>
|
|
1668
|
-
var seconds = (seconds2) =>
|
|
1669
|
-
var minutes = (minutes2) =>
|
|
1670
|
-
var hours = (hours2) =>
|
|
1671
|
-
var days = (days2) =>
|
|
1672
|
-
var weeks = (weeks2) =>
|
|
1673
|
-
var toMillis = (self) =>
|
|
1946
|
+
var zero = /* @__PURE__ */ make6(0);
|
|
1947
|
+
var infinity = /* @__PURE__ */ make6(Infinity);
|
|
1948
|
+
var negativeInfinity = /* @__PURE__ */ make6(-Infinity);
|
|
1949
|
+
var nanos = (nanos2) => make6(nanos2);
|
|
1950
|
+
var millis = (millis2) => make6(millis2);
|
|
1951
|
+
var seconds = (seconds2) => make6(seconds2 * 1e3);
|
|
1952
|
+
var minutes = (minutes2) => make6(minutes2 * 6e4);
|
|
1953
|
+
var hours = (hours2) => make6(hours2 * 36e5);
|
|
1954
|
+
var days = (days2) => make6(days2 * 864e5);
|
|
1955
|
+
var weeks = (weeks2) => make6(weeks2 * 6048e5);
|
|
1956
|
+
var toMillis = (self) => match3(fromInputUnsafe(self), {
|
|
1674
1957
|
onMillis: identity,
|
|
1675
1958
|
onNanos: (nanos2) => Number(nanos2) / 1e6,
|
|
1676
1959
|
onInfinity: () => Infinity,
|
|
@@ -1688,7 +1971,7 @@ var toNanosUnsafe = (input) => {
|
|
|
1688
1971
|
return roundMillisToNanos(self.value.millis);
|
|
1689
1972
|
}
|
|
1690
1973
|
};
|
|
1691
|
-
var
|
|
1974
|
+
var match3 = /* @__PURE__ */ dual(2, (self, options) => {
|
|
1692
1975
|
switch (self.value._tag) {
|
|
1693
1976
|
case "Millis":
|
|
1694
1977
|
return options.onMillis(self.value.millis);
|
|
@@ -2024,7 +2307,7 @@ var FiberImpl = class {
|
|
|
2024
2307
|
}
|
|
2025
2308
|
let cause = causeInterrupt(fiberId2);
|
|
2026
2309
|
if (this.currentStackFrame) {
|
|
2027
|
-
cause = causeAnnotate(cause,
|
|
2310
|
+
cause = causeAnnotate(cause, make5(StackTraceKey, this.currentStackFrame));
|
|
2028
2311
|
}
|
|
2029
2312
|
if (annotations) {
|
|
2030
2313
|
cause = causeAnnotate(cause, annotations);
|
|
@@ -2055,7 +2338,7 @@ var FiberImpl = class {
|
|
|
2055
2338
|
}
|
|
2056
2339
|
const interruptChildren = fiberMiddleware.interruptChildren && fiberMiddleware.interruptChildren(this);
|
|
2057
2340
|
if (interruptChildren !== void 0) {
|
|
2058
|
-
return this.evaluate(
|
|
2341
|
+
return this.evaluate(flatMap2(interruptChildren, () => exit3));
|
|
2059
2342
|
}
|
|
2060
2343
|
this._exit = exit3;
|
|
2061
2344
|
this.runtimeMetrics?.recordFiberEnd(this.context, this._exit);
|
|
@@ -2085,7 +2368,7 @@ var FiberImpl = class {
|
|
|
2085
2368
|
if (!yielding && !this.currentPreventYield && this.currentScheduler.shouldYield(this)) {
|
|
2086
2369
|
yielding = true;
|
|
2087
2370
|
const prev = current;
|
|
2088
|
-
current =
|
|
2371
|
+
current = flatMap2(yieldNow, () => prev);
|
|
2089
2372
|
}
|
|
2090
2373
|
current = this.currentTracerContext ? this.currentTracerContext(current, this) : current[evaluate](this);
|
|
2091
2374
|
if (current === Yield) {
|
|
@@ -2209,7 +2492,7 @@ var fiberInterruptAll = (fibers) => withFiber((parent) => {
|
|
|
2209
2492
|
fiber2.interruptUnsafe(parent.id, annotations);
|
|
2210
2493
|
fiberArr.push(fiber2);
|
|
2211
2494
|
}
|
|
2212
|
-
return
|
|
2495
|
+
return asVoid2(fiberAwaitAll(fiberArr));
|
|
2213
2496
|
});
|
|
2214
2497
|
var succeed3 = exitSucceed;
|
|
2215
2498
|
var failCause = exitFailCause;
|
|
@@ -2228,7 +2511,7 @@ var suspend = /* @__PURE__ */ makePrimitive({
|
|
|
2228
2511
|
return this[args]();
|
|
2229
2512
|
}
|
|
2230
2513
|
});
|
|
2231
|
-
var fromResult = /* @__PURE__ */
|
|
2514
|
+
var fromResult = /* @__PURE__ */ match2({
|
|
2232
2515
|
onFailure: fail3,
|
|
2233
2516
|
onSuccess: succeed3
|
|
2234
2517
|
});
|
|
@@ -2250,7 +2533,7 @@ var succeedNone = /* @__PURE__ */ succeed3(/* @__PURE__ */ none2());
|
|
|
2250
2533
|
var failCauseSync = (evaluate2) => suspend(() => failCause(internalCall(evaluate2)));
|
|
2251
2534
|
var die = (defect) => exitDie(defect);
|
|
2252
2535
|
var failSync = (error) => suspend(() => fail3(internalCall(error)));
|
|
2253
|
-
var
|
|
2536
|
+
var void_2 = /* @__PURE__ */ succeed3(void 0);
|
|
2254
2537
|
var try_ = (options) => {
|
|
2255
2538
|
const evaluate2 = typeof options === "function" ? options : options.try;
|
|
2256
2539
|
const catcher = typeof options === "function" ? (cause) => new UnknownError(cause, "An error occurred in Effect.try") : options.catch;
|
|
@@ -2322,7 +2605,7 @@ var asyncFinalizer = /* @__PURE__ */ makePrimitive({
|
|
|
2322
2605
|
}
|
|
2323
2606
|
},
|
|
2324
2607
|
[contE](cause, _fiber) {
|
|
2325
|
-
return hasInterrupts(cause) ?
|
|
2608
|
+
return hasInterrupts(cause) ? flatMap2(this[args](), () => failCause(cause)) : failCause(cause);
|
|
2326
2609
|
}
|
|
2327
2610
|
});
|
|
2328
2611
|
var callback = (register) => callbackOptions(register, register.length >= 2);
|
|
@@ -2360,7 +2643,7 @@ var fromIteratorEagerUnsafe = (evaluate2) => {
|
|
|
2360
2643
|
return suspend(() => {
|
|
2361
2644
|
if (isFirstExecution) {
|
|
2362
2645
|
isFirstExecution = false;
|
|
2363
|
-
return
|
|
2646
|
+
return flatMap2(state.value, (value2) => fromIteratorUnsafe(iterator, value2));
|
|
2364
2647
|
} else {
|
|
2365
2648
|
return suspend(() => fromIteratorUnsafe(evaluate2()));
|
|
2366
2649
|
}
|
|
@@ -2392,8 +2675,8 @@ var fromIteratorUnsafe = /* @__PURE__ */ makePrimitive({
|
|
|
2392
2675
|
return this[contA](this[args][1], fiber2);
|
|
2393
2676
|
}
|
|
2394
2677
|
});
|
|
2395
|
-
var
|
|
2396
|
-
var
|
|
2678
|
+
var asVoid2 = (self) => flatMap2(self, (_) => exitVoid);
|
|
2679
|
+
var flatMap2 = /* @__PURE__ */ dual(2, (self, f) => {
|
|
2397
2680
|
const onSuccess = Object.create(OnSuccessProto);
|
|
2398
2681
|
onSuccess[args] = self;
|
|
2399
2682
|
onSuccess[contA] = f.length !== 1 ? (a) => f(a) : f;
|
|
@@ -2411,9 +2694,9 @@ var flatMapEager = /* @__PURE__ */ dual(2, (self, f) => {
|
|
|
2411
2694
|
if (effectIsExit(self)) {
|
|
2412
2695
|
return self._tag === "Success" ? f(self.value) : self;
|
|
2413
2696
|
}
|
|
2414
|
-
return
|
|
2697
|
+
return flatMap2(self, f);
|
|
2415
2698
|
});
|
|
2416
|
-
var map3 = /* @__PURE__ */ dual(2, (self, f) =>
|
|
2699
|
+
var map3 = /* @__PURE__ */ dual(2, (self, f) => flatMap2(self, (a) => succeed3(internalCall(() => f(a)))));
|
|
2417
2700
|
var mapEager = /* @__PURE__ */ dual(2, (self, f) => effectIsExit(self) ? exitMap(self, f) : map3(self, f));
|
|
2418
2701
|
var mapErrorEager = /* @__PURE__ */ dual(2, (self, f) => effectIsExit(self) ? exitMapError(self, f) : mapError(self, f));
|
|
2419
2702
|
var exitIsSuccess = (self) => self._tag === "Success";
|
|
@@ -2481,12 +2764,12 @@ var onExitPrimitive = /* @__PURE__ */ makePrimitive({
|
|
|
2481
2764
|
[contA](value, _, exit3) {
|
|
2482
2765
|
exit3 ??= exitSucceed(value);
|
|
2483
2766
|
const eff = this[args][1](exit3);
|
|
2484
|
-
return eff ?
|
|
2767
|
+
return eff ? flatMap2(eff, (_2) => exit3) : exit3;
|
|
2485
2768
|
},
|
|
2486
2769
|
[contE](cause, _, exit3) {
|
|
2487
2770
|
exit3 ??= exitFailCause(cause);
|
|
2488
2771
|
const eff = this[args][1](exit3);
|
|
2489
|
-
return eff ?
|
|
2772
|
+
return eff ? flatMap2(eff, (_2) => exit3) : exit3;
|
|
2490
2773
|
}
|
|
2491
2774
|
});
|
|
2492
2775
|
var uninterruptible = (self) => withFiber((fiber2) => {
|
|
@@ -2531,7 +2814,7 @@ var iterateEagerImpl = (options) => {
|
|
|
2531
2814
|
const item = items[index];
|
|
2532
2815
|
const effect = onItem(state, item, index);
|
|
2533
2816
|
if (!effectIsExit(effect)) {
|
|
2534
|
-
return
|
|
2817
|
+
return flatMap2(exit(effect), (itemExit) => step(state, item, itemExit, index) ?? runSequential(state, items, index + 1, end) ?? void_2);
|
|
2535
2818
|
}
|
|
2536
2819
|
const terminal = step(state, item, effect, index);
|
|
2537
2820
|
if (terminal) return terminal._tag === "Failure" ? terminal : void 0;
|
|
@@ -2559,7 +2842,7 @@ var iterateEagerImpl = (options) => {
|
|
|
2559
2842
|
terminal = defect;
|
|
2560
2843
|
done2 = true;
|
|
2561
2844
|
interrupted = true;
|
|
2562
|
-
return fibers && fibers.size > 0 ?
|
|
2845
|
+
return fibers && fibers.size > 0 ? flatMap2(uninterruptible(fiberInterruptAll(Array.from(fibers))), () => defect) : defect;
|
|
2563
2846
|
};
|
|
2564
2847
|
const runStep = (item, exit3, currentIndex) => {
|
|
2565
2848
|
if (!orderedStep) return step(state, item, exit3, currentIndex);
|
|
@@ -2598,7 +2881,7 @@ var iterateEagerImpl = (options) => {
|
|
|
2598
2881
|
return suspend(() => {
|
|
2599
2882
|
terminal = exitVoid;
|
|
2600
2883
|
interrupted = true;
|
|
2601
|
-
return fibers ? fiberInterruptAll(fibers) :
|
|
2884
|
+
return fibers ? fiberInterruptAll(fibers) : void_2;
|
|
2602
2885
|
});
|
|
2603
2886
|
});
|
|
2604
2887
|
} else {
|
|
@@ -2637,7 +2920,7 @@ var iterateEagerImpl = (options) => {
|
|
|
2637
2920
|
const eff2 = go();
|
|
2638
2921
|
if (eff2) resume(eff2);
|
|
2639
2922
|
} else if (done2 && fibers.size === 0) {
|
|
2640
|
-
resume(terminal ??
|
|
2923
|
+
resume(terminal ?? void_2);
|
|
2641
2924
|
}
|
|
2642
2925
|
} catch (error) {
|
|
2643
2926
|
resume(failDefect(error));
|
|
@@ -2663,7 +2946,7 @@ var iterateEagerImpl = (options) => {
|
|
|
2663
2946
|
if (!fibers) {
|
|
2664
2947
|
return exitVoid;
|
|
2665
2948
|
} else if (fibers.size === 0) {
|
|
2666
|
-
resume(
|
|
2949
|
+
resume(void_2);
|
|
2667
2950
|
}
|
|
2668
2951
|
}
|
|
2669
2952
|
};
|
|
@@ -2762,7 +3045,7 @@ var ClockImpl = class {
|
|
|
2762
3045
|
if (millis2 <= 0) return yieldNow;
|
|
2763
3046
|
else if (!Number.isFinite(millis2)) return never;
|
|
2764
3047
|
return callback((resume) => {
|
|
2765
|
-
const continuation = millis2 > MAX_TIMER_MILLIS ? this.sleepMillis(millis2 - MAX_TIMER_MILLIS) :
|
|
3048
|
+
const continuation = millis2 > MAX_TIMER_MILLIS ? this.sleepMillis(millis2 - MAX_TIMER_MILLIS) : void_2;
|
|
2766
3049
|
const handle = setTimeout(() => resume(continuation), Math.min(millis2, MAX_TIMER_MILLIS));
|
|
2767
3050
|
return sync(() => clearTimeout(handle));
|
|
2768
3051
|
});
|
|
@@ -2897,7 +3180,7 @@ var TaggedError2 = TaggedError;
|
|
|
2897
3180
|
var succeed4 = exitSucceed;
|
|
2898
3181
|
var failCause2 = exitFailCause;
|
|
2899
3182
|
var fail4 = exitFail;
|
|
2900
|
-
var
|
|
3183
|
+
var void_3 = exitVoid;
|
|
2901
3184
|
var isSuccess3 = exitIsSuccess;
|
|
2902
3185
|
|
|
2903
3186
|
// ../../node_modules/.pnpm/effect@4.0.0-beta.103_patch_hash=78523ded7c3dfc3efd3cec0247f4960d00eaa3d3c96a2077457694a4d8b453c6/node_modules/effect/dist/Clock.js
|
|
@@ -3053,7 +3336,7 @@ var fail5 = fail3;
|
|
|
3053
3336
|
var failCauseSync2 = failCauseSync;
|
|
3054
3337
|
var try_2 = try_;
|
|
3055
3338
|
var fromResult2 = fromResult;
|
|
3056
|
-
var
|
|
3339
|
+
var flatMap3 = flatMap2;
|
|
3057
3340
|
var exit2 = exit;
|
|
3058
3341
|
var map5 = map3;
|
|
3059
3342
|
var catchCause2 = catchCause;
|
|
@@ -3587,7 +3870,7 @@ var Transformation = class _Transformation {
|
|
|
3587
3870
|
function isTransformation(u) {
|
|
3588
3871
|
return hasProperty(u, TypeId7) && u[TypeId7] === TypeId7;
|
|
3589
3872
|
}
|
|
3590
|
-
var
|
|
3873
|
+
var make8 = (options) => {
|
|
3591
3874
|
if (isTransformation(options)) {
|
|
3592
3875
|
return options;
|
|
3593
3876
|
}
|
|
@@ -4104,35 +4387,35 @@ var Objects = class _Objects extends Base2 {
|
|
|
4104
4387
|
let indexes;
|
|
4105
4388
|
const finishIndex = (s, key, k2, inputValue, exitValue) => {
|
|
4106
4389
|
if (exitValue._tag === "Failure") {
|
|
4107
|
-
return wrapPropertyKeyIssue(s, ast, key, exitValue) ??
|
|
4390
|
+
return wrapPropertyKeyIssue(s, ast, key, exitValue) ?? void_3;
|
|
4108
4391
|
}
|
|
4109
4392
|
const value = exitValue === sameExit ? inputValue : exitValue[args];
|
|
4110
4393
|
if (k2 !== missing && value !== missing) {
|
|
4111
|
-
if (hasProperties && (expectedKeysSet.has(key) || expectedKeysSet.has(k2))) return
|
|
4394
|
+
if (hasProperties && (expectedKeysSet.has(key) || expectedKeysSet.has(k2))) return void_3;
|
|
4112
4395
|
assignProperty(s.out, k2, value);
|
|
4113
4396
|
}
|
|
4114
|
-
return
|
|
4397
|
+
return void_3;
|
|
4115
4398
|
};
|
|
4116
4399
|
const parseIndex = (s, key, index, exitKey) => {
|
|
4117
4400
|
if (!exitKey) {
|
|
4118
4401
|
const eff = index.parserKey(key, s.options);
|
|
4119
4402
|
if (!effectIsExit(eff)) {
|
|
4120
|
-
return
|
|
4403
|
+
return flatMap3(exit2(eff), (exit3) => parseIndex(s, key, index, exit3));
|
|
4121
4404
|
}
|
|
4122
4405
|
exitKey = eff;
|
|
4123
4406
|
}
|
|
4124
4407
|
if (exitKey._tag === "Failure") {
|
|
4125
|
-
return wrapPropertyKeyIssue(s, ast, key, exitKey) ??
|
|
4408
|
+
return wrapPropertyKeyIssue(s, ast, key, exitKey) ?? void_3;
|
|
4126
4409
|
}
|
|
4127
4410
|
const k2 = exitKey === sameExit ? key : exitKey[args];
|
|
4128
4411
|
const inputValue = s.input[key];
|
|
4129
4412
|
const result2 = index.parserValue(inputValue, s.options);
|
|
4130
|
-
return effectIsExit(result2) ? finishIndex(s, key, k2, inputValue, result2) :
|
|
4413
|
+
return effectIsExit(result2) ? finishIndex(s, key, k2, inputValue, result2) : flatMap3(exit2(result2), (exit3) => finishIndex(s, key, k2, inputValue, exit3));
|
|
4131
4414
|
};
|
|
4132
4415
|
const parseStringIndex = (s, key, index) => {
|
|
4133
4416
|
const inputValue = s.input[key];
|
|
4134
4417
|
const result2 = index.parserValue(inputValue, s.options);
|
|
4135
|
-
return effectIsExit(result2) ? finishIndex(s, key, key, inputValue, result2) :
|
|
4418
|
+
return effectIsExit(result2) ? finishIndex(s, key, key, inputValue, result2) : flatMap3(exit2(result2), (exit3) => finishIndex(s, key, key, inputValue, exit3));
|
|
4136
4419
|
};
|
|
4137
4420
|
const parseIndexes = indexCount ? iterateEager()({
|
|
4138
4421
|
onItem: (s, [key, index]) => parseIndex(s, key, index),
|
|
@@ -4613,7 +4896,7 @@ var parseUnion = /* @__PURE__ */ iterateEager()({
|
|
|
4613
4896
|
if (s.successes) {
|
|
4614
4897
|
s.successes.push(candidate);
|
|
4615
4898
|
} else {
|
|
4616
|
-
return
|
|
4899
|
+
return void_3;
|
|
4617
4900
|
}
|
|
4618
4901
|
}
|
|
4619
4902
|
}
|
|
@@ -4799,18 +5082,18 @@ function appendTransformation(from, transformation, to) {
|
|
|
4799
5082
|
const link2 = new Link(from, transformation);
|
|
4800
5083
|
return replaceEncoding(to, to.encoding ? [...to.encoding, link2] : [link2]);
|
|
4801
5084
|
}
|
|
4802
|
-
function mapOrSame(
|
|
5085
|
+
function mapOrSame(as3, f) {
|
|
4803
5086
|
let changed = false;
|
|
4804
|
-
const out = new Array(
|
|
4805
|
-
for (let i = 0; i <
|
|
4806
|
-
const a =
|
|
5087
|
+
const out = new Array(as3.length);
|
|
5088
|
+
for (let i = 0; i < as3.length; i++) {
|
|
5089
|
+
const a = as3[i];
|
|
4807
5090
|
const fa = f(a);
|
|
4808
5091
|
if (fa !== a) {
|
|
4809
5092
|
changed = true;
|
|
4810
5093
|
}
|
|
4811
5094
|
out[i] = fa;
|
|
4812
5095
|
}
|
|
4813
|
-
return changed ? out :
|
|
5096
|
+
return changed ? out : as3;
|
|
4814
5097
|
}
|
|
4815
5098
|
function annotateKey(ast, annotations) {
|
|
4816
5099
|
const context2 = ast.context ? new Context(ast.context.isOptional, ast.context.isMutable, ast.context.defaultValue, {
|
|
@@ -5129,7 +5412,7 @@ function makeOption(schema) {
|
|
|
5129
5412
|
return none2();
|
|
5130
5413
|
};
|
|
5131
5414
|
}
|
|
5132
|
-
function
|
|
5415
|
+
function make9(schema) {
|
|
5133
5416
|
const parser = makeEffect(schema);
|
|
5134
5417
|
return (input, options) => {
|
|
5135
5418
|
const exit3 = runSyncExit2(parser(input, options));
|
|
@@ -5221,7 +5504,7 @@ function makeParser(ast) {
|
|
|
5221
5504
|
}
|
|
5222
5505
|
}
|
|
5223
5506
|
} else {
|
|
5224
|
-
result2 =
|
|
5507
|
+
result2 = flatMap3(result2, (value) => {
|
|
5225
5508
|
if (input !== missing && value !== missing) {
|
|
5226
5509
|
const issues = collectIssues(encodingChecks, input, void 0, ast, options);
|
|
5227
5510
|
if (issues) {
|
|
@@ -5243,7 +5526,7 @@ function makeParser(ast) {
|
|
|
5243
5526
|
}
|
|
5244
5527
|
}
|
|
5245
5528
|
} else {
|
|
5246
|
-
result2 =
|
|
5529
|
+
result2 = flatMap3(result2, (value) => {
|
|
5247
5530
|
if (value !== missing) {
|
|
5248
5531
|
const issues = collectIssues(checks, value, void 0, ast, options);
|
|
5249
5532
|
if (issues) {
|
|
@@ -5321,17 +5604,17 @@ var SchemaProto = {
|
|
|
5321
5604
|
return this.rebuild(appendChecks(this.ast, checks));
|
|
5322
5605
|
}
|
|
5323
5606
|
};
|
|
5324
|
-
function
|
|
5607
|
+
function make10(ast, options) {
|
|
5325
5608
|
function Schema() {
|
|
5326
5609
|
}
|
|
5327
5610
|
const self = Object.defineProperties(Object.setPrototypeOf(Schema, SchemaProto), Object.getOwnPropertyDescriptors({
|
|
5328
5611
|
...options
|
|
5329
5612
|
}));
|
|
5330
5613
|
self.ast = ast;
|
|
5331
|
-
self.rebuild = (ast2) =>
|
|
5614
|
+
self.rebuild = (ast2) => make10(ast2, options);
|
|
5332
5615
|
const makeEffect2 = makeEffect(self);
|
|
5333
5616
|
self.makeEffect = (input, options2) => fromIssueEffect(makeEffect2(input, options2));
|
|
5334
|
-
self.make =
|
|
5617
|
+
self.make = make9(self);
|
|
5335
5618
|
self.makeOption = makeOption(self);
|
|
5336
5619
|
return self;
|
|
5337
5620
|
}
|
|
@@ -6198,7 +6481,7 @@ function fromASTs(asts) {
|
|
|
6198
6481
|
// ../../node_modules/.pnpm/effect@4.0.0-beta.103_patch_hash=78523ded7c3dfc3efd3cec0247f4960d00eaa3d3c96a2077457694a4d8b453c6/node_modules/effect/dist/Schema.js
|
|
6199
6482
|
function declareConstructor() {
|
|
6200
6483
|
return (typeParameters, run3, annotations) => {
|
|
6201
|
-
return
|
|
6484
|
+
return make11(new Declaration(typeParameters.map(getAST), (typeParameters2) => run3(typeParameters2.map((ast) => make11(ast))), annotations));
|
|
6202
6485
|
};
|
|
6203
6486
|
}
|
|
6204
6487
|
function declare(is2, annotations) {
|
|
@@ -6241,13 +6524,13 @@ function decodeUnknownSync(schema, options) {
|
|
|
6241
6524
|
return runSchemaErrorSync(parser(input, options2));
|
|
6242
6525
|
};
|
|
6243
6526
|
}
|
|
6244
|
-
var
|
|
6245
|
-
var optionalKey2 = /* @__PURE__ */ lambda((schema) =>
|
|
6527
|
+
var make11 = make10;
|
|
6528
|
+
var optionalKey2 = /* @__PURE__ */ lambda((schema) => make11(optionalKey(schema.ast), {
|
|
6246
6529
|
schema
|
|
6247
6530
|
}));
|
|
6248
6531
|
var optional = /* @__PURE__ */ lambda((self) => optionalKey2(UndefinedOr(self)));
|
|
6249
6532
|
function Literal2(literal) {
|
|
6250
|
-
const out =
|
|
6533
|
+
const out = make11(new Literal(literal), {
|
|
6251
6534
|
literal,
|
|
6252
6535
|
transform(to) {
|
|
6253
6536
|
return out.pipe(decodeTo2(Literal2(to), {
|
|
@@ -6258,14 +6541,14 @@ function Literal2(literal) {
|
|
|
6258
6541
|
});
|
|
6259
6542
|
return out;
|
|
6260
6543
|
}
|
|
6261
|
-
var Unknown2 = /* @__PURE__ */
|
|
6262
|
-
var Null2 = /* @__PURE__ */
|
|
6263
|
-
var Undefined2 = /* @__PURE__ */
|
|
6264
|
-
var String4 = /* @__PURE__ */
|
|
6265
|
-
var Number5 = /* @__PURE__ */
|
|
6266
|
-
var Boolean3 = /* @__PURE__ */
|
|
6544
|
+
var Unknown2 = /* @__PURE__ */ make11(unknown);
|
|
6545
|
+
var Null2 = /* @__PURE__ */ make11(null_);
|
|
6546
|
+
var Undefined2 = /* @__PURE__ */ make11(undefined_2);
|
|
6547
|
+
var String4 = /* @__PURE__ */ make11(string2);
|
|
6548
|
+
var Number5 = /* @__PURE__ */ make11(number2);
|
|
6549
|
+
var Boolean3 = /* @__PURE__ */ make11(boolean);
|
|
6267
6550
|
function makeStruct(ast, fields) {
|
|
6268
|
-
return
|
|
6551
|
+
return make11(ast, {
|
|
6269
6552
|
fields,
|
|
6270
6553
|
mapFields(f, options) {
|
|
6271
6554
|
const fields2 = f(this.fields);
|
|
@@ -6277,7 +6560,7 @@ function Struct(fields) {
|
|
|
6277
6560
|
return makeStruct(struct(fields, void 0), fields);
|
|
6278
6561
|
}
|
|
6279
6562
|
function makeTuple(ast, elements) {
|
|
6280
|
-
return
|
|
6563
|
+
return make11(ast, {
|
|
6281
6564
|
elements,
|
|
6282
6565
|
mapElements(f, options) {
|
|
6283
6566
|
const elements2 = f(this.elements);
|
|
@@ -6288,11 +6571,11 @@ function makeTuple(ast, elements) {
|
|
|
6288
6571
|
function Tuple(elements) {
|
|
6289
6572
|
return makeTuple(tuple(elements), elements);
|
|
6290
6573
|
}
|
|
6291
|
-
var ArraySchema = /* @__PURE__ */ lambda((schema) =>
|
|
6574
|
+
var ArraySchema = /* @__PURE__ */ lambda((schema) => make11(new Arrays(false, [], [schema.ast]), {
|
|
6292
6575
|
value: schema
|
|
6293
6576
|
}));
|
|
6294
6577
|
function makeUnion(ast, members) {
|
|
6295
|
-
return
|
|
6578
|
+
return make11(ast, {
|
|
6296
6579
|
members,
|
|
6297
6580
|
mapMembers(f, options) {
|
|
6298
6581
|
const members2 = f(this.members);
|
|
@@ -6305,7 +6588,7 @@ function Union2(members, options) {
|
|
|
6305
6588
|
}
|
|
6306
6589
|
function Literals(literals) {
|
|
6307
6590
|
const members = literals.map(Literal2);
|
|
6308
|
-
return
|
|
6591
|
+
return make11(union2(members, "anyOf", void 0), {
|
|
6309
6592
|
literals,
|
|
6310
6593
|
members,
|
|
6311
6594
|
mapMembers(f) {
|
|
@@ -6323,14 +6606,14 @@ var NullOr = /* @__PURE__ */ lambda((self) => Union2([self, Null2]));
|
|
|
6323
6606
|
var UndefinedOr = /* @__PURE__ */ lambda((self) => Union2([self, Undefined2]));
|
|
6324
6607
|
function decodeTo2(to, transformation) {
|
|
6325
6608
|
return (from) => {
|
|
6326
|
-
return
|
|
6609
|
+
return make11(decodeTo(from.ast, to.ast, transformation ? make8(transformation) : passthrough2()), {
|
|
6327
6610
|
from,
|
|
6328
6611
|
to
|
|
6329
6612
|
});
|
|
6330
6613
|
};
|
|
6331
6614
|
}
|
|
6332
6615
|
function withConstructorDefault2(defaultValue) {
|
|
6333
|
-
return (schema) =>
|
|
6616
|
+
return (schema) => make11(withConstructorDefault(schema.ast, toIssueEffect(defaultValue)), {
|
|
6334
6617
|
schema
|
|
6335
6618
|
});
|
|
6336
6619
|
}
|
|
@@ -6345,7 +6628,7 @@ function instanceOf(constructor, annotations) {
|
|
|
6345
6628
|
}
|
|
6346
6629
|
function link() {
|
|
6347
6630
|
return (encodeTo, transformation) => {
|
|
6348
|
-
return new Link(encodeTo.ast,
|
|
6631
|
+
return new Link(encodeTo.ast, make8(transformation));
|
|
6349
6632
|
};
|
|
6350
6633
|
}
|
|
6351
6634
|
var makeFilter2 = makeFilter;
|
|
@@ -6377,7 +6660,7 @@ function isBase64(annotations) {
|
|
|
6377
6660
|
...annotations
|
|
6378
6661
|
});
|
|
6379
6662
|
}
|
|
6380
|
-
var Finite = /* @__PURE__ */
|
|
6663
|
+
var Finite = /* @__PURE__ */ make11(finite);
|
|
6381
6664
|
function makeIsGreaterThanOrEqualTo(options) {
|
|
6382
6665
|
const gte = isGreaterThanOrEqualTo(options.order);
|
|
6383
6666
|
const formatter = options.formatter ?? format;
|
|
@@ -6575,7 +6858,7 @@ var File = /* @__PURE__ */ instanceOf(globalThis.File, {
|
|
|
6575
6858
|
name: String4,
|
|
6576
6859
|
lastModified: Int
|
|
6577
6860
|
}), transformOrFail2({
|
|
6578
|
-
decode: (e) =>
|
|
6861
|
+
decode: (e) => match2(decodeBase64(e.data), {
|
|
6579
6862
|
onFailure: () => fail5(new InvalidValue({
|
|
6580
6863
|
message: "Expected a valid Base64 string"
|
|
6581
6864
|
})),
|
|
@@ -6736,7 +7019,7 @@ function toCodecJsonBase(ast, recur) {
|
|
|
6736
7019
|
if (!isFunction(getLink)) {
|
|
6737
7020
|
return replaceEncoding(ast, [unknownToJson]);
|
|
6738
7021
|
}
|
|
6739
|
-
const typeParameters = ast.typeParameters.map((tp) =>
|
|
7022
|
+
const typeParameters = ast.typeParameters.map((tp) => make10(toEncoded(tp)));
|
|
6740
7023
|
const link2 = getLink(typeParameters);
|
|
6741
7024
|
return link2 === void 0 ? ast : replaceEncoding(ast, [mapLink(link2, recur)]);
|
|
6742
7025
|
}
|
|
@@ -6901,11 +7184,12 @@ var en_default = {
|
|
|
6901
7184
|
noGoal: "Start a goal before publishing or reverting the handbook. Without a goal there are no team members, acknowledgement gates or reminders.",
|
|
6902
7185
|
noRequirement: "No handbook release requires acknowledgement yet.",
|
|
6903
7186
|
wrongRelease: "Acknowledge handbook release {{release}}, the currently required version.",
|
|
6904
|
-
guard: "{{member}} has not acknowledged handbook release {{release}} yet. The team plugin has asked them to; when they do, you are woken if items still wait to be assigned. Assign then; do not retry on a timer.",
|
|
6905
|
-
leadAcknowledged: "{{member}} acknowledged handbook release {{release}}. Assignments to them are no longer refused: assign the items still waiting.",
|
|
6906
7187
|
reminder: "Handbook release {{release}} requires acknowledgement. Read wiki_read_handbook, then call team_acknowledge_handbook with this release number.",
|
|
6907
|
-
|
|
6908
|
-
|
|
7188
|
+
startNotAssigned: "This work item is not assigned to you, so you cannot start it. Work only on items assigned to you; if you have none, end your turn and wait for the lead to assign you one.",
|
|
7189
|
+
startNeedsAck: "Acknowledge handbook release {{release}} before starting work: read it with wiki_read_handbook, call team_acknowledge_handbook with release {{release}}, then claim this item again.",
|
|
7190
|
+
memberHold: "Only acknowledge it in this turn, then end the turn: do not start any work item that is not assigned to you. You are woken when the lead assigns you one.",
|
|
7191
|
+
memberBrief: "First step: read the handbook with wiki_read_handbook and call team_acknowledge_handbook for its currently required release; reading alone does not acknowledge it, and you cannot claim or start work until you have.",
|
|
7192
|
+
leadBrief: "Read the handbook with wiki_read_handbook and explicitly acknowledge its currently required release with team_acknowledge_handbook before taking new work. Publish or revert it through team_publish_handbook or team_revert_handbook; publishing a release that requires acknowledgement also acknowledges it for you."
|
|
6909
7193
|
},
|
|
6910
7194
|
tab: { title: "Teams" },
|
|
6911
7195
|
page: {
|
|
@@ -7178,9 +7462,10 @@ var en_default = {
|
|
|
7178
7462
|
};
|
|
7179
7463
|
|
|
7180
7464
|
// src/handbook/messages.ts
|
|
7181
|
-
function handbookMessage(key, release
|
|
7182
|
-
return en_default.handbook[key].replace(/{{release}}/g, String(release ?? ""))
|
|
7465
|
+
function handbookMessage(key, release) {
|
|
7466
|
+
return en_default.handbook[key].replace(/{{release}}/g, String(release ?? ""));
|
|
7183
7467
|
}
|
|
7468
|
+
var handbookReminder = (release, toLead) => toLead ? handbookMessage("reminder", release) : `${handbookMessage("reminder", release)} ${handbookMessage("memberHold")}`;
|
|
7184
7469
|
|
|
7185
7470
|
// src/domain/leadBrief.ts
|
|
7186
7471
|
var PERSON_MESSAGE_RULE = "Send a message to the person only for a product decision you cannot make yourself; put progress, updates and technical problems in work item comments with work_post_comment instead.";
|
|
@@ -7190,6 +7475,9 @@ var MEMBER_NO_STASH_RULE = `${NO_STASH} To try something you can undo, commit to
|
|
|
7190
7475
|
var MEMBER_ASK_BEFORE_OUTSIDE_RULE = "Before you change dependencies or patches, write outside the project root, or fetch code from the network (git clone, downloads), mention your lead in a work item comment and wait for an answer.";
|
|
7191
7476
|
var MEMBER_READ_RANGES_RULE = "Read files in ranges: find the place with Grep first, then read only the lines you need; read only the relevant section of a skill file.";
|
|
7192
7477
|
var LEAD_ACCEPT_RULE = `When you check a finished item, run the checks that this project's rules name yourself. Send the item back if its changes touch patches/ or a lockfile, unless the item has a comment from you approving that change. ${NO_STASH} To compare against the base, run the same check in your own working directory on the base branch and compare the error counts; do not stash in the member's worktree.`;
|
|
7478
|
+
var PROGRESS_CHECKIN_MINUTES = 20;
|
|
7479
|
+
var PROGRESS_CHECKIN_LIMIT = 2;
|
|
7480
|
+
var MEMBER_PROGRESS_RULE = `Report as you go: each time a group of tests turns green, a file you changed passes its typecheck, you are about to change approach because you are stuck, or you are about to stop and wait for someone, commit what you have to your own branch (a work-in-progress commit is fine) and post one line of progress and any blocker on the item with work_post_comment. Do not wait until the whole item is done. If an item of yours goes ${PROGRESS_CHECKIN_MINUTES} minutes with no progress from you, the team plugin mentions you on it to ask; answer it the same way.`;
|
|
7193
7481
|
var memberStuckRule = (leadThreadId) => {
|
|
7194
7482
|
const mention = leadThreadId === void 0 ? "" : ` that mentions your lead (mentions: [{ "kind": "agent", "threadId": "${leadThreadId}" }])`;
|
|
7195
7483
|
const reply = leadThreadId === void 0 ? "" : " Your lead will reply or change the plan.";
|
|
@@ -7197,12 +7485,12 @@ var memberStuckRule = (leadThreadId) => {
|
|
|
7197
7485
|
};
|
|
7198
7486
|
var LEAD_STUCK_RULE = "When a member is stuck, answer in that item's comments before you next look in on members: give a concrete direction, split the item, or reassign it. A member is stuck when they mention you because they are stuck, and also when a comment of theirs reports a blocker, such as a test or error they cannot get past, even if it does not mention you. Do not just note it.";
|
|
7199
7487
|
var LEAD_REPEATED_BLOCKER_RULE = "If, when you look in, a blocker a member reported is still there and their branch has no new commit since your last look-in, do not just ask for a work-in-progress commit: ask what they have tried and which exact line fails, then give a direction, or split or reassign the item.";
|
|
7200
|
-
var LEAD_CLAIM_CHECK_RULE = "Each time you look in on members, also check that every item you assigned has been moved to In Progress by the member it is assigned to, and that no two members are working on the same item; if an item has not been started or is being worked on twice, ask about it in its comments or reassign it.";
|
|
7488
|
+
var LEAD_CLAIM_CHECK_RULE = "Each time you look in on members, also check that every item you assigned has been moved to In Progress by the member it is assigned to, and that no two members are working on the same item; if an item has not been started or is being worked on twice, ask about it in its comments or reassign it. For each member whose worktree you can read on this machine, also run git status and git log there: if it has uncommitted changes, or commits newer than the last item they delivered, while none of their items is In Progress or waiting for your review, post a comment with work_post_comment that mentions them on the item they are assigned, asking which item they are working on and telling them to claim it with work_claim_item before they change anything else.";
|
|
7201
7489
|
var LEAD_SCHEDULE_CHECKIN_RULE = "Before you end a turn while any item of this goal is not done, including items still in Backlog and items assigned but not started, make sure your next look-in is scheduled: call list_wakes, and if no wake-up is waiting for you, call schedule_wake with delaySeconds of at most 900 and a note saying to look in on members. Nothing else wakes you while nobody has started an item.";
|
|
7202
7490
|
var LEAD_SPLIT_RULE = "Use work_create_item to split the goal into a few work items: one item per task, with a clear action in the title. Members do not see this conversation or your goal, so put everything a member needs into the description: the deliverable, the constraints, and how to hand the work in. Create them without assignees.";
|
|
7203
7491
|
var LEAD_OWN_ITEM_RULE = "If a work item for this goal is assigned to you, also record it as blocked by every item you create. Each time a member marks an item done you will be told, so check it then; when they are all done, mark that item done with work_update_item.";
|
|
7204
7492
|
var LEAD_REBALANCE_RULE = "When a member has nothing in progress while another member has an item waiting in line that is not blocked, move one waiting item to the idle member with work_update_item.";
|
|
7205
|
-
var LEAD_CHECKPOINT_RULE =
|
|
7493
|
+
var LEAD_CHECKPOINT_RULE = `Members commit and post a one-line progress comment each time they reach a step (a group of tests turns green, a file passes its typecheck, before they change approach, before they stop to wait for someone), and the team plugin mentions a member on an item in progress after ${PROGRESS_CHECKIN_MINUTES} minutes with no progress from them, up to ${PROGRESS_CHECKIN_LIMIT} times in a row. Each time you look in on members, check each item in progress: if the plugin has asked the member and there has been no answer for ${PROGRESS_CHECKIN_LIMIT * PROGRESS_CHECKIN_MINUTES} minutes since its first ask (a member on another machine that has gone offline is asked only once), or the member keeps posting progress but their branch has had no new commit for more than 30 minutes, post a comment with work_post_comment that mentions the member and asks them to run the tests and typecheck for what they have changed so far, commit the work in progress to their branch, and post a one-line progress and blocker comment on the item. Take the times from work_history and, when you can read the member's worktree on this machine, from git log -1 --format=%cI there, and compare them with the current time; do not estimate. When you cannot read their worktree, as with a remote member, judge by work_history and comments alone; not being able to see commits does not mean there are none.`;
|
|
7206
7494
|
var LEAD_SEND_BACK_RULE = "If a finished item is not acceptable, send it back: use work_update_item to set its state back to an open one (see work_list_states), and change its assignees too if someone else should redo it. Then say what is wrong in a comment with work_post_comment, mentioning the member.";
|
|
7207
7495
|
var LEAD_NO_MEMBER_TASKS = "Do not do members' tasks yourself, and never assign an item you create to yourself: merging, pushing and integrating the work are member tasks too.";
|
|
7208
7496
|
var tableCell = (value) => value.replace(/\|/g, "\\|").replace(/[\r\n]/g, " ");
|
|
@@ -8031,7 +8319,7 @@ function registerBoardCommands(ctx, goals, rosters, wakes, options = {}) {
|
|
|
8031
8319
|
{ items: rows, truncated },
|
|
8032
8320
|
goalItem,
|
|
8033
8321
|
memberThreads,
|
|
8034
|
-
|
|
8322
|
+
leadThread,
|
|
8035
8323
|
wakeState
|
|
8036
8324
|
] = await Promise.all([
|
|
8037
8325
|
Promise.all(
|
|
@@ -8067,11 +8355,11 @@ function registerBoardCommands(ctx, goals, rosters, wakes, options = {}) {
|
|
|
8067
8355
|
goal,
|
|
8068
8356
|
[
|
|
8069
8357
|
...memberThreads?.items ?? [],
|
|
8070
|
-
...
|
|
8358
|
+
...leadThread === null ? [] : [
|
|
8071
8359
|
{
|
|
8072
|
-
threadId:
|
|
8073
|
-
status:
|
|
8074
|
-
summary: { latestTurn:
|
|
8360
|
+
threadId: leadThread.id,
|
|
8361
|
+
status: leadThread.status,
|
|
8362
|
+
summary: { latestTurn: leadThread.latestTurn }
|
|
8075
8363
|
}
|
|
8076
8364
|
]
|
|
8077
8365
|
],
|
|
@@ -8466,6 +8754,8 @@ function createRosterService(ctx, options = {}) {
|
|
|
8466
8754
|
|
|
8467
8755
|
// src/runtime/deliver.ts
|
|
8468
8756
|
import * as NodeCrypto from "node:crypto";
|
|
8757
|
+
var recipientOf = (principal) => principal.kind === "agent" && principal.threadId !== void 0 ? { threadId: principal.threadId } : principal.kind === "remote-agent" && principal.principalId !== void 0 ? { principalId: principal.principalId } : void 0;
|
|
8758
|
+
var recipientKey = (who) => "threadId" in who ? `thread:${who.threadId}` : `principal:${who.principalId}`;
|
|
8469
8759
|
var worktreeSetupSentence = async (ctx, projectId, branch) => {
|
|
8470
8760
|
const intro = `You are in your own newly created worktree on branch ${branch}.`;
|
|
8471
8761
|
const project2 = await ctx.projects.get({ projectId }).catch(() => null);
|
|
@@ -8502,6 +8792,7 @@ var createMemberWorktreeLane = (state, events) => {
|
|
|
8502
8792
|
};
|
|
8503
8793
|
var shortReason = (error) => (error instanceof Error ? error.message : String(error)).replace(/\s+/g, " ").trim().slice(0, 240) || "Worktree preparation failed";
|
|
8504
8794
|
var FALLBACK_SUFFIX = ":worktree-fallback";
|
|
8795
|
+
var wakeRequestId = (id) => `team-wake:${id}`;
|
|
8505
8796
|
async function deliverWake(ctx, input) {
|
|
8506
8797
|
const { recipient } = input;
|
|
8507
8798
|
if ("principalId" in recipient) {
|
|
@@ -9150,12 +9441,13 @@ var agentThreads = (principals) => [
|
|
|
9150
9441
|
...new Set(principals.flatMap((p) => p.kind === "agent" ? [p.threadId] : []))
|
|
9151
9442
|
];
|
|
9152
9443
|
var commentRecipients = (project2, actor, people) => {
|
|
9444
|
+
const author = recipientOf(actor);
|
|
9153
9445
|
const recipients = /* @__PURE__ */ new Map();
|
|
9154
9446
|
for (const person of people) {
|
|
9155
|
-
|
|
9156
|
-
|
|
9157
|
-
|
|
9158
|
-
|
|
9447
|
+
const recipient = recipientOf(person);
|
|
9448
|
+
if (recipient === void 0) continue;
|
|
9449
|
+
const key = recipientKey(recipient);
|
|
9450
|
+
if (author === void 0 || recipientKey(author) !== key) recipients.set(key, recipient);
|
|
9159
9451
|
}
|
|
9160
9452
|
return [...recipients.values()].filter((recipient) => isMember(project2, recipient));
|
|
9161
9453
|
};
|
|
@@ -9513,7 +9805,7 @@ var itemHeadline = (sequenceId, item) => {
|
|
|
9513
9805
|
const parts = [title, descriptionStart(item?.description)].filter((part) => part !== "");
|
|
9514
9806
|
return parts.length === 0 ? "" : `${parts.join(" ")} `;
|
|
9515
9807
|
};
|
|
9516
|
-
var itemText = (workItemId, sequenceId, item, leadThreadId) => `${itemHeadline(sequenceId, item)}You have ${workLabel(workItemId, sequenceId)}.
|
|
9808
|
+
var itemText = (workItemId, sequenceId, item, leadThreadId) => `${itemHeadline(sequenceId, item)}You have ${workLabel(workItemId, sequenceId)}. ${handbookMessage("memberBrief")} Then read it with work_read_items, passing workItemIds: ["${workItemId}"]. If it is blocked by items that are not done yet, do not start it; you will be told again when they are done. Otherwise claim it with work_claim_item before you change any file. Before you change anything, search this repository's rules and checks with memory_search and follow what applies. Then work on it. ${MEMBER_READ_RANGES_RULE} ${MEMBER_NO_STASH_RULE} ${MEMBER_ASK_BEFORE_OUTSIDE_RULE} ${MEMBER_CHECKS_RULE} ${MEMBER_PROGRESS_RULE} ${memberStuckRule(leadThreadId)} ${PERSON_MESSAGE_RULE}`;
|
|
9517
9809
|
var leadItemText = (workItemId, sequenceId, title) => `You have ${titled(workItemId, sequenceId, title)}. You lead this team, so this item is the goal itself: do not claim it or do its work yourself. Read it with work_read_items, passing workItemIds: ["${workItemId}"]. If it has no work items yet, split it as your team brief says. ${LEAD_SPLIT_RULE} ${LEAD_OWN_ITEM_RULE} Record dependencies and assign each item to one member as the brief describes. ${LEAD_NO_MEMBER_TASKS} ${PERSON_MESSAGE_RULE}`;
|
|
9518
9810
|
var leadUnblockedText = (workItemId, sequenceId, title) => `Everything blocking ${titled(workItemId, sequenceId, title)} is done now. Read those items with work_read_items and check the results. ${LEAD_ACCEPT_RULE} ${LEAD_SEND_BACK_RULE} When all of them are acceptable, mark this item done with work_update_item. ${LEAD_NO_MEMBER_TASKS}`;
|
|
9519
9811
|
var unblockedText = (workItemId, sequenceId, title) => `Everything blocking ${titled(workItemId, sequenceId, title)} is done now. Read those items with work_read_items, finish this one, and mark it done with work_update_item.`;
|
|
@@ -9552,7 +9844,7 @@ function startWakeRuntime(ctx, goals, options = {}) {
|
|
|
9552
9844
|
const delivered = await deliverWake(ctx, {
|
|
9553
9845
|
projectId: wake.projectId,
|
|
9554
9846
|
recipient: wake,
|
|
9555
|
-
requestId:
|
|
9847
|
+
requestId: wakeRequestId(id),
|
|
9556
9848
|
messageId: `team-wake-msg:${id}`,
|
|
9557
9849
|
memberWorktree: worktree === void 0 ? void 0 : { ...worktree, lane: worktrees },
|
|
9558
9850
|
// 评论在收件人正在跑时插进当前这一轮,不排到这一轮结束(试跑 3:一轮 97 分钟,检查点落空)。
|
|
@@ -9629,12 +9921,15 @@ function startWakeRuntime(ctx, goals, options = {}) {
|
|
|
9629
9921
|
return { flush, ready, state: wakes, worktrees };
|
|
9630
9922
|
}
|
|
9631
9923
|
|
|
9632
|
-
// src/runtime/
|
|
9633
|
-
var
|
|
9924
|
+
// src/runtime/memberWaiting.ts
|
|
9925
|
+
var readMemberExecution = async (ctx, threadId) => {
|
|
9634
9926
|
const shell = await ctx.threads.get({ threadId });
|
|
9635
9927
|
const summary = await ctx.threads.execution.summary({ threadId, limit: 1 });
|
|
9636
9928
|
return { ...shell, queuePaused: summary.queuePaused, summary };
|
|
9637
9929
|
};
|
|
9930
|
+
var waitingOnSomeone = (execution) => execution.summary.queuePaused || execution.summary.pendingApprovalCount > 0 || execution.summary.pendingUserInputCount > 0 || (execution.pendingAsyncQuestionCount ?? 0) > 0 || (execution.awaitingPersonReplyCount ?? 0) > 0;
|
|
9931
|
+
|
|
9932
|
+
// src/runtime/recovery.ts
|
|
9638
9933
|
var itemLabel = (item) => `W${item.sequenceId} (workItemId ${item.workItemId})`;
|
|
9639
9934
|
var deferredText = (recovery) => recovery.deferredWakeCount === void 0 ? "" : `They also have ${recovery.deferredWakeCount} assigned ${recovery.deferredWakeCount === 1 ? "item that has" : "items that have"} not been woken yet. `;
|
|
9640
9935
|
var leadText = (recovery, name, paused) => `Member ${name} (threadId ${recovery.threadId}) ${recovery.afterTurnId === void 0 ? "stopped because of an upstream error" : "could not start a session"} (${recovery.category}). ${recovery.items.map(itemLabel).join(", ")} ${recovery.items.length === 1 ? "is" : "are"} still open. ${deferredText(recovery)}${recovery.alreadyRetried ? "An automatic continuation has already been attempted for this work during these consecutive failures. " : ""}${leadInstructions(paused)}`;
|
|
@@ -9682,7 +9977,7 @@ function startRecoveryRuntime(ctx, goals, state, worktrees) {
|
|
|
9682
9977
|
for (const recovery of recoveries) {
|
|
9683
9978
|
try {
|
|
9684
9979
|
const stalled = recovery.kind === "stall";
|
|
9685
|
-
const execution = stalled ? await
|
|
9980
|
+
const execution = stalled ? await readMemberExecution(ctx, recovery.threadId) : await ctx.projections.getThreadExecution(recovery.threadId);
|
|
9686
9981
|
const queuedContinuation = recovery.plan?.resumeQueue === true;
|
|
9687
9982
|
if (execution === null || execution.archivedAt !== null || execution.session == null || !queuedContinuation && (execution.session.activeTurnId !== null || execution.latestTurn?.turnId !== (recovery.afterTurnId ?? recovery.turnId) || (stalled ? !["ready", "idle", "stopped"].includes(execution.session.status) || execution.latestTurn.state !== "completed" || execution.latestTurn.completedAt === null : execution.session.status !== "error" || execution.latestTurn.state === "running"))) {
|
|
9688
9983
|
if (!skipped.has(recovery.key)) {
|
|
@@ -9701,9 +9996,7 @@ function startRecoveryRuntime(ctx, goals, state, worktrees) {
|
|
|
9701
9996
|
continue;
|
|
9702
9997
|
}
|
|
9703
9998
|
if ("summary" in execution) {
|
|
9704
|
-
if (execution
|
|
9705
|
-
(execution.awaitingPersonReplyCount ?? 0) > 0)
|
|
9706
|
-
continue;
|
|
9999
|
+
if (waitingOnSomeone(execution) || execution.summary.queue.length > 0) continue;
|
|
9707
10000
|
if (wakingThreads.has(recovery.threadId) || Object.values(projects).some(
|
|
9708
10001
|
(project2) => Object.values(project2.recovery ?? {}).some(
|
|
9709
10002
|
(member) => member.pending?.plan?.recipientThreadId === recovery.threadId && member.pending !== current[recovery.projectId]?.recovery?.[recovery.threadId]?.pending
|
|
@@ -9901,6 +10194,166 @@ fired:${fired.wakes.length}`);
|
|
|
9901
10194
|
});
|
|
9902
10195
|
}
|
|
9903
10196
|
|
|
10197
|
+
// src/runtime/progressCheckin.ts
|
|
10198
|
+
var PROGRESS_CHECKIN_TEXT = `How far along are you on this item? There has been no progress from you here for ${PROGRESS_CHECKIN_MINUTES} minutes. Commit what you have to your branch first (a work-in-progress commit is fine), then reply here with work_post_comment: one line of progress and any blocker.`;
|
|
10199
|
+
var TICK_MS = 6e4;
|
|
10200
|
+
var memberKey = (principal) => {
|
|
10201
|
+
const who = recipientOf(principal);
|
|
10202
|
+
return who === void 0 ? void 0 : recipientKey(who);
|
|
10203
|
+
};
|
|
10204
|
+
var memberKeys = (principals) => principals.flatMap((principal) => {
|
|
10205
|
+
const key = memberKey(principal);
|
|
10206
|
+
return key === void 0 ? [] : [key];
|
|
10207
|
+
});
|
|
10208
|
+
var fresh = (at) => ({ since: at, asked: [] });
|
|
10209
|
+
function foldProgress(state, event) {
|
|
10210
|
+
const decoded = decodeWorkEvent(event);
|
|
10211
|
+
if (Option_exports.isNone(decoded)) return state;
|
|
10212
|
+
const work = decoded.value;
|
|
10213
|
+
const { projectId, workItemId } = work.payload;
|
|
10214
|
+
const key = `${projectId}
|
|
10215
|
+
${workItemId}`;
|
|
10216
|
+
const at = event.occurredAt;
|
|
10217
|
+
const current = readFact(state, key);
|
|
10218
|
+
const put = (item) => ({ ...state, [key]: item });
|
|
10219
|
+
switch (work.type) {
|
|
10220
|
+
case "work.item-created": {
|
|
10221
|
+
if (isClosed({ stateGroup: work.payload.state.group })) return state;
|
|
10222
|
+
return put({
|
|
10223
|
+
projectId,
|
|
10224
|
+
workItemId,
|
|
10225
|
+
started: work.payload.state.group === "started",
|
|
10226
|
+
members: Object.fromEntries(
|
|
10227
|
+
memberKeys(work.payload.assignees).map((member) => [member, fresh(at)])
|
|
10228
|
+
),
|
|
10229
|
+
lastCommenter: null
|
|
10230
|
+
});
|
|
10231
|
+
}
|
|
10232
|
+
case "work.item-updated": {
|
|
10233
|
+
if (current === null) return state;
|
|
10234
|
+
const group = work.payload.state?.group;
|
|
10235
|
+
const started = group === void 0 ? current.started : group === "started";
|
|
10236
|
+
const assigned = work.payload.assignees === void 0 ? Object.keys(current.members) : memberKeys(work.payload.assignees);
|
|
10237
|
+
return put({
|
|
10238
|
+
...current,
|
|
10239
|
+
started,
|
|
10240
|
+
members: Object.fromEntries(
|
|
10241
|
+
assigned.map((member) => {
|
|
10242
|
+
const clock = readFact(current.members, member);
|
|
10243
|
+
return [member, clock === null || started && !current.started ? fresh(at) : clock];
|
|
10244
|
+
})
|
|
10245
|
+
)
|
|
10246
|
+
});
|
|
10247
|
+
}
|
|
10248
|
+
case "work.item-claimed": {
|
|
10249
|
+
if (current === null) return state;
|
|
10250
|
+
const member = memberKey(work.payload.assignee);
|
|
10251
|
+
const group = work.payload.state?.group;
|
|
10252
|
+
return put({
|
|
10253
|
+
...current,
|
|
10254
|
+
started: group === void 0 ? current.started : group === "started",
|
|
10255
|
+
members: member === void 0 ? current.members : { ...current.members, [member]: fresh(at) }
|
|
10256
|
+
});
|
|
10257
|
+
}
|
|
10258
|
+
case "work.comment-posted": {
|
|
10259
|
+
if (current === null) return state;
|
|
10260
|
+
const { actor, mentions } = work.payload;
|
|
10261
|
+
const author = memberKey(actor);
|
|
10262
|
+
if (author !== void 0)
|
|
10263
|
+
return put({
|
|
10264
|
+
...current,
|
|
10265
|
+
members: readFact(current.members, author) === null ? current.members : { ...current.members, [author]: fresh(at) },
|
|
10266
|
+
lastCommenter: author
|
|
10267
|
+
});
|
|
10268
|
+
const asked = actor.kind === "plugin" && actor.pluginId === "team" ? new Set(memberKeys(mentions)) : /* @__PURE__ */ new Set();
|
|
10269
|
+
return put({
|
|
10270
|
+
...current,
|
|
10271
|
+
lastCommenter: null,
|
|
10272
|
+
members: Object.fromEntries(
|
|
10273
|
+
Object.entries(current.members).map(([member, clock]) => [
|
|
10274
|
+
member,
|
|
10275
|
+
asked.has(member) ? { ...clock, asked: [...clock.asked, at] } : clock
|
|
10276
|
+
])
|
|
10277
|
+
)
|
|
10278
|
+
});
|
|
10279
|
+
}
|
|
10280
|
+
default:
|
|
10281
|
+
return state;
|
|
10282
|
+
}
|
|
10283
|
+
}
|
|
10284
|
+
function startProgressCheckinRuntime(ctx, goals, now3 = factTime) {
|
|
10285
|
+
const progress = ctx.derivedState({
|
|
10286
|
+
key: "progress-checkin",
|
|
10287
|
+
version: 2,
|
|
10288
|
+
events: ["work.item-created", "work.item-updated", "work.item-claimed", "work.comment-posted"],
|
|
10289
|
+
init: () => ({}),
|
|
10290
|
+
apply: foldProgress
|
|
10291
|
+
});
|
|
10292
|
+
const localReady = async (item, threadId) => {
|
|
10293
|
+
const execution = await readMemberExecution(ctx, threadId);
|
|
10294
|
+
if (execution.archivedAt !== null || execution.session === null) return false;
|
|
10295
|
+
if (waitingOnSomeone(execution)) return false;
|
|
10296
|
+
return !(execution.session.activeTurnId === null && (item.lastCommenter === recipientKey({ threadId }) || execution.summary.queue.length > 0));
|
|
10297
|
+
};
|
|
10298
|
+
const remoteReady = async (item, principalId) => {
|
|
10299
|
+
const pending = await ctx.work.remoteAgentPending.get({
|
|
10300
|
+
projectId: item.projectId,
|
|
10301
|
+
principalId
|
|
10302
|
+
});
|
|
10303
|
+
return pending.wakes.count === 0;
|
|
10304
|
+
};
|
|
10305
|
+
const ask = async (item, who, clock, at) => {
|
|
10306
|
+
if (clock.asked.length >= PROGRESS_CHECKIN_LIMIT) return;
|
|
10307
|
+
const from = Date.parse(clock.asked.at(-1) ?? clock.since);
|
|
10308
|
+
if (at - from < PROGRESS_CHECKIN_MINUTES * 6e4) return;
|
|
10309
|
+
const ready = "threadId" in who ? await localReady(item, who.threadId) : await remoteReady(item, who.principalId);
|
|
10310
|
+
if (!ready) return;
|
|
10311
|
+
const key = stableHash(
|
|
10312
|
+
`${item.projectId}
|
|
10313
|
+
${item.workItemId}
|
|
10314
|
+
${recipientKey(who)}
|
|
10315
|
+
${clock.since}
|
|
10316
|
+
${clock.asked.length}`
|
|
10317
|
+
);
|
|
10318
|
+
await ctx.work.comments.post({
|
|
10319
|
+
projectId: item.projectId,
|
|
10320
|
+
workItemId: item.workItemId,
|
|
10321
|
+
requestId: `team-progress-checkin:${key}`,
|
|
10322
|
+
body: PROGRESS_CHECKIN_TEXT,
|
|
10323
|
+
mentions: [
|
|
10324
|
+
"threadId" in who ? { kind: "agent", threadId: who.threadId } : { kind: "remote-agent", principalId: who.principalId }
|
|
10325
|
+
]
|
|
10326
|
+
});
|
|
10327
|
+
};
|
|
10328
|
+
const tick = async () => {
|
|
10329
|
+
const started = Object.values(await progress.get()).filter((item) => item.started);
|
|
10330
|
+
const at = Date.parse(await now3());
|
|
10331
|
+
for (const projectId of new Set(started.map((item) => item.projectId))) {
|
|
10332
|
+
const goal = await goals.read(projectId);
|
|
10333
|
+
if (goal === null) continue;
|
|
10334
|
+
const execution = goalExecution(goal);
|
|
10335
|
+
const members = new Map(
|
|
10336
|
+
execution.members.filter((member) => member.memberId !== execution.leadMemberId).map((member) => [recipientKey(member), member])
|
|
10337
|
+
);
|
|
10338
|
+
for (const item of started) {
|
|
10339
|
+
if (item.projectId !== projectId) continue;
|
|
10340
|
+
for (const [member, clock] of Object.entries(item.members)) {
|
|
10341
|
+
const who = members.get(member);
|
|
10342
|
+
if (who === void 0) continue;
|
|
10343
|
+
await ask(item, who, clock, at).catch((error) => {
|
|
10344
|
+
ctx.log.warn("team progress check-in failed", {
|
|
10345
|
+
workItemId: item.workItemId,
|
|
10346
|
+
member,
|
|
10347
|
+
error
|
|
10348
|
+
});
|
|
10349
|
+
});
|
|
10350
|
+
}
|
|
10351
|
+
}
|
|
10352
|
+
}
|
|
10353
|
+
};
|
|
10354
|
+
ctx.interval({ name: "team-progress-checkin", everyMs: TICK_MS, handle: tick });
|
|
10355
|
+
}
|
|
10356
|
+
|
|
9904
10357
|
// src/handbook/content.ts
|
|
9905
10358
|
async function releaseRefs(memory, projectId, release) {
|
|
9906
10359
|
return release === 0 ? [] : (await memory.handbook.releases.get({ projectId, release })).pages;
|
|
@@ -9951,23 +10404,6 @@ async function publicationRequiresAck(memory, projectId, input) {
|
|
|
9951
10404
|
return false;
|
|
9952
10405
|
}
|
|
9953
10406
|
|
|
9954
|
-
// src/handbook/waitingWork.ts
|
|
9955
|
-
async function hasUnassignedWork(items, projectId, goal) {
|
|
9956
|
-
const goalItemId = teamGoalItemId(projectId, goal.goalId);
|
|
9957
|
-
const waiting = (item) => item.workItemId !== goalItemId && !isClosed({ stateGroup: item.state.group }) && !assignedToGoalMember(goal, item.assignees);
|
|
9958
|
-
let cursor = null;
|
|
9959
|
-
do {
|
|
9960
|
-
const page = await items.list({
|
|
9961
|
-
projectId,
|
|
9962
|
-
limit: PAGE_SIZE,
|
|
9963
|
-
...cursor === null ? {} : { cursor }
|
|
9964
|
-
});
|
|
9965
|
-
if (page.items.some(waiting)) return true;
|
|
9966
|
-
cursor = page.nextCursor;
|
|
9967
|
-
} while (cursor !== null);
|
|
9968
|
-
return false;
|
|
9969
|
-
}
|
|
9970
|
-
|
|
9971
10407
|
// src/handbook/contracts.ts
|
|
9972
10408
|
var Release = Int.check(isGreaterThanOrEqualTo3(1));
|
|
9973
10409
|
var HandbookPageKind = Literals([
|
|
@@ -10026,10 +10462,6 @@ var Acknowledged = Struct({
|
|
|
10026
10462
|
var ReminderSent = Struct({
|
|
10027
10463
|
...Acknowledged.fields
|
|
10028
10464
|
});
|
|
10029
|
-
var LeadNotified = Struct({
|
|
10030
|
-
...Acknowledged.fields,
|
|
10031
|
-
woke: Boolean3
|
|
10032
|
-
});
|
|
10033
10465
|
|
|
10034
10466
|
// src/handbook/state.ts
|
|
10035
10467
|
var HANDBOOK_EVENTS2 = ["plugin.event-appended", "wiki.handbook-released"];
|
|
@@ -10056,8 +10488,7 @@ var decodeFact3 = decodeUnknownOption2(
|
|
|
10056
10488
|
envelope("handbook-publication-intended", PublicationIntent),
|
|
10057
10489
|
envelope("handbook-publication-completed", PublicationCompleted),
|
|
10058
10490
|
envelope("handbook-acknowledged", Acknowledged),
|
|
10059
|
-
envelope("handbook-reminder-sent", ReminderSent)
|
|
10060
|
-
envelope("handbook-lead-notified", LeadNotified)
|
|
10491
|
+
envelope("handbook-reminder-sent", ReminderSent)
|
|
10061
10492
|
])
|
|
10062
10493
|
);
|
|
10063
10494
|
var decodeRelease = decodeUnknownSync(
|
|
@@ -10121,23 +10552,11 @@ function foldHandbook(state, event) {
|
|
|
10121
10552
|
const projectId = fact.name === "team/goal-started" ? fact.data.goal.projectId : fact.data.projectId;
|
|
10122
10553
|
const project2 = readFact(state.projects, projectId) ?? emptyHandbookProject();
|
|
10123
10554
|
switch (fact.name) {
|
|
10124
|
-
case "team/goal-started":
|
|
10125
|
-
const goal = fact.data.goal;
|
|
10126
|
-
const required = project2.requiredRelease;
|
|
10555
|
+
case "team/goal-started":
|
|
10127
10556
|
return {
|
|
10128
10557
|
...state,
|
|
10129
|
-
|
|
10130
|
-
state.pendingReminders,
|
|
10131
|
-
project2,
|
|
10132
|
-
projectId,
|
|
10133
|
-
required,
|
|
10134
|
-
goalExecution(goal).members.filter(
|
|
10135
|
-
({ memberId }) => memberId !== goal.leadMemberId && !hasAcknowledged(project2, memberId, required)
|
|
10136
|
-
)
|
|
10137
|
-
),
|
|
10138
|
-
projects: { ...state.projects, [projectId]: { ...project2, goal } }
|
|
10558
|
+
projects: { ...state.projects, [projectId]: { ...project2, goal: fact.data.goal } }
|
|
10139
10559
|
};
|
|
10140
|
-
}
|
|
10141
10560
|
case "team/handbook-publication-intended": {
|
|
10142
10561
|
const intent = fact.data;
|
|
10143
10562
|
if (readFact(state.intents, intent.requestId) !== null) return state;
|
|
@@ -10196,27 +10615,15 @@ function foldHandbook(state, event) {
|
|
|
10196
10615
|
}
|
|
10197
10616
|
}
|
|
10198
10617
|
};
|
|
10199
|
-
const key = reminderKey(projectId, release, memberId);
|
|
10200
|
-
const notice = project2.goal !== null && memberId !== project2.goal.leadMemberId && release === project2.requiredRelease;
|
|
10201
10618
|
return {
|
|
10202
10619
|
...state,
|
|
10203
|
-
pendingAcknowledgements: without(
|
|
10204
|
-
|
|
10205
|
-
|
|
10206
|
-
|
|
10207
|
-
[key]: { version: 1, projectId, release, memberId }
|
|
10208
|
-
}
|
|
10209
|
-
} : {},
|
|
10620
|
+
pendingAcknowledgements: without(
|
|
10621
|
+
state.pendingAcknowledgements,
|
|
10622
|
+
reminderKey(projectId, release, memberId)
|
|
10623
|
+
),
|
|
10210
10624
|
projects: { ...state.projects, [projectId]: next }
|
|
10211
10625
|
};
|
|
10212
10626
|
}
|
|
10213
|
-
case "team/handbook-lead-notified": {
|
|
10214
|
-
const pendingLeadNotices = without(
|
|
10215
|
-
state.pendingLeadNotices ?? {},
|
|
10216
|
-
reminderKey(projectId, fact.data.release, fact.data.memberId)
|
|
10217
|
-
);
|
|
10218
|
-
return pendingLeadNotices === state.pendingLeadNotices ? state : { ...state, pendingLeadNotices };
|
|
10219
|
-
}
|
|
10220
10627
|
case "team/handbook-reminder-sent": {
|
|
10221
10628
|
const key = reminderKey(projectId, fact.data.release, fact.data.memberId);
|
|
10222
10629
|
if (readFact(project2.reminded, key) !== null) return state;
|
|
@@ -10322,7 +10729,7 @@ function startHandbookRuntime(ctx, worktrees) {
|
|
|
10322
10729
|
};
|
|
10323
10730
|
const remind = async () => {
|
|
10324
10731
|
const snapshot = await state.get();
|
|
10325
|
-
const wakeState = Object.keys(snapshot.pendingReminders).length === 0
|
|
10732
|
+
const wakeState = Object.keys(snapshot.pendingReminders).length === 0 ? void 0 : await worktrees.lane.state.get();
|
|
10326
10733
|
for (const [key, reminder] of Object.entries(snapshot.pendingReminders)) {
|
|
10327
10734
|
const { projectId, release, member } = reminder;
|
|
10328
10735
|
const project2 = readFact(snapshot.projects, projectId) ?? emptyHandbookProject();
|
|
@@ -10341,7 +10748,8 @@ function startHandbookRuntime(ctx, worktrees) {
|
|
|
10341
10748
|
recipient,
|
|
10342
10749
|
requestId: `team-handbook:${id}`,
|
|
10343
10750
|
messageId: `team-handbook-msg:${id}`,
|
|
10344
|
-
|
|
10751
|
+
// 成员闲着时被换版提醒叫醒,不能借机自己挑活:成员的提醒写死只确认、确认完就结束这一轮。
|
|
10752
|
+
text: handbookReminder(release, member.memberId === project2.goal?.leadMemberId),
|
|
10345
10753
|
memberWorktree: worktree === void 0 ? void 0 : { ...worktree, lane: worktrees.lane }
|
|
10346
10754
|
});
|
|
10347
10755
|
if (!delivered) continue;
|
|
@@ -10361,39 +10769,6 @@ function startHandbookRuntime(ctx, worktrees) {
|
|
|
10361
10769
|
ctx.log.warn("team handbook reminder failed", { projectId, key, error });
|
|
10362
10770
|
}
|
|
10363
10771
|
}
|
|
10364
|
-
const unassigned = /* @__PURE__ */ new Map();
|
|
10365
|
-
for (const [key, notice] of Object.entries(snapshot.pendingLeadNotices ?? {})) {
|
|
10366
|
-
const { projectId, release, memberId } = notice;
|
|
10367
|
-
const project2 = readFact(snapshot.projects, projectId) ?? emptyHandbookProject();
|
|
10368
|
-
const lead = leadThread(project2);
|
|
10369
|
-
try {
|
|
10370
|
-
const { goal } = project2;
|
|
10371
|
-
const waiting = lead !== void 0 && goal !== null && currentRecipient(project2, memberId) !== void 0 && !goalClosed(project2, wakeState?.[projectId]) && await (unassigned.get(projectId) ?? unassigned.set(projectId, hasUnassignedWork(ctx.work.items, projectId, goal)).get(projectId));
|
|
10372
|
-
if (waiting) {
|
|
10373
|
-
const name = (await worktrees.goals.read(projectId))?.members.find(
|
|
10374
|
-
(member) => member.memberId === memberId
|
|
10375
|
-
)?.name ?? memberId;
|
|
10376
|
-
const id = stableHash(`lead:${key}`);
|
|
10377
|
-
const delivered = await deliverWake(ctx, {
|
|
10378
|
-
projectId,
|
|
10379
|
-
recipient: { threadId: lead },
|
|
10380
|
-
requestId: `team-handbook-lead:${id}`,
|
|
10381
|
-
messageId: `team-handbook-lead-msg:${id}`,
|
|
10382
|
-
text: handbookMessage("leadAcknowledged", release, name)
|
|
10383
|
-
});
|
|
10384
|
-
if (!delivered) continue;
|
|
10385
|
-
}
|
|
10386
|
-
await append2(projectId, "handbook-lead-notified", `lead:${key}`, {
|
|
10387
|
-
version: 1,
|
|
10388
|
-
projectId,
|
|
10389
|
-
release,
|
|
10390
|
-
memberId,
|
|
10391
|
-
woke: waiting
|
|
10392
|
-
});
|
|
10393
|
-
} catch (error) {
|
|
10394
|
-
ctx.log.warn("team handbook lead notice failed", { projectId, key, error });
|
|
10395
|
-
}
|
|
10396
|
-
}
|
|
10397
10772
|
};
|
|
10398
10773
|
const execute = async () => {
|
|
10399
10774
|
for (const intent of Object.values((await state.get()).pendingPublications)) {
|
|
@@ -10450,6 +10825,33 @@ function startHandbookRuntime(ctx, worktrees) {
|
|
|
10450
10825
|
}))
|
|
10451
10826
|
};
|
|
10452
10827
|
},
|
|
10828
|
+
/**
|
|
10829
|
+
* 开工守卫(work.start:认领、或把件改进开工组)。只管团队目标里的成员,人和外人照常放行。
|
|
10830
|
+
* 先看是不是派给他的:没派给自己的件不许开工(run5:成员读了目标自己挑件,和派给别人的撞了);
|
|
10831
|
+
* 再看手册:没确认当前要求的版本不许开工。说明写给开工的成员,带下一步。
|
|
10832
|
+
*/
|
|
10833
|
+
async startCheck(input) {
|
|
10834
|
+
const project2 = readFact(
|
|
10835
|
+
(await state.get({ throughSequence: input.throughSequence })).projects,
|
|
10836
|
+
input.projectId
|
|
10837
|
+
);
|
|
10838
|
+
if (project2 === null) return { allowed: true };
|
|
10839
|
+
const member = callerMember(project2, principalCaller(input.starter));
|
|
10840
|
+
if (member === void 0) return { allowed: true };
|
|
10841
|
+
if (input.via === "update" && member.memberId === project2.goal?.leadMemberId)
|
|
10842
|
+
return { allowed: true };
|
|
10843
|
+
const assigned = input.assignees.some(
|
|
10844
|
+
(assignee) => callerMember(project2, principalCaller(assignee))?.memberId === member.memberId
|
|
10845
|
+
);
|
|
10846
|
+
if (!assigned)
|
|
10847
|
+
return { allowed: false, detail: handbookMessage("startNotAssigned") };
|
|
10848
|
+
if (project2.requiredRelease !== null && !hasAcknowledged(project2, member.memberId, project2.requiredRelease))
|
|
10849
|
+
return {
|
|
10850
|
+
allowed: false,
|
|
10851
|
+
detail: handbookMessage("startNeedsAck", project2.requiredRelease)
|
|
10852
|
+
};
|
|
10853
|
+
return { allowed: true };
|
|
10854
|
+
},
|
|
10453
10855
|
ack(release, invocation) {
|
|
10454
10856
|
return serial(async () => {
|
|
10455
10857
|
const projectId = invocation.projectId;
|
|
@@ -10512,38 +10914,15 @@ function startHandbookRuntime(ctx, worktrees) {
|
|
|
10512
10914
|
await remind();
|
|
10513
10915
|
return detail === null ? outcome : { ...outcome, detail };
|
|
10514
10916
|
});
|
|
10515
|
-
},
|
|
10516
|
-
async check(input) {
|
|
10517
|
-
const project2 = readFact(
|
|
10518
|
-
(await state.get({ throughSequence: input.throughSequence })).projects,
|
|
10519
|
-
input.projectId
|
|
10520
|
-
);
|
|
10521
|
-
if (project2 === null || project2.requiredRelease === null) return { allowed: true };
|
|
10522
|
-
if (project2.goal !== null && input.workItemId === teamGoalItemId(input.projectId, project2.goal.goalId))
|
|
10523
|
-
return { allowed: true };
|
|
10524
|
-
for (const actor of input.added) {
|
|
10525
|
-
const caller = actor.kind === "human" ? void 0 : actor.kind === "agent" ? { kind: "thread", threadId: actor.threadId } : actor;
|
|
10526
|
-
const member = callerMember(project2, caller);
|
|
10527
|
-
if (member !== void 0 && !hasAcknowledged(project2, member.memberId, project2.requiredRelease)) {
|
|
10528
|
-
const name = (await worktrees.goals.read(input.projectId))?.members.find(
|
|
10529
|
-
(row) => row.memberId === member.memberId
|
|
10530
|
-
)?.name ?? member.memberId;
|
|
10531
|
-
return {
|
|
10532
|
-
allowed: false,
|
|
10533
|
-
detail: handbookMessage("guard", project2.requiredRelease, name)
|
|
10534
|
-
};
|
|
10535
|
-
}
|
|
10536
|
-
}
|
|
10537
|
-
return { allowed: true };
|
|
10538
10917
|
}
|
|
10539
10918
|
};
|
|
10540
10919
|
}
|
|
10920
|
+
var principalCaller = (principal) => principal.kind === "agent" ? { kind: "thread", threadId: principal.threadId } : principal.kind === "remote-agent" ? { kind: "remote-agent", principalId: principal.principalId } : void 0;
|
|
10541
10921
|
var currentRecipient = (project2, memberId) => {
|
|
10542
10922
|
const member = goalExecution(project2.goal).members.find((row) => row.memberId === memberId);
|
|
10543
10923
|
if (member === void 0) return void 0;
|
|
10544
10924
|
return "threadId" in member ? { threadId: member.threadId } : { principalId: member.principalId };
|
|
10545
10925
|
};
|
|
10546
|
-
var leadThread = (project2) => project2.goal?.threads.find((thread) => thread.memberId === project2.goal?.leadMemberId)?.threadId;
|
|
10547
10926
|
var goalClosed = (project2, wake) => project2.goal !== null && wake !== void 0 && isClosed(readFact(wake.items, teamGoalItemId(project2.goal.projectId, project2.goal.goalId)));
|
|
10548
10927
|
|
|
10549
10928
|
// src/handbook/entry.ts
|
|
@@ -10596,7 +10975,7 @@ function registerHandbook(ctx, runtime) {
|
|
|
10596
10975
|
payloadSchema: payloadSchemaOf(ReadHandbookInput),
|
|
10597
10976
|
handle: (input) => runtime.read(decodeRead4(input).projectId)
|
|
10598
10977
|
});
|
|
10599
|
-
ctx.operations.guard({ operations: ["work.
|
|
10978
|
+
ctx.operations.guard({ operations: ["work.start"], check: runtime.startCheck });
|
|
10600
10979
|
}
|
|
10601
10980
|
|
|
10602
10981
|
// src/handbook/panelContracts.ts
|
|
@@ -10714,7 +11093,7 @@ function registerHandbookPanel(ctx, runtime) {
|
|
|
10714
11093
|
// src/index.ts
|
|
10715
11094
|
var index_default = definePlugin({
|
|
10716
11095
|
id: "team",
|
|
10717
|
-
apiVersion:
|
|
11096
|
+
apiVersion: 37,
|
|
10718
11097
|
activate(ctx) {
|
|
10719
11098
|
const rosters = createRosterService(ctx);
|
|
10720
11099
|
registerRosterCommands(ctx, rosters);
|
|
@@ -10725,6 +11104,7 @@ var index_default = definePlugin({
|
|
|
10725
11104
|
registerDetailCommands(ctx, goals);
|
|
10726
11105
|
startRecoveryRuntime(ctx, goals, wakes.state, wakes.worktrees);
|
|
10727
11106
|
startLeadCheckinRuntime(ctx, wakes.state, goals);
|
|
11107
|
+
startProgressCheckinRuntime(ctx, goals);
|
|
10728
11108
|
const handbook = startHandbookRuntime(ctx, { lane: wakes.worktrees, goals });
|
|
10729
11109
|
registerHandbook(ctx, handbook);
|
|
10730
11110
|
registerHandbookPanel(ctx, handbook);
|