@celljs/ta-team 4.18.0 → 4.20.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.
@@ -50,6 +50,22 @@ var TaHostUtil;
50
50
  }
51
51
  TaHostUtil2.role = role;
52
52
  })(TaHostUtil || (TaHostUtil = {}));
53
+ var TA_DOUBLE_LOOK = {
54
+ name: "@celljs/ta-web",
55
+ key: "assistant.species",
56
+ given: ["trex", "triceratops", "stegosaurus", "brachiosaurus", "velociraptor", "ankylosaurus", "pteranodon", "parasaurolophus"]
57
+ };
58
+ var TaDoubleLookUtil;
59
+ (function(TaDoubleLookUtil2) {
60
+ function given(id) {
61
+ let hash = 2166136261;
62
+ for (let i = 0;i < id.length; i++) {
63
+ hash = Math.imul(hash ^ id.charCodeAt(i), 16777619);
64
+ }
65
+ return TA_DOUBLE_LOOK.given[(hash >>> 0) % TA_DOUBLE_LOOK.given.length];
66
+ }
67
+ TaDoubleLookUtil2.given = given;
68
+ })(TaDoubleLookUtil || (TaDoubleLookUtil = {}));
53
69
  var TA_ASK_ENTRY = "ta-ask";
54
70
  var TaAskUtil;
55
71
  (function(TaAskUtil2) {
package/host/index.mjs CHANGED
@@ -1019,6 +1019,22 @@ var TaHostUtil;
1019
1019
  TaHostUtil2.role = role;
1020
1020
  })(TaHostUtil || (TaHostUtil = {}));
1021
1021
  var TA_DOUBLE_FILE = { name: "@celljs/ta-web", key: "assistant.file" };
1022
+ var TA_DOUBLE_LOOK = {
1023
+ name: "@celljs/ta-web",
1024
+ key: "assistant.species",
1025
+ given: ["trex", "triceratops", "stegosaurus", "brachiosaurus", "velociraptor", "ankylosaurus", "pteranodon", "parasaurolophus"]
1026
+ };
1027
+ var TaDoubleLookUtil;
1028
+ (function(TaDoubleLookUtil2) {
1029
+ function given(id2) {
1030
+ let hash = 2166136261;
1031
+ for (let i = 0;i < id2.length; i++) {
1032
+ hash = Math.imul(hash ^ id2.charCodeAt(i), 16777619);
1033
+ }
1034
+ return TA_DOUBLE_LOOK.given[(hash >>> 0) % TA_DOUBLE_LOOK.given.length];
1035
+ }
1036
+ TaDoubleLookUtil2.given = given;
1037
+ })(TaDoubleLookUtil || (TaDoubleLookUtil = {}));
1022
1038
  var TA_ASK_ENTRY = "ta-ask";
1023
1039
  var TaAskUtil;
1024
1040
  (function(TaAskUtil2) {
@@ -1322,6 +1338,7 @@ var RELAY_PING_MS = 25000;
1322
1338
  var RELAY_PROOF = "ta-relay ready";
1323
1339
  var RELAY_HUB_MAX_VALUE = 96 * 1024;
1324
1340
  var RELAY_HUB_MAX_STATE = 3 * 1024 * 1024;
1341
+ var RELAY_PICTURE_MAX_CHARS = 16 * 1024;
1325
1342
 
1326
1343
  // ../ta-relay/esm/common/relay-pairing.js
1327
1344
  var RelayPairingUtil;
@@ -1688,6 +1705,10 @@ var RelayIdentityUtil;
1688
1705
  return typeof look === "string" && /^[a-z][a-z0-9-]{0,31}$/.test(look);
1689
1706
  }
1690
1707
  RelayIdentityUtil2.isLook = isLook;
1708
+ function isPicture(picture) {
1709
+ return typeof picture === "string" && picture.length <= RELAY_PICTURE_MAX_CHARS && /^data:image\/(png|jpeg|webp|svg\+xml);base64,[A-Za-z0-9+/]+={0,2}$/.test(picture);
1710
+ }
1711
+ RelayIdentityUtil2.isPicture = isPicture;
1691
1712
  function withLook(value, look) {
1692
1713
  const { look: _, ...rest } = value;
1693
1714
  return isLook(look) ? { ...rest, look } : rest;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celljs/ta-team",
3
- "version": "4.18.0",
3
+ "version": "4.20.0",
4
4
  "description": "A pi package for Ta: people let into your Ta by a link, each with a role (admin, collaborator, viewer, guest, or one of your own), what they may do checked by the Ta service for every call and every tool, asking for more and the answers, and a record",
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.18.0",
31
- "@celljs/ta-relay": "4.18.0",
32
- "@celljs/ta-web": "4.18.0",
30
+ "@celljs/ta-protocol": "4.20.0",
31
+ "@celljs/ta-relay": "4.20.0",
32
+ "@celljs/ta-web": "4.20.0",
33
33
  "@types/react": "^19.3.0"
34
34
  },
35
35
  "publishConfig": {
package/web/index.js CHANGED
@@ -1889,6 +1889,7 @@ var RELAY_PING_MS = 25000;
1889
1889
  var RELAY_PROOF = "ta-relay ready";
1890
1890
  var RELAY_HUB_MAX_VALUE = 96 * 1024;
1891
1891
  var RELAY_HUB_MAX_STATE = 3 * 1024 * 1024;
1892
+ var RELAY_PICTURE_MAX_CHARS = 16 * 1024;
1892
1893
 
1893
1894
  // ../ta-relay/esm/common/relay-pairing.js
1894
1895
  var RelayPairingUtil;
@@ -2367,6 +2368,10 @@ var RelayIdentityUtil;
2367
2368
  return typeof look === "string" && /^[a-z][a-z0-9-]{0,31}$/.test(look);
2368
2369
  }
2369
2370
  RelayIdentityUtil2.isLook = isLook;
2371
+ function isPicture(picture) {
2372
+ return typeof picture === "string" && picture.length <= RELAY_PICTURE_MAX_CHARS && /^data:image\/(png|jpeg|webp|svg\+xml);base64,[A-Za-z0-9+/]+={0,2}$/.test(picture);
2373
+ }
2374
+ RelayIdentityUtil2.isPicture = isPicture;
2370
2375
  function withLook(value, look) {
2371
2376
  const { look: _, ...rest } = value;
2372
2377
  return isLook(look) ? { ...rest, look } : rest;