@celljs/ta-meeting 0.0.0-stage → 4.34.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/README.en.md ADDED
@@ -0,0 +1,25 @@
1
+ # Cell - Ta Meeting
2
+
3
+ A pi package that comes with Ta (on by default, turned off in Settings → Extensions): meetings. Tap to start when a meeting starts and Ta writes down what is said; at the end, in a conversation of its own, it gives the minutes, the key points and the to-dos (who, when), and does the to-dos it can once you pick them.
4
+
5
+ - **The Meetings page** (Discover → Work): a red button starts. While recording it shows the time and the words as they come; pause, resume, end and sum up, or discard. It goes on while you look elsewhere in Ta, and a row "Recording a meeting" on the double's home leads back.
6
+ - **Transcription**: with a voice service chosen in Settings → Voice (OpenAI Realtime, Qwen, Hunyuan, Doubao), that service hears, its key staying in the Ta service; without one, the recognizer of the device (Apple's in the Ta app and the desktop app, the browser's own elsewhere). When the service drops or the microphone is taken, it pauses by itself and what was written down is kept.
7
+ - **Text only**: no audio is recorded or kept. The text is saved every 30 seconds and once more at the end, in `meetings/<id>.txt` of the agent directory on this computer (0600), never through the relay.
8
+ - **Summing up**: at the end a conversation named after the meeting opens, the words of the meeting in the context of its message, and Ta answers by the `meeting-notes` skill: one line, then one card (the to-dos, the key points, a multiple choice "Which should I do?", the full minutes folded). Once you pick: what can be done at once is done there; what takes days becomes a goal card; what is to happen at a time becomes a scheduled task; what goes to other people is only drafted, sent when you say so.
9
+ - **Earlier meetings**: a row each with its title, time, length and characters; tap to go back to its minutes (or to sum it up when it was not), swipe left to remove its text (the conversation of its minutes stays).
10
+ - **Settings → Voice → Meetings**: how long the text is kept (30, 90, 180, 365 days, default 90) and the space it may take (10, 50, 200 MB, default 50); beyond them the oldest goes first, never the meeting being recorded nor the newest.
11
+
12
+ ## Data and calls
13
+
14
+ Package data (`@celljs/ta-meeting`, written by the server alone): `meetings` (the title, start and end, length, characters, size and conversation of the minutes of each), `settings` (`keepDays`, `maxMB`). The words of the meetings are in `meetings/` of the agent directory.
15
+
16
+ Server methods (the page calls them with `callHost`; only the user and members with `settings.manage` may): `list()`, `settings()`, `setSettings(change)`, `save(meeting, text)`, `get(id)`, `update(id, { title?, session? })`, `remove(id)`.
17
+
18
+ The page writes down with `ui.voice.transcribe` (`WebVoice` of ta-web): through the Ta service when a voice service is chosen, else with the recognizer of the device; as a recognizer ends a stretch of speech, the next listening starts at once.
19
+
20
+ ## Development
21
+
22
+ ```bash
23
+ bun run build # tsc + bundles web/, host/
24
+ bun run test
25
+ ```
package/README.md CHANGED
@@ -1,3 +1,25 @@
1
- # Temporary Holding Version
1
+ # Cell - Ta Meeting
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Ta 自带的 pi 包(默认开启,可在 设置 → 扩展 关闭):会议。开会时点一下开始,Ta 边听边记;结束后在一个单独的对话里给出纪要、重点和待办(谁、什么时候),你勾选后它把能做的待办接着做掉。
4
+
5
+ - **会议页**(发现 → 工作):一个红色按钮开始记录。记录中显示时长、实时文字,可以暂停、继续、结束并整理或放弃。离开这页也会继续记,分身首页多一行「会议记录中」点回来。
6
+ - **转写**:在 设置 → 语音 选了语音服务(OpenAI Realtime、通义、混元、豆包)时用它听写,Key 只在 Ta 服务里;没选就用本机的听写(Ta App 和桌面版用 Apple 的识别,浏览器用自带的)。服务断开或麦克风被占用时自动转为暂停,已记下的文字都在。
7
+ - **只留文字**:不录音、不存音频。文字每 30 秒存一次,结束时再存一次,存在本机 agent 目录的 `meetings/<id>.txt`(0600),不经中继。
8
+ - **整理**:结束后打开一个以会议命名的对话,消息的上下文里带着会议文字,Ta 按 `meeting-notes` 技能回复:一句结论,一张卡片(待办表、重点、「要我做哪些?」的多选、折叠的完整纪要)。你选了之后:一次能做完的当场做;跨天的写成目标卡;要定时的建定时任务;发给别人的只出草稿,你说发才发。
9
+ - **记录过的会议**:每行是标题、时间、时长和字数;点开回到它的纪要对话(还没整理的就开始整理),左滑删除文字(纪要对话保留)。
10
+ - **设置 → 语音 → 会议**:文字保留天数(30、90、180、365 天,默认 90)和最多占用(10、50、200 MB,默认 50);超过的从最早的开始自动删除,正在记录的和最新的一场不删。
11
+
12
+ ## 数据与调用
13
+
14
+ 包数据(`@celljs/ta-meeting`,只由服务端写):`meetings`(每场的标题、开始和结束时间、时长、字数、大小、纪要对话),`settings`(`keepDays`、`maxMB`)。会议文字在 agent 目录的 `meetings/`。
15
+
16
+ 服务端方法(页面经 `callHost` 调用;只有用户本人和有 `settings.manage` 的成员能调):`list()`、`settings()`、`setSettings(change)`、`save(meeting, text)`、`get(id)`、`update(id, { title?, session? })`、`remove(id)`。
17
+
18
+ 页面用 `ui.voice.transcribe`(ta-web 的 `WebVoice`)连续听写:选了语音服务就由 Ta 服务转写,否则用本机的识别;识别器断句结束后立即接着听。
19
+
20
+ ## 开发
21
+
22
+ ```bash
23
+ bun run build # tsc + 打包 web/、host/
24
+ bun run test
25
+ ```
package/host/index.mjs ADDED
@@ -0,0 +1,244 @@
1
+ // web-src/host.ts
2
+ import { chmodSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
3
+ import { join } from "node:path";
4
+
5
+ // web-src/meeting-protocol.ts
6
+ var NAME = "@celljs/ta-meeting";
7
+ var PAGE = `${NAME}/home`;
8
+ var Keys;
9
+ ((Keys) => {
10
+ Keys.MEETINGS = "meetings";
11
+ Keys.SETTINGS = "settings";
12
+ })(Keys ||= {});
13
+ var DEFAULT_SETTINGS = { keepDays: 90, maxMB: 50 };
14
+
15
+ // web-src/meeting-util.ts
16
+ var DAY = 86400000;
17
+ var MB = 1024 * 1024;
18
+ var ID = /^m[a-z0-9]{4,40}$/;
19
+ var MeetingUtil;
20
+ ((MeetingUtil) => {
21
+ function validId(id) {
22
+ return typeof id === "string" && ID.test(id);
23
+ }
24
+ MeetingUtil.validId = validId;
25
+ function newId(now) {
26
+ return `m${now.toString(36)}${Math.random().toString(36).slice(2, 8)}`;
27
+ }
28
+ MeetingUtil.newId = newId;
29
+ function settings(raw) {
30
+ const value = raw ?? {};
31
+ const number = (n, min, max, fallback) => typeof n === "number" && Number.isFinite(n) ? Math.min(max, Math.max(min, Math.round(n))) : fallback;
32
+ return {
33
+ keepDays: number(value.keepDays, 1, 3650, DEFAULT_SETTINGS.keepDays),
34
+ maxMB: number(value.maxMB, 1, 1024, DEFAULT_SETTINGS.maxMB)
35
+ };
36
+ }
37
+ MeetingUtil.settings = settings;
38
+ function meetings(raw) {
39
+ if (!Array.isArray(raw)) {
40
+ return [];
41
+ }
42
+ return raw.filter((one) => !!one && validId(one.id) && typeof one.title === "string" && typeof one.startedAt === "number").sort((a, b) => b.startedAt - a.startedAt);
43
+ }
44
+ MeetingUtil.meetings = meetings;
45
+ function prune(meetings2, settings2, now) {
46
+ const removed = new Set;
47
+ const oldFirst = [...meetings2].sort((a, b) => a.startedAt - b.startedAt);
48
+ for (const one of oldFirst) {
49
+ if (!one.recording && now - (one.endedAt ?? one.startedAt) > settings2.keepDays * DAY) {
50
+ removed.add(one.id);
51
+ }
52
+ }
53
+ let bytes = meetings2.filter((one) => !removed.has(one.id)).reduce((sum, one) => sum + (one.bytes || 0), 0);
54
+ for (const one of oldFirst.slice(0, -1)) {
55
+ if (bytes <= settings2.maxMB * MB) {
56
+ break;
57
+ }
58
+ if (!one.recording && !removed.has(one.id)) {
59
+ removed.add(one.id);
60
+ bytes -= one.bytes || 0;
61
+ }
62
+ }
63
+ return [...removed];
64
+ }
65
+ MeetingUtil.prune = prune;
66
+ function clock(ms) {
67
+ const seconds = Math.max(0, Math.floor(ms / 1000));
68
+ const two = (n) => String(n).padStart(2, "0");
69
+ const h = Math.floor(seconds / 3600);
70
+ const m = Math.floor(seconds % 3600 / 60);
71
+ const s = seconds % 60;
72
+ return h ? `${h}:${two(m)}:${two(s)}` : `${two(m)}:${two(s)}`;
73
+ }
74
+ MeetingUtil.clock = clock;
75
+ function transcript(segments) {
76
+ return segments.filter((one) => one.text.trim()).map((one) => `[${clock(one.at)}] ${one.text.trim().replace(/\s*\n\s*/g, " ")}`).join(`
77
+ `);
78
+ }
79
+ MeetingUtil.transcript = transcript;
80
+ function when(at) {
81
+ const date = new Date(at);
82
+ const two = (n) => String(n).padStart(2, "0");
83
+ return `${date.getFullYear()}-${two(date.getMonth() + 1)}-${two(date.getDate())} ${two(date.getHours())}:${two(date.getMinutes())}`;
84
+ }
85
+ MeetingUtil.when = when;
86
+ function context(meeting, transcript2) {
87
+ return [
88
+ "Sum it up by the skill meeting-notes.",
89
+ `Meeting: ${meeting.title}`,
90
+ `Started: ${when(meeting.startedAt)}, listened to for ${Math.max(1, Math.round(meeting.ms / 60000))} min`,
91
+ "Transcript (a line each stretch of speech, after when it was said; written by a recognizer, so names and terms may be heard wrong):",
92
+ transcript2 || "(nothing was heard)"
93
+ ].join(`
94
+ `);
95
+ }
96
+ MeetingUtil.context = context;
97
+ })(MeetingUtil ||= {});
98
+
99
+ // web-src/host.ts
100
+ var TITLE_MAX = 80;
101
+
102
+ class MeetingHost {
103
+ host;
104
+ now;
105
+ queue = Promise.resolve();
106
+ constructor(host, now = Date.now) {
107
+ this.host = host;
108
+ this.now = now;
109
+ }
110
+ dispose() {}
111
+ begin() {
112
+ return this.serial(async () => {
113
+ await this.prune(await this.meetings(), await this.settings());
114
+ });
115
+ }
116
+ list() {
117
+ return this.meetings();
118
+ }
119
+ async settings() {
120
+ return MeetingUtil.settings(await this.data(Keys.SETTINGS));
121
+ }
122
+ setSettings(change) {
123
+ return this.serial(async () => {
124
+ const settings = MeetingUtil.settings({ ...await this.settings(), ...change ?? {} });
125
+ await this.host.setExtensionData(NAME, Keys.SETTINGS, settings);
126
+ await this.prune(await this.meetings(), settings);
127
+ return settings;
128
+ });
129
+ }
130
+ save(change, text) {
131
+ return this.serial(async () => {
132
+ const id = this.checked(change?.id);
133
+ const words = typeof text === "string" ? text : "";
134
+ const meetings = await this.meetings();
135
+ const before = meetings.find((one) => one.id === id);
136
+ const bytes = this.write(id, words);
137
+ const meeting = {
138
+ id,
139
+ title: this.title(change.title) || before?.title || MeetingUtil.when(this.now()),
140
+ startedAt: typeof change.startedAt === "number" ? change.startedAt : before?.startedAt ?? this.now(),
141
+ ms: typeof change.ms === "number" ? Math.max(0, change.ms) : before?.ms ?? 0,
142
+ chars: words.length,
143
+ bytes,
144
+ ...change.recording ? { recording: true } : { endedAt: before?.endedAt ?? this.now() },
145
+ ...before?.session ? { session: before.session } : {}
146
+ };
147
+ const all = [meeting, ...meetings.filter((one) => one.id !== id)];
148
+ await this.prune(all, await this.settings());
149
+ return meeting;
150
+ });
151
+ }
152
+ async get(id) {
153
+ const checked = this.checked(id);
154
+ const meeting = (await this.meetings()).find((one) => one.id === checked);
155
+ if (!meeting) {
156
+ return;
157
+ }
158
+ const file = this.file(meeting.id);
159
+ return { meeting, text: existsSync(file) ? readFileSync(file, "utf8") : "" };
160
+ }
161
+ update(id, change) {
162
+ return this.serial(async () => {
163
+ const checked = this.checked(id);
164
+ const meetings = await this.meetings();
165
+ const meeting = meetings.find((one) => one.id === checked);
166
+ if (!meeting) {
167
+ return;
168
+ }
169
+ const title = this.title(change?.title);
170
+ if (title) {
171
+ meeting.title = title;
172
+ }
173
+ if (typeof change?.session === "string" && change.session) {
174
+ meeting.session = change.session;
175
+ }
176
+ await this.host.setExtensionData(NAME, Keys.MEETINGS, meetings);
177
+ return meeting;
178
+ });
179
+ }
180
+ remove(id) {
181
+ return this.serial(async () => {
182
+ const checked = this.checked(id);
183
+ rmSync(this.file(checked), { force: true });
184
+ const meetings = await this.meetings();
185
+ await this.host.setExtensionData(NAME, Keys.MEETINGS, meetings.filter((one) => one.id !== checked));
186
+ });
187
+ }
188
+ async prune(meetings, settings) {
189
+ const removed = new Set(MeetingUtil.prune(meetings, settings, this.now()));
190
+ for (const id of removed) {
191
+ rmSync(this.file(id), { force: true });
192
+ }
193
+ await this.host.setExtensionData(NAME, Keys.MEETINGS, meetings.filter((one) => !removed.has(one.id)));
194
+ }
195
+ write(id, text) {
196
+ const dir = this.dir();
197
+ mkdirSync(dir, { recursive: true, mode: 448 });
198
+ const file = this.file(id);
199
+ writeFileSync(file, text, { mode: 384 });
200
+ chmodSync(file, 384);
201
+ return Buffer.byteLength(text);
202
+ }
203
+ title(title) {
204
+ return typeof title === "string" ? title.replace(/\s+/g, " ").trim().slice(0, TITLE_MAX) : "";
205
+ }
206
+ checked(id) {
207
+ if (!MeetingUtil.validId(id)) {
208
+ throw new Error(`Not a meeting: ${String(id)}`);
209
+ }
210
+ return id;
211
+ }
212
+ dir() {
213
+ return join(this.host.agentDir, "meetings");
214
+ }
215
+ file(id) {
216
+ return join(this.dir(), `${id}.txt`);
217
+ }
218
+ async meetings() {
219
+ return MeetingUtil.meetings(await this.data(Keys.MEETINGS));
220
+ }
221
+ data(key) {
222
+ return this.host.getExtensionData(NAME, key).catch(() => {
223
+ return;
224
+ });
225
+ }
226
+ serial(work) {
227
+ const run = this.queue.then(work, work);
228
+ this.queue = run.catch(() => {
229
+ return;
230
+ });
231
+ return run;
232
+ }
233
+ }
234
+ async function activate(host) {
235
+ const meetings = new MeetingHost(host);
236
+ await meetings.begin().catch(() => {
237
+ return;
238
+ });
239
+ return meetings;
240
+ }
241
+ export {
242
+ activate as default,
243
+ MeetingHost
244
+ };
package/package.json CHANGED
@@ -1,6 +1,64 @@
1
1
  {
2
2
  "name": "@celljs/ta-meeting",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "4.34.0",
4
+ "description": "A pi package for Ta: meetings written down as they are said, then minutes, key points and to-dos, and the to-dos Ta can do done once the user picks them",
5
+ "keywords": [
6
+ "pi-package"
7
+ ],
8
+ "homepage": "https://github.com/cellbang/ta",
9
+ "bugs": {
10
+ "url": "https://github.com/cellbang/ta/issues"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/cellbang/cell.git"
15
+ },
16
+ "license": "MIT",
17
+ "files": [
18
+ "web",
19
+ "host",
20
+ "skills",
21
+ "!**/*.map"
22
+ ],
23
+ "scripts": {
24
+ "build": "tsc -b && bun build web-src/index.tsx --format esm --target browser --outfile web/index.js && bun build web-src/host.ts --format esm --target node --outfile host/index.mjs",
25
+ "clean": "rm -rf lib web host *.tsbuildinfo",
26
+ "test": "bun test ./lib",
27
+ "watch": "tsc -b -w --preserveWatchOutput"
28
+ },
29
+ "devDependencies": {
30
+ "@celljs/ta-protocol": "4.34.0",
31
+ "@celljs/ta-web": "4.34.0",
32
+ "@types/react": "^19.3.0"
33
+ },
34
+ "publishConfig": {
35
+ "access": "public"
36
+ },
37
+ "pi": {
38
+ "title": {
39
+ "en": "Meetings",
40
+ "zh-CN": "会议",
41
+ "zh-TW": "會議",
42
+ "ja-JP": "会議"
43
+ },
44
+ "summary": {
45
+ "en": "Tap to start when a meeting starts: Ta writes down what is said, and at the end gives the minutes, the key points and the to-dos with who and when, then does the ones it can once you pick them. Only the text is kept, never the audio.",
46
+ "zh-CN": "开会时点一下开始:Ta 边听边记,结束后给出纪要、重点和待办(谁、什么时候),你勾选后它把能做的待办接着做掉。只留文字,不留录音。",
47
+ "zh-TW": "開會時點一下開始:Ta 邊聽邊記,結束後給出紀要、重點和待辦(誰、什麼時候),你勾選後它把能做的待辦接著做掉。只留文字,不留錄音。",
48
+ "ja-JP": "会議が始まったらタップ:Ta が聞きながら書き取り、終わると議事録・要点・ToDo(担当と期限)をまとめ、選んだ ToDo のうちできるものを進めます。残すのは文字だけで、録音は残しません。"
49
+ },
50
+ "icon": "Mic",
51
+ "web": [
52
+ "./web/index.js"
53
+ ],
54
+ "host": "./host/index.mjs",
55
+ "skills": [
56
+ "./skills"
57
+ ],
58
+ "permissions": {
59
+ "host": {
60
+ "*": "settings.manage"
61
+ }
62
+ }
63
+ }
64
+ }
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: meeting-notes
3
+ description: Sums up a meeting from what was said in it (the transcript Meetings sends, or one the user pastes or points to) into the minutes, the key points and the to-dos with who and when, then does the to-dos the user picks that Ta can do. Use it whenever a meeting is to be summed up or its to-dos followed up.
4
+ ---
5
+
6
+ # Summing up a meeting
7
+
8
+ The words come from a speech recognizer: a line each stretch of speech, after when it was said (`[12:05] …`). Names,
9
+ terms and numbers may be heard wrong, and who said what is not marked.
10
+
11
+ - Fix what is plainly heard wrong from the context (a product, a name said right elsewhere); never make up what was not
12
+ said. A name, an owner or a date you are not sure of: write it with `?`, or `未定` / `TBD` when nobody said it.
13
+ - Leave out small talk, repetitions and what was taken back; keep decisions, numbers, dates, disagreements and risks.
14
+ - Write in the language of the meeting.
15
+
16
+ ## The reply
17
+
18
+ Lead with one line: what the meeting decided, at most 25 Chinese characters or 15 words. Then one `ta-glance` card,
19
+ status `info`, with:
20
+
21
+ 1. `table` of the to-dos, columns `事项` (what), `谁` (who), `何时` (when), `Ta` (`可做` when you can do it with
22
+ your tools, else empty); a row each, in the order they matter. English columns for an English meeting.
23
+ 2. `notes` of the key points, at most 3: decisions (`info`), risks or open questions (`risk`).
24
+ 3. `options` with `multi: true`, question `要我做哪些?` / `Which should I do?`: the to-dos you can do, a line each
25
+ saying what you would make (`起草给客户的邮件`, `写发布检查清单到 docs/`, `每周一 10 点提醒跟进`),
26
+ `recommended` on those that need nothing more from the user.
27
+ 4. `details` folded `纪要` / `Minutes`: the full minutes in Markdown: topics, what was said of each, conclusions, the
28
+ to-dos again with their owners.
29
+
30
+ Nothing was said, or too little to sum up: say so in a line, no card.
31
+
32
+ ## Following up
33
+
34
+ When the user picks to-dos (their answer to the options, or in their own words), do them, each the way it fits:
35
+
36
+ - **Once, now**: a draft (an email, a message, a document, a plan), a search, a change in a project, a file: do it in
37
+ this conversation and show the result.
38
+ - **Over days, or the way is not known yet**: draft a goal card (`ta-goal`) for it; it starts once the user says so.
39
+ - **Again and again, or at a time** (a reminder before the deadline, a weekly follow-up): a scheduled task.
40
+ - **To other people** (a message, an email, a post): write the draft only; send nothing unless the user says so.
41
+
42
+ Never pass the words of the meeting to anyone or anywhere unless the user asks: they are private to the user.