@dinoxx/dinox-cli 2.20.2 → 3.0.0
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 +17 -16
- package/dist/chunks/{applePodcast-V4FSJOC5.js → applePodcast-YDYM4JYQ.js} +3 -3
- package/dist/chunks/{bbc-NTMRPYRF.js → bbc-N3BM2EGG.js} +3 -3
- package/dist/chunks/{bilibili-UA3MBSPH.js → bilibili-V4XVW33T.js} +63 -9
- package/dist/chunks/{bohaishibei-B7UVXH4Y.js → bohaishibei-IQO5CZTN.js} +3 -3
- package/dist/chunks/{chunk-BKCNERPB.js → chunk-2DREJFKB.js} +98 -17
- package/dist/chunks/{chunk-4GM3PRSK.js → chunk-ARBWJ3ZA.js} +4176 -2821
- package/dist/chunks/{chunk-XMMTGPZ6.js → chunk-AZ43P73A.js} +56 -2
- package/dist/chunks/{chunk-D3CETVY5.js → chunk-HG3RZFDX.js} +3 -3
- package/dist/chunks/{chunk-MDWXLRRN.js → chunk-KJBN7TD7.js} +3 -3
- package/dist/chunks/{chunk-FIQYJ6KZ.js → chunk-LLAXR5EG.js} +1 -1
- package/dist/chunks/{chunk-TILRKKRN.js → chunk-MKEL2KNU.js} +893 -468
- package/dist/chunks/{chunk-FGQRYB7F.js → chunk-MZMOE3RX.js} +13 -1
- package/dist/chunks/{chunk-W4EWLODY.js → chunk-N2VYTZWU.js} +2 -2
- package/dist/chunks/{chunk-XEPDFQYD.js → chunk-N5YDNM3P.js} +26 -26
- package/dist/chunks/{chunk-7MGDG5BW.js → chunk-NVKSI4BD.js} +470 -82
- package/dist/chunks/{chunk-QFUD3I7W.js → chunk-QPVGA46P.js} +0 -1
- package/dist/chunks/{chunk-6AZT4ARG.js → chunk-R2CGNGOT.js} +3 -3
- package/dist/chunks/{chunk-GTDX2LIJ.js → chunk-RSSEVU2F.js} +58 -10
- package/dist/chunks/{chunk-CHGKDZV6.js → chunk-WABL3OUP.js} +2 -2
- package/dist/chunks/{cookies-6QQHSM26.js → cookies-ORQ3RLAH.js} +1 -3
- package/dist/chunks/{doubanGroup-HR4K2KMY.js → doubanGroup-MADXDGDI.js} +4 -4
- package/dist/chunks/{doubao-MXUHPLUB.js → doubao-DKZERP6Y.js} +2 -2
- package/dist/chunks/{douyin-UU2FSQPS.js → douyin-PIWFZHK7.js} +91 -5
- package/dist/chunks/{ensure-E3DIRHSQ.js → ensure-MPOQ244L.js} +5 -5
- package/dist/chunks/{execute-YP2N2AMS.js → execute-KMNZ5EFR.js} +3 -3
- package/dist/chunks/{facebook-SZFOVE7R.js → facebook-TI2CF5UY.js} +2 -2
- package/dist/chunks/{feishu-ISWRJ7HI.js → feishu-XSSEBWQD.js} +2 -2
- package/dist/chunks/{ima-D7CX5WR4.js → ima-SKE2C64C.js} +2 -2
- package/dist/chunks/{instagram-HNDPO37H.js → instagram-4W4HCWJN.js} +2 -2
- package/dist/chunks/{install-IIMVFNAT.js → install-35YBLHXE.js} +0 -2
- package/dist/chunks/{jike-H7L4LJTN.js → jike-GS64MEEO.js} +4 -4
- package/dist/chunks/{mcp-AK373P5P.js → mcp-H667ML2O.js} +9 -9
- package/dist/chunks/{mcpServer-7VL4KJH2.js → mcpServer-G2WEAD2O.js} +13 -11
- package/dist/chunks/{metaso-ZVZW5UBB.js → metaso-RRYEUXIL.js} +2 -2
- package/dist/chunks/{run-OYMMVKCB.js → run-7D6ATULD.js} +7 -7
- package/dist/chunks/{runCli-ZJ7WYHJ7.js → runCli-QEWWUIZN.js} +8 -8
- package/dist/chunks/{setup-EEU6GSWX.js → setup-DSTOF3BZ.js} +2 -2
- package/dist/chunks/{threads-ADW6IANQ.js → threads-JKMT3E73.js} +3 -3
- package/dist/chunks/{twitter-NAGCB3NI.js → twitter-WNBOJELM.js} +2 -2
- package/dist/chunks/{web-QFKZCM4F.js → web-LJESVHHV.js} +4 -4
- package/dist/chunks/{wechat-OXNNLT4J.js → wechat-N7O77CB4.js} +40 -1
- package/dist/chunks/{weibo-PMVGDNQU.js → weibo-XPEV5CLQ.js} +4 -4
- package/dist/chunks/{workbuddy-NNAXIIIZ.js → workbuddy-ZXNDX7O7.js} +5 -5
- package/dist/chunks/{xiaoheihe-WFQJRBAD.js → xiaoheihe-WXFAORLQ.js} +3 -3
- package/dist/chunks/{xiaohongshu-5CXBELGW.js → xiaohongshu-3N3ZVSXJ.js} +2 -2
- package/dist/chunks/{xiaoyuzhou-6L6IB46Y.js → xiaoyuzhou-OGIWFABL.js} +3 -3
- package/dist/chunks/{youtube-52NGBTQC.js → youtube-YRSK7CWC.js} +3 -3
- package/dist/chunks/{zcool-HDSWK4KD.js → zcool-K5KJ2KDG.js} +2 -2
- package/dist/chunks/{zhihu-EX2VRJYY.js → zhihu-X6XSPD6B.js} +2 -2
- package/dist/dinox.js +5 -5
- package/dist/dsh-plugin/lib/client.js +309 -567
- package/dist/dsh-plugin/lib/index.js +1 -1
- package/dist/dsh-plugin/package.json +1 -1
- package/dist/dsh-plugin/runtime.json +2 -2
- package/dist/editor-ui/mcp-app.html +356 -592
- package/package.json +22 -12
- /package/dist/chunks/{chunk-QFSMFANX.js → chunk-SM2QOO45.js} +0 -0
|
@@ -2,7 +2,7 @@ import { createRequire as __dinoxCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __dinoxCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
ensureDaemonRunning
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-KJBN7TD7.js";
|
|
6
6
|
import {
|
|
7
7
|
WRITE_DURABILITY_OPTION,
|
|
8
8
|
buildBatchWriteReceiptFields,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
withCommandRuntime,
|
|
34
34
|
withExclusivePowerSync,
|
|
35
35
|
withNoteDatabase
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-HG3RZFDX.js";
|
|
37
37
|
import {
|
|
38
38
|
reportProgress
|
|
39
39
|
} from "./chunk-BZQYECIH.js";
|
|
@@ -42,7 +42,9 @@ import {
|
|
|
42
42
|
DEFAULT_DAEMON_PORT,
|
|
43
43
|
MAX_BOX_NAME_LENGTH,
|
|
44
44
|
MAX_TAG_SEGMENT_LENGTH,
|
|
45
|
+
NOTE_PROPERTY_LIMITS,
|
|
45
46
|
PROPERTY_OPTION_COLORS,
|
|
47
|
+
PROPERTY_OPTION_LABEL_MAX_LENGTH,
|
|
46
48
|
REQUIRED_NOTE_BOX_COLUMNS,
|
|
47
49
|
REQUIRED_NOTE_TAG_COLUMNS,
|
|
48
50
|
REQUIRED_TAG_NODE_COLUMNS,
|
|
@@ -81,6 +83,7 @@ import {
|
|
|
81
83
|
canonicalizeBoxPath,
|
|
82
84
|
canonicalizeTagPath,
|
|
83
85
|
closePowerSyncAndReleaseOwner,
|
|
86
|
+
coercePropertyValue,
|
|
84
87
|
commandSchemasFromGroupDescriptor,
|
|
85
88
|
configureProperty,
|
|
86
89
|
connectPowerSync,
|
|
@@ -106,6 +109,7 @@ import {
|
|
|
106
109
|
ensureNoTagPathConflict,
|
|
107
110
|
executeNoteSearch,
|
|
108
111
|
executeTodoSearch,
|
|
112
|
+
extractMarkdownFrontmatter,
|
|
109
113
|
fetchCredentialsWithAuthorization,
|
|
110
114
|
fetchDomainReadModel,
|
|
111
115
|
fetchSavedViewScopedPage,
|
|
@@ -161,6 +165,7 @@ import {
|
|
|
161
165
|
migrateLegacyOptions,
|
|
162
166
|
migrationAffectedCount,
|
|
163
167
|
normalizeBoxLookupKey,
|
|
168
|
+
normalizeDatePropertyValue,
|
|
164
169
|
normalizePropertyDefConfig,
|
|
165
170
|
normalizeTagLookupKey,
|
|
166
171
|
normalizeTaskTexts,
|
|
@@ -168,6 +173,7 @@ import {
|
|
|
168
173
|
nowIsoUtc,
|
|
169
174
|
parentIdForPath,
|
|
170
175
|
parentPathOf,
|
|
176
|
+
parseRawNoteProperties,
|
|
171
177
|
parseSavedViewZettelBoxDetails,
|
|
172
178
|
parseStorageUploadCategory,
|
|
173
179
|
parseStoredBoxIds,
|
|
@@ -226,6 +232,7 @@ import {
|
|
|
226
232
|
updateNotePropertySlots,
|
|
227
233
|
updateTodoTaskStatus,
|
|
228
234
|
updateTodoTasks,
|
|
235
|
+
upgradeLegacyNoteNodes,
|
|
229
236
|
validateTagsForBulk,
|
|
230
237
|
validateTagsForCreate,
|
|
231
238
|
validateTagsForUpdate,
|
|
@@ -235,10 +242,10 @@ import {
|
|
|
235
242
|
withNestedWriteTransaction,
|
|
236
243
|
withPowerSyncWriteTransaction,
|
|
237
244
|
withReadTransaction
|
|
238
|
-
} from "./chunk-
|
|
245
|
+
} from "./chunk-ARBWJ3ZA.js";
|
|
239
246
|
import {
|
|
240
247
|
executeCommandLine
|
|
241
|
-
} from "./chunk-
|
|
248
|
+
} from "./chunk-N2VYTZWU.js";
|
|
242
249
|
import {
|
|
243
250
|
AI_SERVICE_URL,
|
|
244
251
|
FORMAT_OPTIONS,
|
|
@@ -264,7 +271,11 @@ import {
|
|
|
264
271
|
updateConfig,
|
|
265
272
|
validateRequestId,
|
|
266
273
|
withAsyncRelease
|
|
267
|
-
} from "./chunk-
|
|
274
|
+
} from "./chunk-WABL3OUP.js";
|
|
275
|
+
import {
|
|
276
|
+
TASK_STATUS_VALUES,
|
|
277
|
+
isTaskStatus
|
|
278
|
+
} from "./chunk-2DREJFKB.js";
|
|
268
279
|
import {
|
|
269
280
|
acquireDaemonExclusiveIntentLock,
|
|
270
281
|
acquireDaemonStartLock,
|
|
@@ -277,7 +288,7 @@ import {
|
|
|
277
288
|
readPid,
|
|
278
289
|
sendDaemonRequest,
|
|
279
290
|
shutdownDaemonForExclusiveAccess
|
|
280
|
-
} from "./chunk-
|
|
291
|
+
} from "./chunk-SM2QOO45.js";
|
|
281
292
|
import {
|
|
282
293
|
agentLaunch
|
|
283
294
|
} from "./chunk-7ODU7LXP.js";
|
|
@@ -1480,7 +1491,7 @@ var batchCommandDescriptor = {
|
|
|
1480
1491
|
fields: ["ok", "summary", "results"]
|
|
1481
1492
|
},
|
|
1482
1493
|
examples: [
|
|
1483
|
-
`echo '[["note","search","AI","--limit","5"],["todo","search","--status","
|
|
1494
|
+
`echo '[["note","search","AI","--limit","5"],["todo","search","--status","todo,in_progress"]]' | dino batch --format json`,
|
|
1484
1495
|
"dino batch --input ops.json --stop-on-error --format json"
|
|
1485
1496
|
]
|
|
1486
1497
|
},
|
|
@@ -3322,7 +3333,7 @@ var gatewayCommandGroup = {
|
|
|
3322
3333
|
examples: ["dino gateway mcp"]
|
|
3323
3334
|
},
|
|
3324
3335
|
action: async () => {
|
|
3325
|
-
const { serveDinoxMcpOverStdio } = await import("./mcpServer-
|
|
3336
|
+
const { serveDinoxMcpOverStdio } = await import("./mcpServer-G2WEAD2O.js");
|
|
3326
3337
|
await serveDinoxMcpOverStdio();
|
|
3327
3338
|
}
|
|
3328
3339
|
},
|
|
@@ -3404,7 +3415,7 @@ var editorCommandGroup = {
|
|
|
3404
3415
|
examples: ["dino editor mcp", "dino editor mcp --session codex"]
|
|
3405
3416
|
},
|
|
3406
3417
|
action: async (context) => {
|
|
3407
|
-
const { serveEditorMcpOverStdio } = await import("./mcp-
|
|
3418
|
+
const { serveEditorMcpOverStdio } = await import("./mcp-H667ML2O.js");
|
|
3408
3419
|
await serveEditorMcpOverStdio({ session: String(context.options.session ?? "mcp") });
|
|
3409
3420
|
}
|
|
3410
3421
|
},
|
|
@@ -3427,7 +3438,7 @@ var editorCommandGroup = {
|
|
|
3427
3438
|
},
|
|
3428
3439
|
action: async (context) => {
|
|
3429
3440
|
hostOf(context);
|
|
3430
|
-
const { installDsh } = await import("./install-
|
|
3441
|
+
const { installDsh } = await import("./install-35YBLHXE.js");
|
|
3431
3442
|
const result = await installDsh(installOptions(context));
|
|
3432
3443
|
report(result, "Installed the Dinox editor in DeepSeek Harness:", result.next);
|
|
3433
3444
|
}
|
|
@@ -3451,7 +3462,7 @@ var editorCommandGroup = {
|
|
|
3451
3462
|
},
|
|
3452
3463
|
action: async (context) => {
|
|
3453
3464
|
hostOf(context);
|
|
3454
|
-
const { uninstallDsh } = await import("./install-
|
|
3465
|
+
const { uninstallDsh } = await import("./install-35YBLHXE.js");
|
|
3455
3466
|
report(await uninstallDsh(installOptions(context)), "Removed the Dinox editor from DeepSeek Harness:", "Restart DeepSeek Harness Desktop.");
|
|
3456
3467
|
}
|
|
3457
3468
|
},
|
|
@@ -3472,7 +3483,7 @@ var editorCommandGroup = {
|
|
|
3472
3483
|
examples: ["dino editor status", "dino editor status --format json"]
|
|
3473
3484
|
},
|
|
3474
3485
|
action: async (context) => {
|
|
3475
|
-
const { editorStatus } = await import("./install-
|
|
3486
|
+
const { editorStatus } = await import("./install-35YBLHXE.js");
|
|
3476
3487
|
const status = editorStatus(installOptions(context));
|
|
3477
3488
|
if (getRequestedStructuredOutputFormat()) {
|
|
3478
3489
|
printSuccess(status);
|
|
@@ -5334,6 +5345,337 @@ function buildNoteSearchResponse(input) {
|
|
|
5334
5345
|
};
|
|
5335
5346
|
}
|
|
5336
5347
|
|
|
5348
|
+
// ../../packages/note-engine/src/frontmatter-properties.ts
|
|
5349
|
+
import { parse as parseYaml } from "yaml";
|
|
5350
|
+
var PROPERTY_PATH_SEPARATOR = ".";
|
|
5351
|
+
var SHORT_LIST_LIMIT = 20;
|
|
5352
|
+
var NESTED_TEXT_DEPTH = 6;
|
|
5353
|
+
var RESERVED_KEYS = /* @__PURE__ */ new Set([
|
|
5354
|
+
"title",
|
|
5355
|
+
"tags",
|
|
5356
|
+
"tag",
|
|
5357
|
+
"keywords",
|
|
5358
|
+
"created",
|
|
5359
|
+
"created_at",
|
|
5360
|
+
// Written by Dinox's own Markdown export; the note gets its own timestamps and id on import.
|
|
5361
|
+
"updated",
|
|
5362
|
+
"updated_at",
|
|
5363
|
+
"dinox_id",
|
|
5364
|
+
"cssclasses",
|
|
5365
|
+
"cssclass",
|
|
5366
|
+
"publish"
|
|
5367
|
+
]);
|
|
5368
|
+
var TAG_KEYS = /* @__PURE__ */ new Set(["tags", "tag", "keywords"]);
|
|
5369
|
+
var CREATED_KEYS = /* @__PURE__ */ new Set(["created", "created_at"]);
|
|
5370
|
+
var LIST_TYPES = /* @__PURE__ */ new Set(["list", "multitext", "aliases"]);
|
|
5371
|
+
var EMPTY_DOCUMENT = {
|
|
5372
|
+
title: "",
|
|
5373
|
+
tags: [],
|
|
5374
|
+
createdAt: null,
|
|
5375
|
+
dinoxId: null,
|
|
5376
|
+
properties: []
|
|
5377
|
+
};
|
|
5378
|
+
function readMarkdownFrontmatter(frontmatter, propertyTypes) {
|
|
5379
|
+
const source = frontmatter.trim();
|
|
5380
|
+
if (!source) return { ...EMPTY_DOCUMENT, properties: [] };
|
|
5381
|
+
let parsed;
|
|
5382
|
+
try {
|
|
5383
|
+
parsed = parseYaml(source);
|
|
5384
|
+
} catch {
|
|
5385
|
+
return null;
|
|
5386
|
+
}
|
|
5387
|
+
if (!isRecord(parsed)) return { ...EMPTY_DOCUMENT, properties: [] };
|
|
5388
|
+
const document = {
|
|
5389
|
+
title: "",
|
|
5390
|
+
tags: [],
|
|
5391
|
+
createdAt: null,
|
|
5392
|
+
dinoxId: null,
|
|
5393
|
+
properties: []
|
|
5394
|
+
};
|
|
5395
|
+
for (const [rawKey, value] of Object.entries(parsed)) {
|
|
5396
|
+
if (rawKey === "__proto__") continue;
|
|
5397
|
+
const lowered = rawKey.toLowerCase();
|
|
5398
|
+
if (lowered === "title" && !document.title) {
|
|
5399
|
+
document.title = readTitle(value);
|
|
5400
|
+
continue;
|
|
5401
|
+
}
|
|
5402
|
+
if (TAG_KEYS.has(lowered)) {
|
|
5403
|
+
document.tags.push(...flattenTagValues(value));
|
|
5404
|
+
continue;
|
|
5405
|
+
}
|
|
5406
|
+
if (CREATED_KEYS.has(lowered) && !document.createdAt) {
|
|
5407
|
+
document.createdAt = readCreatedAt(value);
|
|
5408
|
+
continue;
|
|
5409
|
+
}
|
|
5410
|
+
if (lowered === "dinox_id" && !document.dinoxId) {
|
|
5411
|
+
document.dinoxId = readTitle(value) || null;
|
|
5412
|
+
continue;
|
|
5413
|
+
}
|
|
5414
|
+
if (RESERVED_KEYS.has(lowered)) continue;
|
|
5415
|
+
const segment = normalizeSegment(rawKey);
|
|
5416
|
+
if (!segment) continue;
|
|
5417
|
+
collectProperty(document.properties, [segment], value, lookupType(propertyTypes, rawKey, lowered));
|
|
5418
|
+
}
|
|
5419
|
+
return document;
|
|
5420
|
+
}
|
|
5421
|
+
function chooseMarkdownPropertyDefinitions(notes, catalog) {
|
|
5422
|
+
const plans = [];
|
|
5423
|
+
const seen = /* @__PURE__ */ new Set();
|
|
5424
|
+
for (const properties of notes) {
|
|
5425
|
+
for (const property of properties) {
|
|
5426
|
+
if (catalog.has(property.key) || seen.has(property.key)) continue;
|
|
5427
|
+
seen.add(property.key);
|
|
5428
|
+
plans.push({
|
|
5429
|
+
key: property.key,
|
|
5430
|
+
name: property.name,
|
|
5431
|
+
type: property.type,
|
|
5432
|
+
dateMode: property.dateMode
|
|
5433
|
+
});
|
|
5434
|
+
}
|
|
5435
|
+
}
|
|
5436
|
+
return plans;
|
|
5437
|
+
}
|
|
5438
|
+
function buildMarkdownPropertyValues(properties, resolved, currentPropertiesJson) {
|
|
5439
|
+
const current = parseRawNoteProperties(currentPropertiesJson);
|
|
5440
|
+
const patch = {};
|
|
5441
|
+
for (const property of properties) {
|
|
5442
|
+
if (Object.keys(patch).length >= NOTE_PROPERTY_LIMITS.mutationKeys) break;
|
|
5443
|
+
const choice = resolved.get(property.key);
|
|
5444
|
+
if (!choice) continue;
|
|
5445
|
+
if (Object.hasOwn(current, property.key) && current[property.key] !== null) continue;
|
|
5446
|
+
const value = coerceMarkdownPropertyValue(choice, property.value);
|
|
5447
|
+
if (value === null) continue;
|
|
5448
|
+
patch[property.key] = value;
|
|
5449
|
+
}
|
|
5450
|
+
return patch;
|
|
5451
|
+
}
|
|
5452
|
+
function collectProperty(properties, parts, value, explicitType) {
|
|
5453
|
+
if (properties.length >= NOTE_PROPERTY_LIMITS.mutationKeys) return;
|
|
5454
|
+
if (value == null) return;
|
|
5455
|
+
if (isRecord(value)) {
|
|
5456
|
+
const entries = Object.entries(value).filter(([key]) => key !== "__proto__");
|
|
5457
|
+
if (entries.length === 0) return;
|
|
5458
|
+
for (const [key, child] of entries) {
|
|
5459
|
+
const segment = normalizeSegment(key);
|
|
5460
|
+
if (!segment) continue;
|
|
5461
|
+
collectProperty(properties, [...parts, segment], child, void 0);
|
|
5462
|
+
}
|
|
5463
|
+
return;
|
|
5464
|
+
}
|
|
5465
|
+
if (Array.isArray(value)) {
|
|
5466
|
+
if (value.some((item) => isRecord(item) || Array.isArray(item))) {
|
|
5467
|
+
pushText(properties, parts, describeNested(value, 0));
|
|
5468
|
+
return;
|
|
5469
|
+
}
|
|
5470
|
+
pushList(properties, parts, value, explicitType);
|
|
5471
|
+
return;
|
|
5472
|
+
}
|
|
5473
|
+
pushScalar(properties, parts, value, explicitType);
|
|
5474
|
+
}
|
|
5475
|
+
function pushScalar(properties, parts, value, explicitType) {
|
|
5476
|
+
if (explicitType === "aliases" && typeof value === "string") {
|
|
5477
|
+
const items = value.split(",").map((item) => item.trim()).filter(Boolean);
|
|
5478
|
+
pushList(properties, parts, items, "aliases");
|
|
5479
|
+
return;
|
|
5480
|
+
}
|
|
5481
|
+
const typed = scalarProperty(value, explicitType);
|
|
5482
|
+
if (!typed) return;
|
|
5483
|
+
pushProperty(properties, parts, typed);
|
|
5484
|
+
}
|
|
5485
|
+
function pushList(properties, parts, values, explicitType) {
|
|
5486
|
+
if (explicitType === "text") {
|
|
5487
|
+
pushText(properties, parts, values.map(scalarToText).filter(Boolean).join("\n"));
|
|
5488
|
+
return;
|
|
5489
|
+
}
|
|
5490
|
+
if (explicitType === "number" || explicitType === "checkbox" || explicitType === "date" || explicitType === "datetime") {
|
|
5491
|
+
pushScalar(properties, parts, values.length === 1 ? values[0] : null, explicitType);
|
|
5492
|
+
return;
|
|
5493
|
+
}
|
|
5494
|
+
const wantsList = explicitType === void 0 || LIST_TYPES.has(explicitType);
|
|
5495
|
+
const options = wantsList ? readShortList(values) : null;
|
|
5496
|
+
if (options) {
|
|
5497
|
+
pushProperty(properties, parts, {
|
|
5498
|
+
type: "multi_select",
|
|
5499
|
+
value: options,
|
|
5500
|
+
dateMode: "date"
|
|
5501
|
+
});
|
|
5502
|
+
return;
|
|
5503
|
+
}
|
|
5504
|
+
pushText(properties, parts, values.map(scalarToText).filter(Boolean).join("\n"));
|
|
5505
|
+
}
|
|
5506
|
+
function pushText(properties, parts, text) {
|
|
5507
|
+
const value = clipText(text);
|
|
5508
|
+
if (!value) return;
|
|
5509
|
+
pushProperty(properties, parts, { type: "text", value, dateMode: "date" });
|
|
5510
|
+
}
|
|
5511
|
+
function pushProperty(properties, parts, property) {
|
|
5512
|
+
if (properties.length >= NOTE_PROPERTY_LIMITS.mutationKeys) return;
|
|
5513
|
+
const key = parts.join(PROPERTY_PATH_SEPARATOR);
|
|
5514
|
+
if (!isPropertyKeyValid(key) || properties.some((item) => item.key === key)) return;
|
|
5515
|
+
properties.push({
|
|
5516
|
+
key,
|
|
5517
|
+
name: key,
|
|
5518
|
+
type: property.type,
|
|
5519
|
+
value: property.value,
|
|
5520
|
+
dateMode: property.dateMode
|
|
5521
|
+
});
|
|
5522
|
+
}
|
|
5523
|
+
function scalarProperty(value, explicitType) {
|
|
5524
|
+
if (explicitType === "checkbox") {
|
|
5525
|
+
const coerced = coercePropertyValue("checkbox", value);
|
|
5526
|
+
return typeof coerced === "boolean" ? { type: "checkbox", value: coerced, dateMode: "date" } : null;
|
|
5527
|
+
}
|
|
5528
|
+
if (explicitType === "number") {
|
|
5529
|
+
const coerced = coercePropertyValue("number", value);
|
|
5530
|
+
return typeof coerced === "number" ? { type: "number", value: coerced, dateMode: "date" } : null;
|
|
5531
|
+
}
|
|
5532
|
+
if (explicitType === "date" || explicitType === "datetime") {
|
|
5533
|
+
const dateMode2 = explicitType === "datetime" ? "datetime" : "date";
|
|
5534
|
+
const coerced = normalizeDatePropertyValue(dateInput(value), dateMode2);
|
|
5535
|
+
return coerced ? { type: "date", value: coerced, dateMode: dateMode2 } : null;
|
|
5536
|
+
}
|
|
5537
|
+
if (explicitType === "text" || explicitType !== void 0 && LIST_TYPES.has(explicitType)) {
|
|
5538
|
+
const text2 = scalarToText(value);
|
|
5539
|
+
return text2 ? { type: "text", value: clipText(text2), dateMode: "date" } : null;
|
|
5540
|
+
}
|
|
5541
|
+
if (typeof value === "boolean") return { type: "checkbox", value, dateMode: "date" };
|
|
5542
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
5543
|
+
return { type: "number", value, dateMode: "date" };
|
|
5544
|
+
}
|
|
5545
|
+
if (value instanceof Date && !Number.isNaN(value.getTime())) {
|
|
5546
|
+
const coerced = normalizeDatePropertyValue(value.toISOString(), "datetime");
|
|
5547
|
+
return coerced ? { type: "date", value: coerced, dateMode: "datetime" } : null;
|
|
5548
|
+
}
|
|
5549
|
+
if (typeof value !== "string") return null;
|
|
5550
|
+
const text = value.trim();
|
|
5551
|
+
if (!text) return null;
|
|
5552
|
+
const dateMode = inferDateMode(text);
|
|
5553
|
+
if (dateMode) {
|
|
5554
|
+
const coerced = normalizeDatePropertyValue(text, dateMode);
|
|
5555
|
+
if (coerced) return { type: "date", value: coerced, dateMode };
|
|
5556
|
+
}
|
|
5557
|
+
return { type: "text", value: clipText(text), dateMode: "date" };
|
|
5558
|
+
}
|
|
5559
|
+
function readShortList(values) {
|
|
5560
|
+
if (values.length === 0 || values.length > SHORT_LIST_LIMIT) return null;
|
|
5561
|
+
const options = [];
|
|
5562
|
+
for (const value of values) {
|
|
5563
|
+
const option = scalarToOption(value);
|
|
5564
|
+
if (!option) return null;
|
|
5565
|
+
options.push(option);
|
|
5566
|
+
}
|
|
5567
|
+
return options;
|
|
5568
|
+
}
|
|
5569
|
+
function scalarToOption(value) {
|
|
5570
|
+
const text = scalarToText(value);
|
|
5571
|
+
if (!text || text.length > PROPERTY_OPTION_LABEL_MAX_LENGTH) return null;
|
|
5572
|
+
return text;
|
|
5573
|
+
}
|
|
5574
|
+
function scalarToText(value) {
|
|
5575
|
+
if (typeof value === "string") return value.trim();
|
|
5576
|
+
if (typeof value === "number" && Number.isFinite(value)) return String(value);
|
|
5577
|
+
if (typeof value === "boolean") return value ? "true" : "false";
|
|
5578
|
+
if (value instanceof Date && !Number.isNaN(value.getTime())) return value.toISOString();
|
|
5579
|
+
return "";
|
|
5580
|
+
}
|
|
5581
|
+
function describeNested(value, depth) {
|
|
5582
|
+
if (depth > NESTED_TEXT_DEPTH || value == null) return "";
|
|
5583
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
5584
|
+
return scalarToText(value);
|
|
5585
|
+
}
|
|
5586
|
+
if (value instanceof Date) return scalarToText(value);
|
|
5587
|
+
if (Array.isArray(value)) {
|
|
5588
|
+
return value.map((item) => describeNested(item, depth + 1)).filter(Boolean).join("\n");
|
|
5589
|
+
}
|
|
5590
|
+
if (!isRecord(value)) return "";
|
|
5591
|
+
return Object.entries(value).filter(([key]) => key !== "__proto__").map(([key, child]) => {
|
|
5592
|
+
const rendered = describeNested(child, depth + 1);
|
|
5593
|
+
if (!rendered) return "";
|
|
5594
|
+
if (!rendered.includes("\n")) return `${key}: ${rendered}`;
|
|
5595
|
+
const indented = rendered.split("\n").map((line) => ` ${line}`).join("\n");
|
|
5596
|
+
return `${key}:
|
|
5597
|
+
${indented}`;
|
|
5598
|
+
}).filter(Boolean).join("\n");
|
|
5599
|
+
}
|
|
5600
|
+
function coerceMarkdownPropertyValue(choice, value) {
|
|
5601
|
+
if (choice.type === "date") {
|
|
5602
|
+
return normalizeDatePropertyValue(value, choice.dateMode ?? "date");
|
|
5603
|
+
}
|
|
5604
|
+
if ((choice.type === "text" || choice.type === "url" || choice.type === "email" || choice.type === "phone") && Array.isArray(value)) {
|
|
5605
|
+
const joined = value.filter((item) => typeof item === "string").join("\u3001");
|
|
5606
|
+
return coercePropertyValue("text", joined);
|
|
5607
|
+
}
|
|
5608
|
+
if ((choice.type === "select" || choice.type === "status") && Array.isArray(value)) {
|
|
5609
|
+
const first = value.find((item) => typeof item === "string" && item.trim());
|
|
5610
|
+
return typeof first === "string" ? coercePropertyValue(choice.type, first) : null;
|
|
5611
|
+
}
|
|
5612
|
+
return coercePropertyValue(choice.type, value);
|
|
5613
|
+
}
|
|
5614
|
+
function lookupType(propertyTypes, key, lowered) {
|
|
5615
|
+
const declared = propertyTypes?.[key];
|
|
5616
|
+
if (lowered === "aliases") return declared === "text" ? "text" : "aliases";
|
|
5617
|
+
return declared;
|
|
5618
|
+
}
|
|
5619
|
+
function readTitle(value) {
|
|
5620
|
+
if (typeof value === "string") return value.trim();
|
|
5621
|
+
if (typeof value === "number" && Number.isFinite(value)) return String(value);
|
|
5622
|
+
return "";
|
|
5623
|
+
}
|
|
5624
|
+
function readCreatedAt(value) {
|
|
5625
|
+
if (value instanceof Date && !Number.isNaN(value.getTime())) return value.toISOString();
|
|
5626
|
+
if (typeof value !== "string") return null;
|
|
5627
|
+
return parseCreatedAt(value);
|
|
5628
|
+
}
|
|
5629
|
+
function dateInput(value) {
|
|
5630
|
+
if (value instanceof Date && !Number.isNaN(value.getTime())) return value.toISOString();
|
|
5631
|
+
return value;
|
|
5632
|
+
}
|
|
5633
|
+
function inferDateMode(value) {
|
|
5634
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(value)) return "date";
|
|
5635
|
+
if (/^\d{4}-\d{2}-\d{2}[T\s]\d{2}:\d{2}/.test(value)) return "datetime";
|
|
5636
|
+
return null;
|
|
5637
|
+
}
|
|
5638
|
+
function parseCreatedAt(value) {
|
|
5639
|
+
const trimmed = value.trim();
|
|
5640
|
+
if (!trimmed) return null;
|
|
5641
|
+
const local = trimmed.match(
|
|
5642
|
+
/^(\d{4})[-/](\d{2})[-/](\d{2})(?:[ T](\d{2}):(\d{2})(?::(\d{2}))?)?$/
|
|
5643
|
+
);
|
|
5644
|
+
if (local) {
|
|
5645
|
+
const year = local[1];
|
|
5646
|
+
const month = local[2];
|
|
5647
|
+
const day = local[3];
|
|
5648
|
+
const hour = local[4] ?? "00";
|
|
5649
|
+
const minute = local[5] ?? "00";
|
|
5650
|
+
const second = local[6] ?? "00";
|
|
5651
|
+
const parsed2 = /* @__PURE__ */ new Date(`${year}-${month}-${day}T${hour}:${minute}:${second}`);
|
|
5652
|
+
return Number.isNaN(parsed2.getTime()) ? null : parsed2.toISOString();
|
|
5653
|
+
}
|
|
5654
|
+
const parsed = new Date(trimmed);
|
|
5655
|
+
return Number.isNaN(parsed.getTime()) ? null : parsed.toISOString();
|
|
5656
|
+
}
|
|
5657
|
+
function flattenTagValues(value) {
|
|
5658
|
+
if (typeof value === "string") {
|
|
5659
|
+
return value.split(",").map((part) => part.trim()).filter(Boolean);
|
|
5660
|
+
}
|
|
5661
|
+
if (typeof value === "number" || typeof value === "boolean") return [String(value)];
|
|
5662
|
+
if (!Array.isArray(value)) return [];
|
|
5663
|
+
return value.flatMap((item) => flattenTagValues(item));
|
|
5664
|
+
}
|
|
5665
|
+
function normalizeSegment(value) {
|
|
5666
|
+
const normalized = value.normalize("NFKC").replace(/[\n\r\t]/g, " ").replace(/\s+/g, " ").trim();
|
|
5667
|
+
if (!normalized || normalized === "__proto__") return "";
|
|
5668
|
+
return normalized;
|
|
5669
|
+
}
|
|
5670
|
+
function clipText(value) {
|
|
5671
|
+
const trimmed = value.trim();
|
|
5672
|
+
if (!trimmed) return "";
|
|
5673
|
+
return trimmed.length > NOTE_PROPERTY_LIMITS.textLength ? trimmed.slice(0, NOTE_PROPERTY_LIMITS.textLength) : trimmed;
|
|
5674
|
+
}
|
|
5675
|
+
function isRecord(value) {
|
|
5676
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
5677
|
+
}
|
|
5678
|
+
|
|
5337
5679
|
// src/commands/domain/options.ts
|
|
5338
5680
|
function parseIntegerOption(value) {
|
|
5339
5681
|
const normalized = value.trim();
|
|
@@ -5507,7 +5849,7 @@ function parseNoteTemplateContent(raw) {
|
|
|
5507
5849
|
});
|
|
5508
5850
|
}
|
|
5509
5851
|
assertCanonicalTemplateDocument(parsed);
|
|
5510
|
-
return projectNoteContent(parsed).document;
|
|
5852
|
+
return projectNoteContent(upgradeLegacyNoteNodes(parsed)).document;
|
|
5511
5853
|
}
|
|
5512
5854
|
function serializeNoteTemplateContent(document) {
|
|
5513
5855
|
assertCanonicalTemplateDocument(document);
|
|
@@ -5658,6 +6000,21 @@ async function previewDeleteNoteTemplate(db, input) {
|
|
|
5658
6000
|
}
|
|
5659
6001
|
|
|
5660
6002
|
// src/commands/notes/createFromTemplate.ts
|
|
6003
|
+
function seedWritesProperties(seed) {
|
|
6004
|
+
return Boolean(seed.values) || seed.frontmatterProperties.length > 0;
|
|
6005
|
+
}
|
|
6006
|
+
function applyFrontmatterToSeed(seed, frontmatter) {
|
|
6007
|
+
if (!frontmatter) return [];
|
|
6008
|
+
const parsed = readMarkdownFrontmatter(frontmatter);
|
|
6009
|
+
if (!parsed) {
|
|
6010
|
+
throw new DinoxError("The content front matter is not valid YAML", {
|
|
6011
|
+
code: "USAGE_ERROR",
|
|
6012
|
+
suggestion: "Fix the YAML between the leading `---` lines, or remove it."
|
|
6013
|
+
});
|
|
6014
|
+
}
|
|
6015
|
+
seed.frontmatterProperties = parsed.properties;
|
|
6016
|
+
return parsed.tags;
|
|
6017
|
+
}
|
|
5661
6018
|
async function resolveNoteCreateSeed(db, input) {
|
|
5662
6019
|
const template = input.templateId ? await getNoteTemplate(db, { userId: input.userId, id: input.templateId }) : null;
|
|
5663
6020
|
const projection = template?.document ? projectNoteContent(hydrateNoteTemplateDocument(template.document)) : null;
|
|
@@ -5672,19 +6029,50 @@ async function resolveNoteCreateSeed(db, input) {
|
|
|
5672
6029
|
values = raw;
|
|
5673
6030
|
if (Object.keys(values).length === 0) values = null;
|
|
5674
6031
|
}
|
|
5675
|
-
return {
|
|
6032
|
+
return {
|
|
6033
|
+
template,
|
|
6034
|
+
templateContent,
|
|
6035
|
+
propertiesJson: serializeRawNoteProperties(declared),
|
|
6036
|
+
values,
|
|
6037
|
+
frontmatterProperties: []
|
|
6038
|
+
};
|
|
6039
|
+
}
|
|
6040
|
+
async function frontmatterValues(tx, userId, properties, updatedAt) {
|
|
6041
|
+
if (properties.length === 0) return {};
|
|
6042
|
+
const resolved = /* @__PURE__ */ new Map();
|
|
6043
|
+
for (const definition of await listProperties(tx, { userId, limit: 5e3 })) {
|
|
6044
|
+
if (!definition.key) continue;
|
|
6045
|
+
resolved.set(definition.key, {
|
|
6046
|
+
type: definition.type,
|
|
6047
|
+
...definition.config?.type === "date" ? { dateMode: definition.config.mode } : {}
|
|
6048
|
+
});
|
|
6049
|
+
}
|
|
6050
|
+
for (const plan of chooseMarkdownPropertyDefinitions([properties], resolved)) {
|
|
6051
|
+
await runDomainCommand(tx, "properties.ensure", {
|
|
6052
|
+
key: plan.key,
|
|
6053
|
+
name: plan.name,
|
|
6054
|
+
type: plan.type,
|
|
6055
|
+
...plan.type === "date" && plan.dateMode === "datetime" ? { config: { version: 1, type: "date", mode: "datetime" } } : {},
|
|
6056
|
+
source: "manual",
|
|
6057
|
+
userId,
|
|
6058
|
+
updatedAt
|
|
6059
|
+
});
|
|
6060
|
+
resolved.set(plan.key, { type: plan.type, ...plan.type === "date" ? { dateMode: plan.dateMode } : {} });
|
|
6061
|
+
}
|
|
6062
|
+
return buildMarkdownPropertyValues(properties, resolved, null);
|
|
5676
6063
|
}
|
|
5677
6064
|
async function applyValues(tx, noteId, userId, seed) {
|
|
5678
|
-
if (!seed
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
userId,
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
6065
|
+
if (!seedWritesProperties(seed)) return;
|
|
6066
|
+
const updatedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
6067
|
+
const patch = {
|
|
6068
|
+
...await frontmatterValues(tx, userId, seed.frontmatterProperties, updatedAt),
|
|
6069
|
+
...seed.values ?? {}
|
|
6070
|
+
};
|
|
6071
|
+
if (Object.keys(patch).length === 0) return;
|
|
6072
|
+
await runDomainCommand(tx, "notes.updateProperties", { noteId, userId, patch, updatedAt });
|
|
5685
6073
|
}
|
|
5686
6074
|
async function createNoteWithSeed(db, input) {
|
|
5687
|
-
if (!input.seed
|
|
6075
|
+
if (!seedWritesProperties(input.seed)) {
|
|
5688
6076
|
await input.insert(db);
|
|
5689
6077
|
return;
|
|
5690
6078
|
}
|
|
@@ -6127,8 +6515,13 @@ async function runNoteCreate({ command, options }) {
|
|
|
6127
6515
|
const useTemplateContent = createOptions.content === void 0 && seed.templateContent !== null;
|
|
6128
6516
|
const contentMd = useTemplateContent ? seed.templateContent.contentMd : createOptions.content !== void 0 ? await parseStringInput(String(createOptions.content)) : "";
|
|
6129
6517
|
const canonicalContentMd = useTemplateContent ? contentMd : await canonicalizeBidlinksInMarkdown(db, contentMd, identity.userId);
|
|
6130
|
-
const { contentJson, contentText } = useTemplateContent ? { contentJson: seed.templateContent.contentJson, contentText: seed.templateContent.contentText } : convertMarkdownToNoteContent(canonicalContentMd);
|
|
6131
|
-
const
|
|
6518
|
+
const { contentJson, contentText, frontmatter } = useTemplateContent ? { contentJson: seed.templateContent.contentJson, contentText: seed.templateContent.contentText, frontmatter: null } : convertMarkdownToNoteContent(canonicalContentMd, { frontmatter: "extract" });
|
|
6519
|
+
const frontmatterTags = applyFrontmatterToSeed(seed, frontmatter);
|
|
6520
|
+
const storedContentMd = frontmatter ? extractMarkdownFrontmatter(canonicalContentMd).body : canonicalContentMd;
|
|
6521
|
+
const tagsInput = [
|
|
6522
|
+
...typeof createOptions.tags === "string" ? await parseStringListInput(createOptions.tags, "--tags") : [],
|
|
6523
|
+
...frontmatterTags
|
|
6524
|
+
];
|
|
6132
6525
|
const boxNames = typeof createOptions.boxes === "string" ? await parseStringListInput(createOptions.boxes, "--boxes") : [];
|
|
6133
6526
|
const noteType = parseNoteType(createOptions.type);
|
|
6134
6527
|
const id = generateId();
|
|
@@ -6136,7 +6529,7 @@ async function runNoteCreate({ command, options }) {
|
|
|
6136
6529
|
id,
|
|
6137
6530
|
title: String(createOptions.title),
|
|
6138
6531
|
noteType,
|
|
6139
|
-
contentMd:
|
|
6532
|
+
contentMd: storedContentMd,
|
|
6140
6533
|
contentJson,
|
|
6141
6534
|
contentText,
|
|
6142
6535
|
tags: await validateTagsForCreate(tx, tagsInput, identity.userId),
|
|
@@ -6156,7 +6549,7 @@ async function runNoteCreate({ command, options }) {
|
|
|
6156
6549
|
tagsInput,
|
|
6157
6550
|
zettelBoxNames: boxNames
|
|
6158
6551
|
});
|
|
6159
|
-
if (seed.template || seed
|
|
6552
|
+
if (seed.template || seedWritesProperties(seed)) {
|
|
6160
6553
|
const properties = await previewNoteCreateProperties(db, { noteId: id, userId: identity.userId, seed, insert });
|
|
6161
6554
|
preview.inputs = { ...preview.inputs, ...seed.template ? { template: { id: seed.template.id, name: seed.template.name } } : {} };
|
|
6162
6555
|
preview.changes = { ...preview.changes, properties: properties.properties };
|
|
@@ -6170,9 +6563,9 @@ async function runNoteCreate({ command, options }) {
|
|
|
6170
6563
|
ok: true,
|
|
6171
6564
|
id,
|
|
6172
6565
|
...seed.template ? { template: { id: seed.template.id, name: seed.template.name } } : {},
|
|
6173
|
-
...seed.template || seed
|
|
6566
|
+
...seed.template || seedWritesProperties(seed) ? { properties: (await readNoteProperties(db, { userId: identity.userId, noteId: id })).properties } : {},
|
|
6174
6567
|
...await readNoteWriteReceipt(db, id, {
|
|
6175
|
-
changed: ["title", "type", "content_md", "content_json", "content_text", "tags", "boxes", ...seed.template || seed
|
|
6568
|
+
changed: ["title", "type", "content_md", "content_json", "content_text", "tags", "boxes", ...seed.template || seedWritesProperties(seed) ? ["properties"] : []],
|
|
6176
6569
|
upload,
|
|
6177
6570
|
stale: commandStale(runtime)
|
|
6178
6571
|
})
|
|
@@ -9802,7 +10195,7 @@ import { spawn as spawn2 } from "node:child_process";
|
|
|
9802
10195
|
import { readFile } from "node:fs/promises";
|
|
9803
10196
|
import { homedir as homedir2 } from "node:os";
|
|
9804
10197
|
import path5 from "node:path";
|
|
9805
|
-
import { parse as
|
|
10198
|
+
import { parse as parseYaml2 } from "yaml";
|
|
9806
10199
|
|
|
9807
10200
|
// src/skills/registry.ts
|
|
9808
10201
|
function commands(file, key) {
|
|
@@ -9937,7 +10330,7 @@ async function removeRetiredSkillLeftover(leftover) {
|
|
|
9937
10330
|
|
|
9938
10331
|
// src/commands/skills/index.ts
|
|
9939
10332
|
var MAX_CAPTURED_INSTALLER_OUTPUT_BYTES = 64 * 1024;
|
|
9940
|
-
function
|
|
10333
|
+
function isRecord2(value) {
|
|
9941
10334
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
9942
10335
|
}
|
|
9943
10336
|
function defaultLockFilePath() {
|
|
@@ -10004,7 +10397,7 @@ async function readSkillsLock(lockFilePath, readLockFile) {
|
|
|
10004
10397
|
} catch (error) {
|
|
10005
10398
|
throw invalidLockError(lockFilePath, "file is not valid JSON", error);
|
|
10006
10399
|
}
|
|
10007
|
-
if (!
|
|
10400
|
+
if (!isRecord2(parsed) || !isRecord2(parsed.skills)) {
|
|
10008
10401
|
throw invalidLockError(lockFilePath, "expected an object with a skills map");
|
|
10009
10402
|
}
|
|
10010
10403
|
return {
|
|
@@ -10064,7 +10457,7 @@ function scanRetiredSkills(lockFilePath, lock) {
|
|
|
10064
10457
|
};
|
|
10065
10458
|
}
|
|
10066
10459
|
const rawEntry = entries[skill.name];
|
|
10067
|
-
const entry =
|
|
10460
|
+
const entry = isRecord2(rawEntry) ? rawEntry : {};
|
|
10068
10461
|
const observed = {
|
|
10069
10462
|
source: typeof entry.source === "string" ? entry.source : null,
|
|
10070
10463
|
skillFolderHash: typeof entry.skillFolderHash === "string" ? entry.skillFolderHash : null
|
|
@@ -10104,12 +10497,12 @@ function readSkillVersion(skillMarkdown) {
|
|
|
10104
10497
|
if (!frontmatter) return null;
|
|
10105
10498
|
let parsed;
|
|
10106
10499
|
try {
|
|
10107
|
-
parsed =
|
|
10500
|
+
parsed = parseYaml2(frontmatter);
|
|
10108
10501
|
} catch {
|
|
10109
10502
|
return null;
|
|
10110
10503
|
}
|
|
10111
|
-
if (!
|
|
10112
|
-
const metadataVersion =
|
|
10504
|
+
if (!isRecord2(parsed)) return null;
|
|
10505
|
+
const metadataVersion = isRecord2(parsed.metadata) ? parsed.metadata.version : void 0;
|
|
10113
10506
|
const version = metadataVersion ?? parsed.version;
|
|
10114
10507
|
return typeof version === "string" && version.trim() ? version.trim() : null;
|
|
10115
10508
|
}
|
|
@@ -10123,7 +10516,7 @@ async function scanCurrentSkills(lockFilePath = defaultLockFilePath(), readLockF
|
|
|
10123
10516
|
skills.push({ name, status: "missing", source: null, installedVersion: null });
|
|
10124
10517
|
continue;
|
|
10125
10518
|
}
|
|
10126
|
-
const source =
|
|
10519
|
+
const source = isRecord2(rawEntry) && typeof rawEntry.source === "string" ? rawEntry.source : null;
|
|
10127
10520
|
if (source !== SKILLS_REPO_SLUG) {
|
|
10128
10521
|
skills.push({ name, status: "foreign", source, installedVersion: null });
|
|
10129
10522
|
continue;
|
|
@@ -11487,7 +11880,7 @@ var clipCommandGroup = {
|
|
|
11487
11880
|
examples: ["dino clip inspect https://example.com/article --format json"]
|
|
11488
11881
|
},
|
|
11489
11882
|
action: async (context) => {
|
|
11490
|
-
const { runClipInspect } = await import("./run-
|
|
11883
|
+
const { runClipInspect } = await import("./run-7D6ATULD.js");
|
|
11491
11884
|
await runClipInspect(context);
|
|
11492
11885
|
}
|
|
11493
11886
|
},
|
|
@@ -11545,7 +11938,7 @@ var clipCommandGroup = {
|
|
|
11545
11938
|
]
|
|
11546
11939
|
},
|
|
11547
11940
|
action: async (context) => {
|
|
11548
|
-
const { runClipAdd } = await import("./run-
|
|
11941
|
+
const { runClipAdd } = await import("./run-7D6ATULD.js");
|
|
11549
11942
|
await runClipAdd(context);
|
|
11550
11943
|
}
|
|
11551
11944
|
},
|
|
@@ -11566,7 +11959,7 @@ var clipCommandGroup = {
|
|
|
11566
11959
|
examples: ["dino clip process 01a1e3bb-3827-790d-b850-52b187c12b53 --format json"]
|
|
11567
11960
|
},
|
|
11568
11961
|
action: async (context) => {
|
|
11569
|
-
const { runClipProcess } = await import("./run-
|
|
11962
|
+
const { runClipProcess } = await import("./run-7D6ATULD.js");
|
|
11570
11963
|
await runClipProcess(context);
|
|
11571
11964
|
}
|
|
11572
11965
|
},
|
|
@@ -11590,7 +11983,7 @@ var clipCommandGroup = {
|
|
|
11590
11983
|
examples: ["dino clip setup", "dino clip setup --progress --format json", "dino clip setup --check --format json"]
|
|
11591
11984
|
},
|
|
11592
11985
|
action: async (context) => {
|
|
11593
|
-
const { runClipSetup } = await import("./setup-
|
|
11986
|
+
const { runClipSetup } = await import("./setup-DSTOF3BZ.js");
|
|
11594
11987
|
await runClipSetup(context);
|
|
11595
11988
|
}
|
|
11596
11989
|
},
|
|
@@ -11610,7 +12003,7 @@ var clipCommandGroup = {
|
|
|
11610
12003
|
examples: ["dino clip cookies-list --format json"]
|
|
11611
12004
|
},
|
|
11612
12005
|
action: async () => {
|
|
11613
|
-
const { runClipCookiesList } = await import("./cookies-
|
|
12006
|
+
const { runClipCookiesList } = await import("./cookies-ORQ3RLAH.js");
|
|
11614
12007
|
await runClipCookiesList();
|
|
11615
12008
|
}
|
|
11616
12009
|
},
|
|
@@ -11637,7 +12030,7 @@ var clipCommandGroup = {
|
|
|
11637
12030
|
]
|
|
11638
12031
|
},
|
|
11639
12032
|
action: async (context) => {
|
|
11640
|
-
const { runClipCookiesImport } = await import("./cookies-
|
|
12033
|
+
const { runClipCookiesImport } = await import("./cookies-ORQ3RLAH.js");
|
|
11641
12034
|
await runClipCookiesImport(context);
|
|
11642
12035
|
}
|
|
11643
12036
|
},
|
|
@@ -11661,7 +12054,7 @@ var clipCommandGroup = {
|
|
|
11661
12054
|
examples: ["pbpaste | dino clip cookies-set example.com - --format json"]
|
|
11662
12055
|
},
|
|
11663
12056
|
action: async (context) => {
|
|
11664
|
-
const { runClipCookiesSet } = await import("./cookies-
|
|
12057
|
+
const { runClipCookiesSet } = await import("./cookies-ORQ3RLAH.js");
|
|
11665
12058
|
await runClipCookiesSet(context);
|
|
11666
12059
|
}
|
|
11667
12060
|
},
|
|
@@ -11683,7 +12076,7 @@ var clipCommandGroup = {
|
|
|
11683
12076
|
examples: ["dino clip cookies-remove example.com --format json", "dino clip cookies-remove --all --format json"]
|
|
11684
12077
|
},
|
|
11685
12078
|
action: async (context) => {
|
|
11686
|
-
const { runClipCookiesRemove } = await import("./cookies-
|
|
12079
|
+
const { runClipCookiesRemove } = await import("./cookies-ORQ3RLAH.js");
|
|
11687
12080
|
await runClipCookiesRemove(context);
|
|
11688
12081
|
}
|
|
11689
12082
|
}
|
|
@@ -13141,7 +13534,7 @@ async function buildTodoUpdateDryRunPreview(args) {
|
|
|
13141
13534
|
const updates = args.updates ?? [{
|
|
13142
13535
|
taskId: args.taskId ?? "",
|
|
13143
13536
|
...args.noteId !== void 0 ? { noteId: args.noteId } : {},
|
|
13144
|
-
...args.
|
|
13537
|
+
...args.status !== void 0 ? { status: args.status } : {},
|
|
13145
13538
|
...args.priority !== void 0 ? { priority: args.priority } : {},
|
|
13146
13539
|
...args.schedule !== void 0 ? { schedule: args.schedule } : {}
|
|
13147
13540
|
}];
|
|
@@ -13153,16 +13546,16 @@ async function buildTodoUpdateDryRunPreview(args) {
|
|
|
13153
13546
|
note_id: plan.noteId,
|
|
13154
13547
|
note_title: (plan.row.title ?? "").trim(),
|
|
13155
13548
|
...result,
|
|
13156
|
-
updated: plan.write !== null && (result.
|
|
13549
|
+
updated: plan.write !== null && (result.status_from !== result.status_to || result.priority_from !== result.priority_to || JSON.stringify(result.due_from) !== JSON.stringify(result.due_to) || result.cascaded_task_ids.length > 0)
|
|
13157
13550
|
})));
|
|
13158
13551
|
const warnings = buildExecutionWarnings4(args.config, args.offline);
|
|
13159
13552
|
if (single) {
|
|
13160
13553
|
const task = tasks[0];
|
|
13161
13554
|
const patch = updates[0];
|
|
13162
13555
|
const changes = {};
|
|
13163
|
-
if (patch.
|
|
13164
|
-
changes.
|
|
13165
|
-
changes.
|
|
13556
|
+
if (patch.status !== void 0) {
|
|
13557
|
+
changes.status_from = task.status_from;
|
|
13558
|
+
changes.status_to = task.status_to;
|
|
13166
13559
|
}
|
|
13167
13560
|
if (patch.priority !== void 0) {
|
|
13168
13561
|
changes.priority_from = task.priority_from;
|
|
@@ -13184,7 +13577,7 @@ async function buildTodoUpdateDryRunPreview(args) {
|
|
|
13184
13577
|
inputs: {
|
|
13185
13578
|
task_id: task.task_id,
|
|
13186
13579
|
note_id: args.noteId?.trim() || null,
|
|
13187
|
-
...patch.
|
|
13580
|
+
...patch.status !== void 0 ? { status_to: patch.status } : {},
|
|
13188
13581
|
...patch.priority !== void 0 ? { priority_to: patch.priority ?? "none" } : {},
|
|
13189
13582
|
...patch.schedule !== void 0 ? { schedule: patch.schedule } : {}
|
|
13190
13583
|
},
|
|
@@ -13272,7 +13665,7 @@ function toDraftItems(value, path6 = "--items") {
|
|
|
13272
13665
|
throw new DinoxError(`${where}.text must be a string`, { code: "INVALID_ARGUMENT" });
|
|
13273
13666
|
}
|
|
13274
13667
|
const draft = { text: item.text };
|
|
13275
|
-
if (item.
|
|
13668
|
+
if (item.status !== void 0 && item.status !== null) draft.status = parseTaskStatusValue(item.status, `${where}.status`);
|
|
13276
13669
|
if (item.priority !== void 0 && item.priority !== null) {
|
|
13277
13670
|
draft.priority = parsePriorityValue(item.priority, `${where}.priority`);
|
|
13278
13671
|
}
|
|
@@ -13315,8 +13708,7 @@ function toTaskUpdates(value) {
|
|
|
13315
13708
|
const noteId = item.note_id ?? item.noteId;
|
|
13316
13709
|
const update = { taskId };
|
|
13317
13710
|
if (typeof noteId === "string") update.noteId = noteId;
|
|
13318
|
-
if (item.status !== void 0) update.
|
|
13319
|
-
if (typeof item.checked === "boolean") update.checked = item.checked;
|
|
13711
|
+
if (item.status !== void 0) update.status = parseTaskStatusValue(item.status, `${where}.status`);
|
|
13320
13712
|
if (item.priority !== void 0) {
|
|
13321
13713
|
update.priority = item.priority === null ? null : parsePriorityValue(item.priority, `${where}.priority`);
|
|
13322
13714
|
}
|
|
@@ -13326,24 +13718,20 @@ function toTaskUpdates(value) {
|
|
|
13326
13718
|
return update;
|
|
13327
13719
|
});
|
|
13328
13720
|
}
|
|
13329
|
-
|
|
13721
|
+
var TASK_STATUS_LIST = TASK_STATUS_VALUES.join(", ");
|
|
13722
|
+
function parseTaskStatusValue(value, optionName) {
|
|
13330
13723
|
const normalized = typeof value === "string" ? value.trim().toLowerCase() : "";
|
|
13331
|
-
if (normalized
|
|
13332
|
-
|
|
13333
|
-
}
|
|
13334
|
-
throw new DinoxError("--status must be one of: all, completed, uncompleted");
|
|
13724
|
+
if (isTaskStatus(normalized)) return normalized;
|
|
13725
|
+
throw new DinoxError(`${optionName} must be one of: ${TASK_STATUS_LIST}`, { code: "INVALID_ARGUMENT" });
|
|
13335
13726
|
}
|
|
13336
|
-
function
|
|
13337
|
-
|
|
13338
|
-
|
|
13339
|
-
|
|
13727
|
+
function parseTaskStatusFilter(value) {
|
|
13728
|
+
if (value === void 0 || value === null) return [];
|
|
13729
|
+
const entries = typeof value === "string" ? value.split(/[\s,,]+/).filter(Boolean) : [];
|
|
13730
|
+
if (entries.length === 0) {
|
|
13731
|
+
throw new DinoxError(`--status must list one or more of: ${TASK_STATUS_LIST}`, { code: "INVALID_ARGUMENT" });
|
|
13340
13732
|
}
|
|
13341
|
-
|
|
13342
|
-
|
|
13343
|
-
}
|
|
13344
|
-
throw new DinoxError(
|
|
13345
|
-
"--status must be one of: completed, uncompleted, done, undone, true, false, 1, 0"
|
|
13346
|
-
);
|
|
13733
|
+
const wanted = new Set(entries.map((entry) => parseTaskStatusValue(entry, "--status")));
|
|
13734
|
+
return TASK_STATUS_VALUES.filter((status) => wanted.has(status));
|
|
13347
13735
|
}
|
|
13348
13736
|
function parsePositiveIntegerOption2(value, optionName, fallback, max) {
|
|
13349
13737
|
if (value === void 0 || value === null || value === "") {
|
|
@@ -13442,7 +13830,7 @@ async function withTodoDatabase(globals, run) {
|
|
|
13442
13830
|
async function runTodoSearch({ args, globals, options }) {
|
|
13443
13831
|
const searchOptions = options;
|
|
13444
13832
|
const keyword = args.query?.trim() ?? "";
|
|
13445
|
-
const taskStatus =
|
|
13833
|
+
const taskStatus = parseTaskStatusFilter(searchOptions.status);
|
|
13446
13834
|
const taskTagFilter = typeof searchOptions.tags === "string" ? await parseTagFilterInput(searchOptions.tags) : [];
|
|
13447
13835
|
const taskPriorityFilter = parsePriorityFilter(searchOptions.priority);
|
|
13448
13836
|
const taskDateRange = parseTaskDateRange({
|
|
@@ -13558,7 +13946,7 @@ function parseSingleUpdate(taskId, options) {
|
|
|
13558
13946
|
const update = { taskId };
|
|
13559
13947
|
const noteId = optionalString(options.noteId);
|
|
13560
13948
|
if (noteId !== void 0) update.noteId = noteId;
|
|
13561
|
-
if (options.status !== void 0) update.
|
|
13949
|
+
if (options.status !== void 0) update.status = parseTaskStatusValue(options.status, "--status");
|
|
13562
13950
|
if (options.priority !== void 0) update.priority = parsePriorityValue(options.priority, "--priority");
|
|
13563
13951
|
const schedule = parseScheduleOptions(options.due, options.time);
|
|
13564
13952
|
if (options.clearDue) {
|
|
@@ -13610,7 +13998,7 @@ async function runTodoUpdate({ args, globals, options }) {
|
|
|
13610
13998
|
offline,
|
|
13611
13999
|
taskId: update.taskId,
|
|
13612
14000
|
noteId: update.noteId,
|
|
13613
|
-
|
|
14001
|
+
status: update.status,
|
|
13614
14002
|
priority: update.priority,
|
|
13615
14003
|
schedule: update.schedule
|
|
13616
14004
|
});
|
|
@@ -13637,7 +14025,7 @@ var todoSearchCommand = {
|
|
|
13637
14025
|
}
|
|
13638
14026
|
],
|
|
13639
14027
|
options: [
|
|
13640
|
-
{ flags: "--status <
|
|
14028
|
+
{ flags: "--status <list>", description: "Statuses to keep, comma-separated: backlog,todo,in_progress,done,cancelled (omit for every status)" },
|
|
13641
14029
|
{ flags: "--tags <string|@file>", description: "Tags every task must carry, via its own #tag or its note's tags (JSON array or comma/newline-separated)" },
|
|
13642
14030
|
{ flags: "--priority <list>", description: "Priorities to keep, comma-separated: high,medium,low,none" },
|
|
13643
14031
|
{ flags: "--from <date>", description: "Task date range start (YYYY-MM-DD or ISO datetime); matches tasks whose schedule overlaps the range" },
|
|
@@ -13660,9 +14048,9 @@ var todoSearchCommand = {
|
|
|
13660
14048
|
metaFields: ["stale", "meta.query", "meta.returned_count", "meta.total_count", "meta.total_count_is_lower_bound", "meta.matched_note_count", "meta.limit", "meta.offset", "meta.has_more", "meta.next_cursor", "meta.scan_limit", "meta.scanned_note_count", "meta.scan_truncated", "meta.truncated", "meta.applied_filters.status", "meta.applied_filters.tags", "meta.applied_filters.priority", "meta.applied_filters.include_deleted", "meta.applied_filters.date_range"]
|
|
13661
14049
|
},
|
|
13662
14050
|
examples: [
|
|
13663
|
-
'dino todo search "\u62A5\u9500" --status
|
|
14051
|
+
'dino todo search "\u62A5\u9500" --status backlog,todo,in_progress --format json',
|
|
13664
14052
|
"dino todo search --days 7 --format json",
|
|
13665
|
-
"dino todo search --status
|
|
14053
|
+
"dino todo search --status todo,in_progress --priority high,medium --format json"
|
|
13666
14054
|
]
|
|
13667
14055
|
},
|
|
13668
14056
|
action: runTodoSearch
|
|
@@ -13677,7 +14065,7 @@ var NEW_TASK_OPTIONS = [
|
|
|
13677
14065
|
{ flags: "--tasks <string|@file>", description: "Task list (JSON array or comma/newline-separated)" },
|
|
13678
14066
|
{
|
|
13679
14067
|
flags: "--items <json|@file>",
|
|
13680
|
-
description: "Structured tasks: JSON array of {text,
|
|
14068
|
+
description: "Structured tasks: JSON array of {text, status?, priority?, schedule?: {date, time?}, subtasks?: [...]} (status: backlog|todo|in_progress|done|cancelled, default todo)"
|
|
13681
14069
|
},
|
|
13682
14070
|
{ flags: "--priority <priority>", description: "Priority for --task/--tasks: high|medium|low" },
|
|
13683
14071
|
{ flags: "--due <date>", description: "Due date for --task/--tasks (local YYYY-MM-DD)" },
|
|
@@ -13708,7 +14096,7 @@ var todoAppendCommand = {
|
|
|
13708
14096
|
output: {
|
|
13709
14097
|
type: "structured",
|
|
13710
14098
|
summary: "Append result with target note, created tasks, and write receipt",
|
|
13711
|
-
fields: ["note_id", "appended_count", "source", "created", "day_key", "parent_task_id", "tasks.task_id", "tasks.text", "tasks.priority", "tasks.parent_task_id", "tasks.due_time", ...TODO_WRITE_RECEIPT_FIELDS]
|
|
14099
|
+
fields: ["note_id", "appended_count", "source", "created", "day_key", "parent_task_id", "tasks.task_id", "tasks.text", "tasks.status", "tasks.priority", "tasks.parent_task_id", "tasks.due_time", ...TODO_WRITE_RECEIPT_FIELDS]
|
|
13712
14100
|
},
|
|
13713
14101
|
examples: [
|
|
13714
14102
|
'dino todo append "\u8865\u4EA4\u62A5\u9500\u5355" --priority high --due 2026-11-10 --format json',
|
|
@@ -13741,7 +14129,7 @@ var todoCreateCommand = {
|
|
|
13741
14129
|
output: {
|
|
13742
14130
|
type: "structured",
|
|
13743
14131
|
summary: "Creation result with new note id, created task count, and write receipt",
|
|
13744
|
-
fields: ["note_id", "created_count", "title", "tasks.task_id", "tasks.text", "tasks.priority", "tasks.parent_task_id", "tasks.due_time", ...TODO_WRITE_RECEIPT_FIELDS]
|
|
14132
|
+
fields: ["note_id", "created_count", "title", "tasks.task_id", "tasks.text", "tasks.status", "tasks.priority", "tasks.parent_task_id", "tasks.due_time", ...TODO_WRITE_RECEIPT_FIELDS]
|
|
13745
14133
|
},
|
|
13746
14134
|
examples: ['dino todo create --task "\u8865\u4EA4\u62A5\u9500\u5355" --task "\u6574\u7406\u53D1\u7968" --format json']
|
|
13747
14135
|
},
|
|
@@ -13749,7 +14137,7 @@ var todoCreateCommand = {
|
|
|
13749
14137
|
};
|
|
13750
14138
|
var todoUpdateCommand = {
|
|
13751
14139
|
name: "update",
|
|
13752
|
-
description: "Update a task's status, priority, or due time by task id (
|
|
14140
|
+
description: "Update a task's status, priority, or due time by task id (closing cascades to subtasks, reopening to parents)",
|
|
13753
14141
|
arguments: [
|
|
13754
14142
|
{
|
|
13755
14143
|
syntax: "[taskId]",
|
|
@@ -13759,7 +14147,7 @@ var todoUpdateCommand = {
|
|
|
13759
14147
|
options: [
|
|
13760
14148
|
{
|
|
13761
14149
|
flags: "--status <status>",
|
|
13762
|
-
description: "
|
|
14150
|
+
description: "Set the status: backlog|todo|in_progress|done|cancelled"
|
|
13763
14151
|
},
|
|
13764
14152
|
{ flags: "--priority <priority>", description: "Set priority: high|medium|low, or none to clear" },
|
|
13765
14153
|
{ flags: "--due <date>", description: "Set the due date (local YYYY-MM-DD)" },
|
|
@@ -13781,10 +14169,10 @@ var todoUpdateCommand = {
|
|
|
13781
14169
|
output: {
|
|
13782
14170
|
type: "structured",
|
|
13783
14171
|
summary: "Mutation result with the task's new state, cascaded tasks, and write receipt (batch: per-task results and per-note receipts)",
|
|
13784
|
-
fields: ["task_id", "
|
|
14172
|
+
fields: ["task_id", "status", "priority", "due_time", "cascaded_task_ids", "updated", "note_id", "updated_count", "note_ids", "tasks.task_id", "tasks.updated", "notes.note_id", ...TODO_WRITE_RECEIPT_FIELDS]
|
|
13785
14173
|
},
|
|
13786
14174
|
examples: [
|
|
13787
|
-
"dino todo update <taskId> --note-id <noteId> --status
|
|
14175
|
+
"dino todo update <taskId> --note-id <noteId> --status done --format json",
|
|
13788
14176
|
"dino todo update <taskId> --priority high --due 2026-11-10 --time 09:30 --format json",
|
|
13789
14177
|
`dino todo update --updates '[{"task_id":"<id>","status":"done"},{"task_id":"<id2>","priority":"none"}]' --format json`
|
|
13790
14178
|
]
|
|
@@ -14120,7 +14508,7 @@ function parseMcpGroups(raw) {
|
|
|
14120
14508
|
}
|
|
14121
14509
|
async function runMcp(context) {
|
|
14122
14510
|
const groups = parseMcpGroups(context.options.groups);
|
|
14123
|
-
const { serveStandaloneMcpOverStdio } = await import("./mcpServer-
|
|
14511
|
+
const { serveStandaloneMcpOverStdio } = await import("./mcpServer-G2WEAD2O.js");
|
|
14124
14512
|
await serveStandaloneMcpOverStdio({ readOnly: context.options.readOnly === true, groups });
|
|
14125
14513
|
}
|
|
14126
14514
|
var mcpCommandDescriptor = {
|