feat(mindspace): add opt-in local analytics
This commit is contained in:
@@ -888,6 +888,9 @@ function resolveHtmlPublishArtifacts({
|
||||
workingDir,
|
||||
publicBaseUrl,
|
||||
requestStartedAt,
|
||||
userId = '',
|
||||
sessionId = '',
|
||||
onPageGenerated = null,
|
||||
}) {
|
||||
materializeMissingPublicHtmlWrites({
|
||||
messages: reply?.messages ?? [],
|
||||
@@ -918,6 +921,9 @@ function resolveHtmlPublishArtifacts({
|
||||
recentArtifacts,
|
||||
replyText: reply?.text,
|
||||
});
|
||||
if (typeof onPageGenerated === 'function' && confirmedArtifacts.length > 0) {
|
||||
void onPageGenerated({ userId, sessionId, artifacts: confirmedArtifacts });
|
||||
}
|
||||
return {
|
||||
publishedArtifacts,
|
||||
expectedArtifacts,
|
||||
@@ -1406,6 +1412,7 @@ export function createWechatMpService({
|
||||
scheduleService = null,
|
||||
wechatScheduleLlmConfigService = null,
|
||||
llmProviderService = null,
|
||||
onPageGenerated = null,
|
||||
applySessionLlmProvider = null,
|
||||
refreshSessionSnapshot = null,
|
||||
pageDataFinishGuard = null,
|
||||
@@ -1979,6 +1986,9 @@ export function createWechatMpService({
|
||||
workingDir,
|
||||
publicBaseUrl: config.publicBaseUrl,
|
||||
requestStartedAt,
|
||||
userId: user.userId,
|
||||
sessionId,
|
||||
onPageGenerated,
|
||||
});
|
||||
const hasValidLinkInReply = await hasAnyValidPublishedHtmlLink(reply?.text, linkExistsForRequest, {
|
||||
confirmedArtifacts,
|
||||
@@ -2135,6 +2145,9 @@ export function createWechatMpService({
|
||||
workingDir,
|
||||
publicBaseUrl: config.publicBaseUrl,
|
||||
requestStartedAt: retryStartedAt,
|
||||
userId: user.userId,
|
||||
sessionId,
|
||||
onPageGenerated,
|
||||
});
|
||||
const hasValidLinkInReply = await hasAnyValidPublishedHtmlLink(reply?.text, linkExistsForRequest, {
|
||||
confirmedArtifacts,
|
||||
|
||||
Reference in New Issue
Block a user