@morozinc/opencode-tencentdb-plugin 0.0.0-stage → 0.1.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/LICENSE +661 -0
- package/LICENSE-MIT +24 -0
- package/NOTICE.md +14 -0
- package/README.md +207 -2
- package/dist/gui-experimental.cjs +64 -0
- package/dist/integration.mjs +1986 -0
- package/docs/screenshots/code-indexes.png +0 -0
- package/package.json +61 -4
- package/scripts/prepare-runtime.mjs +298 -0
- package/src/binding.ts +33 -0
- package/src/bmad-artifact-preview.tsx +111 -0
- package/src/embedding-settings.tsx +191 -0
- package/src/gui.tsx +388 -0
- package/src/index.ts +484 -0
- package/src/integration.d.ts +75 -0
- package/src/rpc.ts +195 -0
- package/src/rule-document.ts +44 -0
- package/src/rules-contract.ts +77 -0
- package/src/rules.ts +237 -0
- package/src/runtime.ts +436 -0
- package/vendor/TENCENT-LICENSE +27 -0
- package/vendor/integration/native/config.ts +253 -0
- package/vendor/integration/native/embedding.ts +270 -0
- package/vendor/integration/native/index.ts +265 -0
- package/vendor/integration/project/index.ts +151 -0
- package/vendor/integration/project/knowledge.ts +283 -0
- package/vendor/integration/server.ts +154 -0
- package/vendor/integration/tencentChatRules.ts +84 -0
- package/vendor/integration/tencentGenerationContext.ts +4 -0
- package/vendor/integration/tencentKnowledgeClient.ts +512 -0
- package/vendor/integration/tencentMemoryClient.ts +391 -0
- package/vendor/integration/tencentUserQuestion.ts +51 -0
- package/vendor/locks/MemoryCore.json +4776 -0
- package/vendor/locks/MemoryKnowledge.json +3761 -0
- package/vendor/locks/MemoryPanel.json +467 -0
- package/vendor/locks/web.json +6418 -0
- package/vendor/provenance.json +21 -0
- package/vendor/runner.mjs +12 -0
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
import type { KnowledgeConfig } from "./tencentKnowledgeClient";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
import { readFileSync, realpathSync } from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { resolveTencentGenerationContext } from "./tencentGenerationContext";
|
|
6
|
+
import {
|
|
7
|
+
hasMemoryChatBinding,
|
|
8
|
+
resolveProjectContext,
|
|
9
|
+
type ProjectContext,
|
|
10
|
+
} from "./project";
|
|
11
|
+
import { binding } from "../../src/binding";
|
|
12
|
+
|
|
13
|
+
export type MemoryConfig = {
|
|
14
|
+
gatewayUrl: string;
|
|
15
|
+
serviceId: string;
|
|
16
|
+
teamId: string;
|
|
17
|
+
agentId: string;
|
|
18
|
+
userId: string;
|
|
19
|
+
gatewayApiKey?: string;
|
|
20
|
+
};
|
|
21
|
+
type MemoryHit = {
|
|
22
|
+
id: string;
|
|
23
|
+
content: string;
|
|
24
|
+
score?: number;
|
|
25
|
+
type?: string;
|
|
26
|
+
source_path?: string;
|
|
27
|
+
event_date?: string;
|
|
28
|
+
status_hint?: string;
|
|
29
|
+
source_status?: string;
|
|
30
|
+
source_origin?: "scenario_write" | "v2_import";
|
|
31
|
+
source_sha256?: string;
|
|
32
|
+
guidance_scope?: "project" | "global";
|
|
33
|
+
guidance_status?: "active" | "unverified";
|
|
34
|
+
};
|
|
35
|
+
type MemorySearchData = {
|
|
36
|
+
strategy?: string;
|
|
37
|
+
degraded?: boolean;
|
|
38
|
+
message?: string;
|
|
39
|
+
evidence_status?:
|
|
40
|
+
"available" | "partial" | "empty" | "missing_exact_ids" | "degraded";
|
|
41
|
+
items?: MemoryHit[];
|
|
42
|
+
returned?: number;
|
|
43
|
+
total_candidates?: number;
|
|
44
|
+
complete?: boolean;
|
|
45
|
+
next_offset?: number;
|
|
46
|
+
matched_exact_ids?: string[];
|
|
47
|
+
missing_exact_ids?: string[];
|
|
48
|
+
source_catalog?: {
|
|
49
|
+
paths?: string[];
|
|
50
|
+
returned?: number;
|
|
51
|
+
total?: number;
|
|
52
|
+
complete?: boolean;
|
|
53
|
+
next_offset?: number;
|
|
54
|
+
error?: string;
|
|
55
|
+
unindexed_paths?: string[];
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export function sourceScope(sourcePath?: string) {
|
|
60
|
+
if (!sourcePath) return { source_scope: "unclassified" as const };
|
|
61
|
+
if (/^(?:knowledge\/global|global)\//.test(sourcePath))
|
|
62
|
+
return { source_scope: "global" as const };
|
|
63
|
+
const project = sourcePath.match(
|
|
64
|
+
/^(?:knowledge|bmad|v2\/projects)\/([^/]+)\//,
|
|
65
|
+
)?.[1];
|
|
66
|
+
if (project)
|
|
67
|
+
return {
|
|
68
|
+
source_scope: "project" as const,
|
|
69
|
+
source_project: project,
|
|
70
|
+
};
|
|
71
|
+
if (/^(?:v2\/wiki|wiki)\//.test(sourcePath))
|
|
72
|
+
return { source_scope: "shared_legacy" as const };
|
|
73
|
+
return { source_scope: "unclassified" as const };
|
|
74
|
+
}
|
|
75
|
+
type ScenarioEntry = { path: string; summary?: string; version?: number };
|
|
76
|
+
type ScenarioWrite = { path: string; version?: number; memory_id?: string };
|
|
77
|
+
|
|
78
|
+
export function loadMemoryConfig(): MemoryConfig & KnowledgeConfig {
|
|
79
|
+
const configPath = process.env.AIONUI_TDAI_MEMORY_CONFIG;
|
|
80
|
+
if (!configPath) throw new Error("AIONUI_TDAI_MEMORY_CONFIG is missing");
|
|
81
|
+
const config = JSON.parse(readFileSync(configPath, "utf8")) as MemoryConfig &
|
|
82
|
+
KnowledgeConfig;
|
|
83
|
+
for (const key of [
|
|
84
|
+
"gatewayUrl",
|
|
85
|
+
"serviceId",
|
|
86
|
+
"teamId",
|
|
87
|
+
"agentId",
|
|
88
|
+
"userId",
|
|
89
|
+
] as const) {
|
|
90
|
+
if (!config[key]) throw new Error(`Memory configuration is missing ${key}`);
|
|
91
|
+
}
|
|
92
|
+
return config;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** Shared with AionCore: all agents in a workspace use the same artifact namespace. */
|
|
96
|
+
export function memoryScope(workspace = binding().project.workspace): string {
|
|
97
|
+
if (!workspace?.trim())
|
|
98
|
+
throw new Error(
|
|
99
|
+
"Memory workspace is missing; pass workspace to tdai_context or restart this conversation",
|
|
100
|
+
);
|
|
101
|
+
let canonical = path.resolve(workspace);
|
|
102
|
+
try {
|
|
103
|
+
canonical = realpathSync(canonical);
|
|
104
|
+
} catch {
|
|
105
|
+
/* A new workspace may not exist yet. */
|
|
106
|
+
}
|
|
107
|
+
canonical = canonical.replace(/\\/g, "/").replace(/\/+$/, "") || "/";
|
|
108
|
+
const name =
|
|
109
|
+
path.posix
|
|
110
|
+
.basename(canonical)
|
|
111
|
+
.toLowerCase()
|
|
112
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
113
|
+
.replace(/^-|-$/g, "") || "project";
|
|
114
|
+
return `${name}-${createHash("sha256").update(canonical).digest("hex").slice(0, 10)}`;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export function memorySearchProjectOptions(context: ProjectContext) {
|
|
118
|
+
const roots = [context.workspace, ...context.roots];
|
|
119
|
+
return {
|
|
120
|
+
project_scopes: [...new Set(roots.map((root) => memoryScope(root)))],
|
|
121
|
+
project_aliases: [
|
|
122
|
+
...new Set(
|
|
123
|
+
[context.name, path.basename(path.resolve(context.workspace))]
|
|
124
|
+
.map((alias) => alias.trim().toLowerCase())
|
|
125
|
+
.filter((alias) => alias.length >= 2 && alias.length <= 160),
|
|
126
|
+
),
|
|
127
|
+
],
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function clip(value: string, length: number): string {
|
|
132
|
+
return value.slice(0, length).replace(/[\uD800-\uDBFF]$/, "");
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export class TencentMemoryClient {
|
|
136
|
+
constructor(private readonly config: MemoryConfig) {}
|
|
137
|
+
|
|
138
|
+
async addConversation(
|
|
139
|
+
sessionId: string,
|
|
140
|
+
messages: Array<{ role: "user" | "assistant"; content: string }>,
|
|
141
|
+
) {
|
|
142
|
+
const llmContext = await resolveTencentGenerationContext();
|
|
143
|
+
const saved = await this.call<Record<string, unknown>>("conversation/add", {
|
|
144
|
+
session_id: sessionId,
|
|
145
|
+
messages,
|
|
146
|
+
llm_context: llmContext,
|
|
147
|
+
});
|
|
148
|
+
return { ...saved, generation_model: llmContext.model };
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
async call<T>(route: string, body: Record<string, unknown>): Promise<T> {
|
|
152
|
+
const response = await fetch(
|
|
153
|
+
`${this.config.gatewayUrl.replace(/\/$/, "")}/v3/${route}`,
|
|
154
|
+
{
|
|
155
|
+
method: "POST",
|
|
156
|
+
headers: {
|
|
157
|
+
"Content-Type": "application/json",
|
|
158
|
+
"x-tdai-service-id": this.config.serviceId,
|
|
159
|
+
Authorization: `Bearer ${this.config.gatewayApiKey || "local"}`,
|
|
160
|
+
},
|
|
161
|
+
body: JSON.stringify({
|
|
162
|
+
...body,
|
|
163
|
+
team_id: this.config.teamId,
|
|
164
|
+
agent_id: this.config.agentId,
|
|
165
|
+
user_id: this.config.userId,
|
|
166
|
+
}),
|
|
167
|
+
signal: AbortSignal.timeout(15000),
|
|
168
|
+
},
|
|
169
|
+
);
|
|
170
|
+
const envelope = (await response.json()) as {
|
|
171
|
+
code: number;
|
|
172
|
+
message?: string;
|
|
173
|
+
data?: T;
|
|
174
|
+
};
|
|
175
|
+
if (!response.ok || envelope.code !== 0)
|
|
176
|
+
throw new Error(
|
|
177
|
+
envelope.message || `MemoryCore returned HTTP ${response.status}`,
|
|
178
|
+
);
|
|
179
|
+
return envelope.data as T;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
async search(
|
|
183
|
+
query: string,
|
|
184
|
+
limit = 5,
|
|
185
|
+
excerptLength = 1800,
|
|
186
|
+
options: {
|
|
187
|
+
offset?: number;
|
|
188
|
+
intent?:
|
|
189
|
+
| "search"
|
|
190
|
+
| "continue"
|
|
191
|
+
| "latest"
|
|
192
|
+
| "current_decision"
|
|
193
|
+
| "exact_ids"
|
|
194
|
+
| "list_all"
|
|
195
|
+
| "rules";
|
|
196
|
+
scope_mode?: "current_project" | "cross_project" | "projectless";
|
|
197
|
+
project_scopes?: string[];
|
|
198
|
+
project_aliases?: string[];
|
|
199
|
+
include_global?: boolean;
|
|
200
|
+
exact_ids?: string[];
|
|
201
|
+
} = {},
|
|
202
|
+
) {
|
|
203
|
+
const context = binding().project;
|
|
204
|
+
const isCurrentProject = options.scope_mode !== "cross_project";
|
|
205
|
+
const projectOptions = context.project_id
|
|
206
|
+
? memorySearchProjectOptions(context)
|
|
207
|
+
: { project_scopes: [], project_aliases: [] };
|
|
208
|
+
const data = await this.call<MemorySearchData>("atomic/search", {
|
|
209
|
+
query,
|
|
210
|
+
limit,
|
|
211
|
+
...options,
|
|
212
|
+
scope_mode: isCurrentProject ? "current_project" : "cross_project",
|
|
213
|
+
project_scopes: isCurrentProject ? projectOptions.project_scopes : [],
|
|
214
|
+
project_aliases: isCurrentProject ? projectOptions.project_aliases : [],
|
|
215
|
+
include_global: options.include_global ?? true,
|
|
216
|
+
});
|
|
217
|
+
const degraded = data.degraded ?? true;
|
|
218
|
+
return {
|
|
219
|
+
strategy: data.strategy,
|
|
220
|
+
degraded,
|
|
221
|
+
message:
|
|
222
|
+
data.message ??
|
|
223
|
+
(data.degraded === undefined
|
|
224
|
+
? "Gateway did not report retrieval health; treat the evidence as partial."
|
|
225
|
+
: undefined),
|
|
226
|
+
evidence_status:
|
|
227
|
+
data.evidence_status ?? (degraded ? "degraded" : "partial"),
|
|
228
|
+
items: (data.items ?? []).slice(0, limit).map((hit) => ({
|
|
229
|
+
id: hit.id,
|
|
230
|
+
type: hit.type,
|
|
231
|
+
score: hit.score,
|
|
232
|
+
source_path: hit.source_path,
|
|
233
|
+
...sourceScope(hit.source_path),
|
|
234
|
+
event_date: hit.event_date,
|
|
235
|
+
status_hint: hit.status_hint,
|
|
236
|
+
source_status: hit.source_status,
|
|
237
|
+
source_origin: hit.source_origin,
|
|
238
|
+
source_sha256: hit.source_sha256,
|
|
239
|
+
guidance_scope: hit.guidance_scope,
|
|
240
|
+
guidance_status: hit.guidance_status,
|
|
241
|
+
content: clip(hit.content, excerptLength),
|
|
242
|
+
truncated: hit.content.length > excerptLength,
|
|
243
|
+
})),
|
|
244
|
+
returned: data.returned ?? data.items?.length ?? 0,
|
|
245
|
+
total_candidates: data.total_candidates ?? data.items?.length ?? 0,
|
|
246
|
+
complete: data.complete ?? false,
|
|
247
|
+
next_offset: data.next_offset,
|
|
248
|
+
matched_exact_ids: data.matched_exact_ids ?? [],
|
|
249
|
+
missing_exact_ids: data.missing_exact_ids ?? [],
|
|
250
|
+
source_catalog: data.source_catalog
|
|
251
|
+
? {
|
|
252
|
+
paths: data.source_catalog.paths ?? [],
|
|
253
|
+
returned:
|
|
254
|
+
data.source_catalog.returned ??
|
|
255
|
+
data.source_catalog.paths?.length ??
|
|
256
|
+
0,
|
|
257
|
+
total: data.source_catalog.total ?? 0,
|
|
258
|
+
complete: data.source_catalog.complete ?? false,
|
|
259
|
+
next_offset: data.source_catalog.next_offset,
|
|
260
|
+
error: data.source_catalog.error,
|
|
261
|
+
unindexed_paths: data.source_catalog.unindexed_paths,
|
|
262
|
+
}
|
|
263
|
+
: undefined,
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
async list(pathPrefix?: string, offset = 0, limit = 30) {
|
|
268
|
+
const data = await this.call<{ entries?: ScenarioEntry[] }>("scenario/ls", {
|
|
269
|
+
path_prefix: pathPrefix,
|
|
270
|
+
});
|
|
271
|
+
const entries = (data.entries ?? []).toSorted((a, b) =>
|
|
272
|
+
a.path.localeCompare(b.path),
|
|
273
|
+
);
|
|
274
|
+
return {
|
|
275
|
+
entries: entries.slice(offset, offset + limit).map((entry) => ({
|
|
276
|
+
path: entry.path,
|
|
277
|
+
...sourceScope(entry.path),
|
|
278
|
+
summary: entry.summary ? clip(entry.summary, 160) : undefined,
|
|
279
|
+
version: entry.version,
|
|
280
|
+
})),
|
|
281
|
+
total: entries.length,
|
|
282
|
+
offset,
|
|
283
|
+
has_more: offset + limit < entries.length,
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
async context(query: string, context: ProjectContext, workspace?: string) {
|
|
288
|
+
const projectOptions = memorySearchProjectOptions(context);
|
|
289
|
+
const scope = memoryScope(workspace ?? context.workspace);
|
|
290
|
+
if (!projectOptions.project_scopes.includes(scope))
|
|
291
|
+
throw new Error(
|
|
292
|
+
"Memory workspace is outside the current project. Use one of its registered roots.",
|
|
293
|
+
);
|
|
294
|
+
const prefix = context.project_id ? `bmad/${scope}/` : null;
|
|
295
|
+
const values = await Promise.allSettled([
|
|
296
|
+
this.search(query, 4, 1100, {
|
|
297
|
+
scope_mode: "current_project",
|
|
298
|
+
...projectOptions,
|
|
299
|
+
}),
|
|
300
|
+
this.search(query, 4, 1100, {
|
|
301
|
+
scope_mode: "current_project",
|
|
302
|
+
...projectOptions,
|
|
303
|
+
intent: "rules",
|
|
304
|
+
include_global: true,
|
|
305
|
+
}),
|
|
306
|
+
prefix
|
|
307
|
+
? this.list(prefix, 0, 8)
|
|
308
|
+
: Promise.resolve({
|
|
309
|
+
entries: [],
|
|
310
|
+
total: 0,
|
|
311
|
+
offset: 0,
|
|
312
|
+
has_more: false,
|
|
313
|
+
}),
|
|
314
|
+
]);
|
|
315
|
+
const [memories, guidance, artifacts] = values;
|
|
316
|
+
const { items = [], ...memoryRetrieval } =
|
|
317
|
+
memories.status === "fulfilled" ? memories.value : {};
|
|
318
|
+
return {
|
|
319
|
+
project_scope: context.project_id ? scope : null,
|
|
320
|
+
bmad_prefix: prefix,
|
|
321
|
+
memories: items,
|
|
322
|
+
memory_retrieval:
|
|
323
|
+
memories.status === "fulfilled" ? memoryRetrieval : null,
|
|
324
|
+
guidance: guidance.status === "fulfilled" ? guidance.value.items : [],
|
|
325
|
+
guidance_retrieval:
|
|
326
|
+
guidance.status === "fulfilled"
|
|
327
|
+
? {
|
|
328
|
+
complete: guidance.value.complete,
|
|
329
|
+
next_offset: guidance.value.next_offset,
|
|
330
|
+
total_candidates: guidance.value.total_candidates,
|
|
331
|
+
degraded: guidance.value.degraded,
|
|
332
|
+
message: guidance.value.message,
|
|
333
|
+
}
|
|
334
|
+
: null,
|
|
335
|
+
artifacts: artifacts.status === "fulfilled" ? artifacts.value : null,
|
|
336
|
+
unavailable: values.flatMap((value, index) =>
|
|
337
|
+
value.status === "rejected"
|
|
338
|
+
? [["search", "guidance", "artifacts"][index]]
|
|
339
|
+
: [],
|
|
340
|
+
),
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/** L2 is human-readable authority; its L1 excerpt is searchable before success is returned. */
|
|
345
|
+
async writeScenario(
|
|
346
|
+
documentPath: string,
|
|
347
|
+
content: string,
|
|
348
|
+
summary?: string,
|
|
349
|
+
kind: "episodic" | "persona" | "instruction" = "episodic",
|
|
350
|
+
) {
|
|
351
|
+
const bound = hasMemoryChatBinding();
|
|
352
|
+
if (bound && kind !== "episodic")
|
|
353
|
+
throw new Error(
|
|
354
|
+
"Use tdai_global_rule_write or tdai_project_rule_write to save standing rules in this chat.",
|
|
355
|
+
);
|
|
356
|
+
const saved = await this.call<ScenarioWrite>(
|
|
357
|
+
bound ? "scenario/document-write" : "scenario/write",
|
|
358
|
+
{
|
|
359
|
+
path: documentPath,
|
|
360
|
+
content,
|
|
361
|
+
summary,
|
|
362
|
+
index_content: clip(
|
|
363
|
+
[documentPath, summary, content].filter(Boolean).join("\n\n"),
|
|
364
|
+
7800,
|
|
365
|
+
),
|
|
366
|
+
index_type: kind,
|
|
367
|
+
},
|
|
368
|
+
);
|
|
369
|
+
if (!saved.memory_id)
|
|
370
|
+
throw new Error(
|
|
371
|
+
"Document saved without a searchable record. Update MemoryCore and retry the same path.",
|
|
372
|
+
);
|
|
373
|
+
return { ...saved, indexed: true };
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
async writeMemory(input: {
|
|
377
|
+
subject: string;
|
|
378
|
+
content: string;
|
|
379
|
+
summary?: string;
|
|
380
|
+
scope?: "project" | "global";
|
|
381
|
+
kind?: "episodic" | "persona" | "instruction";
|
|
382
|
+
}) {
|
|
383
|
+
const scope = input.scope === "global" ? "global" : memoryScope();
|
|
384
|
+
return this.writeScenario(
|
|
385
|
+
`knowledge/${scope}/${input.subject}.md`,
|
|
386
|
+
input.content,
|
|
387
|
+
input.summary,
|
|
388
|
+
input.kind,
|
|
389
|
+
);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { callMemoryChatHost, hasMemoryChatBinding } from "./project";
|
|
4
|
+
|
|
5
|
+
export function registerUserQuestionTool(server: McpServer): void {
|
|
6
|
+
if (!hasMemoryChatBinding()) return;
|
|
7
|
+
server.tool(
|
|
8
|
+
"ellmsha_ask_user",
|
|
9
|
+
"Ask the user in this chat when a decision is needed. Shows a question form and returns the selected or typed answers. Prefer the harness’s native question tool when available.",
|
|
10
|
+
{
|
|
11
|
+
questions: z
|
|
12
|
+
.array(
|
|
13
|
+
z.object({
|
|
14
|
+
id: z.string().trim().min(1).max(256),
|
|
15
|
+
header: z.string().max(512).default(""),
|
|
16
|
+
question: z.string().trim().min(1).max(8192),
|
|
17
|
+
options: z
|
|
18
|
+
.array(
|
|
19
|
+
z.object({
|
|
20
|
+
label: z.string().trim().min(1).max(2048),
|
|
21
|
+
description: z.string().max(4096).default(""),
|
|
22
|
+
}),
|
|
23
|
+
)
|
|
24
|
+
.max(32)
|
|
25
|
+
.default([]),
|
|
26
|
+
multiSelect: z.boolean().default(false),
|
|
27
|
+
isOther: z.boolean().default(true),
|
|
28
|
+
isSecret: z.boolean().default(false),
|
|
29
|
+
}),
|
|
30
|
+
)
|
|
31
|
+
.min(1)
|
|
32
|
+
.max(12),
|
|
33
|
+
},
|
|
34
|
+
{ readOnlyHint: true, destructiveHint: false, openWorldHint: false },
|
|
35
|
+
async ({ questions }, extra) => ({
|
|
36
|
+
content: [
|
|
37
|
+
{
|
|
38
|
+
type: "text",
|
|
39
|
+
text: JSON.stringify(
|
|
40
|
+
await callMemoryChatHost(
|
|
41
|
+
"question",
|
|
42
|
+
undefined,
|
|
43
|
+
questions,
|
|
44
|
+
extra.signal,
|
|
45
|
+
),
|
|
46
|
+
),
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
}),
|
|
50
|
+
);
|
|
51
|
+
}
|