@celljs/ta-team 4.21.0 → 4.23.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 CHANGED
@@ -1355,6 +1355,7 @@ var RELAY_PROOF = "ta-relay ready";
1355
1355
  var RELAY_HUB_MAX_VALUE = 96 * 1024;
1356
1356
  var RELAY_HUB_MAX_STATE = 3 * 1024 * 1024;
1357
1357
  var RELAY_PICTURE_MAX_CHARS = 16 * 1024;
1358
+ var RELAY_HUB_LOG_CHARS = 4 * 1024 * 1024;
1358
1359
 
1359
1360
  // ../ta-relay/esm/common/relay-pairing.js
1360
1361
  var RelayPairingUtil;
@@ -2416,6 +2417,11 @@ var TaImageNote;
2416
2417
  var TaImageSize;
2417
2418
  (function(TaImageSize2) {
2418
2419
  const JPEG_BYTES = 256 * 1024;
2420
+ function type(bytes) {
2421
+ const at = (offset, ...values) => values.every((value, index) => bytes[offset + index] === value);
2422
+ return at(0, 255, 216, 255) ? "image/jpeg" : at(0, 137, 80, 78, 71) ? "image/png" : at(0, 71, 73, 70, 56) ? "image/gif" : at(0, 82, 73, 70, 70) && at(8, 87, 69, 66, 80) ? "image/webp" : undefined;
2423
+ }
2424
+ TaImageSize2.type = type;
2419
2425
  function of(base64) {
2420
2426
  var _a, _b, _c;
2421
2427
  let bytes;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celljs/ta-team",
3
- "version": "4.21.0",
3
+ "version": "4.23.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.21.0",
31
- "@celljs/ta-relay": "4.21.0",
32
- "@celljs/ta-web": "4.21.0",
30
+ "@celljs/ta-protocol": "4.23.0",
31
+ "@celljs/ta-relay": "4.23.0",
32
+ "@celljs/ta-web": "4.23.0",
33
33
  "@types/react": "^19.3.0"
34
34
  },
35
35
  "publishConfig": {
package/web/index.js CHANGED
@@ -1906,6 +1906,7 @@ var RELAY_PROOF = "ta-relay ready";
1906
1906
  var RELAY_HUB_MAX_VALUE = 96 * 1024;
1907
1907
  var RELAY_HUB_MAX_STATE = 3 * 1024 * 1024;
1908
1908
  var RELAY_PICTURE_MAX_CHARS = 16 * 1024;
1909
+ var RELAY_HUB_LOG_CHARS = 4 * 1024 * 1024;
1909
1910
 
1910
1911
  // ../ta-relay/esm/common/relay-pairing.js
1911
1912
  var RelayPairingUtil;
@@ -2861,6 +2862,36 @@ class TeamSharedHome {
2861
2862
  listeners = new Set;
2862
2863
  timer;
2863
2864
  items = () => this.current;
2865
+ asPartners = () => {
2866
+ const made = new WeakMap;
2867
+ let list = [];
2868
+ let from;
2869
+ return {
2870
+ partners: () => {
2871
+ if (from !== this.current) {
2872
+ from = this.current;
2873
+ list = this.current.map((item) => {
2874
+ let partner = made.get(item);
2875
+ if (!partner) {
2876
+ partner = {
2877
+ id: item.id,
2878
+ kind: item.kind === "agent" ? "agent" : "group",
2879
+ name: item.title,
2880
+ about: item.detail,
2881
+ icon: item.icon,
2882
+ ...item.face ? { face: item.face } : {},
2883
+ open: item.open
2884
+ };
2885
+ made.set(item, partner);
2886
+ }
2887
+ return partner;
2888
+ });
2889
+ }
2890
+ return list;
2891
+ },
2892
+ subscribe: this.subscribe
2893
+ };
2894
+ };
2864
2895
  subscribe = (listener) => {
2865
2896
  this.listeners.add(listener);
2866
2897
  return () => this.listeners.delete(listener);
@@ -2900,6 +2931,7 @@ class TeamSharedHome {
2900
2931
  show(joined) {
2901
2932
  const items = joined.flatMap((one) => (one.shared ?? []).map((shared) => ({
2902
2933
  id: `${one.owner}:${shared.kind}:${shared.id}`,
2934
+ kind: shared.kind,
2903
2935
  title: shared.name,
2904
2936
  detail: t("fromTa", { owner: one.owner }),
2905
2937
  icon: icon(shared.kind === "agent" ? "Bot" : "Hash"),
@@ -3852,7 +3884,11 @@ function activate(pi2) {
3852
3884
  book.load();
3853
3885
  const home = new TeamSharedHome;
3854
3886
  const stopHome = home.start();
3855
- pi2.registerHomeItems?.(home);
3887
+ if (typeof pi2.registerPartners === "function") {
3888
+ pi2.registerPartners(home.asPartners());
3889
+ } else {
3890
+ pi2.registerHomeItems?.(home);
3891
+ }
3856
3892
  TeamSharedHome.openPending();
3857
3893
  return () => {
3858
3894
  removeStyle();