@celljs/ta-channels 4.32.1 → 4.33.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/host/index.mjs +29 -0
- package/package.json +4 -4
package/host/index.mjs
CHANGED
|
@@ -2999,6 +2999,35 @@ var TaGuestUtil;
|
|
|
2999
2999
|
}
|
|
3000
3000
|
TaGuestUtil2.role = role;
|
|
3001
3001
|
})(TaGuestUtil || (TaGuestUtil = {}));
|
|
3002
|
+
// ../ta-protocol/esm/common/inbox-protocol.js
|
|
3003
|
+
var TaInboxUtil;
|
|
3004
|
+
(function(TaInboxUtil2) {
|
|
3005
|
+
TaInboxUtil2.KEEP_MS = 7 * 24 * 3600000;
|
|
3006
|
+
TaInboxUtil2.KEEP_MAX = 500;
|
|
3007
|
+
TaInboxUtil2.RETRY_MS = [60000, 5 * 60000, 30 * 60000];
|
|
3008
|
+
function merge(messages) {
|
|
3009
|
+
if (messages.length === 1) {
|
|
3010
|
+
return messages[0];
|
|
3011
|
+
}
|
|
3012
|
+
const contexts = messages.map((message) => TaMessageContext.read(message)).filter((context) => !!context);
|
|
3013
|
+
const seen = messages.map((message) => TaMessageContext.strip(message).trim()).filter(Boolean);
|
|
3014
|
+
const text = seen.join(`
|
|
3015
|
+
|
|
3016
|
+
`);
|
|
3017
|
+
return contexts.length ? TaMessageContext.wrap(contexts.join(`
|
|
3018
|
+
`), text) : text;
|
|
3019
|
+
}
|
|
3020
|
+
TaInboxUtil2.merge = merge;
|
|
3021
|
+
function sort(events) {
|
|
3022
|
+
const waiting = events.filter((event) => event.status === "waiting").sort((a, b) => a.at - b.at);
|
|
3023
|
+
const went = events.filter((event) => event.status !== "waiting").sort((a, b) => {
|
|
3024
|
+
var _a, _b, _c, _d;
|
|
3025
|
+
return ((_b = (_a = b.doneAt) !== null && _a !== undefined ? _a : b.deliveredAt) !== null && _b !== undefined ? _b : b.at) - ((_d = (_c = a.doneAt) !== null && _c !== undefined ? _c : a.deliveredAt) !== null && _d !== undefined ? _d : a.at);
|
|
3026
|
+
});
|
|
3027
|
+
return [...waiting, ...went];
|
|
3028
|
+
}
|
|
3029
|
+
TaInboxUtil2.sort = sort;
|
|
3030
|
+
})(TaInboxUtil || (TaInboxUtil = {}));
|
|
3002
3031
|
// ../ta-protocol/esm/common/location.js
|
|
3003
3032
|
var TaLocation;
|
|
3004
3033
|
(function(TaLocation2) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celljs/ta-channels",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.33.0",
|
|
4
4
|
"description": "A pi package for Ta: agents with roles of their own and channels where the user, Ta and the agents talk; Ta builds the team for what the user wants",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package"
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"watch": "tsc -b -w --preserveWatchOutput"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@celljs/ta-protocol": "4.
|
|
31
|
-
"@celljs/ta-relay": "4.
|
|
32
|
-
"@celljs/ta-web": "4.
|
|
30
|
+
"@celljs/ta-protocol": "4.33.0",
|
|
31
|
+
"@celljs/ta-relay": "4.33.0",
|
|
32
|
+
"@celljs/ta-web": "4.33.0",
|
|
33
33
|
"@types/react": "^19.3.0"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|