feat: LLM intent router, direct chat execution, and Memory V2 light intervention
Wire chat intent routing with direct_chat on regular sessions, skill-selected short-circuit to Agent, memory light/heavy intervention tiers, and fix direct chat UI stuck streaming after completion. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+21
-2
@@ -16,6 +16,7 @@ import { createSubscriptionService } from './billing-subscription.mjs';
|
||||
import { createDbPool, isDatabaseConfigured } from './db.mjs';
|
||||
import { createUserAuth } from './user-auth.mjs';
|
||||
import { createLlmProviderService } from './llm-providers.mjs';
|
||||
import { createMemoryV2AdminConfigService } from './memory-v2-admin-config.mjs';
|
||||
import { createPlazaPostService, formatPostRow } from './plaza-posts.mjs';
|
||||
import { createPlazaInteractionService } from './plaza-interactions.mjs';
|
||||
import { createPlazaOpsService } from './plaza-ops.mjs';
|
||||
@@ -24,6 +25,7 @@ import { ensureAlgorithmConfig, loadAlgorithmConfig } from './plaza-algorithm.mj
|
||||
import { createNotificationDispatcher } from './notification-dispatcher.mjs';
|
||||
import { createWechatAdminService } from './wechat-admin.mjs';
|
||||
import { createWechatMpService, loadWechatMpConfig } from './wechat-mp.mjs';
|
||||
import { createAdminSystemTestService } from './admin-system-tests.mjs';
|
||||
|
||||
const noop = () => {};
|
||||
|
||||
@@ -36,7 +38,7 @@ const noop = () => {};
|
||||
* @param {string} [env.apiSecret] Goosed/relay API secret.
|
||||
* @param {number} [env.defaultSignupBalanceCents]
|
||||
* @param {boolean} [env.ensureAdminUser] Ensure an admin account exists on boot (default true).
|
||||
* @returns {Promise<{pool, userAuth, llmProviderService, plazaPosts, plazaOps, wechatAdmin}>}
|
||||
* @returns {Promise<{pool, userAuth, llmProviderService, memoryV2ConfigService, adminSystemTestService, plazaPosts, plazaOps, wechatAdmin}>}
|
||||
*/
|
||||
export async function createAdminServices(env = {}) {
|
||||
if (!isDatabaseConfigured()) {
|
||||
@@ -91,6 +93,13 @@ export async function createAdminServices(env = {}) {
|
||||
}
|
||||
|
||||
const llmProviderService = createLlmProviderService(pool, { apiTarget, apiSecret });
|
||||
const memoryV2ConfigService = createMemoryV2AdminConfigService(pool);
|
||||
const adminSystemTestService = createAdminSystemTestService({
|
||||
pool,
|
||||
userAuth,
|
||||
portalBaseUrl: process.env.SYSTEM_TEST_PORTAL_BASE_URL
|
||||
?? `http://127.0.0.1:${process.env.H5_PORT ?? 8081}`,
|
||||
});
|
||||
const wechatMpConfig = loadWechatMpConfig();
|
||||
const wechatMpService = createWechatMpService({
|
||||
config: wechatMpConfig,
|
||||
@@ -116,5 +125,15 @@ export async function createAdminServices(env = {}) {
|
||||
: null,
|
||||
});
|
||||
|
||||
return { pool, userAuth, llmProviderService, plazaPosts, plazaOps, wechatAdmin, subscriptionService };
|
||||
return {
|
||||
pool,
|
||||
userAuth,
|
||||
llmProviderService,
|
||||
memoryV2ConfigService,
|
||||
adminSystemTestService,
|
||||
plazaPosts,
|
||||
plazaOps,
|
||||
wechatAdmin,
|
||||
subscriptionService,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user