Add smart ACK provider for WeChat MP replies
Replace fixed ackText with a rule-based AckProvider that picks response templates by message type and intent (translate, summary, rewrite, poster, ppt, mindmap, code, search, schedule). Pure sync, zero I/O, auto-falls back to config.ackText on any error. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+81
-1
@@ -144,6 +144,20 @@ export type BillingConfig = {
|
||||
balanceCents: number;
|
||||
};
|
||||
|
||||
export type UserNotification = {
|
||||
id: string;
|
||||
userId: string;
|
||||
channel: 'web' | 'wechat';
|
||||
notificationType: string;
|
||||
title: string;
|
||||
body: string;
|
||||
data?: Record<string, unknown> | null;
|
||||
status: 'unread' | 'read';
|
||||
readAt: number | null;
|
||||
createdAt: number;
|
||||
updatedAt: number;
|
||||
};
|
||||
|
||||
export type JsapiPayParams = {
|
||||
appId: string;
|
||||
timeStamp: string;
|
||||
@@ -171,6 +185,29 @@ export type InsufficientBalanceDetails = {
|
||||
suggestedTiers: number[];
|
||||
};
|
||||
|
||||
export type ActiveSubscription = {
|
||||
id: string;
|
||||
planType: string;
|
||||
status: 'active' | 'expired' | 'cancelled';
|
||||
periodTokensLimit: number;
|
||||
periodTokensUsed: number;
|
||||
periodStart: number;
|
||||
periodEnd: number;
|
||||
expiresAt: number;
|
||||
overageRate: number;
|
||||
autoRenew: boolean;
|
||||
};
|
||||
|
||||
export type PlanDefinition = {
|
||||
key: string;
|
||||
name: string;
|
||||
priceCents: number;
|
||||
periodDays: number;
|
||||
periodTokens: number;
|
||||
modelTier: string;
|
||||
overageRate: number;
|
||||
};
|
||||
|
||||
export type PortalUser = {
|
||||
id: string;
|
||||
username: string;
|
||||
@@ -179,11 +216,16 @@ export type PortalUser = {
|
||||
displayName: string;
|
||||
role: 'user' | 'admin';
|
||||
status: 'active' | 'suspended' | 'disabled';
|
||||
planType?: 'free' | 'growth' | 'pro' | 'enterprise';
|
||||
planType?: string;
|
||||
workspaceRoot: string;
|
||||
balanceCents: number;
|
||||
totalCreditCents?: number;
|
||||
tokensUsed: number;
|
||||
subscription?: ActiveSubscription | null;
|
||||
spaceQuotaBytes?: number;
|
||||
spaceUsedBytes?: number;
|
||||
spaceReservedBytes?: number;
|
||||
spaceAvailableBytes?: number;
|
||||
publishSlug?: string;
|
||||
publishUrl?: string;
|
||||
publishSkillName?: string;
|
||||
@@ -215,6 +257,42 @@ export type MindSpaceCategory = {
|
||||
itemCount: number;
|
||||
};
|
||||
|
||||
export type MindSpaceScheduleItem = {
|
||||
id: string;
|
||||
kind: 'task' | 'event';
|
||||
title: string;
|
||||
description?: string | null;
|
||||
status: 'active' | 'completed' | 'cancelled' | 'deleted';
|
||||
startAt?: number | null;
|
||||
endAt?: number | null;
|
||||
dueAt?: number | null;
|
||||
allDay: boolean;
|
||||
timezone: string;
|
||||
location?: string | null;
|
||||
sourceChannel?: 'h5' | 'wechat' | 'agent' | 'api';
|
||||
sourceMessageId?: string | null;
|
||||
sourceText?: string | null;
|
||||
createdAt: number;
|
||||
updatedAt: number;
|
||||
};
|
||||
|
||||
export type MindSpaceDigestSubscription = {
|
||||
id: string;
|
||||
hour: number;
|
||||
minute: number;
|
||||
timezone: string;
|
||||
channel: 'wechat' | 'in_app';
|
||||
status: 'active' | 'locked' | 'failed' | 'cancelled';
|
||||
nextRunAt: number;
|
||||
lastRunAt?: number | null;
|
||||
attempts?: number;
|
||||
};
|
||||
|
||||
export type MindSpaceSchedule = {
|
||||
todayTodoItems: MindSpaceScheduleItem[];
|
||||
digestSubscriptions: MindSpaceDigestSubscription[];
|
||||
};
|
||||
|
||||
export type MindSpace = {
|
||||
id: string;
|
||||
userId: string;
|
||||
@@ -222,6 +300,7 @@ export type MindSpace = {
|
||||
status: 'active' | 'locked' | 'deleted';
|
||||
quota: MindSpaceQuota;
|
||||
categories: MindSpaceCategory[];
|
||||
schedule?: MindSpaceSchedule | null;
|
||||
createdAt: number;
|
||||
updatedAt: number;
|
||||
};
|
||||
@@ -242,6 +321,7 @@ export type MindSpaceAsset = {
|
||||
scanStatus?: 'pending' | 'passed' | 'warned' | 'blocked';
|
||||
sourceType: 'upload' | 'chat' | 'agent' | 'template' | 'generated' | 'workspace';
|
||||
hasThumbnail?: boolean;
|
||||
publicUrl?: string | null;
|
||||
sourcePageId?: string | null;
|
||||
createdAt: number;
|
||||
updatedAt: number;
|
||||
|
||||
Reference in New Issue
Block a user