@chen_hu_hu/pi-qq 1.0.2 → 1.2.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.md +49 -36
- package/doc/features-v1.md +51 -51
- package/doc/features-v2.md +209 -0
- package/doc/plan-v1.md +20 -20
- package/doc/plan-v2.md +331 -0
- package/index.ts +64 -10
- package/package.json +1 -1
- package/src/append-stream.ts +1 -1
- package/src/bot.ts +46 -6
- package/src/config.ts +7 -3
- package/src/download.ts +8 -8
- package/src/files.ts +166 -43
- package/src/images.ts +19 -7
- package/src/inbound.ts +138 -24
- package/src/logger.ts +180 -0
- package/src/outbound.ts +20 -3
- package/src/run-feedback.ts +24 -36
- package/src/voice.ts +25 -0
package/src/logger.ts
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { appendFileSync, mkdirSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Structured logger for pi-qq.
|
|
6
|
+
*
|
|
7
|
+
* One JSON record per line, one file per local day:
|
|
8
|
+
* <cwd>/.pi/pi-qq/logs/pi-qq-YYYY-MM-DD.log
|
|
9
|
+
*
|
|
10
|
+
* The default level is silent. Logging is best-effort and must never break QQ
|
|
11
|
+
* message handling. Tests can override the directory via PI_QQ_LOG_DIR.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export type LogLevel = "silent" | "error" | "warn" | "info" | "debug";
|
|
15
|
+
export type LogFields = Record<string, unknown>;
|
|
16
|
+
|
|
17
|
+
const LEVEL_WEIGHT: Record<LogLevel, number> = {
|
|
18
|
+
debug: 10,
|
|
19
|
+
info: 20,
|
|
20
|
+
warn: 30,
|
|
21
|
+
error: 40,
|
|
22
|
+
silent: 100,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const DEFAULT_LOG_LEVEL: LogLevel = "silent";
|
|
26
|
+
|
|
27
|
+
let activeLevel: LogLevel = DEFAULT_LOG_LEVEL;
|
|
28
|
+
let activeDir: string | undefined;
|
|
29
|
+
|
|
30
|
+
export function isLogLevel(value: unknown): value is LogLevel {
|
|
31
|
+
return typeof value === "string" && Object.prototype.hasOwnProperty.call(LEVEL_WEIGHT, value);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function normalizeLogLevel(value: unknown): LogLevel {
|
|
35
|
+
return isLogLevel(value) ? value : DEFAULT_LOG_LEVEL;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Whether an event at `level` passes the configured threshold. */
|
|
39
|
+
export function isLevelEnabled(configured: LogLevel, level: Exclude<LogLevel, "silent">): boolean {
|
|
40
|
+
return configured !== "silent" && LEVEL_WEIGHT[level] >= LEVEL_WEIGHT[configured];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Set the active threshold and optional directory. */
|
|
44
|
+
export function configureLogger(level: LogLevel, dir?: string): void {
|
|
45
|
+
activeLevel = normalizeLogLevel(level);
|
|
46
|
+
activeDir = dir;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function getLogLevel(): LogLevel {
|
|
50
|
+
return activeLevel;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function resolveLogDir(): string {
|
|
54
|
+
return process.env.PI_QQ_LOG_DIR ?? activeDir ?? join(process.cwd(), ".pi", "pi-qq", "logs");
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function pad(n: number): string {
|
|
58
|
+
return String(n).padStart(2, "0");
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Local calendar date used in the log filename. */
|
|
62
|
+
export function dateStamp(now = new Date()): string {
|
|
63
|
+
return `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}`;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function logFileName(now = new Date()): string {
|
|
67
|
+
return `pi-qq-${dateStamp(now)}.log`;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function getLogFilePath(now = new Date()): string {
|
|
71
|
+
return join(resolveLogDir(), logFileName(now));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function normalizeData(data: unknown): LogFields | undefined {
|
|
75
|
+
if (data === undefined) return undefined;
|
|
76
|
+
if (data instanceof Error) return { err: data };
|
|
77
|
+
if (data !== null && typeof data === "object" && !Array.isArray(data)) return data as LogFields;
|
|
78
|
+
return { data };
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function stringifyError(err: unknown): string {
|
|
82
|
+
return err instanceof Error ? err.message : String(err);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function writeRecord(level: Exclude<LogLevel, "silent">, scope: string, message: string, data?: unknown): void {
|
|
86
|
+
if (!isLevelEnabled(activeLevel, level)) return;
|
|
87
|
+
|
|
88
|
+
const record: LogFields = {
|
|
89
|
+
time: new Date().toISOString(),
|
|
90
|
+
level,
|
|
91
|
+
scope,
|
|
92
|
+
msg: message,
|
|
93
|
+
};
|
|
94
|
+
const fields = normalizeData(data);
|
|
95
|
+
if (fields) {
|
|
96
|
+
for (const [key, value] of Object.entries(fields)) {
|
|
97
|
+
// Protect the record envelope from accidental overrides.
|
|
98
|
+
if (!(key in record)) record[key] = value;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
let line: string;
|
|
103
|
+
try {
|
|
104
|
+
line = JSON.stringify(record, (_key, value) => {
|
|
105
|
+
if (typeof value === "bigint") return `${value}n`;
|
|
106
|
+
if (value instanceof Error) {
|
|
107
|
+
return { name: value.name, message: value.message, stack: value.stack };
|
|
108
|
+
}
|
|
109
|
+
return value;
|
|
110
|
+
});
|
|
111
|
+
} catch (err) {
|
|
112
|
+
line = JSON.stringify({
|
|
113
|
+
time: record.time,
|
|
114
|
+
level,
|
|
115
|
+
scope,
|
|
116
|
+
msg: message,
|
|
117
|
+
serializationError: stringifyError(err),
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
try {
|
|
122
|
+
const dir = resolveLogDir();
|
|
123
|
+
mkdirSync(dir, { recursive: true });
|
|
124
|
+
appendFileSync(join(dir, logFileName()), `${line}\n`, "utf8");
|
|
125
|
+
} catch {
|
|
126
|
+
// Logging is diagnostic only; never break message handling.
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export const log = {
|
|
131
|
+
get level(): LogLevel {
|
|
132
|
+
return activeLevel;
|
|
133
|
+
},
|
|
134
|
+
debug(scope: string, message: string, data?: unknown): void {
|
|
135
|
+
writeRecord("debug", scope, message, data);
|
|
136
|
+
},
|
|
137
|
+
info(scope: string, message: string, data?: unknown): void {
|
|
138
|
+
writeRecord("info", scope, message, data);
|
|
139
|
+
},
|
|
140
|
+
warn(scope: string, message: string, data?: unknown): void {
|
|
141
|
+
writeRecord("warn", scope, message, data);
|
|
142
|
+
},
|
|
143
|
+
error(scope: string, message: string, data?: unknown): void {
|
|
144
|
+
writeRecord("error", scope, message, data);
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
/** Adapter for the QQ SDK's Logger interface: (message, meta?) -> record. */
|
|
149
|
+
export const sdkLogger = {
|
|
150
|
+
debug(message: string, meta?: Record<string, unknown>): void {
|
|
151
|
+
log.debug("qqbot", message, meta);
|
|
152
|
+
},
|
|
153
|
+
info(message: string, meta?: Record<string, unknown>): void {
|
|
154
|
+
log.info("qqbot", message, meta);
|
|
155
|
+
},
|
|
156
|
+
warn(message: string, meta?: Record<string, unknown>): void {
|
|
157
|
+
log.warn("qqbot", message, meta);
|
|
158
|
+
},
|
|
159
|
+
error(message: string, meta?: Record<string, unknown>): void {
|
|
160
|
+
log.error("qqbot", message, meta);
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
/** Short string form for noisy tool payloads. */
|
|
165
|
+
export function previewForLog(value: unknown, maxChars = 2000): string {
|
|
166
|
+
let text: string;
|
|
167
|
+
if (typeof value === "string") {
|
|
168
|
+
text = value;
|
|
169
|
+
} else if (value instanceof Error) {
|
|
170
|
+
text = `${value.name}: ${value.message}`;
|
|
171
|
+
} else {
|
|
172
|
+
try {
|
|
173
|
+
const stringified = JSON.stringify(value);
|
|
174
|
+
text = typeof stringified === "string" ? stringified : String(value);
|
|
175
|
+
} catch {
|
|
176
|
+
text = String(value);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return text.length <= maxChars ? text : `${text.slice(0, maxChars)}…(${text.length} chars)`;
|
|
180
|
+
}
|
package/src/outbound.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { QQBot } from "@tencent-connect/qqbot-nodejs";
|
|
2
2
|
import { ReplyBudget } from "./reply-budget";
|
|
3
|
+
import { log } from "./logger";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* pi → QQ text relay (F4 non-streaming path): lightweight Markdown-to-plain
|
|
@@ -115,21 +116,37 @@ export async function sendReply(bot: QQBot, text: string, ch: ReplyChannel): Pro
|
|
|
115
116
|
const replyTarget =
|
|
116
117
|
mode === "passive" && msgId ? { scope: "c2c" as const, targetId, msgId } : { scope: "c2c" as const, targetId };
|
|
117
118
|
try {
|
|
119
|
+
log.debug("outbound", "sending text chunk", {
|
|
120
|
+
mode,
|
|
121
|
+
targetId,
|
|
122
|
+
msgId: msgId ?? null,
|
|
123
|
+
length: chunk.length,
|
|
124
|
+
text: chunk,
|
|
125
|
+
});
|
|
118
126
|
await bot.sendText(replyTarget, chunk);
|
|
119
127
|
if (mode === "passive" && msgId) ch.budget.commitPassive(msgId);
|
|
128
|
+
log.info("outbound", "text chunk sent", { mode, targetId, length: chunk.length });
|
|
120
129
|
} catch (err) {
|
|
130
|
+
log.warn("outbound", "text chunk failed", {
|
|
131
|
+
mode,
|
|
132
|
+
targetId,
|
|
133
|
+
length: chunk.length,
|
|
134
|
+
err,
|
|
135
|
+
});
|
|
121
136
|
if (mode === "passive") {
|
|
122
137
|
// Passive failure (e.g. stale msgId) → retry once proactively.
|
|
123
138
|
try {
|
|
139
|
+
log.warn("outbound", "passive send failed; retrying proactively", { targetId: ch.boundOpenid });
|
|
124
140
|
await bot.sendText({ scope: "c2c", targetId: ch.boundOpenid }, chunk);
|
|
125
|
-
ch.onWarn?.("
|
|
141
|
+
ch.onWarn?.("Passive reply failed; falling back to proactive.");
|
|
126
142
|
continue;
|
|
127
143
|
} catch (retryErr) {
|
|
128
|
-
|
|
144
|
+
log.error("outbound", "proactive retry failed", { targetId: ch.boundOpenid, err: retryErr });
|
|
145
|
+
ch.onWarn?.(`Proactive send failed: ${(retryErr as Error).message}`);
|
|
129
146
|
continue;
|
|
130
147
|
}
|
|
131
148
|
}
|
|
132
|
-
ch.onWarn?.(
|
|
149
|
+
ch.onWarn?.(`Send failed: ${(err as Error).message}`);
|
|
133
150
|
}
|
|
134
151
|
}
|
|
135
152
|
}
|
package/src/run-feedback.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { QQBot } from "@tencent-connect/qqbot-nodejs";
|
|
|
2
2
|
import { AppendStream } from "./append-stream";
|
|
3
3
|
import { sendReply, type ReplyChannel } from "./outbound";
|
|
4
4
|
import type { ReplyBudget } from "./reply-budget";
|
|
5
|
+
import { log } from "./logger";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* F7 long-task feedback: run-level state machine (summary frames + text bubbles).
|
|
@@ -15,7 +16,7 @@ import type { ReplyBudget } from "./reply-budget";
|
|
|
15
16
|
* The final reply is its own text bubble. Frames are sent every `streamFlushMs`
|
|
16
17
|
* (default 10000ms):
|
|
17
18
|
*
|
|
18
|
-
* Activity: [💭] Thinking... / [🔧] [2] bash (event order
|
|
19
|
+
* Activity: [💭] Thinking... / [🔧] [2] bash (event order)
|
|
19
20
|
* Text: message text (streamed increments, rendered as Markdown)
|
|
20
21
|
*
|
|
21
22
|
* Any failed frame discards the bubble; unsent text falls back to the message path.
|
|
@@ -35,8 +36,6 @@ export interface RunFeedbackDeps {
|
|
|
35
36
|
/** Stream summary frame interval in ms (minimum 300). */
|
|
36
37
|
getStreamFlushMs: () => number;
|
|
37
38
|
getStreamRelay: () => boolean;
|
|
38
|
-
/** Debug mode: SDK logs plus timestamps on stream frames. */
|
|
39
|
-
getDebug: () => boolean;
|
|
40
39
|
makeChannel: () => ReplyChannel;
|
|
41
40
|
onWarn: (msg: string) => void;
|
|
42
41
|
}
|
|
@@ -82,14 +81,7 @@ interface RunState {
|
|
|
82
81
|
messageHeartbeats: number;
|
|
83
82
|
}
|
|
84
83
|
|
|
85
|
-
/**
|
|
86
|
-
function nowStamp(): string {
|
|
87
|
-
const d = new Date();
|
|
88
|
-
const p = (n: number) => String(n).padStart(2, "0");
|
|
89
|
-
return `${p(d.getHours())}:${p(d.getMinutes())}:${p(d.getSeconds())}`;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/** Tool count line: `[🔧] [n] name`; debug mode prefixes [HH:MM:SS]. */
|
|
84
|
+
/** Tool count line: `[🔧] [n] name`. */
|
|
93
85
|
function formatToolCount(name: string, count: number): string {
|
|
94
86
|
return `[🔧] [${count}] ${name}`;
|
|
95
87
|
}
|
|
@@ -97,12 +89,12 @@ function formatToolCount(name: string, count: number): string {
|
|
|
97
89
|
/** Heartbeat text: tool totals and elapsed time only (features-v1.md decision #3). */
|
|
98
90
|
export function formatHeartbeat(elapsedMs: number, tools: Map<string, ToolStat2>): string {
|
|
99
91
|
const minutes = Math.floor(elapsedMs / 60_000);
|
|
100
|
-
const elapsedText = minutes < 1 ? "
|
|
101
|
-
if (tools.size === 0) return `⏱
|
|
92
|
+
const elapsedText = minutes < 1 ? "less than 1 minute" : `${minutes} minute${minutes === 1 ? "" : "s"}`;
|
|
93
|
+
if (tools.size === 0) return `⏱ Running for ${elapsedText} (no tool calls yet)`;
|
|
102
94
|
const parts = [...tools.entries()].map(([name, s]) => formatToolCount(name, s.count));
|
|
103
95
|
const errors = [...tools.values()].reduce((n, s) => n + s.errors, 0);
|
|
104
|
-
const suffix = errors > 0 ? ` · ${errors}
|
|
105
|
-
return `⏱
|
|
96
|
+
const suffix = errors > 0 ? ` · ${errors} failed` : "";
|
|
97
|
+
return `⏱ Running for ${elapsedText} · ${parts.join(" · ")}${suffix}`;
|
|
106
98
|
}
|
|
107
99
|
|
|
108
100
|
const STREAM_LIVENESS_MS = 60_000; // Add a liveness row after this much silence
|
|
@@ -119,11 +111,6 @@ export class RunFeedback {
|
|
|
119
111
|
this.deps = deps;
|
|
120
112
|
}
|
|
121
113
|
|
|
122
|
-
private debug(message: string): void {
|
|
123
|
-
if (!this.deps.getDebug()) return;
|
|
124
|
-
console.error(`[pi-qq debug ${nowStamp()}] ${message}`);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
114
|
/** Called by inbound before injecting: mark the next run as QQ-triggered. */
|
|
128
115
|
markQQTrigger(openid: string, msgId: string): void {
|
|
129
116
|
this.pending = { openid, msgId, at: Date.now() };
|
|
@@ -153,7 +140,7 @@ export class RunFeedback {
|
|
|
153
140
|
messageHeartbeats: 0,
|
|
154
141
|
};
|
|
155
142
|
this.run = run;
|
|
156
|
-
|
|
143
|
+
log.debug("run", "started", { msgId: run.msgId?.slice(0, 8) ?? "?" });
|
|
157
144
|
|
|
158
145
|
// Typing keepalive: start immediately, renew every 50s (zero quota).
|
|
159
146
|
const keepTyping = () => {
|
|
@@ -260,7 +247,10 @@ export class RunFeedback {
|
|
|
260
247
|
this.clearTimers();
|
|
261
248
|
this.run = null;
|
|
262
249
|
if (run) {
|
|
263
|
-
|
|
250
|
+
log.debug("run", "ended", {
|
|
251
|
+
msgId: run.msgId?.slice(0, 8) ?? "?",
|
|
252
|
+
elapsedMs: Date.now() - run.startedAt,
|
|
253
|
+
});
|
|
264
254
|
// Do not resend on DONE failure; content was already shown.
|
|
265
255
|
try {
|
|
266
256
|
await this.sealBubble(run);
|
|
@@ -334,21 +324,18 @@ export class RunFeedback {
|
|
|
334
324
|
);
|
|
335
325
|
}
|
|
336
326
|
|
|
337
|
-
/** Append activity rows;
|
|
327
|
+
/** Append activity rows; rows continue across frames. */
|
|
338
328
|
private async appendLineGroups(r: RunState, lines?: string[]): Promise<boolean> {
|
|
339
329
|
const group = lines ?? this.collectWindowLines(r);
|
|
340
330
|
if (group.length === 0) return true;
|
|
341
|
-
|
|
342
|
-
const frame = stamp + group.join(`\n${stamp}`) + "\n";
|
|
343
|
-
return this.pushAppend(r, frame, "activity");
|
|
331
|
+
return this.pushAppend(r, `${group.join("\n")}\n`, "activity");
|
|
344
332
|
}
|
|
345
333
|
|
|
346
|
-
/** Append text: text messages own bubbles
|
|
334
|
+
/** Append text: text messages own bubbles. */
|
|
347
335
|
private async appendText(r: RunState, text: string): Promise<boolean> {
|
|
348
336
|
// Previous text message finalized: seal it and start a new bubble.
|
|
349
337
|
if (r.startNewBubble) await this.closeBubble(r);
|
|
350
|
-
|
|
351
|
-
return this.pushAppend(r, stamp + text, "text");
|
|
338
|
+
return this.pushAppend(r, text, "text");
|
|
352
339
|
}
|
|
353
340
|
|
|
354
341
|
/** Heartbeat fallback when streaming is unavailable (max N messages per run). */
|
|
@@ -363,8 +350,7 @@ export class RunFeedback {
|
|
|
363
350
|
const bot = this.deps.bot();
|
|
364
351
|
if (!bot) return;
|
|
365
352
|
run.messageHeartbeats += 1;
|
|
366
|
-
|
|
367
|
-
await sendReply(bot, `${stamp}${formatHeartbeat(Date.now() - run.startedAt, run.tools)}`, this.deps.makeChannel());
|
|
353
|
+
await sendReply(bot, formatHeartbeat(Date.now() - run.startedAt, run.tools), this.deps.makeChannel());
|
|
368
354
|
}
|
|
369
355
|
|
|
370
356
|
/** Append a frame (lazy bubble; close on kind change); discard on failure. */
|
|
@@ -381,7 +367,7 @@ export class RunFeedback {
|
|
|
381
367
|
run.cur = {
|
|
382
368
|
stream: new AppendStream(bot.messageApi, bot.getCredentials(), run.openid, run.msgId, {
|
|
383
369
|
onError: (err) => this.handleStreamError(run, err),
|
|
384
|
-
onDebug: (message) =>
|
|
370
|
+
onDebug: (message) => log.debug("stream", message, { msgId: run.msgId?.slice(0, 8) ?? "?" }),
|
|
385
371
|
}),
|
|
386
372
|
kind,
|
|
387
373
|
};
|
|
@@ -400,10 +386,12 @@ export class RunFeedback {
|
|
|
400
386
|
private handleStreamError(run: RunState, err: Error): void {
|
|
401
387
|
const had = run.cur !== null;
|
|
402
388
|
run.cur = null;
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
389
|
+
log.warn("stream", "stream error", {
|
|
390
|
+
msgId: run.msgId?.slice(0, 8) ?? "?",
|
|
391
|
+
elapsedMs: Date.now() - run.startedAt,
|
|
392
|
+
err,
|
|
393
|
+
});
|
|
394
|
+
if (had) this.deps.onWarn(`Stream unavailable; falling back to text (${err.message}).`);
|
|
407
395
|
const rest = run.finalizedText.slice(run.resultSentLen);
|
|
408
396
|
if (rest) {
|
|
409
397
|
const bound = this.deps.boundOpenid();
|
package/src/voice.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** QQ voice attachments: identify voice messages and extract platform ASR text. */
|
|
2
|
+
import type { InboundAttachmentLike } from "./download";
|
|
3
|
+
|
|
4
|
+
export interface VoiceAttachmentLike extends InboundAttachmentLike {
|
|
5
|
+
asr_refer_text?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/** A QQ voice message has content_type "voice"; other media/file types are excluded. */
|
|
9
|
+
export function isVoiceAttachment(attachment: { content_type?: string }): boolean {
|
|
10
|
+
return (attachment.content_type ?? "").toLowerCase() === "voice";
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Collect non-empty ASR text from voice attachments in order.
|
|
15
|
+
* Returns undefined when no attachment has a usable transcript.
|
|
16
|
+
*/
|
|
17
|
+
export function resolveVoiceTranscript(attachments: readonly VoiceAttachmentLike[]): string | undefined {
|
|
18
|
+
const transcripts: string[] = [];
|
|
19
|
+
for (const attachment of attachments) {
|
|
20
|
+
if (!isVoiceAttachment(attachment)) continue;
|
|
21
|
+
const text = attachment.asr_refer_text?.trim();
|
|
22
|
+
if (text) transcripts.push(text);
|
|
23
|
+
}
|
|
24
|
+
return transcripts.length > 0 ? transcripts.join("\n") : undefined;
|
|
25
|
+
}
|