dsh-jianji 1.0.20 → 1.0.21
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.
- package/README.md +19 -4
- package/dist/assets/index-BWhLFINV.css +1 -0
- package/dist/assets/index-DmdVTaGL.js +476 -0
- package/dist/assets/{web-BIeLSzhk.js → web-CxgP9YLV.js} +1 -1
- package/dist/assets/{web-CWQD6I14.js → web-DpkysRre.js} +1 -1
- package/dist/index.html +76 -14
- package/package.json +2 -2
- package/plugin/schema.js +11 -0
- package/plugin/store.js +14 -2
- package/plugin/tools.js +3 -3
- package/dist/assets/index-CEuy4H5z.js +0 -449
- package/dist/assets/index-CQ8SzVCZ.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./index-
|
|
1
|
+
import{t as e}from"./index-DmdVTaGL.js";var t=class extends e{constructor(){super(),this.handleVisibilityChange=()=>{let e={isActive:document.hidden!==!0};this.notifyListeners(`appStateChange`,e),document.hidden?this.notifyListeners(`pause`,null):this.notifyListeners(`resume`,null)},document.addEventListener(`visibilitychange`,this.handleVisibilityChange,!1)}exitApp(){throw this.unimplemented(`Not implemented on web.`)}async getInfo(){throw this.unimplemented(`Not implemented on web.`)}async getLaunchUrl(){return{url:``}}async getState(){return{isActive:document.hidden!==!0}}async minimizeApp(){throw this.unimplemented(`Not implemented on web.`)}async toggleBackButtonHandler(){throw this.unimplemented(`Not implemented on web.`)}async getAppLanguage(){return{value:navigator.language.split(`-`)[0].toLowerCase()}}};export{t as AppWeb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./index-
|
|
1
|
+
import{t as e}from"./index-DmdVTaGL.js";var t=class extends e{constructor(){super(...arguments),this.pending=[],this.deliveredNotifications=[],this.hasNotificationSupport=()=>{if(!(`Notification`in window)||!Notification.requestPermission)return!1;if(Notification.permission!==`granted`)try{new Notification(``)}catch(e){if(e instanceof Error&&e.name===`TypeError`)return!1}return!0}}async getDeliveredNotifications(){let e=[];for(let t of this.deliveredNotifications){let n={title:t.title,id:parseInt(t.tag),body:t.body};e.push(n)}return{notifications:e}}async removeDeliveredNotifications(e){for(let t of e.notifications){let e=this.deliveredNotifications.find(e=>e.tag===String(t.id));e?.close(),this.deliveredNotifications=this.deliveredNotifications.filter(()=>!e)}}async removeDeliveredNotificationsById(e){for(let t of e.ids){let e=this.deliveredNotifications.find(e=>e.tag===String(t));e?.close(),this.deliveredNotifications=this.deliveredNotifications.filter(t=>t!==e)}}async removeAllDeliveredNotifications(){for(let e of this.deliveredNotifications)e.close();this.deliveredNotifications=[]}async getByIds(e){let t=e.ids.map(e=>String(e)),n=this.pending.filter(e=>t.includes(String(e.id))),r=this.deliveredNotifications.filter(e=>t.includes(e.tag)).map(e=>this.deliveredToSchema(e));return{notifications:[...n,...r]}}async getAll(e){let t=[...this.pending],n=this.deliveredNotifications.map(e=>this.deliveredToSchema(e));return e?.state===`SCHEDULED`?{notifications:t}:e?.state===`TRIGGERED`?{notifications:n}:{notifications:[...t,...n]}}deliveredToSchema(e){return{title:e.title,id:parseInt(e.tag),body:e.body}}async createChannel(){throw this.unimplemented(`Not implemented on web.`)}async deleteChannel(){throw this.unimplemented(`Not implemented on web.`)}async listChannels(){throw this.unimplemented(`Not implemented on web.`)}async schedule(e){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);for(let t of e.notifications)this.sendNotification(t);return{notifications:e.notifications.map(e=>({id:e.id}))}}async update(e){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);let t=[];for(let n of e.notifications){let e=this.pending.findIndex(e=>e.id===n.id);e!==-1&&(this.pending.splice(e,1),this.sendNotification(n),t.push(n))}return{notifications:t.map(e=>({id:e.id}))}}async getPending(){return{notifications:this.pending}}async cancelAll(){this.pending=[]}async registerActionTypes(){throw this.unimplemented(`Not implemented on web.`)}async cancel(e){this.pending=this.pending.filter(t=>!e.notifications.find(e=>e.id===t.id))}async areEnabled(){let{display:e}=await this.checkPermissions();return{value:e===`granted`}}async changeExactNotificationSetting(){throw this.unimplemented(`Not implemented on web.`)}async checkExactNotificationSetting(){throw this.unimplemented(`Not implemented on web.`)}async requestPermissions(){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);return{display:this.transformNotificationPermission(await Notification.requestPermission())}}async checkPermissions(){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);return{display:this.transformNotificationPermission(Notification.permission)}}transformNotificationPermission(e){switch(e){case`granted`:return`granted`;case`denied`:return`denied`;default:return`prompt`}}sendPending(){let e=[],t=new Date().getTime();for(let n of this.pending)n.schedule?.at&&n.schedule.at.getTime()<=t&&(this.buildNotification(n),e.push(n));this.pending=this.pending.filter(t=>!e.find(e=>e===t))}sendNotification(e){if(e.schedule?.at){let t=e.schedule.at.getTime()-new Date().getTime();this.pending.push(e),setTimeout(()=>{this.sendPending()},t)}else this.buildNotification(e)}buildNotification(e){let t=new Notification(e.title,{body:e.body,tag:String(e.id)});return t.addEventListener(`click`,this.onClick.bind(this,e),!1),t.addEventListener(`show`,this.onShow.bind(this,e),!1),t.addEventListener(`close`,()=>{this.deliveredNotifications=this.deliveredNotifications.filter(()=>!this)},!1),this.deliveredNotifications.push(t),t}onClick(e){let t={actionId:`tap`,notification:e};this.notifyListeners(`localNotificationActionPerformed`,t)}onShow(e){this.notifyListeners(`localNotificationReceived`,e)}};export{t as LocalNotificationsWeb};
|
package/dist/index.html
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
<link rel="icon" href="./assets/icon-BGGQCemX.svg" type="image/svg+xml">
|
|
15
15
|
<link rel="apple-touch-icon" href="./assets/icon-180.png">
|
|
16
16
|
<title>简记 · 待办、记录与灵感</title>
|
|
17
|
-
<script type="module" crossorigin src="./assets/index-
|
|
18
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
17
|
+
<script type="module" crossorigin src="./assets/index-DmdVTaGL.js"></script>
|
|
18
|
+
<link rel="stylesheet" crossorigin href="./assets/index-BWhLFINV.css">
|
|
19
19
|
</head>
|
|
20
20
|
<body>
|
|
21
21
|
<svg class="icon-sprite" viewBox="0 0 24 24" aria-hidden="true">
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
<symbol id="icon-info" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M12 10.5V17M12 7h.01"/></symbol>
|
|
48
48
|
<symbol id="icon-note" viewBox="0 0 24 24"><path d="M5 3.5h11l3 3V20.5H5v-17Z"/><path d="M16 3.5v4h4M8.5 11h7M8.5 15h5"/></symbol>
|
|
49
49
|
<symbol id="icon-sparkles" viewBox="0 0 24 24"><path d="m12 3 1.45 4.05L17.5 8.5l-4.05 1.45L12 14l-1.45-4.05L6.5 8.5l4.05-1.45L12 3Z"/><path d="m18.5 14 .75 2.25L21.5 17l-2.25.75L18.5 20l-.75-2.25L15.5 17l2.25-.75L18.5 14ZM5.5 13l.65 1.85L8 15.5l-1.85.65L5.5 18l-.65-1.85L3 15.5l1.85-.65L5.5 13Z"/></symbol>
|
|
50
|
+
<symbol id="icon-scan" viewBox="0 0 24 24"><path d="M8 4H5.5A1.5 1.5 0 0 0 4 5.5V8M16 4h2.5A1.5 1.5 0 0 1 20 5.5V8M8 20H5.5A1.5 1.5 0 0 1 4 18.5V16M16 20h2.5a1.5 1.5 0 0 0 1.5-1.5V16M7.5 12h9"/></symbol>
|
|
50
51
|
<symbol id="icon-cloud" viewBox="0 0 24 24"><path d="M7 18h10a4 4 0 0 0 .8-7.9A6 6 0 0 0 6.2 9.5"/><path d="M4.8 10.5A4 4 0 0 0 7 18"/></symbol>
|
|
51
52
|
<symbol id="icon-drag" viewBox="0 0 24 24"><circle cx="9" cy="6" r="1"/><circle cx="15" cy="6" r="1"/><circle cx="9" cy="12" r="1"/><circle cx="15" cy="12" r="1"/><circle cx="9" cy="18" r="1"/><circle cx="15" cy="18" r="1"/></symbol>
|
|
52
53
|
<symbol id="icon-globe" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M3.5 12h17M12 3c2.2 2.4 3.4 5.5 3.4 9S14.2 18.6 12 21c-2.2-2.4-3.4-5.5-3.4-9S9.8 5.4 12 3Z"/></symbol>
|
|
@@ -242,7 +243,10 @@
|
|
|
242
243
|
<dialog class="inspector detail-dialog" id="inspector" aria-labelledby="inspectorHeading">
|
|
243
244
|
<div class="detail-dialog-shell">
|
|
244
245
|
<div class="inspector-head">
|
|
245
|
-
<
|
|
246
|
+
<div>
|
|
247
|
+
<h2 class="inspector-title" id="inspectorHeading">编辑待办</h2>
|
|
248
|
+
<p class="dialog-copy">标题可选、正文必填,也可以上传截图自动识别。</p>
|
|
249
|
+
</div>
|
|
246
250
|
<button class="icon-button inspector-close" id="inspectorClose" type="button" aria-label="关闭详情">
|
|
247
251
|
<svg class="od-icon"><use href="#icon-close"></use></svg>
|
|
248
252
|
</button>
|
|
@@ -251,29 +255,36 @@
|
|
|
251
255
|
</div>
|
|
252
256
|
</dialog>
|
|
253
257
|
|
|
254
|
-
<dialog id="createDialog" aria-labelledby="createDialogTitle">
|
|
258
|
+
<dialog class="create-dialog" id="createDialog" aria-labelledby="createDialogTitle">
|
|
255
259
|
<div class="dialog-shell">
|
|
256
260
|
<div class="dialog-head">
|
|
257
261
|
<div>
|
|
258
262
|
<h2 class="dialog-title" id="createDialogTitle">新建待办</h2>
|
|
259
|
-
<p class="dialog-copy"
|
|
263
|
+
<p class="dialog-copy">标题可选、正文必填,也可以上传截图自动识别。</p>
|
|
260
264
|
</div>
|
|
261
265
|
<button class="icon-button" id="createCloseButton" type="button" aria-label="关闭新建待办">
|
|
262
266
|
<svg class="od-icon"><use href="#icon-close"></use></svg>
|
|
263
267
|
</button>
|
|
264
268
|
</div>
|
|
265
269
|
<div class="dialog-body">
|
|
266
|
-
<form class="settings-form" id="createTaskForm" novalidate>
|
|
267
|
-
<div class="
|
|
270
|
+
<form class="settings-form create-form" id="createTaskForm" novalidate>
|
|
271
|
+
<div class="image-import-row">
|
|
272
|
+
<button class="image-import-button" type="button" data-image-scan="task">
|
|
273
|
+
<svg class="od-icon" aria-hidden="true"><use href="#icon-scan"></use></svg>
|
|
274
|
+
<span>图片转文字</span>
|
|
275
|
+
</button>
|
|
276
|
+
<span class="image-import-status" data-image-status="task" aria-live="polite">上传截图,自动识别并填入下方内容</span>
|
|
277
|
+
<input class="image-import-input" type="file" accept="image/*" data-image-input="task" hidden>
|
|
278
|
+
</div>
|
|
279
|
+
<div class="field create-title-field">
|
|
268
280
|
<label class="field-label" for="createTitleInput">标题(可选)</label>
|
|
269
|
-
<
|
|
281
|
+
<textarea id="createTitleInput" rows="2" maxlength="180" placeholder="给这件事起个标题,也可以留空"></textarea>
|
|
270
282
|
</div>
|
|
271
283
|
<div class="field">
|
|
272
284
|
<label class="field-label" for="createBodyInput">正文(必填)</label>
|
|
273
|
-
<textarea id="createBodyInput" maxlength="4000" placeholder="
|
|
274
|
-
<span class="field-hint">正文会作为列表中的主要内容展示。</span>
|
|
285
|
+
<textarea class="create-body-input" id="createBodyInput" maxlength="4000" placeholder="写下要完成的事情、验收标准、相关链接、联系人或需要注意的细节…" required></textarea>
|
|
275
286
|
</div>
|
|
276
|
-
<div class="field-grid">
|
|
287
|
+
<div class="field-grid create-meta-grid">
|
|
277
288
|
<div class="field">
|
|
278
289
|
<label class="field-label" for="createStatusInput">状态</label>
|
|
279
290
|
<button class="picker-trigger field-picker-trigger" id="createStatusInput" type="button" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-controls="appPickerOptions" data-picker-type="select" data-picker-title="状态" data-value="todo">
|
|
@@ -291,12 +302,19 @@
|
|
|
291
302
|
</button>
|
|
292
303
|
</div>
|
|
293
304
|
</div>
|
|
294
|
-
<div class="field">
|
|
305
|
+
<div class="field create-emphasis-field">
|
|
306
|
+
<label class="field-label" for="createEmphasisInput">文字醒目</label>
|
|
307
|
+
<button class="picker-trigger field-picker-trigger emphasis-picker-trigger" id="createEmphasisInput" type="button" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-controls="appPickerOptions" data-picker-type="select" data-picker-title="文字醒目" data-value="normal">
|
|
308
|
+
<span class="picker-emphasis-marker" data-emphasis-preview="normal" aria-hidden="true"><span class="task-emphasis-text">文</span></span>
|
|
309
|
+
<span class="picker-trigger-value" data-picker-label>普通</span>
|
|
310
|
+
<svg class="od-icon picker-chevron" aria-hidden="true"><use href="#icon-down"></use></svg>
|
|
311
|
+
</button>
|
|
312
|
+
</div>
|
|
313
|
+
<div class="field create-tag-field">
|
|
295
314
|
<span class="field-label">标签</span>
|
|
296
315
|
<div class="tag-editor-field" id="createTagList">
|
|
297
316
|
<div class="tag-editor-list"></div>
|
|
298
317
|
</div>
|
|
299
|
-
<span class="field-hint">点选常用标签,或临时添加一个标签;最多 8 个。</span>
|
|
300
318
|
</div>
|
|
301
319
|
<p class="field-error" id="createTaskError" hidden></p>
|
|
302
320
|
</form>
|
|
@@ -324,6 +342,14 @@
|
|
|
324
342
|
</div>
|
|
325
343
|
<div class="dialog-body">
|
|
326
344
|
<form class="settings-form record-form" id="recordForm" novalidate>
|
|
345
|
+
<div class="image-import-row">
|
|
346
|
+
<button class="image-import-button" type="button" data-image-scan="record">
|
|
347
|
+
<svg class="od-icon" aria-hidden="true"><use href="#icon-scan"></use></svg>
|
|
348
|
+
<span>图片转文字</span>
|
|
349
|
+
</button>
|
|
350
|
+
<span class="image-import-status" data-image-status="record" aria-live="polite">上传截图,自动识别并填入记录</span>
|
|
351
|
+
<input class="image-import-input" type="file" accept="image/*" data-image-input="record" hidden>
|
|
352
|
+
</div>
|
|
327
353
|
<div class="field">
|
|
328
354
|
<label class="field-label" for="recordTitleInput">标题(可选)</label>
|
|
329
355
|
<input id="recordTitleInput" type="text" maxlength="180" placeholder="给这段想法起个名字">
|
|
@@ -365,6 +391,14 @@
|
|
|
365
391
|
</div>
|
|
366
392
|
<div class="dialog-body">
|
|
367
393
|
<form class="settings-form inspiration-form" id="inspirationForm" novalidate>
|
|
394
|
+
<div class="image-import-row">
|
|
395
|
+
<button class="image-import-button" type="button" data-image-scan="inspiration">
|
|
396
|
+
<svg class="od-icon" aria-hidden="true"><use href="#icon-scan"></use></svg>
|
|
397
|
+
<span>图片转文字</span>
|
|
398
|
+
</button>
|
|
399
|
+
<span class="image-import-status" data-image-status="inspiration" aria-live="polite">上传截图,自动识别主题和灵感内容</span>
|
|
400
|
+
<input class="image-import-input" type="file" accept="image/*" data-image-input="inspiration" hidden>
|
|
401
|
+
</div>
|
|
368
402
|
<div class="field">
|
|
369
403
|
<label class="field-label" for="inspirationTopicInput">主题</label>
|
|
370
404
|
<input id="inspirationTopicInput" type="text" maxlength="120" placeholder="例如:产品体验、写作、旅行计划" autocomplete="off" required>
|
|
@@ -523,6 +557,34 @@
|
|
|
523
557
|
</div>
|
|
524
558
|
</section>
|
|
525
559
|
|
|
560
|
+
<section class="settings-section is-ai" aria-labelledby="imageTextSettingsTitle">
|
|
561
|
+
<div class="settings-section-head">
|
|
562
|
+
<span class="settings-section-icon" aria-hidden="true">
|
|
563
|
+
<svg class="od-icon"><use href="#icon-scan"></use></svg>
|
|
564
|
+
</span>
|
|
565
|
+
<div>
|
|
566
|
+
<h3 class="settings-section-title" id="imageTextSettingsTitle">图片转文字</h3>
|
|
567
|
+
<p class="settings-section-copy">新建或编辑待办、新建记录或灵感时上传截图,由 DeepSeek 识别并预填表单。</p>
|
|
568
|
+
</div>
|
|
569
|
+
</div>
|
|
570
|
+
<div class="settings-section-body">
|
|
571
|
+
<div class="field">
|
|
572
|
+
<label class="field-label" for="deepseekKeyInput">DeepSeek API Key</label>
|
|
573
|
+
<input id="deepseekKeyInput" type="password" placeholder="sk-…" autocomplete="off" spellcheck="false">
|
|
574
|
+
<span class="field-hint">Key 仅保存在当前设备的浏览器存储中,不会写入同步仓库。</span>
|
|
575
|
+
</div>
|
|
576
|
+
<div class="settings-ai-actions">
|
|
577
|
+
<button class="secondary-button" id="testDeepseekButton" type="button">测试连接</button>
|
|
578
|
+
<button class="primary-button" id="saveDeepseekButton" type="button">
|
|
579
|
+
<svg class="od-icon"><use href="#icon-save"></use></svg>
|
|
580
|
+
<span>保存 Key</span>
|
|
581
|
+
</button>
|
|
582
|
+
</div>
|
|
583
|
+
<p class="settings-ai-status" id="deepseekKeyStatus">尚未配置,图片转文字暂不可用。</p>
|
|
584
|
+
<p class="security-note">图片只会在识别时发送到 api.deepseek.com;不会上传到同步仓库,也不会作为附件保存。</p>
|
|
585
|
+
</div>
|
|
586
|
+
</section>
|
|
587
|
+
|
|
526
588
|
<section class="settings-section is-sync" aria-labelledby="dataSyncTitle">
|
|
527
589
|
<div class="settings-section-head">
|
|
528
590
|
<span class="settings-section-icon" aria-hidden="true">
|
|
@@ -582,7 +644,7 @@
|
|
|
582
644
|
</div>
|
|
583
645
|
<div class="settings-section-body">
|
|
584
646
|
<p class="security-note">DSH 中的任务会通过简记工具读取和修改。派发待办时会创建新会话,并在执行完成后把状态与结果写回这里。</p>
|
|
585
|
-
<p class="field-hint">Gitee
|
|
647
|
+
<p class="field-hint">Gitee 令牌、GitHub 更新令牌、DeepSeek Key 和界面偏好仍只保存在当前客户端,不会暴露给模型。</p>
|
|
586
648
|
</div>
|
|
587
649
|
</section>
|
|
588
650
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-jianji",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.21",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "DeepSeek Harness 的简记插件:待办、记录、主题灵感、标签与一键派发",
|
|
6
6
|
"main": "plugin/index.js",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"start": "npm run build && node server/index.js",
|
|
49
49
|
"serve": "npm start",
|
|
50
50
|
"prepare": "git config core.hooksPath .githooks",
|
|
51
|
-
"check": "node --check src/app.js && node --check src/reminders.js && node --check src/updater.js && node --check src/widget.js && node --check server/index.js && node --check scripts/build-android.js && node --check scripts/bump-version.js && node --check scripts/commit-convention.js && node --check scripts/check-commit-message.js && node --check scripts/generate-release-notes.js",
|
|
51
|
+
"check": "node --check src/app.js && node --check src/recognizer.js && node --check src/reminders.js && node --check src/updater.js && node --check src/widget.js && node --check server/index.js && node --check scripts/build-android.js && node --check scripts/bump-version.js && node --check scripts/commit-convention.js && node --check scripts/check-commit-message.js && node --check scripts/generate-release-notes.js",
|
|
52
52
|
"check:commits": "node scripts/generate-release-notes.js --check-only",
|
|
53
53
|
"release:notes": "node scripts/generate-release-notes.js",
|
|
54
54
|
"android:sync": "npm run build && cap sync android",
|
package/plugin/schema.js
CHANGED
|
@@ -13,6 +13,17 @@ export const taskSchema = z.object({
|
|
|
13
13
|
title: z.string(),
|
|
14
14
|
notes: z.string(),
|
|
15
15
|
status: z.enum(["todo", "doing", "held", "done"]),
|
|
16
|
+
emphasis: z.enum([
|
|
17
|
+
"normal",
|
|
18
|
+
"bold",
|
|
19
|
+
"underline",
|
|
20
|
+
"highlight",
|
|
21
|
+
"red",
|
|
22
|
+
"orange",
|
|
23
|
+
"green",
|
|
24
|
+
"blue",
|
|
25
|
+
"purple"
|
|
26
|
+
]).optional(),
|
|
16
27
|
completedAt: z.string().optional(),
|
|
17
28
|
dueDate: z.string(),
|
|
18
29
|
tags: z.array(z.string()),
|
package/plugin/store.js
CHANGED
|
@@ -4,8 +4,19 @@ const MAX_TASK_TAGS = 8;
|
|
|
4
4
|
const MAX_COMMON_TAGS = 50;
|
|
5
5
|
const MAX_TOMBSTONES_MS = 1000 * 60 * 60 * 24 * 90;
|
|
6
6
|
const STATUSES = new Set(["todo", "doing", "held", "done"]);
|
|
7
|
+
const EMPHASIS = new Set([
|
|
8
|
+
"normal",
|
|
9
|
+
"bold",
|
|
10
|
+
"underline",
|
|
11
|
+
"highlight",
|
|
12
|
+
"red",
|
|
13
|
+
"orange",
|
|
14
|
+
"green",
|
|
15
|
+
"blue",
|
|
16
|
+
"purple"
|
|
17
|
+
]);
|
|
7
18
|
const TASK_FIELDS = new Set([
|
|
8
|
-
"title", "notes", "status", "completedAt", "dueDate", "tags", "pinned", "order",
|
|
19
|
+
"title", "notes", "status", "emphasis", "completedAt", "dueDate", "tags", "pinned", "order",
|
|
9
20
|
"createdAt", "updatedAt", "deletedAt", "deviceId", "dispatch"
|
|
10
21
|
]);
|
|
11
22
|
const RECORD_FIELDS = new Set([
|
|
@@ -80,6 +91,7 @@ export function normalizeTask(item, options = {}) {
|
|
|
80
91
|
title: String(item?.title || "").slice(0, 180),
|
|
81
92
|
notes: String(item?.notes || "").slice(0, 4000),
|
|
82
93
|
status,
|
|
94
|
+
emphasis: EMPHASIS.has(item?.emphasis) ? item.emphasis : "normal",
|
|
83
95
|
completedAt: status === "done"
|
|
84
96
|
? String(item?.completedAt || item?.updatedAt || item?.createdAt || options.now || nowIso())
|
|
85
97
|
: "",
|
|
@@ -237,7 +249,7 @@ export class JianjiStore {
|
|
|
237
249
|
.sort(compareVersion)
|
|
238
250
|
.at(-1);
|
|
239
251
|
return {
|
|
240
|
-
schemaVersion:
|
|
252
|
+
schemaVersion: 7,
|
|
241
253
|
revision: this.#revision,
|
|
242
254
|
items: tasks,
|
|
243
255
|
tasks,
|
package/plugin/tools.js
CHANGED
|
@@ -102,11 +102,11 @@ export function registerTools(ctx, store) {
|
|
|
102
102
|
|
|
103
103
|
ctx.tools.register(defineTool({
|
|
104
104
|
name: "jianji_create",
|
|
105
|
-
description: "
|
|
105
|
+
description: "在简记中新建待办、记录或灵感。待办可设置标题、备注、状态、文字醒目样式、截止日期、标签、置顶和排序;记录可设置标题与正文;灵感可设置主题与正文。",
|
|
106
106
|
parameters: {
|
|
107
107
|
resource: { type: "string", enum: ["task", "record", "inspiration"], required: true },
|
|
108
108
|
fields: {
|
|
109
|
-
...fieldsParameter("新建字段。待办支持 title、notes、status、dueDate、tags、pinned、order;记录支持 title、body;灵感支持 topic、body。"),
|
|
109
|
+
...fieldsParameter("新建字段。待办支持 title、notes、status、emphasis(normal / bold / underline / highlight / red / orange / green / blue / purple)、dueDate、tags、pinned、order;记录支持 title、body;灵感支持 topic、body。"),
|
|
110
110
|
required: true
|
|
111
111
|
}
|
|
112
112
|
},
|
|
@@ -128,7 +128,7 @@ export function registerTools(ctx, store) {
|
|
|
128
128
|
resource: { type: "string", enum: ["task", "record", "inspiration"], required: true },
|
|
129
129
|
id: { type: "string", required: true, description: "待办、记录或灵感 id。" },
|
|
130
130
|
fields: {
|
|
131
|
-
...fieldsParameter("
|
|
131
|
+
...fieldsParameter("要更新的字段。待办的 emphasis 支持 normal / bold / underline / highlight / red / orange / green / blue / purple;可用 notesAppend 或 bodyAppend 追加文本;传空字符串可清空可清空字段。"),
|
|
132
132
|
required: true
|
|
133
133
|
}
|
|
134
134
|
},
|