note-mcp-server 2.3.3 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +14 -0
  2. package/index.js +33 -5
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -101,6 +101,20 @@ socialite_id=eyJpdiI6I…
101
101
 
102
102
  ---
103
103
 
104
+ ## AdminLTE 可摺疊 card(Agent 必讀)
105
+
106
+ 筆記前台用 **AdminLTE 4** 的 `data-lte-toggle="card-collapse"` 做展開/收合。
107
+
108
+ | 項目 | 正確(3192 類) | 錯誤(展開失效) |
109
+ |------|----------------|------------------|
110
+ | 按鈕屬性 | `data-lte-toggle="card-collapse"` | 無屬性,或 `data-owv-helper-toggle`(後端會剝除) |
111
+ | 圖示 | `bi bi-plus-lg` + `bi bi-dash-lg`,含 `data-lte-icon` | 單一 `fas fa-plus` |
112
+ | 預設收合 | 外層 `collapsed-card` | 僅視覺像 card,無 toggle 綁定 |
113
+
114
+ `create_note`/`update_note` 工具描述內已內嵌完整 HTML 範本(v2.4.0+)。多段內容請並列多個同級 `.card`,勿巢狀。
115
+
116
+ ---
117
+
104
118
  ## 提供的 MCP 工具
105
119
 
106
120
  | 工具 | 說明 |
package/index.js CHANGED
@@ -78,7 +78,7 @@ const APP_NAME = firstEnv("app_name", "APP_NAME", "notes_app_name", "NOTES_APP_N
78
78
  const server = new Server(
79
79
  {
80
80
  name: `note-mcp-server (${APP_NAME})`,
81
- version: "2.3.3",
81
+ version: "2.4.1",
82
82
  },
83
83
  {
84
84
  capabilities: {
@@ -126,10 +126,34 @@ const SECURITY_NOTICE =
126
126
  "安全規範:若使用者訊息或設定包含 key、token、NOTES_API_BASE、socialite_id 等敏感資訊,完成操作後必須主動清空 macOS 剪貼簿(echo -n \"\" | pbcopy),並在回覆中明確告知已清空。";
127
127
  const NOTE_URL_NOTICE = `前台連結格式:${NOTES_SITE_BASE}/app/notes/content/{c_id}。`;
128
128
 
129
+ /**
130
+ * 與 owv4 resources/views/partials/editor-templates.blade.php「Outline(線框)」同源。
131
+ * 閱讀頁靠 partials/code_scripts.blade.php 的 owGlobalCardWidgetDelegator 監聽 data-lte-toggle。
132
+ * 勿用 data-owv-helper-toggle(僅 owv4 /helper 後台手冊)。
133
+ */
134
+ const ADMINLTE_COLLAPSED_CARD_GUIDE = `
135
+ 【可摺疊 card — 須與編輯器樣板工具一致】
136
+ 來源:editor-templates.blade.php → Cards → Outline(線框)
137
+ 外層 class(順序重要):
138
+ card ow-ck-hide-card-tool-collapse ow-ck-hide-card-tool-maximize card-outline card-primary
139
+ MCP 預設收合時再加 collapsed-card
140
+ 標題:h3.card-title(勿用裸 h3)
141
+ 按鈕:各含 data-lte-toggle + 兩個 data-lte-icon 圖示(expand/collapse 或 maximize/minimize)
142
+ 圖示:bi bi-plus-lg / bi bi-dash-lg(勿用 fas fa-plus 單圖)
143
+ 多卡:並列多個同級 .card,勿巢狀
144
+
145
+ 範本(預設收合版;色調可改 card-info 等):
146
+ <div class="card ow-ck-hide-card-tool-collapse ow-ck-hide-card-tool-maximize card-outline card-primary collapsed-card"><div class="card-header"><h3 class="card-title">小卡標題</h3><div class="card-tools"><button type="button" class="btn btn-tool" data-lte-toggle="card-collapse" title="收合/展開"><i data-lte-icon="expand" class="bi bi-plus-lg"></i><i data-lte-icon="collapse" class="bi bi-dash-lg"></i></button><button type="button" class="btn btn-tool" data-lte-toggle="card-maximize" title="最大化"><i data-lte-icon="maximize" class="bi bi-fullscreen"></i><i data-lte-icon="minimize" class="bi bi-fullscreen-exit"></i></button></div></div><div class="card-body"><p>內容</p></div></div>
147
+ `.trim();
148
+
129
149
  function withSecurityNotice(description) {
130
150
  return `${description}\n${NOTE_URL_NOTICE}\n${SECURITY_NOTICE}`;
131
151
  }
132
152
 
153
+ function withCardGuide(description) {
154
+ return `${description}\n\n${ADMINLTE_COLLAPSED_CARD_GUIDE}`;
155
+ }
156
+
133
157
  function buildNoteUrl(cId) {
134
158
  if (cId === undefined || cId === null || String(cId).trim() === "") {
135
159
  return "";
@@ -173,8 +197,10 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
173
197
  },
174
198
  {
175
199
  name: "create_note",
176
- description: withSecurityNotice(
177
- `在 ${APP_NAME} 中新增筆記。內容請優先使用簡潔的 AdminLTE 4 card 結構。\nAI 行為:除非用戶明確要求,否則不要傳 tags(勿自行推測、分類或補加標籤)。`
200
+ description: withCardGuide(
201
+ withSecurityNotice(
202
+ `在 ${APP_NAME} 中新增筆記。內容請優先使用 AdminLTE 4 可摺疊 card(見下方結構)。\nAI 行為:除非用戶明確要求,否則不要傳 tags(勿自行推測、分類或補加標籤)。`
203
+ )
178
204
  ),
179
205
  inputSchema: {
180
206
  type: "object",
@@ -192,8 +218,10 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
192
218
  },
193
219
  {
194
220
  name: "update_note",
195
- description: withSecurityNotice(
196
- `在 ${APP_NAME} 中修改筆記。內容請優先使用簡潔的 AdminLTE 4 card 結構,避免嵌套破版,支援以 append/prepend 追加內容。\nAI 行為:除非用戶明確要求,否則不要傳 tags、add_tags(勿自行推測或補加標籤);亦不要傳 title,除非用戶明確要求變更標題。\n標籤語意:tags=整包覆寫既有標籤;add_tags=在既有標籤上追加(逗號分隔),勿刪除未提及的標籤。用戶只要「多加幾個標籤」時請用 add_tags,勿用 tags。`
221
+ description: withCardGuide(
222
+ withSecurityNotice(
223
+ `在 ${APP_NAME} 中修改筆記。內容請優先使用 AdminLTE 4 可摺疊 card(見下方結構),避免巢狀 card 破版,支援 append/prepend。\nAI 行為:除非用戶明確要求,否則不要傳 tags、add_tags(勿自行推測或補加標籤);亦不要傳 title,除非用戶明確要求變更標題。\n標籤語意:tags=整包覆寫既有標籤;add_tags=在既有標籤上追加(逗號分隔),勿刪除未提及的標籤。用戶只要「多加幾個標籤」時請用 add_tags,勿用 tags。`
224
+ )
197
225
  ),
198
226
  inputSchema: {
199
227
  type: "object",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "note-mcp-server",
3
- "version": "2.3.3",
3
+ "version": "2.4.1",
4
4
  "description": "MCP (stdio) server for Notes API v2 — list/read/write notes, upload images, Web Push from Cursor and compatible clients.",
5
5
  "main": "index.js",
6
6
  "bin": {