Isolate Cursor executor to admin-configured whitelist channel for H5 and WeChat.
Memind CI / Test, build, and release guards (push) Failing after 4m22s
Memind CI / Test, build, and release guards (push) Failing after 4m22s
Non-allowlisted users stay on the existing Goose/DeepSeek path; only memindadm whitelist users enter the TKMind Cursor channel on selected intents and channels. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
} from './chat-skills.mjs';
|
||||
import {
|
||||
cursorAgentTasksDefaultEnabled,
|
||||
cursorExecutorEnabled,
|
||||
cursorPageTasksDefaultEnabled,
|
||||
resolvePreferredCodeExecutor,
|
||||
} from './cursor-agent-launch.mjs';
|
||||
@@ -61,8 +62,10 @@ export function resolveCursorTaskKind(taskText, skill = '') {
|
||||
export function isPageCursorDefaultCandidate(userMessage, {
|
||||
rawToolMode = 'chat',
|
||||
env = process.env,
|
||||
channelEligible = false,
|
||||
} = {}) {
|
||||
if (!cursorPageTasksDefaultEnabled(env)) return false;
|
||||
if (!cursorExecutorEnabled(env)) return false;
|
||||
if (!channelEligible) return false;
|
||||
if (String(rawToolMode ?? '').trim().toLowerCase() === 'code') return false;
|
||||
|
||||
const skill = selectedChatSkill(userMessage);
|
||||
@@ -178,8 +181,9 @@ export function enforcePageGenerationCursorRuntime(userMessage, {
|
||||
taskType = null,
|
||||
forceDeepReasoning = false,
|
||||
env = process.env,
|
||||
channelEligible = false,
|
||||
} = {}) {
|
||||
if (!isPageCursorDefaultCandidate(userMessage, { rawToolMode, env })) {
|
||||
if (!isPageCursorDefaultCandidate(userMessage, { rawToolMode, env, channelEligible })) {
|
||||
return {
|
||||
userMessage,
|
||||
rawToolMode,
|
||||
@@ -216,6 +220,8 @@ export function enforcePageGenerationCursorRuntime(userMessage, {
|
||||
executor: codeExecutor,
|
||||
pageCursorDefault: true,
|
||||
cursorTaskKind: taskKind,
|
||||
cursorChannel: true,
|
||||
channel: 'h5',
|
||||
suggestedDelivery: resolveCursorSuggestedDelivery(taskKind),
|
||||
selectedChatSkill: resolveCursorTaskSkill(taskKind, runMetadata.selectedChatSkill),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user