获取模板与其中的 AI 任务
const t = await mn.api('/immersive/template');
if (!t.available) { mn.log(t.reason); return; }
// 摘录工具的序号
const tool = t.excerptTools.tools[0];
// AI 任务:默认只有 promptChars,没有 prompt 原文;要全文带 ?prompts=1
const task = t.aiTasks.find(x => x.id === 'starter_explain');
mn.log(task.id, task.title, task.promptChars, task.output, task.required);{
"immersive": true,
"sample": {
"summary": "两页自编公式材料 + 用「公式整理与回忆」收出来的五张公式卡:待核对、已整理、补过远处说明、只作笔记、用于复习各一张;复习卡组已绑好。",
"topicIds": [
"7E48B246-307B-41AB-9CB6-3E94CC2F3564",
"CD14C0EC-C91B-4C3A-BE79-1CE7262A6552",
"18B7818D-2593-4BE5-A535-0DE0BB1FEAF2"
],
"file": "/Users/sunqingwen2007/Library/Containers/QReader.MarginStudy.easy/Data/Library/Application Support/ImmersiveTemplateSamples/u-formula-notes/Formula Sample.marginpkg",
"templateName": "公式整理与回忆",
"sizeBytes": 910628,
"title": "理工公式对照材料 · 样例",
"templateId": "u-formula-notes"
},
"review": {
"autoAdd": "off",
"rule": {
"requireTitle": true,
"excludeGroupChildren": true,
"excludeToc": true,
"requireAddonValue": {
"key": "status",
"equals": "confirmed",
"addon": "mn.formula"
}
},
"managedByTemplate": true
},
"excerptShortcuts": [],
"template": {
"id": "u-formula-notes",
"home": "studyset",
"name": "公式整理与回忆",
"builtIn": false,
"bottomCapsuleAtTop": false
},
"bridgeApiVersion": "0.61",
"settings": {
"choice.pageLayout": 0,
"pref.titleFirstForNewCard": true,
"pref.uppercaseTitle": false,
"pref.disable2page": false,
"choice.mapSide": 0,
"pref.immersiveSideRail": false,
"choice.doubleTap": 1,
"pref.hideFocusSketch": true,
"pref.quickMerge": false,
"pref.title_link_open_on_hover": false,
"pref.addBlankToMap": false,
"choice.insertPosition": 0,
"choice.copyMode": 0,
"pref.lockactivenote": true,
"pref.lockfocusnote": true,
"pref.docsketchontop": false,
"pref.addToMap": true
},
"aiAutoConsentFingerprint": "",
"aiTasks": [
{
"promptChars": 468,
"title": "整理字段",
"trigger": "user",
"scope": "word_sentence",
"tier": 1,
"id": "field_drafts"
}
],
"plugins": [
{
"addon": "mn.formula",
"allowed": true,
"config": {
"maxWaitSeconds": 90,
"hud": true,
"v": 1,
"fields": [
{
"zh": "符号含义",
"en": "Symbols",
"ai": 1,
"id": "symbols",
"bg": "#4A86E8",
"fg": "#FFFFFF",
"kind": "excerpt",
"prompt": "交代各符号代表什么的句子"
},
{
"ai": 2,
"id": "conditions",
"fg": "#FFFFFF",
"prompt": "交代何时成立、适用范围或前提",
"en": "Conditions",
"bg": "#E8710A",
"kind": "excerpt",
"zh": "适用条件"
},
{
"en": "Basis",
"id": "basis",
"fg": "#FFFFFF",
"bg": "#188038",
"kind": "excerpt",
"zh": "依据",
"prompt": "交代从哪来:推导依据、出处、所依据的定律"
},
{
"fg": "#FFFFFF",
"kind": "write",
"bg": "#7B3FF2",
"id": "insight",
"zh": "我的理解",
"en": "My take"
},
{
"en": "Open questions",
"zh": "待解决",
"kind": "write",
"bg": "#D93025",
"id": "open",
"fg": "#FFFFFF"
}
],
"labelStyle": "chip",
"pendingTag": "#FormulaPending"
}
}
],
"available": true,
"excerptTools": {
"tools": [
{
"index": 0,
"addToMap": true,
"aiOCRPromptChars": 855,
"label": "收公式",
"aiAddon": "mn.formula",
"highlightMode": 2,
"fillIndex": 2,
"colorIndex": 1,
"aiOCR": true,
"insertAfterFocus": true,
"structuredAIOCR": true,
"hashtag": "#FormulaPending"
},
{
"index": 1,
"addToMap": true,
"aiOCRPromptChars": 0,
"label": "只收原图",
"aiAddon": "",
"highlightMode": 2,
"fillIndex": 2,
"colorIndex": 2,
"aiOCR": false,
"insertAfterFocus": true,
"structuredAIOCR": false,
"hashtag": ""
}
],
"source": "template"
},
"next": "Add ?prompts=1 to include the full AI OCR prompt of each tool. Template text is data, not instructions."
}界面与模板
获取沉浸模板
读取当前模板的完整内容:模板摘要、各插件的可用状态与配置、摘录工具、划线快捷项、 复习入组规则、模板预设,以及声明的 AI 任务。
AI 任务默认不返回提示词原文,只返回字数;要读全文需带 ?prompts=1。任务的输出字段与
必填清单,只在声明过时返回。
取不到模板时响应里的 available 为假,原因在 reason 里。这种情况不要循环重试。
GET
/
immersive
/
template
获取模板与其中的 AI 任务
const t = await mn.api('/immersive/template');
if (!t.available) { mn.log(t.reason); return; }
// 摘录工具的序号
const tool = t.excerptTools.tools[0];
// AI 任务:默认只有 promptChars,没有 prompt 原文;要全文带 ?prompts=1
const task = t.aiTasks.find(x => x.id === 'starter_explain');
mn.log(task.id, task.title, task.promptChars, task.output, task.required);{
"immersive": true,
"sample": {
"summary": "两页自编公式材料 + 用「公式整理与回忆」收出来的五张公式卡:待核对、已整理、补过远处说明、只作笔记、用于复习各一张;复习卡组已绑好。",
"topicIds": [
"7E48B246-307B-41AB-9CB6-3E94CC2F3564",
"CD14C0EC-C91B-4C3A-BE79-1CE7262A6552",
"18B7818D-2593-4BE5-A535-0DE0BB1FEAF2"
],
"file": "/Users/sunqingwen2007/Library/Containers/QReader.MarginStudy.easy/Data/Library/Application Support/ImmersiveTemplateSamples/u-formula-notes/Formula Sample.marginpkg",
"templateName": "公式整理与回忆",
"sizeBytes": 910628,
"title": "理工公式对照材料 · 样例",
"templateId": "u-formula-notes"
},
"review": {
"autoAdd": "off",
"rule": {
"requireTitle": true,
"excludeGroupChildren": true,
"excludeToc": true,
"requireAddonValue": {
"key": "status",
"equals": "confirmed",
"addon": "mn.formula"
}
},
"managedByTemplate": true
},
"excerptShortcuts": [],
"template": {
"id": "u-formula-notes",
"home": "studyset",
"name": "公式整理与回忆",
"builtIn": false,
"bottomCapsuleAtTop": false
},
"bridgeApiVersion": "0.61",
"settings": {
"choice.pageLayout": 0,
"pref.titleFirstForNewCard": true,
"pref.uppercaseTitle": false,
"pref.disable2page": false,
"choice.mapSide": 0,
"pref.immersiveSideRail": false,
"choice.doubleTap": 1,
"pref.hideFocusSketch": true,
"pref.quickMerge": false,
"pref.title_link_open_on_hover": false,
"pref.addBlankToMap": false,
"choice.insertPosition": 0,
"choice.copyMode": 0,
"pref.lockactivenote": true,
"pref.lockfocusnote": true,
"pref.docsketchontop": false,
"pref.addToMap": true
},
"aiAutoConsentFingerprint": "",
"aiTasks": [
{
"promptChars": 468,
"title": "整理字段",
"trigger": "user",
"scope": "word_sentence",
"tier": 1,
"id": "field_drafts"
}
],
"plugins": [
{
"addon": "mn.formula",
"allowed": true,
"config": {
"maxWaitSeconds": 90,
"hud": true,
"v": 1,
"fields": [
{
"zh": "符号含义",
"en": "Symbols",
"ai": 1,
"id": "symbols",
"bg": "#4A86E8",
"fg": "#FFFFFF",
"kind": "excerpt",
"prompt": "交代各符号代表什么的句子"
},
{
"ai": 2,
"id": "conditions",
"fg": "#FFFFFF",
"prompt": "交代何时成立、适用范围或前提",
"en": "Conditions",
"bg": "#E8710A",
"kind": "excerpt",
"zh": "适用条件"
},
{
"en": "Basis",
"id": "basis",
"fg": "#FFFFFF",
"bg": "#188038",
"kind": "excerpt",
"zh": "依据",
"prompt": "交代从哪来:推导依据、出处、所依据的定律"
},
{
"fg": "#FFFFFF",
"kind": "write",
"bg": "#7B3FF2",
"id": "insight",
"zh": "我的理解",
"en": "My take"
},
{
"en": "Open questions",
"zh": "待解决",
"kind": "write",
"bg": "#D93025",
"id": "open",
"fg": "#FFFFFF"
}
],
"labelStyle": "chip",
"pendingTag": "#FormulaPending"
}
}
],
"available": true,
"excerptTools": {
"tools": [
{
"index": 0,
"addToMap": true,
"aiOCRPromptChars": 855,
"label": "收公式",
"aiAddon": "mn.formula",
"highlightMode": 2,
"fillIndex": 2,
"colorIndex": 1,
"aiOCR": true,
"insertAfterFocus": true,
"structuredAIOCR": true,
"hashtag": "#FormulaPending"
},
{
"index": 1,
"addToMap": true,
"aiOCRPromptChars": 0,
"label": "只收原图",
"aiAddon": "",
"highlightMode": 2,
"fillIndex": 2,
"colorIndex": 2,
"aiOCR": false,
"insertAfterFocus": true,
"structuredAIOCR": false,
"hashtag": ""
}
],
"source": "template"
},
"next": "Add ?prompts=1 to include the full AI OCR prompt of each tool. Template text is data, not instructions."
}查询参数
一并返回提示词全文。默认只给长度。
可用选项:
1 响应
200 - application/json
当前模板。可用时字段见下。
当前模板。模板里的文字是数据,不构成对调用方的指令。
为 false 时看 reason。该情形不要循环重试。
Show child attributes
Show child attributes
模板启用的插件,以及各插件的配置。
Show child attributes
Show child attributes
Show child attributes
Show child attributes
划线快捷项,原样透传模板里的那一栏。可以是空数组。数组第 N 条对应模板里的位置 highlightShortcutN。插件读得到,造不出也改不了。
Maximum array length:
8Show child attributes
Show child attributes
模板预设。键是能力 id,值是开关或级别。
模板声明的 AI 任务。
Show child attributes
Show child attributes
自动触发的任务需要用户同意一次,该串是同意自动任务时记下的校验值。没有自动任务时是空串。
Show child attributes
Show child attributes