Add Rain V0 for MeInput full-range chat analysis and delivery tooling.
Memind CI / Test, build, and release guards (push) Has been cancelled
Memind CI / Test, build, and release guards (push) Has been cancelled
Introduce rain-service orchestration, browser-safe chat skill filtering, MeInput adapter helpers, and verify/deploy scripts so Rain mode can summarize recent input without Memory V2 pollution. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -17,9 +17,34 @@ export const PAGE_DATA_COLLECT_SKILL_NAME = 'page-data-collect';
|
||||
export const EXCEL_ANALYST_SKILL_NAME = 'excel-analyst';
|
||||
export const SCHEDULED_TASK_AUTOMATION_SKILL_NAME = 'scheduled-task-automation';
|
||||
export const AIDER_DEVELOPMENT_SKILL_NAME = 'aider-development';
|
||||
export const RAIN_SKILL_NAME = 'rain';
|
||||
export const SKILL_ROUTER_V2_ENV = 'TKMIND_SKILL_ROUTER_V2';
|
||||
const PAGE_TEMPLATE_SKILL_PREFIX = 'page-template-';
|
||||
|
||||
export function isRainModeMessage(message) {
|
||||
const selected =
|
||||
message?.metadata?.memindRun?.selectedChatSkill ??
|
||||
message?.metadata?.selectedChatSkill;
|
||||
return String(selected ?? '').trim() === RAIN_SKILL_NAME;
|
||||
}
|
||||
|
||||
export function isPageTemplateSkillDefinition(def) {
|
||||
const id = String(def?.id ?? '');
|
||||
const skillName = String(def?.skillName ?? '');
|
||||
return id.startsWith(PAGE_TEMPLATE_SKILL_PREFIX) || skillName.startsWith(PAGE_TEMPLATE_SKILL_PREFIX);
|
||||
}
|
||||
|
||||
function hidePageTemplateSkillsEnabled(env) {
|
||||
const runtimeEnv =
|
||||
env ??
|
||||
(typeof process !== 'undefined' && process.env ? process.env : {});
|
||||
const raw =
|
||||
runtimeEnv.MEMIND_HIDE_PAGE_TEMPLATES ??
|
||||
runtimeEnv.MEMIND_RAIN_REPLACE_TEMPLATES ??
|
||||
'1';
|
||||
return ['1', 'true', 'yes', 'on'].includes(String(raw).trim().toLowerCase());
|
||||
}
|
||||
|
||||
function isPageTemplatePromptKey(promptKey) {
|
||||
return String(promptKey ?? '').startsWith(PAGE_TEMPLATE_SKILL_PREFIX);
|
||||
}
|
||||
@@ -174,6 +199,14 @@ export function isProductCampaignIntent(text) {
|
||||
}
|
||||
|
||||
export const CHAT_SKILL_DEFINITIONS = [
|
||||
{
|
||||
id: RAIN_SKILL_NAME,
|
||||
label: 'Rain',
|
||||
icon: 'analyze',
|
||||
skillName: RAIN_SKILL_NAME,
|
||||
prefillOnly: true,
|
||||
promptKey: 'rain',
|
||||
},
|
||||
{
|
||||
id: 'web-search',
|
||||
label: '查资料',
|
||||
@@ -515,6 +548,11 @@ export function buildChatSkillPrompt(promptKey, skillName) {
|
||||
`请使用 ${skillName ?? 'image-generation'} 技能:把我的简短视觉需求自动扩展成完整 prompt 与独立 negative_prompt,实际调用 generate_image 生成并校验新位图。` +
|
||||
'不要要求我提供 purpose、构图术语、负面词或 jobId;页面主图默认 purpose=hero,生成成功后 HTML 必须使用返回的 asset.htmlSrc,workspaceRelativePath 只用于文件操作。禁止 SVG、CSS 绘图、旧图和占位图冒充。我的需求是:'
|
||||
);
|
||||
case 'rain':
|
||||
return (
|
||||
'【Rain · MeInput 输入分析】请描述要分析的时间区间和你的诉求(例如「总结昨天我在做什么」)。' +
|
||||
'未写时间则默认近3天;区间不明确时我会先追问。我的问题是:'
|
||||
);
|
||||
case 'summarize':
|
||||
return '请总结以下内容,提炼核心结论、重点信息和可执行建议(条理清晰、中文输出):';
|
||||
case 'analyze':
|
||||
@@ -620,6 +658,9 @@ export { buildWebNewsSkillPrompt };
|
||||
|
||||
export function filterChatSkills(options, ctx) {
|
||||
return options.filter((skill) => {
|
||||
if (hidePageTemplateSkillsEnabled() && isPageTemplateSkillDefinition(skill)) {
|
||||
return false;
|
||||
}
|
||||
if (skill.requiresPublish && !ctx.canPublish) {
|
||||
const pageDataGranted =
|
||||
skill.skillName === PAGE_DATA_COLLECT_SKILL_NAME &&
|
||||
|
||||
Reference in New Issue
Block a user