@robbeverhelst/do 1.69.0 → 1.70.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 +1 -1
- package/dist/do.js +82 -52
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ bunx @robbeverhelst/do today
|
|
|
16
16
|
|
|
17
17
|
The daily loop, all over `/api/v1` with an API key — no destructive verbs:
|
|
18
18
|
|
|
19
|
-
- `capture "<text> #tag !
|
|
19
|
+
- `capture "<text> #tag ! ~area"` — quick-add a task to the inbox (`!` stars it)
|
|
20
20
|
- `today` — actionable tasks (overdue / scheduled / due / in-progress)
|
|
21
21
|
- `task done <id>` — complete (idempotent)
|
|
22
22
|
- `task snooze <id> [--days N | --until <date>]` — reschedule
|
package/dist/do.js
CHANGED
|
@@ -2762,6 +2762,9 @@ class Index {
|
|
|
2762
2762
|
function index(name) {
|
|
2763
2763
|
return new IndexBuilderOn(false, name);
|
|
2764
2764
|
}
|
|
2765
|
+
function uniqueIndex(name) {
|
|
2766
|
+
return new IndexBuilderOn(true, name);
|
|
2767
|
+
}
|
|
2765
2768
|
|
|
2766
2769
|
// ../../node_modules/drizzle-orm/pg-core/primary-keys.js
|
|
2767
2770
|
function primaryKey(...config) {
|
|
@@ -4374,7 +4377,6 @@ var userSettings = pgTable("user_settings", {
|
|
|
4374
4377
|
|
|
4375
4378
|
// ../../packages/schema/src/db/domain.ts
|
|
4376
4379
|
var taskStatus = pgEnum("task_status", ["todo", "in_progress", "done", "cancelled"]);
|
|
4377
|
-
var taskPriority = pgEnum("task_priority", ["none", "low", "medium", "high"]);
|
|
4378
4380
|
var habitMeasurementType = pgEnum("habit_measurement_type", [
|
|
4379
4381
|
"binary",
|
|
4380
4382
|
"quantitative",
|
|
@@ -4398,7 +4400,7 @@ var tasks = pgTable("tasks", {
|
|
|
4398
4400
|
tenantId: text("tenant_id").notNull().references(() => tenants.id),
|
|
4399
4401
|
notes: text("notes"),
|
|
4400
4402
|
status: taskStatus("status").notNull().default("todo"),
|
|
4401
|
-
|
|
4403
|
+
starred: boolean("starred").notNull().default(false),
|
|
4402
4404
|
allDay: boolean("all_day").notNull().default(true),
|
|
4403
4405
|
scheduledAt: timestamp("scheduled_at", { withTimezone: true }),
|
|
4404
4406
|
startAt: timestamp("start_at", { withTimezone: true }),
|
|
@@ -4501,6 +4503,20 @@ var pushSubscriptions = pgTable("push_subscriptions", {
|
|
|
4501
4503
|
auth: text("auth").notNull(),
|
|
4502
4504
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
4503
4505
|
}, (t) => [unique("push_subscriptions_endpoint_uniq").on(t.endpoint)]);
|
|
4506
|
+
// ../../packages/schema/src/db/products.ts
|
|
4507
|
+
var products = pgTable("products", {
|
|
4508
|
+
id: text("id").primaryKey(),
|
|
4509
|
+
tenantId: text("tenant_id").notNull().references(() => tenants.id),
|
|
4510
|
+
name: text("name").notNull(),
|
|
4511
|
+
normalizedName: text("normalized_name").notNull(),
|
|
4512
|
+
category: text("category"),
|
|
4513
|
+
baseUnit: text("base_unit"),
|
|
4514
|
+
conversions: jsonb("conversions").$type().notNull().default({}),
|
|
4515
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
4516
|
+
}, (t) => [
|
|
4517
|
+
uniqueIndex("products_tenant_name_key").on(t.tenantId, t.normalizedName),
|
|
4518
|
+
index("products_tenant_idx").on(t.tenantId)
|
|
4519
|
+
]);
|
|
4504
4520
|
// ../../packages/schema/src/db/shopping.ts
|
|
4505
4521
|
var shoppingLists = pgTable("shopping_lists", {
|
|
4506
4522
|
id: text("id").primaryKey().references(() => nodes.id),
|
|
@@ -4520,6 +4536,7 @@ var shoppingItems = pgTable("shopping_items", {
|
|
|
4520
4536
|
tenantId: text("tenant_id").notNull().references(() => tenants.id),
|
|
4521
4537
|
listId: text("list_id").notNull().references(() => shoppingLists.id),
|
|
4522
4538
|
title: text("title").notNull(),
|
|
4539
|
+
productId: text("product_id").references(() => products.id),
|
|
4523
4540
|
quantity: doublePrecision("quantity"),
|
|
4524
4541
|
unit: text("unit"),
|
|
4525
4542
|
isChecked: boolean("is_checked").notNull().default(false),
|
|
@@ -4530,12 +4547,14 @@ var shoppingItems = pgTable("shopping_items", {
|
|
|
4530
4547
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
4531
4548
|
}, (t) => [
|
|
4532
4549
|
index("shopping_items_list_order_idx").on(t.listId, t.sortOrder),
|
|
4533
|
-
index("shopping_items_tenant_idx").on(t.tenantId)
|
|
4550
|
+
index("shopping_items_tenant_idx").on(t.tenantId),
|
|
4551
|
+
index("shopping_items_product_idx").on(t.productId)
|
|
4534
4552
|
]);
|
|
4535
4553
|
// ../../packages/schema/src/db/inventory.ts
|
|
4536
4554
|
var inventoryItems = pgTable("inventory_items", {
|
|
4537
4555
|
id: text("id").primaryKey().references(() => nodes.id),
|
|
4538
4556
|
tenantId: text("tenant_id").notNull().references(() => tenants.id),
|
|
4557
|
+
productId: text("product_id").references(() => products.id),
|
|
4539
4558
|
quantity: doublePrecision("quantity").notNull().default(0),
|
|
4540
4559
|
unit: text("unit"),
|
|
4541
4560
|
category: text("category"),
|
|
@@ -4545,7 +4564,8 @@ var inventoryItems = pgTable("inventory_items", {
|
|
|
4545
4564
|
notes: text("notes"),
|
|
4546
4565
|
facet: jsonb("facet").$type()
|
|
4547
4566
|
}, (t) => [
|
|
4548
|
-
index("inventory_items_tenant_idx").on(t.tenantId)
|
|
4567
|
+
index("inventory_items_tenant_idx").on(t.tenantId),
|
|
4568
|
+
index("inventory_items_product_idx").on(t.productId)
|
|
4549
4569
|
]);
|
|
4550
4570
|
// ../../packages/schema/src/db/collection.ts
|
|
4551
4571
|
var collectionItems = pgTable("collection_items", {
|
|
@@ -4597,13 +4617,15 @@ var recipeIngredients = pgTable("recipe_ingredients", {
|
|
|
4597
4617
|
tenantId: text("tenant_id").notNull().references(() => tenants.id),
|
|
4598
4618
|
recipeId: text("recipe_id").notNull().references(() => recipes.id),
|
|
4599
4619
|
name: text("name").notNull(),
|
|
4620
|
+
productId: text("product_id").references(() => products.id),
|
|
4600
4621
|
quantity: doublePrecision("quantity"),
|
|
4601
4622
|
unit: text("unit"),
|
|
4602
4623
|
sortOrder: integer("sort_order").notNull().default(0),
|
|
4603
4624
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
4604
4625
|
}, (t) => [
|
|
4605
4626
|
index("recipe_ingredients_recipe_order_idx").on(t.recipeId, t.sortOrder),
|
|
4606
|
-
index("recipe_ingredients_tenant_idx").on(t.tenantId)
|
|
4627
|
+
index("recipe_ingredients_tenant_idx").on(t.tenantId),
|
|
4628
|
+
index("recipe_ingredients_product_idx").on(t.productId)
|
|
4607
4629
|
]);
|
|
4608
4630
|
var mealPlans = pgTable("meal_plans", {
|
|
4609
4631
|
id: text("id").primaryKey().references(() => nodes.id),
|
|
@@ -19677,7 +19699,6 @@ var areaColorSchema = exports_external.enum(areaColor.enumValues);
|
|
|
19677
19699
|
var reviewCadenceSchema = exports_external.enum(reviewCadence.enumValues);
|
|
19678
19700
|
var projectStatusSchema = exports_external.enum(projectStatus.enumValues);
|
|
19679
19701
|
var taskStatusSchema = exports_external.enum(taskStatus.enumValues);
|
|
19680
|
-
var taskPrioritySchema = exports_external.enum(taskPriority.enumValues);
|
|
19681
19702
|
var routineKindSchema = exports_external.enum(routineKind.enumValues);
|
|
19682
19703
|
var routineStepRefSchema = exports_external.enum(routineStepRef.enumValues);
|
|
19683
19704
|
var routineRunStatusSchema = exports_external.enum(routineRunStatus.enumValues);
|
|
@@ -19790,7 +19811,7 @@ var updateTaskInputSchema = createUpdateSchema(tasks, {
|
|
|
19790
19811
|
title: exports_external.string().min(1).optional(),
|
|
19791
19812
|
parentId: ulidSchema.nullish()
|
|
19792
19813
|
}).strict();
|
|
19793
|
-
var taskListFilterSchema = exports_external.enum(["all", "unsorted"]);
|
|
19814
|
+
var taskListFilterSchema = exports_external.enum(["all", "unsorted", "starred"]);
|
|
19794
19815
|
// ../../packages/schema/src/contracts/habits.ts
|
|
19795
19816
|
var habitSchema = createSelectSchema(habits);
|
|
19796
19817
|
var habitEntrySchema = createSelectSchema(habitEntries, {
|
|
@@ -19822,12 +19843,17 @@ var createHabitEntryInputSchema = createInsertSchema(habitEntries, {
|
|
|
19822
19843
|
source: habitEntrySourceSchema.default("manual"),
|
|
19823
19844
|
occurredAt: exports_external.coerce.date().optional()
|
|
19824
19845
|
}).omit({ tenantId: true, habitId: true, createdAt: true });
|
|
19846
|
+
var habitStreakStateSchema = exports_external.enum(["active", "recovering", "broken"]);
|
|
19825
19847
|
var habitStreakSchema = exports_external.object({
|
|
19826
19848
|
current: exports_external.number().int().nonnegative(),
|
|
19827
19849
|
longest: exports_external.number().int().nonnegative(),
|
|
19828
19850
|
periodValue: exports_external.number(),
|
|
19829
19851
|
periodTarget: exports_external.number(),
|
|
19830
|
-
satisfiedToday: exports_external.boolean()
|
|
19852
|
+
satisfiedToday: exports_external.boolean(),
|
|
19853
|
+
completionRate: exports_external.number().min(0).max(1),
|
|
19854
|
+
state: habitStreakStateSchema,
|
|
19855
|
+
graceBudget: exports_external.number().int().nonnegative(),
|
|
19856
|
+
graceRemaining: exports_external.number().int().nonnegative()
|
|
19831
19857
|
});
|
|
19832
19858
|
var habitRoutineRefSchema = exports_external.object({
|
|
19833
19859
|
id: ulidSchema,
|
|
@@ -20142,7 +20168,7 @@ var FEATURE_MODULES = [
|
|
|
20142
20168
|
{
|
|
20143
20169
|
key: "tasks",
|
|
20144
20170
|
label: "Tasks",
|
|
20145
|
-
description: "To-dos, due dates, and
|
|
20171
|
+
description: "To-dos, due dates, and starred focus.",
|
|
20146
20172
|
group: "Track",
|
|
20147
20173
|
defaultEnabled: true
|
|
20148
20174
|
},
|
|
@@ -20335,6 +20361,19 @@ var reviewDayStatSchema = exports_external.object({
|
|
|
20335
20361
|
completedOccurrences: exports_external.number().int().nonnegative()
|
|
20336
20362
|
});
|
|
20337
20363
|
var reviewStatsSchema = exports_external.array(reviewDayStatSchema);
|
|
20364
|
+
// ../../packages/schema/src/contracts/products.ts
|
|
20365
|
+
var productConversionsSchema = exports_external.record(exports_external.string(), exports_external.number());
|
|
20366
|
+
var productSchema = createSelectSchema(products, {
|
|
20367
|
+
conversions: productConversionsSchema,
|
|
20368
|
+
createdAt: exports_external.coerce.date()
|
|
20369
|
+
});
|
|
20370
|
+
var createProductInputSchema = createInsertSchema(products, {
|
|
20371
|
+
id: ulidSchema,
|
|
20372
|
+
name: exports_external.string().min(1),
|
|
20373
|
+
category: exports_external.string().nullish(),
|
|
20374
|
+
baseUnit: exports_external.string().nullish(),
|
|
20375
|
+
conversions: productConversionsSchema.optional()
|
|
20376
|
+
}).omit({ tenantId: true, normalizedName: true, createdAt: true });
|
|
20338
20377
|
// ../../packages/schema/src/contracts/shopping.ts
|
|
20339
20378
|
var shoppingRecurrenceUnitSchema = exports_external.enum(["day", "week", "month"]);
|
|
20340
20379
|
var shoppingListSchema = createSelectSchema(shoppingLists, {
|
|
@@ -20354,6 +20393,7 @@ var shoppingItemSchema = createSelectSchema(shoppingItems, {
|
|
|
20354
20393
|
var shoppingItemInputSchema = createInsertSchema(shoppingItems, {
|
|
20355
20394
|
id: ulidSchema,
|
|
20356
20395
|
title: exports_external.string().min(1),
|
|
20396
|
+
productId: ulidSchema.nullish(),
|
|
20357
20397
|
quantity: exports_external.number().positive().nullish(),
|
|
20358
20398
|
unit: exports_external.string().nullish(),
|
|
20359
20399
|
isChecked: exports_external.boolean().optional(),
|
|
@@ -20519,6 +20559,7 @@ var inventoryItemSchema = createSelectSchema(inventoryItems, {
|
|
|
20519
20559
|
});
|
|
20520
20560
|
var createInventoryItemInputSchema = createInsertSchema(inventoryItems, {
|
|
20521
20561
|
id: ulidSchema,
|
|
20562
|
+
productId: ulidSchema.nullish(),
|
|
20522
20563
|
quantity: exports_external.number().min(0).optional(),
|
|
20523
20564
|
unit: exports_external.string().nullish(),
|
|
20524
20565
|
category: exports_external.string().nullish(),
|
|
@@ -20533,6 +20574,7 @@ var createInventoryItemInputSchema = createInsertSchema(inventoryItems, {
|
|
|
20533
20574
|
displayKind: inventoryDisplayKindSchema.optional()
|
|
20534
20575
|
});
|
|
20535
20576
|
var updateInventoryItemInputSchema = createUpdateSchema(inventoryItems, {
|
|
20577
|
+
productId: ulidSchema.nullish(),
|
|
20536
20578
|
quantity: exports_external.number().min(0).optional(),
|
|
20537
20579
|
unit: exports_external.string().nullish(),
|
|
20538
20580
|
category: exports_external.string().nullish(),
|
|
@@ -20644,6 +20686,7 @@ var recipeIngredientSchema = createSelectSchema(recipeIngredients, {
|
|
|
20644
20686
|
var recipeIngredientInputSchema = exports_external.object({
|
|
20645
20687
|
id: ulidSchema,
|
|
20646
20688
|
name: exports_external.string().min(1),
|
|
20689
|
+
productId: ulidSchema.nullish(),
|
|
20647
20690
|
quantity: exports_external.number().positive().nullish(),
|
|
20648
20691
|
unit: exports_external.string().nullish(),
|
|
20649
20692
|
sortOrder: exports_external.number().int().min(0).optional()
|
|
@@ -21617,13 +21660,12 @@ var automationConditionSchema = exports_external.object({
|
|
|
21617
21660
|
op: automationConditionOpSchema,
|
|
21618
21661
|
value: exports_external.unknown().optional()
|
|
21619
21662
|
}).strict();
|
|
21620
|
-
var automationTaskPrioritySchema = exports_external.enum(["none", "low", "medium", "high"]);
|
|
21621
21663
|
var automationActionSchema = exports_external.discriminatedUnion("type", [
|
|
21622
21664
|
exports_external.object({
|
|
21623
21665
|
type: exports_external.literal("create_task"),
|
|
21624
21666
|
title: exports_external.string().min(1).max(200),
|
|
21625
21667
|
notes: exports_external.string().max(2000).optional(),
|
|
21626
|
-
|
|
21668
|
+
starred: exports_external.boolean().optional()
|
|
21627
21669
|
}).strict(),
|
|
21628
21670
|
exports_external.object({ type: exports_external.literal("complete_task") }).strict(),
|
|
21629
21671
|
exports_external.object({
|
|
@@ -22017,20 +22059,8 @@ function addMonths(d, months) {
|
|
|
22017
22059
|
|
|
22018
22060
|
// ../../packages/schema/src/capture.ts
|
|
22019
22061
|
var TAG_RE = /(?:^|\s)#([\p{L}\p{N}][\p{L}\p{N}_-]*)/gu;
|
|
22020
|
-
var
|
|
22062
|
+
var STAR_RE = /(?:^|\s)!(star|flag|s|f)?(?=\s|$)/giu;
|
|
22021
22063
|
var AREA_RE = /(?:^|\s)~([\p{L}\p{N}][\p{L}\p{N}_-]*)/gu;
|
|
22022
|
-
var PRIORITY_ALIASES = {
|
|
22023
|
-
none: "none",
|
|
22024
|
-
n: "none",
|
|
22025
|
-
low: "low",
|
|
22026
|
-
l: "low",
|
|
22027
|
-
med: "medium",
|
|
22028
|
-
medium: "medium",
|
|
22029
|
-
m: "medium",
|
|
22030
|
-
high: "high",
|
|
22031
|
-
h: "high",
|
|
22032
|
-
hi: "high"
|
|
22033
|
-
};
|
|
22034
22064
|
function parseCapture(input, now) {
|
|
22035
22065
|
const tags = [];
|
|
22036
22066
|
for (const match of input.matchAll(TAG_RE)) {
|
|
@@ -22038,12 +22068,10 @@ function parseCapture(input, now) {
|
|
|
22038
22068
|
if (tag && !tags.includes(tag))
|
|
22039
22069
|
tags.push(tag);
|
|
22040
22070
|
}
|
|
22041
|
-
let
|
|
22042
|
-
for (const
|
|
22043
|
-
|
|
22044
|
-
|
|
22045
|
-
if (mapped)
|
|
22046
|
-
priority = mapped;
|
|
22071
|
+
let starred;
|
|
22072
|
+
for (const _ of input.matchAll(STAR_RE)) {
|
|
22073
|
+
starred = true;
|
|
22074
|
+
break;
|
|
22047
22075
|
}
|
|
22048
22076
|
let area;
|
|
22049
22077
|
for (const match of input.matchAll(AREA_RE)) {
|
|
@@ -22053,7 +22081,7 @@ function parseCapture(input, now) {
|
|
|
22053
22081
|
break;
|
|
22054
22082
|
}
|
|
22055
22083
|
}
|
|
22056
|
-
let stripped = blankMatches(input, [TAG_RE,
|
|
22084
|
+
let stripped = blankMatches(input, [TAG_RE, STAR_RE, AREA_RE]);
|
|
22057
22085
|
const when = now ? parseWhen(stripped, now) : undefined;
|
|
22058
22086
|
if (when) {
|
|
22059
22087
|
for (const span of [...when.spans].sort((a, b) => b.start - a.start)) {
|
|
@@ -22064,7 +22092,7 @@ function parseCapture(input, now) {
|
|
|
22064
22092
|
return {
|
|
22065
22093
|
title,
|
|
22066
22094
|
tags,
|
|
22067
|
-
...
|
|
22095
|
+
...starred ? { starred } : {},
|
|
22068
22096
|
...area ? { area } : {},
|
|
22069
22097
|
...when?.scheduledAt ? { scheduledAt: when.scheduledAt, allDay: when.allDay } : {},
|
|
22070
22098
|
...when?.recurrence ? { recurrence: when.recurrence } : {}
|
|
@@ -22554,7 +22582,7 @@ var automationPresets = [
|
|
|
22554
22582
|
name: "Low stock \u2192 add to groceries",
|
|
22555
22583
|
trigger: { entity: "inventory", action: "updated" },
|
|
22556
22584
|
condition: { path: "value.lowStock", op: "eq", value: true },
|
|
22557
|
-
action: { type: "create_task", title: "Restock low groceries"
|
|
22585
|
+
action: { type: "create_task", title: "Restock low groceries" }
|
|
22558
22586
|
}
|
|
22559
22587
|
]
|
|
22560
22588
|
}
|
|
@@ -22587,8 +22615,8 @@ var automationPresets = [
|
|
|
22587
22615
|
{
|
|
22588
22616
|
key: "auto-task-overdue-bump",
|
|
22589
22617
|
entity: "automation",
|
|
22590
|
-
name: "Task overdue \u2192
|
|
22591
|
-
description: "When a task goes overdue,
|
|
22618
|
+
name: "Task overdue \u2192 star a follow-up",
|
|
22619
|
+
description: "When a task goes overdue, create a starred follow-up.",
|
|
22592
22620
|
icon: "\u23F0",
|
|
22593
22621
|
color: "#f59e0b",
|
|
22594
22622
|
category: "Automations",
|
|
@@ -22597,10 +22625,10 @@ var automationPresets = [
|
|
|
22597
22625
|
{
|
|
22598
22626
|
ref: "automation",
|
|
22599
22627
|
kind: "automation",
|
|
22600
|
-
name: "Task overdue \u2192
|
|
22628
|
+
name: "Task overdue \u2192 star a follow-up",
|
|
22601
22629
|
trigger: { entity: "tasks", action: "updated" },
|
|
22602
22630
|
condition: { path: "value.overdue", op: "eq", value: true },
|
|
22603
|
-
action: { type: "create_task", title: "Reprioritise overdue task",
|
|
22631
|
+
action: { type: "create_task", title: "Reprioritise overdue task", starred: true }
|
|
22604
22632
|
}
|
|
22605
22633
|
]
|
|
22606
22634
|
}
|
|
@@ -22644,8 +22672,7 @@ var automationPresets = [
|
|
|
22644
22672
|
condition: { path: "value.status", op: "eq", value: "finished" },
|
|
22645
22673
|
action: {
|
|
22646
22674
|
type: "create_task",
|
|
22647
|
-
title: "Rate the book you just finished"
|
|
22648
|
-
priority: "low"
|
|
22675
|
+
title: "Rate the book you just finished"
|
|
22649
22676
|
}
|
|
22650
22677
|
}
|
|
22651
22678
|
]
|
|
@@ -24304,7 +24331,7 @@ function parseCapture2(input, now) {
|
|
|
24304
24331
|
|
|
24305
24332
|
// src/meta.ts
|
|
24306
24333
|
var CLI_NAME = "do";
|
|
24307
|
-
var VERSION = "1.
|
|
24334
|
+
var VERSION = "1.70.0";
|
|
24308
24335
|
var API_PREFIX = "/api/v1";
|
|
24309
24336
|
var DEFAULT_API_URL = "http://localhost:3001";
|
|
24310
24337
|
|
|
@@ -24832,14 +24859,18 @@ var COMMAND_SPECS = [
|
|
|
24832
24859
|
path: ["capture"],
|
|
24833
24860
|
summary: "Quick-add a task to the inbox from free text.",
|
|
24834
24861
|
args: [
|
|
24835
|
-
{
|
|
24862
|
+
{
|
|
24863
|
+
name: "text",
|
|
24864
|
+
required: true,
|
|
24865
|
+
description: "Task title; may embed #tag, ! (star) and ~area."
|
|
24866
|
+
}
|
|
24836
24867
|
],
|
|
24837
24868
|
flags: [],
|
|
24838
24869
|
scopes: ["tasks:write"],
|
|
24839
24870
|
returns: "Task",
|
|
24840
24871
|
grammar: {
|
|
24841
24872
|
"#tag": "Adds a tag. Repeatable: '#home #urgent'.",
|
|
24842
|
-
"!
|
|
24873
|
+
"!": "Stars the task \u2014 the 1\u20132 things that matter (aliases: !star/!s/!flag/!f). Drives Today's focus and the starred filter."
|
|
24843
24874
|
}
|
|
24844
24875
|
},
|
|
24845
24876
|
{
|
|
@@ -25430,10 +25461,10 @@ var STATUS_MARK = {
|
|
|
25430
25461
|
function renderTask(data, mode) {
|
|
25431
25462
|
const t = data;
|
|
25432
25463
|
const mark = STATUS_MARK[t.status ?? ""] ?? "\u2022";
|
|
25433
|
-
const
|
|
25464
|
+
const star = t.starred ? paint(mode, "yellow", "\u2605 ") : "";
|
|
25434
25465
|
const when2 = t.scheduledAt ?? t.dueAt;
|
|
25435
25466
|
const date6 = when2 ? paint(mode, "dim", ` (${shortDate(when2)})`) : "";
|
|
25436
|
-
return `${mark} ${
|
|
25467
|
+
return `${mark} ${star}${t.title ?? "(untitled)"}${date6}
|
|
25437
25468
|
${paint(mode, "dim", t.id)}`;
|
|
25438
25469
|
}
|
|
25439
25470
|
function renderToday(data, mode) {
|
|
@@ -25444,8 +25475,8 @@ function renderToday(data, mode) {
|
|
|
25444
25475
|
const header = paint(mode, "bold", `Today \xB7 ${result.date} \xB7 ${result.count} item(s)`);
|
|
25445
25476
|
const lines = result.items.map((item) => {
|
|
25446
25477
|
const tag = paint(mode, bucketColor(item.bucket), `[${item.bucket}]`);
|
|
25447
|
-
const
|
|
25448
|
-
return ` ${tag} ${item.title}${
|
|
25478
|
+
const star = item.starred ? paint(mode, "yellow", " \u2605") : "";
|
|
25479
|
+
return ` ${tag} ${item.title}${star} ${paint(mode, "dim", item.id)}`;
|
|
25449
25480
|
});
|
|
25450
25481
|
return [header, ...lines].join(`
|
|
25451
25482
|
`);
|
|
@@ -25571,7 +25602,6 @@ function shortDate(iso) {
|
|
|
25571
25602
|
|
|
25572
25603
|
// src/today.ts
|
|
25573
25604
|
var OPEN_STATUSES = new Set(["todo", "in_progress"]);
|
|
25574
|
-
var PRIORITY_RANK = { high: 0, medium: 1, low: 2, none: 3 };
|
|
25575
25605
|
function toDate(value) {
|
|
25576
25606
|
if (value == null)
|
|
25577
25607
|
return null;
|
|
@@ -25600,7 +25630,7 @@ function selectToday(tasks3, now) {
|
|
|
25600
25630
|
id: task.id,
|
|
25601
25631
|
title: task.title,
|
|
25602
25632
|
status: task.status,
|
|
25603
|
-
|
|
25633
|
+
starred: task.starred ?? false,
|
|
25604
25634
|
bucket,
|
|
25605
25635
|
scheduledAt: scheduled ? scheduled.toISOString() : null,
|
|
25606
25636
|
dueAt: due ? due.toISOString() : null
|
|
@@ -25631,9 +25661,9 @@ function compareItems(a, b) {
|
|
|
25631
25661
|
const byBucket = BUCKET_RANK[a.bucket] - BUCKET_RANK[b.bucket];
|
|
25632
25662
|
if (byBucket !== 0)
|
|
25633
25663
|
return byBucket;
|
|
25634
|
-
const
|
|
25635
|
-
if (
|
|
25636
|
-
return
|
|
25664
|
+
const byStar = Number(b.starred) - Number(a.starred);
|
|
25665
|
+
if (byStar !== 0)
|
|
25666
|
+
return byStar;
|
|
25637
25667
|
const at = a.scheduledAt ?? a.dueAt ?? "";
|
|
25638
25668
|
const bt = b.scheduledAt ?? b.dueAt ?? "";
|
|
25639
25669
|
return at.localeCompare(bt);
|
|
@@ -25730,7 +25760,7 @@ var HANDLERS = {
|
|
|
25730
25760
|
id,
|
|
25731
25761
|
title: parsed.title,
|
|
25732
25762
|
tags: parsed.tags,
|
|
25733
|
-
...parsed.
|
|
25763
|
+
...parsed.starred ? { starred: parsed.starred } : {},
|
|
25734
25764
|
...parsed.area ? { areaName: parsed.area } : {},
|
|
25735
25765
|
...parsed.scheduledAt ? { scheduledAt: parsed.scheduledAt, allDay: parsed.allDay } : {}
|
|
25736
25766
|
});
|