@celljs/ta-moments 0.0.0-stage → 4.13.1
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/README.en.md +29 -0
- package/README.md +28 -2
- package/extension/index.mjs +1787 -0
- package/host/index.mjs +2415 -0
- package/package.json +59 -4
- package/web/index.js +2008 -0
package/README.en.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Cell - Ta Moments
|
|
2
|
+
|
|
3
|
+
A pi package that comes with Ta (on by default; Settings → Extensions of the web client turns it off): Moments. What friends made with Ta, to see and to take: extensions, cards, games, agents' cards, a fix worth telling. Not a feed of what agents did, nor a public social network.
|
|
4
|
+
|
|
5
|
+
- **Friends**: posts go to Ta's friends; Moments has none of its own. The row of Friends at the top of Moments opens the one page of friends (Discover → Friends, of Rooms): add one by a code or a link, or from the members of a room you are both in; once both agree, you see each other's posts. 100 friends at most.
|
|
6
|
+
- **Post**: when a conversation made something others could use and you are pleased with it, Ta drafts a post (the tool `draft_moment`, as far as `moments.post` of Initiative lets it; a post cannot be taken back, so never past Ask), a card in the conversation: its words, up to 3 pictures, an extension or a link to take along, and how long it stays (3 days, a month, half a year, for good). Only Post sends it; after Not now Ta offers less. Or post yourself from the top of Moments, with an extension of yours.
|
|
7
|
+
- **See**: Discover → Moments, the posts of friends and yours, the newest first. While a friend's new post is unseen, the row of Moments under Discover shows that friend's face with an amber dot, never a count.
|
|
8
|
+
- **Take it (instead of a like)**: under a post with an extension, Take it has Ta fetch the package and open a new conversation that reads its code first, says what it does, the files it reads and writes, the commands it runs and what it reaches on the network, installs it only once you say so, then fits it to your computer. A post with a link has Open (an agent's card, a shared conversation, each opened its own way). The author sees who took it.
|
|
9
|
+
- **Like**: the heart. The names under likes and Took it show only to the author, you, and your friends (friends in common, as WeChat does).
|
|
10
|
+
- **Friends made, in the daily brief**: as your Ta writes the daily brief it reads your friends' latest posts and picks at most 3 that matter to you, by what it knows of you, each with why, under Friends made; none, when none does. Its links open Moments at that post, which shows why too. A new post alone never tells you, and nothing counts them.
|
|
11
|
+
- **Told of what others do**: when someone likes or takes a post of yours, Ta tells you, quietly (shown when notices are set to All); the likes of a post are one notice.
|
|
12
|
+
- **Remove a friend**: on the page of friends; neither sees the other's posts any more.
|
|
13
|
+
|
|
14
|
+
## Where it is kept, and when it goes
|
|
15
|
+
|
|
16
|
+
The service keeps next to nothing of yours:
|
|
17
|
+
|
|
18
|
+
- **The relay** keeps one room of each Ta that the Rooms page does not list (`kind: ta-moments`), a directory of its posts: `post:<id>` (the words, the title and link of what it holds, a blurred thumbnail of about 0.5 KB for each picture; read only as its owner wrote it), `like:<id>:<member>`, `took:<id>:<member>` and `back:<member>` (each writes only its own). 40 posts at most, taken away by the author's Ta as they run out or are deleted; a room nobody uses for 90 days the relay deletes.
|
|
19
|
+
- **Pictures** stay on the author's computer (`~/.ta/agent/ta-moments/posts/`), deleted with their post. A friend's Ta asks for them while the author is online, by messages of the room (`ta-moments:want` / `ta-moments:img`, only forwarded by the relay), and keeps them on the friend's computer (`ta-moments/cache/`) until the post goes, the friendship ends, or the cache passes 200 MB (the oldest go first). While the author is off and you never got them, you see the blurred thumbnails and that they show once that computer is online.
|
|
20
|
+
- **An extension posted** is served by the author's computer while it runs Ta (a share `kind: ta-package`, no copy on the relay), stopped with its post; Take it waits for the author to be online.
|
|
21
|
+
- Pictures of drafts stay on the author's computer (`ta-moments/drafts/`) for 7 days.
|
|
22
|
+
|
|
23
|
+
## Data and calls
|
|
24
|
+
|
|
25
|
+
Posts are kept in each Ta's room of friends (`TaRooms.friendRoom`, `kind: ta-friends`). Data of the package (`@celljs/ta-moments`): `decided` (each draft posted or not), `shares`, `rev`, `seen`, `picked` (the posts the brief picked, and why), `told` (who the user was told liked or took a post), `brief` (what the daily brief is given, `TA_BRIEF_SOURCE`).
|
|
26
|
+
|
|
27
|
+
Methods of the host of the package (`pi.host`), which the web extension calls with `callPackageHost('@celljs/ta-moments', …)`: `state()`, `images(room, post)`, `invite(renew?)`, `addFriend(link)`, `answer(ask, accept)`, `removeFriend(id)`, `publish({ key?, text, images, attach?, days })`, `remove(post)`, `like(room, post, on)`, `take(room, post)`, `took(room, post)`, `draftImage(key, index)`, `decline(key)`, `packageTitle(name)`, `level()`.
|
|
28
|
+
|
|
29
|
+
Design: `docs/design/ta-moments.md`.
|
package/README.md
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Cell - Ta Moments
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Ta 自带的 pi 包(默认开启,可在 Web 客户端的 设置 → 扩展 关闭):动态。好友之间互相看、互相拿去用的作品流——发的是你用 Ta 做出来的东西(扩展、小组件、游戏、智能体名片、一次排障),不是智能体自己发的信息流,也不是公开的社交网络。
|
|
4
|
+
|
|
5
|
+
- **好友**:动态给 Ta 的好友看,没有自己的一套好友。动态页顶部"好友"一行打开统一的好友页(发现 → 好友,在"房间"包里):用二维码或链接加好友,也可以在一起所在房间的成员里加;双方同意后互相看到动态。最多 100 位好友。
|
|
6
|
+
- **发**:Ta 在对话里做出了可分享的东西、你也满意时,会起草一条(工具 `draft_moment`,按"主动"里 `moments.post` 的档位;它不能撤回,所以最多到"先问"),对话里出现一张草稿卡片:文字、最多 3 张图、附带的扩展或链接、保留多久(3 天、1 个月、半年、长期)。你改好点"发表"才发出去;"不发了"之后 Ta 少提。也可以在动态页右上角自己发,选一个自己的扩展附带上。
|
|
7
|
+
- **看**:发现 → 动态,好友和你自己的动态按时间排列;有好友发了新动态而你还没看,发现里"动态"一行右侧显示那位好友的头像和一个黄点,不显示数字。
|
|
8
|
+
- **拿去用(代替点赞)**:带扩展的动态底下是"拿去用":Ta 把包取到本机、新开一个对话,先读代码,告诉你它做什么、读写哪些文件、跑什么命令、连哪些网络,等你说装才装,装完按你的电脑调整。带链接的动态是"打开"(智能体名片、分享的对话等交给各自的打开方式)。作者能看到谁拿去用了。
|
|
9
|
+
- **赞**:点心形。赞和"拿去用了"的名字,只给作者、你自己和你的好友看(照微信"共同好友可见")。
|
|
10
|
+
- **每日简报里的"好友在做"**:你的 Ta 写每日简报时,会看到好友最近的动态,按它对你的了解最多挑 3 条和你有关的,写在"好友在做"下,每条附一句理由;没有相关的就不写。点链接打开动态页并定位到那一条;被挑中的动态上也显示这句理由。新动态不会单独提醒你,也没有数字。
|
|
11
|
+
- **有人回应时提醒**:别人赞了或拿去用了你的动态,Ta 发一条低优先级提醒(通知设置为"全部"时显示),同一条动态的赞合成一条。
|
|
12
|
+
- **删除好友**:在好友页删除后,双方都不再看到对方的动态。
|
|
13
|
+
|
|
14
|
+
## 存在哪里、什么时候删
|
|
15
|
+
|
|
16
|
+
平台几乎不替你存东西:
|
|
17
|
+
|
|
18
|
+
- **中继**只存每个 Ta 的一个不列在房间页的房间(`kind: ta-moments`),里面是动态的目录:`post:<id>`(文字、附带的标题和链接、每张图一张约 0.5 KB 的模糊缩略图;只认房主写的),`like:<id>:<成员>`、`took:<id>:<成员>`、`back:<成员>`(各自只写自己的)。最多 40 条,到期或删除时作者的 Ta 删掉;作者一直不上线,房间 90 天没人用由中继删除。
|
|
19
|
+
- **原图**在作者电脑 `~/.ta/agent/ta-moments/posts/`,随动态删除。好友的 Ta 在作者在线时经房间消息要来(`ta-moments:want` / `ta-moments:img`,中继只转发),存在好友电脑 `ta-moments/cache/`;动态没了、删除好友、或缓存超过 200 MB(先删最旧的)时删掉。作者关机而你之前没取到时,先看到模糊缩略图和"原图在某某的电脑上,等它上线后显示"。
|
|
20
|
+
- **附带的扩展**由作者电脑在线提供(分享 `kind: ta-package`,中继不存副本),随动态停止;作者关机时"拿去用"要等它上线。
|
|
21
|
+
- 草稿的图片在作者电脑 `ta-moments/drafts/`,7 天清除。
|
|
22
|
+
|
|
23
|
+
## 数据与调用
|
|
24
|
+
|
|
25
|
+
动态存在每个 Ta 的好友房间里(`TaRooms.friendRoom`,`kind: ta-friends`)。包数据(`@celljs/ta-moments`):`decided`(各草稿发了或没发)、`shares`、`rev`、`seen`、`picked`(简报挑中的动态与理由)、`told`(已提醒过谁赞了、拿去用了)、`brief`(给每日简报的材料,`TA_BRIEF_SOURCE`)。
|
|
26
|
+
|
|
27
|
+
包宿主(`pi.host`)的方法,Web 扩展经 `callPackageHost('@celljs/ta-moments', …)` 调用:`state()`、`images(room, post)`、`invite(renew?)`、`addFriend(link)`、`answer(ask, accept)`、`removeFriend(id)`、`publish({ key?, text, images, attach?, days })`、`remove(post)`、`like(room, post, on)`、`take(room, post)`、`took(room, post)`、`draftImage(key, index)`、`decline(key)`、`packageTitle(name)`、`level()`。
|
|
28
|
+
|
|
29
|
+
设计记录:`docs/design/ta-moments.md`。
|