things-api 0.13.0 → 0.14.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 +2 -2
- package/dist/cli/commands/area.d.ts +5 -5
- package/dist/cli/commands/area.js +12 -7
- package/dist/cli/commands/area.js.map +1 -1
- package/dist/cli/commands/project.js +1 -1
- package/dist/cli/commands/project.js.map +1 -1
- package/dist/cli/commands/reads.js +21 -12
- package/dist/cli/commands/reads.js.map +1 -1
- package/dist/cli/commands/show.js +6 -2
- package/dist/cli/commands/show.js.map +1 -1
- package/dist/cli/commands/todo.js +1 -1
- package/dist/cli/commands/todo.js.map +1 -1
- package/dist/cli/commands/writes.js +116 -70
- package/dist/cli/commands/writes.js.map +1 -1
- package/dist/cli/glyphs.d.ts +9 -2
- package/dist/cli/glyphs.js +11 -5
- package/dist/cli/glyphs.js.map +1 -1
- package/dist/cli/read-driver.d.ts +39 -9
- package/dist/cli/read-driver.js +37 -16
- package/dist/cli/read-driver.js.map +1 -1
- package/dist/cli/render.d.ts +25 -26
- package/dist/cli/render.js +57 -56
- package/dist/cli/render.js.map +1 -1
- package/dist/client.d.ts +92 -35
- package/dist/client.js +61 -18
- package/dist/client.js.map +1 -1
- package/dist/contracts.d.ts +23 -33
- package/dist/contracts.js +1 -1
- package/dist/contracts.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.js +158 -144
- package/dist/mcp/server.js.map +1 -1
- package/dist/model/dates.d.ts +26 -0
- package/dist/model/dates.js +46 -4
- package/dist/model/dates.js.map +1 -1
- package/dist/read/area-filter.d.ts +1 -1
- package/dist/read/area-filter.js +5 -4
- package/dist/read/area-filter.js.map +1 -1
- package/dist/read/area-view.d.ts +0 -11
- package/dist/read/area-view.js +1 -5
- package/dist/read/area-view.js.map +1 -1
- package/dist/read/project-view.d.ts +34 -19
- package/dist/read/project-view.js +26 -20
- package/dist/read/project-view.js.map +1 -1
- package/dist/read/scope.d.ts +1 -1
- package/dist/read/scope.js +5 -4
- package/dist/read/scope.js.map +1 -1
- package/dist/read/shape.d.ts +73 -14
- package/dist/read/shape.js +459 -151
- package/dist/read/shape.js.map +1 -1
- package/dist/read/truncation.d.ts +75 -2
- package/dist/read/truncation.js +69 -46
- package/dist/read/truncation.js.map +1 -1
- package/dist/read/views.d.ts +19 -18
- package/dist/read/views.js +5 -6
- package/dist/read/views.js.map +1 -1
- package/dist/surface-copy.d.ts +6 -0
- package/dist/surface-copy.js +6 -0
- package/dist/surface-copy.js.map +1 -1
- package/dist/write/batch.js +0 -1
- package/dist/write/batch.js.map +1 -1
- package/dist/write/commands.d.ts +25 -1
- package/dist/write/commands.js +256 -121
- package/dist/write/commands.js.map +1 -1
- package/dist/write/guards.js +27 -11
- package/dist/write/guards.js.map +1 -1
- package/dist/write/move.d.ts +26 -5
- package/dist/write/move.js +313 -2
- package/dist/write/move.js.map +1 -1
- package/dist/write/operations.d.ts +49 -19
- package/dist/write/operations.js +2 -2
- package/dist/write/operations.js.map +1 -1
- package/dist/write/pipeline.js +25 -4
- package/dist/write/pipeline.js.map +1 -1
- package/dist/write/pre-state.d.ts +48 -28
- package/dist/write/pre-state.js +134 -13
- package/dist/write/pre-state.js.map +1 -1
- package/dist/write/reorder.js +3 -3
- package/dist/write/reorder.js.map +1 -1
- package/dist/write/resolution-timestamps.d.ts +34 -0
- package/dist/write/resolution-timestamps.js +286 -0
- package/dist/write/resolution-timestamps.js.map +1 -0
- package/dist/write/reversibility.js +5 -5
- package/dist/write/reversibility.js.map +1 -1
- package/dist/write/scope-guard.js +0 -5
- package/dist/write/scope-guard.js.map +1 -1
- package/dist/write/undo.d.ts +0 -6
- package/dist/write/undo.js +44 -4
- package/dist/write/undo.js.map +1 -1
- package/dist/write/vectors/applescript.js +14 -4
- package/dist/write/vectors/applescript.js.map +1 -1
- package/dist/write/vectors/url-scheme.js +0 -8
- package/dist/write/vectors/url-scheme.js.map +1 -1
- package/dist/write/verify/delta.d.ts +16 -2
- package/dist/write/verify/delta.js +21 -2
- package/dist/write/verify/delta.js.map +1 -1
- package/package.json +1 -1
- package/schema/envelope.schema.json +2 -78
- package/skills/things-cli/SKILL.md +7 -5
- package/skills/things-cli/references/contracts.md +3 -4
- package/skills/things-cli/references/model.md +8 -8
- package/skills/things-cli/references/ordering.md +16 -7
|
@@ -551,6 +551,38 @@ function addPositionFlags(cmd) {
|
|
|
551
551
|
.option("--before <ref>", "place the block immediately before this item (same bucket)")
|
|
552
552
|
.option("--after <ref>", "place the block immediately after this item (same bucket)");
|
|
553
553
|
}
|
|
554
|
+
/**
|
|
555
|
+
* The universal-`reorder` anchor grammar (spec §7 ratified vocabulary):
|
|
556
|
+
* --start / --end / --before / --after. `--start`/`--end` name the block's top/
|
|
557
|
+
* bottom slot in its scope; --before/--after anchor against a sibling.
|
|
558
|
+
*/
|
|
559
|
+
function addReorderPositionFlags(cmd) {
|
|
560
|
+
return cmd
|
|
561
|
+
.option("--start", "place the block at the start of its scope")
|
|
562
|
+
.option("--end", "place the block at the end of its scope")
|
|
563
|
+
.option("--before <ref>", "place the block immediately before this item")
|
|
564
|
+
.option("--after <ref>", "place the block immediately after this item");
|
|
565
|
+
}
|
|
566
|
+
/** Build a MovePosition from the reorder --start/--end/--before/--after flags. */
|
|
567
|
+
function reorderPosition(opts) {
|
|
568
|
+
const chosen = [
|
|
569
|
+
opts["start"] === true,
|
|
570
|
+
opts["end"] === true,
|
|
571
|
+
opts["before"] !== undefined,
|
|
572
|
+
opts["after"] !== undefined,
|
|
573
|
+
].filter(Boolean).length;
|
|
574
|
+
if (chosen > 1)
|
|
575
|
+
return "conflict";
|
|
576
|
+
if (opts["start"] === true)
|
|
577
|
+
return { at: "first" };
|
|
578
|
+
if (opts["end"] === true)
|
|
579
|
+
return { at: "last" };
|
|
580
|
+
if (opts["before"] !== undefined)
|
|
581
|
+
return { before: opts["before"] };
|
|
582
|
+
if (opts["after"] !== undefined)
|
|
583
|
+
return { after: opts["after"] };
|
|
584
|
+
return undefined;
|
|
585
|
+
}
|
|
554
586
|
/** One TTY line for a bulk-add batch item (the human, non-JSON multi rendering). */
|
|
555
587
|
function addResultLine(r) {
|
|
556
588
|
const o = r.outcome;
|
|
@@ -669,6 +701,8 @@ export function registerWriteCommands(program) {
|
|
|
669
701
|
.option("--project <ref>", "destination project (uuid or unique name)")
|
|
670
702
|
.option("--area <ref>", "destination area (uuid or unique name)")
|
|
671
703
|
.option("--heading <name>", "existing heading in the destination project")
|
|
704
|
+
.option("--created-at <iso>", "born with this creation timestamp (ISO date or datetime; a date is noon in the effective zone)")
|
|
705
|
+
.option("--completed-at <iso>", "born completed (in the Logbook) with this completion timestamp (ISO date or datetime); drop --when/--reminder")
|
|
672
706
|
.option("--acknowledge-project-reopen", "allow adding into a completed/canceled project")
|
|
673
707
|
.option("--stdin", "read newline-delimited titles from stdin (blank lines skipped); exclusive with title arguments")
|
|
674
708
|
.option("--id-only", "print only the new uuid(s), one per line in creation order, and nothing else (exclusive with --json)"))).action(async (titles, opts) => {
|
|
@@ -706,6 +740,8 @@ export function registerWriteCommands(program) {
|
|
|
706
740
|
...(project !== undefined && { project }),
|
|
707
741
|
...(area !== undefined && { area }),
|
|
708
742
|
...(opts["heading"] !== undefined && { heading: opts["heading"] }),
|
|
743
|
+
...(opts["createdAt"] !== undefined && { createdAt: opts["createdAt"] }),
|
|
744
|
+
...(opts["completedAt"] !== undefined && { completedAt: opts["completedAt"] }),
|
|
709
745
|
});
|
|
710
746
|
const ackReopen = opts["acknowledgeProjectReopen"] !== undefined
|
|
711
747
|
? { acknowledgeProjectReopen: opts["acknowledgeProjectReopen"] }
|
|
@@ -783,7 +819,9 @@ export function registerWriteCommands(program) {
|
|
|
783
819
|
.option("--reminder <HH:mm>", "set a reminder (24h); requires --when today|evening|date")
|
|
784
820
|
.option("--clear-reminder", "clear the reminder (works while scheduled today|evening)")
|
|
785
821
|
.option("--deadline <date>", "YYYY-MM-DD")
|
|
786
|
-
.option("--clear-deadline", "remove the deadline")
|
|
822
|
+
.option("--clear-deadline", "remove the deadline")
|
|
823
|
+
.option("--created-at <iso>", "rewrite the creation timestamp (ISO date or datetime; a date is noon in the effective zone); status-safe")
|
|
824
|
+
.option("--completed-at <iso>", "rewrite the completion timestamp of an already-resolved to-do (a canceled one stays canceled); open to-dos are refused — use complete/cancel")).action(async (uuid, opts) => {
|
|
787
825
|
const notesModes = ["notes", "appendNotes", "prependNotes"].filter((k) => opts[k] !== undefined);
|
|
788
826
|
if (notesModes.length > 1) {
|
|
789
827
|
usageError(opts, "--notes, --append-notes, --prepend-notes are exclusive");
|
|
@@ -807,19 +845,30 @@ export function registerWriteCommands(program) {
|
|
|
807
845
|
...(opts["clearReminder"] === true && { reminder: null }),
|
|
808
846
|
...(opts["deadline"] !== undefined && { deadline: opts["deadline"] }),
|
|
809
847
|
...(opts["clearDeadline"] === true && { deadline: null }),
|
|
848
|
+
...(opts["createdAt"] !== undefined && { createdAt: opts["createdAt"] }),
|
|
849
|
+
...(opts["completedAt"] !== undefined && { completedAt: opts["completedAt"] }),
|
|
810
850
|
}, writeOptionsFrom(opts)));
|
|
811
851
|
});
|
|
812
|
-
for (const [
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
852
|
+
for (const verb of ["complete", "cancel"]) {
|
|
853
|
+
const method = verb === "complete" ? "completeTodo" : "cancelTodo";
|
|
854
|
+
const stampNote = verb === "complete"
|
|
855
|
+
? "resolving it first if needed, then backdating"
|
|
856
|
+
: "keeping it canceled via the certified flip legs";
|
|
817
857
|
addWriteFlags(todo
|
|
818
858
|
.command(`${verb} <uuid>`)
|
|
819
|
-
.description(`${verb[0]?.toUpperCase()}${verb.slice(1)} a to-do. Not available for repeating to-dos
|
|
820
|
-
|
|
859
|
+
.description(`${verb[0]?.toUpperCase()}${verb.slice(1)} a to-do. Not available for repeating to-dos. ` +
|
|
860
|
+
'--completed-at sets the completion timestamp (also the "Completed on" stamp for a canceled ' +
|
|
861
|
+
`item), ${stampNote} — a multi-leg sequence, disclosed in the result and --dry-run.`)
|
|
862
|
+
.option("--completed-at <iso>", "completion timestamp (ISO date or datetime; a date is noon in the effective zone)")).action(async (uuid, opts) => {
|
|
863
|
+
const resolution = opts["completedAt"] !== undefined ? { completedAt: opts["completedAt"] } : {};
|
|
864
|
+
await runWrite(opts, (c) => c.write[method](uuid, resolution, writeOptionsFrom(opts)));
|
|
821
865
|
});
|
|
822
866
|
}
|
|
867
|
+
addWriteFlags(todo
|
|
868
|
+
.command("reopen <uuid>")
|
|
869
|
+
.description("Reopen a to-do. Not available for repeating to-dos.")).action(async (uuid, opts) => {
|
|
870
|
+
await runWrite(opts, (c) => c.write.reopenTodo(uuid, writeOptionsFrom(opts)));
|
|
871
|
+
});
|
|
823
872
|
addPositionFlags(addWriteFlags(todo
|
|
824
873
|
.command("move <refs...>")
|
|
825
874
|
.description("Move one or more to-dos as an ordered block (the argument order is the order they " +
|
|
@@ -986,35 +1035,10 @@ export function registerWriteCommands(program) {
|
|
|
986
1035
|
return;
|
|
987
1036
|
await runWrite(opts, (c) => c.write.clearReminder(uuid, writeOptionsFrom(opts)));
|
|
988
1037
|
});
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
"canceled. The Logbook re-sorts to the new date.")
|
|
994
|
-
.option("--completed-on <date>", "YYYY-MM-DD — new completion date")
|
|
995
|
-
.option("--created-on <date>", "YYYY-MM-DD — new creation date")).action(async (uuid, opts) => {
|
|
996
|
-
await runWrite(opts, (c) => c.write.backdateTodo(uuid, {
|
|
997
|
-
...(opts["completedOn"] !== undefined && {
|
|
998
|
-
completionDate: opts["completedOn"],
|
|
999
|
-
}),
|
|
1000
|
-
...(opts["createdOn"] !== undefined && { creationDate: opts["createdOn"] }),
|
|
1001
|
-
}, writeOptionsFrom(opts)));
|
|
1002
|
-
});
|
|
1003
|
-
addWriteFlags(todo
|
|
1004
|
-
.command("add-logged <title>")
|
|
1005
|
-
.description("Create a to-do directly in the Logbook: completed, with the given past " +
|
|
1006
|
-
"completion date (and optionally a past creation date). For importing history " +
|
|
1007
|
-
"from another system.")
|
|
1008
|
-
.requiredOption("--completed-on <date>", "YYYY-MM-DD — completion date (required)")
|
|
1009
|
-
.option("--created-on <date>", "YYYY-MM-DD — creation date (must be <= completed-on)")
|
|
1010
|
-
.option("--notes <text>", "notes body")).action(async (title, opts) => {
|
|
1011
|
-
await runWrite(opts, (c) => c.write.addLoggedTodo({
|
|
1012
|
-
title,
|
|
1013
|
-
completionDate: opts["completedOn"],
|
|
1014
|
-
...(opts["createdOn"] !== undefined && { creationDate: opts["createdOn"] }),
|
|
1015
|
-
...(opts["notes"] !== undefined && { notes: opts["notes"] }),
|
|
1016
|
-
}, writeOptionsFrom(opts)));
|
|
1017
|
-
});
|
|
1038
|
+
// NB: the bespoke `todo backdate` / `todo add-logged` commands were removed
|
|
1039
|
+
// (plan PR A). Backdated creation and Logbook import are now `todo add
|
|
1040
|
+
// --created-at/--completed-at`; rewriting an existing item's timestamps is
|
|
1041
|
+
// `todo update --created-at/--completed-at` (or complete/cancel --completed-at).
|
|
1018
1042
|
// --- ui vector: GUI-driven transforms (two-key gated) --------------------
|
|
1019
1043
|
const REPEAT_FREQ_HELP = "daily | weekly | monthly | yearly";
|
|
1020
1044
|
const REPEAT_INTERVAL_HELP = "every N units (1–99)";
|
|
@@ -1299,7 +1323,9 @@ export function registerWriteCommands(program) {
|
|
|
1299
1323
|
.option("--area <ref>", "destination area (uuid or unique name)")
|
|
1300
1324
|
.option("--when <value>", "today | evening | anytime | someday | YYYY-MM-DD")
|
|
1301
1325
|
.option("--deadline <date>", "YYYY-MM-DD")
|
|
1302
|
-
.option("--todo <title>", "initial child to-do, repeatable (seeds the new project)", collect, [])
|
|
1326
|
+
.option("--todo <title>", "initial child to-do, repeatable (seeds the new project)", collect, [])
|
|
1327
|
+
.option("--created-at <iso>", "born with this creation timestamp (ISO date or datetime; a date is noon in the effective zone)")
|
|
1328
|
+
.option("--completed-at <iso>", "born completed (in the Logbook) with this completion timestamp; cannot seed open child to-dos (§5b)")).action(async (title, opts) => {
|
|
1303
1329
|
const todos = opts["todo"];
|
|
1304
1330
|
const area = containerRef(opts["area"]);
|
|
1305
1331
|
await runWrite(opts, (c) => c.write.addProject({
|
|
@@ -1309,6 +1335,8 @@ export function registerWriteCommands(program) {
|
|
|
1309
1335
|
...(opts["when"] !== undefined && { when: opts["when"] }),
|
|
1310
1336
|
...(opts["deadline"] !== undefined && { deadline: opts["deadline"] }),
|
|
1311
1337
|
...(todos.length > 0 && { todos }),
|
|
1338
|
+
...(opts["createdAt"] !== undefined && { createdAt: opts["createdAt"] }),
|
|
1339
|
+
...(opts["completedAt"] !== undefined && { completedAt: opts["completedAt"] }),
|
|
1312
1340
|
}, writeOptionsFrom(opts)));
|
|
1313
1341
|
});
|
|
1314
1342
|
addWriteFlags(project
|
|
@@ -1327,6 +1355,8 @@ export function registerWriteCommands(program) {
|
|
|
1327
1355
|
.option("--clear-reminder", "clear the reminder (works while scheduled today|evening)")
|
|
1328
1356
|
.option("--deadline <date>", "YYYY-MM-DD")
|
|
1329
1357
|
.option("--clear-deadline", "remove the deadline")
|
|
1358
|
+
.option("--created-at <iso>", "rewrite the creation timestamp (ISO date or datetime; a date is noon in the effective zone); status-safe")
|
|
1359
|
+
.option("--completed-at <iso>", "rewrite the completion timestamp of an already-resolved project (a canceled one stays canceled); open projects are refused — use complete/cancel")
|
|
1330
1360
|
.action(async (uuid, opts) => {
|
|
1331
1361
|
const notesModes = ["notes", "appendNotes", "prependNotes"].filter((k) => opts[k] !== undefined);
|
|
1332
1362
|
if (notesModes.length > 1) {
|
|
@@ -1353,6 +1383,10 @@ export function registerWriteCommands(program) {
|
|
|
1353
1383
|
...(opts["clearReminder"] === true && { reminder: null }),
|
|
1354
1384
|
...(opts["deadline"] !== undefined && { deadline: opts["deadline"] }),
|
|
1355
1385
|
...(opts["clearDeadline"] === true && { deadline: null }),
|
|
1386
|
+
...(opts["createdAt"] !== undefined && { createdAt: opts["createdAt"] }),
|
|
1387
|
+
...(opts["completedAt"] !== undefined && {
|
|
1388
|
+
completedAt: opts["completedAt"],
|
|
1389
|
+
}),
|
|
1356
1390
|
}, writeOptionsFrom(opts)));
|
|
1357
1391
|
});
|
|
1358
1392
|
addCreateTagsFlag(addWriteFlags(project
|
|
@@ -1407,9 +1441,17 @@ export function registerWriteCommands(program) {
|
|
|
1407
1441
|
.command("cancel <ref>")
|
|
1408
1442
|
.description("Cancel a project (target by uuid or unique name). Canceling also cancels its open " +
|
|
1409
1443
|
"to-dos, so an explicit --children policy is required; already-completed children " +
|
|
1410
|
-
"are never altered."
|
|
1411
|
-
|
|
1412
|
-
|
|
1444
|
+
"are never altered. --completed-at sets the completion timestamp and keeps the project " +
|
|
1445
|
+
"canceled via the certified flip legs (multi-leg, disclosed); it is refused while the " +
|
|
1446
|
+
"project still has open children.")
|
|
1447
|
+
.requiredOption("--children <policy>", "require-resolved (error if open to-dos remain) | auto-cancel (cancel them too)")
|
|
1448
|
+
.option("--completed-at <iso>", "completion timestamp (ISO date or datetime; a date is noon in the effective zone)")).action(async (uuid, opts) => {
|
|
1449
|
+
await runWrite(opts, (c) => c.write.cancelProject(uuid, {
|
|
1450
|
+
children: opts.children,
|
|
1451
|
+
...(opts["completedAt"] !== undefined && {
|
|
1452
|
+
completedAt: opts["completedAt"],
|
|
1453
|
+
}),
|
|
1454
|
+
}, writeOptionsFrom(opts)));
|
|
1413
1455
|
});
|
|
1414
1456
|
addWriteFlags(project
|
|
1415
1457
|
.command("reopen <ref>")
|
|
@@ -1475,9 +1517,16 @@ export function registerWriteCommands(program) {
|
|
|
1475
1517
|
addWriteFlags(project
|
|
1476
1518
|
.command("complete <ref>")
|
|
1477
1519
|
.description("Complete a project (target by uuid or unique name). Completing also completes its " +
|
|
1478
|
-
"open to-dos, so an explicit --children policy is required."
|
|
1479
|
-
|
|
1480
|
-
|
|
1520
|
+
"open to-dos, so an explicit --children policy is required. --completed-at sets the " +
|
|
1521
|
+
"completion timestamp and backdates it (multi-leg, disclosed).")
|
|
1522
|
+
.requiredOption("--children <policy>", "require-resolved (error if open to-dos remain) | auto-complete (complete them too)")
|
|
1523
|
+
.option("--completed-at <iso>", "completion timestamp (ISO date or datetime; a date is noon in the effective zone)")).action(async (uuid, opts) => {
|
|
1524
|
+
await runWrite(opts, (c) => c.write.completeProject(uuid, {
|
|
1525
|
+
children: opts.children,
|
|
1526
|
+
...(opts["completedAt"] !== undefined && {
|
|
1527
|
+
completedAt: opts["completedAt"],
|
|
1528
|
+
}),
|
|
1529
|
+
}, writeOptionsFrom(opts)));
|
|
1481
1530
|
});
|
|
1482
1531
|
addWriteFlags(project
|
|
1483
1532
|
.command("delete <ref>")
|
|
@@ -1817,33 +1866,30 @@ export function registerWriteCommands(program) {
|
|
|
1817
1866
|
client?.close();
|
|
1818
1867
|
}
|
|
1819
1868
|
});
|
|
1820
|
-
|
|
1869
|
+
addReorderPositionFlags(addDriveGuiFlag(addWriteFlags(program
|
|
1821
1870
|
.command("reorder <refs...>")
|
|
1822
|
-
.description("
|
|
1823
|
-
"
|
|
1824
|
-
"
|
|
1825
|
-
"
|
|
1826
|
-
"
|
|
1827
|
-
"
|
|
1828
|
-
"
|
|
1829
|
-
"
|
|
1830
|
-
"
|
|
1831
|
-
"
|
|
1832
|
-
"
|
|
1833
|
-
"
|
|
1834
|
-
"
|
|
1835
|
-
"
|
|
1836
|
-
"
|
|
1837
|
-
"
|
|
1838
|
-
|
|
1839
|
-
"
|
|
1840
|
-
"
|
|
1841
|
-
|
|
1842
|
-
"| upcoming | a day-block intermix both kinds. Reorder a project's headings with " +
|
|
1843
|
-
"`things project move-heading`."))).action(async (refs, opts) => {
|
|
1844
|
-
const position = movePosition(opts);
|
|
1871
|
+
.description("The ONE reorder verb — rearrange to-dos, projects, headings, OR sidebar areas IN " +
|
|
1872
|
+
"PLACE (REARRANGES, never changes membership; to change what an item belongs to use " +
|
|
1873
|
+
"`things todo move` / `things project move`). All operands must be ONE kind (only " +
|
|
1874
|
+
"to-dos and projects intermix, and only on the shared Today/Evening/day axes); a " +
|
|
1875
|
+
"mixed-kind set, a cross-container set, and a non-member anchor each fail closed with " +
|
|
1876
|
+
"one precise message. Argument order is the resulting order; unmentioned siblings " +
|
|
1877
|
+
"keep theirs. Bare (no position) assembles the named items as a block at the " +
|
|
1878
|
+
"EARLIEST one's current slot; --start/--end/--before/--after position the block. A " +
|
|
1879
|
+
"Today/Evening member also has an index slot in its container, so a set sharing BOTH " +
|
|
1880
|
+
"axes is ambiguous — pass --in to say which. HEADINGS: same-project heading " +
|
|
1881
|
+
"re-ranking runs the native heading-block wire; an archived heading is reorderable " +
|
|
1882
|
+
"but repositioning it brings it back to open (disclosed). AREAS: this drives the " +
|
|
1883
|
+
"local Things app (sidebar drag). `things area reorder` and `things project " +
|
|
1884
|
+
"move-heading` remain as kind-specific spellings.")
|
|
1885
|
+
.option("--in <target>", "to-dos/projects only — name the axis to reorder on: today | evening | anytime | " +
|
|
1886
|
+
"someday | inbox, a project/area/heading ref (uuid or unique title), upcoming (the " +
|
|
1887
|
+
"one future day the set shares), or a YYYY-MM-DD day-block. A stage-list or container " +
|
|
1888
|
+
"axis sorts one KIND at a time; only today | evening | upcoming | a day-block " +
|
|
1889
|
+
"intermix both kinds.")))).action(async (refs, opts) => {
|
|
1890
|
+
const position = reorderPosition(opts);
|
|
1845
1891
|
if (position === "conflict") {
|
|
1846
|
-
usageError(opts, "pass at most one of --
|
|
1892
|
+
usageError(opts, "pass at most one of --start / --end / --before / --after");
|
|
1847
1893
|
return;
|
|
1848
1894
|
}
|
|
1849
1895
|
const request = {
|
|
@@ -1851,7 +1897,7 @@ export function registerWriteCommands(program) {
|
|
|
1851
1897
|
...(position !== undefined && { position }),
|
|
1852
1898
|
...(opts["in"] !== undefined && { in: opts["in"] }),
|
|
1853
1899
|
};
|
|
1854
|
-
await runMoveCmd(opts, (c) => c.write.
|
|
1900
|
+
await runMoveCmd(opts, (c) => c.write.reorderAny(request, writeOptionsFrom(opts)));
|
|
1855
1901
|
});
|
|
1856
1902
|
program
|
|
1857
1903
|
.command("capabilities")
|