@robbeverhelst/do 1.68.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 +98 -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 }),
|
|
@@ -4447,6 +4449,7 @@ var recurrenceRules = pgTable("recurrence_rules", {
|
|
|
4447
4449
|
interval: integer("interval").notNull().default(1),
|
|
4448
4450
|
freq: recurrenceFreq("freq"),
|
|
4449
4451
|
byDay: text("by_day").array(),
|
|
4452
|
+
timeOfDay: text("time_of_day"),
|
|
4450
4453
|
until: timestamp("until", { withTimezone: true }),
|
|
4451
4454
|
count: integer("count"),
|
|
4452
4455
|
unit: recurrenceUnit("unit"),
|
|
@@ -4500,6 +4503,20 @@ var pushSubscriptions = pgTable("push_subscriptions", {
|
|
|
4500
4503
|
auth: text("auth").notNull(),
|
|
4501
4504
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
4502
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
|
+
]);
|
|
4503
4520
|
// ../../packages/schema/src/db/shopping.ts
|
|
4504
4521
|
var shoppingLists = pgTable("shopping_lists", {
|
|
4505
4522
|
id: text("id").primaryKey().references(() => nodes.id),
|
|
@@ -4519,6 +4536,7 @@ var shoppingItems = pgTable("shopping_items", {
|
|
|
4519
4536
|
tenantId: text("tenant_id").notNull().references(() => tenants.id),
|
|
4520
4537
|
listId: text("list_id").notNull().references(() => shoppingLists.id),
|
|
4521
4538
|
title: text("title").notNull(),
|
|
4539
|
+
productId: text("product_id").references(() => products.id),
|
|
4522
4540
|
quantity: doublePrecision("quantity"),
|
|
4523
4541
|
unit: text("unit"),
|
|
4524
4542
|
isChecked: boolean("is_checked").notNull().default(false),
|
|
@@ -4529,12 +4547,14 @@ var shoppingItems = pgTable("shopping_items", {
|
|
|
4529
4547
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
4530
4548
|
}, (t) => [
|
|
4531
4549
|
index("shopping_items_list_order_idx").on(t.listId, t.sortOrder),
|
|
4532
|
-
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)
|
|
4533
4552
|
]);
|
|
4534
4553
|
// ../../packages/schema/src/db/inventory.ts
|
|
4535
4554
|
var inventoryItems = pgTable("inventory_items", {
|
|
4536
4555
|
id: text("id").primaryKey().references(() => nodes.id),
|
|
4537
4556
|
tenantId: text("tenant_id").notNull().references(() => tenants.id),
|
|
4557
|
+
productId: text("product_id").references(() => products.id),
|
|
4538
4558
|
quantity: doublePrecision("quantity").notNull().default(0),
|
|
4539
4559
|
unit: text("unit"),
|
|
4540
4560
|
category: text("category"),
|
|
@@ -4544,7 +4564,8 @@ var inventoryItems = pgTable("inventory_items", {
|
|
|
4544
4564
|
notes: text("notes"),
|
|
4545
4565
|
facet: jsonb("facet").$type()
|
|
4546
4566
|
}, (t) => [
|
|
4547
|
-
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)
|
|
4548
4569
|
]);
|
|
4549
4570
|
// ../../packages/schema/src/db/collection.ts
|
|
4550
4571
|
var collectionItems = pgTable("collection_items", {
|
|
@@ -4596,13 +4617,15 @@ var recipeIngredients = pgTable("recipe_ingredients", {
|
|
|
4596
4617
|
tenantId: text("tenant_id").notNull().references(() => tenants.id),
|
|
4597
4618
|
recipeId: text("recipe_id").notNull().references(() => recipes.id),
|
|
4598
4619
|
name: text("name").notNull(),
|
|
4620
|
+
productId: text("product_id").references(() => products.id),
|
|
4599
4621
|
quantity: doublePrecision("quantity"),
|
|
4600
4622
|
unit: text("unit"),
|
|
4601
4623
|
sortOrder: integer("sort_order").notNull().default(0),
|
|
4602
4624
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
4603
4625
|
}, (t) => [
|
|
4604
4626
|
index("recipe_ingredients_recipe_order_idx").on(t.recipeId, t.sortOrder),
|
|
4605
|
-
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)
|
|
4606
4629
|
]);
|
|
4607
4630
|
var mealPlans = pgTable("meal_plans", {
|
|
4608
4631
|
id: text("id").primaryKey().references(() => nodes.id),
|
|
@@ -19676,7 +19699,6 @@ var areaColorSchema = exports_external.enum(areaColor.enumValues);
|
|
|
19676
19699
|
var reviewCadenceSchema = exports_external.enum(reviewCadence.enumValues);
|
|
19677
19700
|
var projectStatusSchema = exports_external.enum(projectStatus.enumValues);
|
|
19678
19701
|
var taskStatusSchema = exports_external.enum(taskStatus.enumValues);
|
|
19679
|
-
var taskPrioritySchema = exports_external.enum(taskPriority.enumValues);
|
|
19680
19702
|
var routineKindSchema = exports_external.enum(routineKind.enumValues);
|
|
19681
19703
|
var routineStepRefSchema = exports_external.enum(routineStepRef.enumValues);
|
|
19682
19704
|
var routineRunStatusSchema = exports_external.enum(routineRunStatus.enumValues);
|
|
@@ -19789,7 +19811,7 @@ var updateTaskInputSchema = createUpdateSchema(tasks, {
|
|
|
19789
19811
|
title: exports_external.string().min(1).optional(),
|
|
19790
19812
|
parentId: ulidSchema.nullish()
|
|
19791
19813
|
}).strict();
|
|
19792
|
-
var taskListFilterSchema = exports_external.enum(["all", "unsorted"]);
|
|
19814
|
+
var taskListFilterSchema = exports_external.enum(["all", "unsorted", "starred"]);
|
|
19793
19815
|
// ../../packages/schema/src/contracts/habits.ts
|
|
19794
19816
|
var habitSchema = createSelectSchema(habits);
|
|
19795
19817
|
var habitEntrySchema = createSelectSchema(habitEntries, {
|
|
@@ -19821,12 +19843,17 @@ var createHabitEntryInputSchema = createInsertSchema(habitEntries, {
|
|
|
19821
19843
|
source: habitEntrySourceSchema.default("manual"),
|
|
19822
19844
|
occurredAt: exports_external.coerce.date().optional()
|
|
19823
19845
|
}).omit({ tenantId: true, habitId: true, createdAt: true });
|
|
19846
|
+
var habitStreakStateSchema = exports_external.enum(["active", "recovering", "broken"]);
|
|
19824
19847
|
var habitStreakSchema = exports_external.object({
|
|
19825
19848
|
current: exports_external.number().int().nonnegative(),
|
|
19826
19849
|
longest: exports_external.number().int().nonnegative(),
|
|
19827
19850
|
periodValue: exports_external.number(),
|
|
19828
19851
|
periodTarget: exports_external.number(),
|
|
19829
|
-
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()
|
|
19830
19857
|
});
|
|
19831
19858
|
var habitRoutineRefSchema = exports_external.object({
|
|
19832
19859
|
id: ulidSchema,
|
|
@@ -19861,6 +19888,7 @@ var recurrenceRuleParams = {
|
|
|
19861
19888
|
timezone: exports_external.string().min(1).default("UTC"),
|
|
19862
19889
|
interval: exports_external.number().int().positive().default(1),
|
|
19863
19890
|
mode: recurrenceModeSchema,
|
|
19891
|
+
timeOfDay: exports_external.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/, "time-of-day must be HH:MM (24h)").nullish(),
|
|
19864
19892
|
freq: recurrenceFreqSchema.optional(),
|
|
19865
19893
|
byDay: exports_external.array(byDayCodeSchema).optional(),
|
|
19866
19894
|
until: exports_external.coerce.date().optional(),
|
|
@@ -20140,7 +20168,7 @@ var FEATURE_MODULES = [
|
|
|
20140
20168
|
{
|
|
20141
20169
|
key: "tasks",
|
|
20142
20170
|
label: "Tasks",
|
|
20143
|
-
description: "To-dos, due dates, and
|
|
20171
|
+
description: "To-dos, due dates, and starred focus.",
|
|
20144
20172
|
group: "Track",
|
|
20145
20173
|
defaultEnabled: true
|
|
20146
20174
|
},
|
|
@@ -20333,6 +20361,19 @@ var reviewDayStatSchema = exports_external.object({
|
|
|
20333
20361
|
completedOccurrences: exports_external.number().int().nonnegative()
|
|
20334
20362
|
});
|
|
20335
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 });
|
|
20336
20377
|
// ../../packages/schema/src/contracts/shopping.ts
|
|
20337
20378
|
var shoppingRecurrenceUnitSchema = exports_external.enum(["day", "week", "month"]);
|
|
20338
20379
|
var shoppingListSchema = createSelectSchema(shoppingLists, {
|
|
@@ -20352,6 +20393,7 @@ var shoppingItemSchema = createSelectSchema(shoppingItems, {
|
|
|
20352
20393
|
var shoppingItemInputSchema = createInsertSchema(shoppingItems, {
|
|
20353
20394
|
id: ulidSchema,
|
|
20354
20395
|
title: exports_external.string().min(1),
|
|
20396
|
+
productId: ulidSchema.nullish(),
|
|
20355
20397
|
quantity: exports_external.number().positive().nullish(),
|
|
20356
20398
|
unit: exports_external.string().nullish(),
|
|
20357
20399
|
isChecked: exports_external.boolean().optional(),
|
|
@@ -20517,6 +20559,7 @@ var inventoryItemSchema = createSelectSchema(inventoryItems, {
|
|
|
20517
20559
|
});
|
|
20518
20560
|
var createInventoryItemInputSchema = createInsertSchema(inventoryItems, {
|
|
20519
20561
|
id: ulidSchema,
|
|
20562
|
+
productId: ulidSchema.nullish(),
|
|
20520
20563
|
quantity: exports_external.number().min(0).optional(),
|
|
20521
20564
|
unit: exports_external.string().nullish(),
|
|
20522
20565
|
category: exports_external.string().nullish(),
|
|
@@ -20531,6 +20574,7 @@ var createInventoryItemInputSchema = createInsertSchema(inventoryItems, {
|
|
|
20531
20574
|
displayKind: inventoryDisplayKindSchema.optional()
|
|
20532
20575
|
});
|
|
20533
20576
|
var updateInventoryItemInputSchema = createUpdateSchema(inventoryItems, {
|
|
20577
|
+
productId: ulidSchema.nullish(),
|
|
20534
20578
|
quantity: exports_external.number().min(0).optional(),
|
|
20535
20579
|
unit: exports_external.string().nullish(),
|
|
20536
20580
|
category: exports_external.string().nullish(),
|
|
@@ -20642,6 +20686,7 @@ var recipeIngredientSchema = createSelectSchema(recipeIngredients, {
|
|
|
20642
20686
|
var recipeIngredientInputSchema = exports_external.object({
|
|
20643
20687
|
id: ulidSchema,
|
|
20644
20688
|
name: exports_external.string().min(1),
|
|
20689
|
+
productId: ulidSchema.nullish(),
|
|
20645
20690
|
quantity: exports_external.number().positive().nullish(),
|
|
20646
20691
|
unit: exports_external.string().nullish(),
|
|
20647
20692
|
sortOrder: exports_external.number().int().min(0).optional()
|
|
@@ -20722,6 +20767,20 @@ var generateGroceryListInputSchema = exports_external.object({
|
|
|
20722
20767
|
to: exports_external.coerce.date(),
|
|
20723
20768
|
deduplicateInventory: exports_external.boolean().optional()
|
|
20724
20769
|
}).strict();
|
|
20770
|
+
var cookedIngredientSchema = exports_external.object({
|
|
20771
|
+
name: exports_external.string(),
|
|
20772
|
+
unit: exports_external.string().nullable(),
|
|
20773
|
+
quantity: exports_external.number().nullable(),
|
|
20774
|
+
matched: exports_external.boolean(),
|
|
20775
|
+
remaining: exports_external.number().nullable()
|
|
20776
|
+
});
|
|
20777
|
+
var mealPlanCookResultSchema = exports_external.object({
|
|
20778
|
+
mealPlanId: ulidSchema,
|
|
20779
|
+
recipeId: ulidSchema.nullable(),
|
|
20780
|
+
servings: exports_external.number().int().nullable(),
|
|
20781
|
+
consumedCount: exports_external.number().int().min(0),
|
|
20782
|
+
ingredients: exports_external.array(cookedIngredientSchema)
|
|
20783
|
+
});
|
|
20725
20784
|
// ../../packages/schema/src/contracts/notes.ts
|
|
20726
20785
|
var noteSchema = createSelectSchema(notes);
|
|
20727
20786
|
var createNoteInputSchema = createInsertSchema(notes, {
|
|
@@ -21601,13 +21660,12 @@ var automationConditionSchema = exports_external.object({
|
|
|
21601
21660
|
op: automationConditionOpSchema,
|
|
21602
21661
|
value: exports_external.unknown().optional()
|
|
21603
21662
|
}).strict();
|
|
21604
|
-
var automationTaskPrioritySchema = exports_external.enum(["none", "low", "medium", "high"]);
|
|
21605
21663
|
var automationActionSchema = exports_external.discriminatedUnion("type", [
|
|
21606
21664
|
exports_external.object({
|
|
21607
21665
|
type: exports_external.literal("create_task"),
|
|
21608
21666
|
title: exports_external.string().min(1).max(200),
|
|
21609
21667
|
notes: exports_external.string().max(2000).optional(),
|
|
21610
|
-
|
|
21668
|
+
starred: exports_external.boolean().optional()
|
|
21611
21669
|
}).strict(),
|
|
21612
21670
|
exports_external.object({ type: exports_external.literal("complete_task") }).strict(),
|
|
21613
21671
|
exports_external.object({
|
|
@@ -22001,20 +22059,8 @@ function addMonths(d, months) {
|
|
|
22001
22059
|
|
|
22002
22060
|
// ../../packages/schema/src/capture.ts
|
|
22003
22061
|
var TAG_RE = /(?:^|\s)#([\p{L}\p{N}][\p{L}\p{N}_-]*)/gu;
|
|
22004
|
-
var
|
|
22062
|
+
var STAR_RE = /(?:^|\s)!(star|flag|s|f)?(?=\s|$)/giu;
|
|
22005
22063
|
var AREA_RE = /(?:^|\s)~([\p{L}\p{N}][\p{L}\p{N}_-]*)/gu;
|
|
22006
|
-
var PRIORITY_ALIASES = {
|
|
22007
|
-
none: "none",
|
|
22008
|
-
n: "none",
|
|
22009
|
-
low: "low",
|
|
22010
|
-
l: "low",
|
|
22011
|
-
med: "medium",
|
|
22012
|
-
medium: "medium",
|
|
22013
|
-
m: "medium",
|
|
22014
|
-
high: "high",
|
|
22015
|
-
h: "high",
|
|
22016
|
-
hi: "high"
|
|
22017
|
-
};
|
|
22018
22064
|
function parseCapture(input, now) {
|
|
22019
22065
|
const tags = [];
|
|
22020
22066
|
for (const match of input.matchAll(TAG_RE)) {
|
|
@@ -22022,12 +22068,10 @@ function parseCapture(input, now) {
|
|
|
22022
22068
|
if (tag && !tags.includes(tag))
|
|
22023
22069
|
tags.push(tag);
|
|
22024
22070
|
}
|
|
22025
|
-
let
|
|
22026
|
-
for (const
|
|
22027
|
-
|
|
22028
|
-
|
|
22029
|
-
if (mapped)
|
|
22030
|
-
priority = mapped;
|
|
22071
|
+
let starred;
|
|
22072
|
+
for (const _ of input.matchAll(STAR_RE)) {
|
|
22073
|
+
starred = true;
|
|
22074
|
+
break;
|
|
22031
22075
|
}
|
|
22032
22076
|
let area;
|
|
22033
22077
|
for (const match of input.matchAll(AREA_RE)) {
|
|
@@ -22037,7 +22081,7 @@ function parseCapture(input, now) {
|
|
|
22037
22081
|
break;
|
|
22038
22082
|
}
|
|
22039
22083
|
}
|
|
22040
|
-
let stripped = blankMatches(input, [TAG_RE,
|
|
22084
|
+
let stripped = blankMatches(input, [TAG_RE, STAR_RE, AREA_RE]);
|
|
22041
22085
|
const when = now ? parseWhen(stripped, now) : undefined;
|
|
22042
22086
|
if (when) {
|
|
22043
22087
|
for (const span of [...when.spans].sort((a, b) => b.start - a.start)) {
|
|
@@ -22048,7 +22092,7 @@ function parseCapture(input, now) {
|
|
|
22048
22092
|
return {
|
|
22049
22093
|
title,
|
|
22050
22094
|
tags,
|
|
22051
|
-
...
|
|
22095
|
+
...starred ? { starred } : {},
|
|
22052
22096
|
...area ? { area } : {},
|
|
22053
22097
|
...when?.scheduledAt ? { scheduledAt: when.scheduledAt, allDay: when.allDay } : {},
|
|
22054
22098
|
...when?.recurrence ? { recurrence: when.recurrence } : {}
|
|
@@ -22538,7 +22582,7 @@ var automationPresets = [
|
|
|
22538
22582
|
name: "Low stock \u2192 add to groceries",
|
|
22539
22583
|
trigger: { entity: "inventory", action: "updated" },
|
|
22540
22584
|
condition: { path: "value.lowStock", op: "eq", value: true },
|
|
22541
|
-
action: { type: "create_task", title: "Restock low groceries"
|
|
22585
|
+
action: { type: "create_task", title: "Restock low groceries" }
|
|
22542
22586
|
}
|
|
22543
22587
|
]
|
|
22544
22588
|
}
|
|
@@ -22571,8 +22615,8 @@ var automationPresets = [
|
|
|
22571
22615
|
{
|
|
22572
22616
|
key: "auto-task-overdue-bump",
|
|
22573
22617
|
entity: "automation",
|
|
22574
|
-
name: "Task overdue \u2192
|
|
22575
|
-
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.",
|
|
22576
22620
|
icon: "\u23F0",
|
|
22577
22621
|
color: "#f59e0b",
|
|
22578
22622
|
category: "Automations",
|
|
@@ -22581,10 +22625,10 @@ var automationPresets = [
|
|
|
22581
22625
|
{
|
|
22582
22626
|
ref: "automation",
|
|
22583
22627
|
kind: "automation",
|
|
22584
|
-
name: "Task overdue \u2192
|
|
22628
|
+
name: "Task overdue \u2192 star a follow-up",
|
|
22585
22629
|
trigger: { entity: "tasks", action: "updated" },
|
|
22586
22630
|
condition: { path: "value.overdue", op: "eq", value: true },
|
|
22587
|
-
action: { type: "create_task", title: "Reprioritise overdue task",
|
|
22631
|
+
action: { type: "create_task", title: "Reprioritise overdue task", starred: true }
|
|
22588
22632
|
}
|
|
22589
22633
|
]
|
|
22590
22634
|
}
|
|
@@ -22628,8 +22672,7 @@ var automationPresets = [
|
|
|
22628
22672
|
condition: { path: "value.status", op: "eq", value: "finished" },
|
|
22629
22673
|
action: {
|
|
22630
22674
|
type: "create_task",
|
|
22631
|
-
title: "Rate the book you just finished"
|
|
22632
|
-
priority: "low"
|
|
22675
|
+
title: "Rate the book you just finished"
|
|
22633
22676
|
}
|
|
22634
22677
|
}
|
|
22635
22678
|
]
|
|
@@ -24288,7 +24331,7 @@ function parseCapture2(input, now) {
|
|
|
24288
24331
|
|
|
24289
24332
|
// src/meta.ts
|
|
24290
24333
|
var CLI_NAME = "do";
|
|
24291
|
-
var VERSION = "1.
|
|
24334
|
+
var VERSION = "1.70.0";
|
|
24292
24335
|
var API_PREFIX = "/api/v1";
|
|
24293
24336
|
var DEFAULT_API_URL = "http://localhost:3001";
|
|
24294
24337
|
|
|
@@ -24816,14 +24859,18 @@ var COMMAND_SPECS = [
|
|
|
24816
24859
|
path: ["capture"],
|
|
24817
24860
|
summary: "Quick-add a task to the inbox from free text.",
|
|
24818
24861
|
args: [
|
|
24819
|
-
{
|
|
24862
|
+
{
|
|
24863
|
+
name: "text",
|
|
24864
|
+
required: true,
|
|
24865
|
+
description: "Task title; may embed #tag, ! (star) and ~area."
|
|
24866
|
+
}
|
|
24820
24867
|
],
|
|
24821
24868
|
flags: [],
|
|
24822
24869
|
scopes: ["tasks:write"],
|
|
24823
24870
|
returns: "Task",
|
|
24824
24871
|
grammar: {
|
|
24825
24872
|
"#tag": "Adds a tag. Repeatable: '#home #urgent'.",
|
|
24826
|
-
"!
|
|
24873
|
+
"!": "Stars the task \u2014 the 1\u20132 things that matter (aliases: !star/!s/!flag/!f). Drives Today's focus and the starred filter."
|
|
24827
24874
|
}
|
|
24828
24875
|
},
|
|
24829
24876
|
{
|
|
@@ -25414,10 +25461,10 @@ var STATUS_MARK = {
|
|
|
25414
25461
|
function renderTask(data, mode) {
|
|
25415
25462
|
const t = data;
|
|
25416
25463
|
const mark = STATUS_MARK[t.status ?? ""] ?? "\u2022";
|
|
25417
|
-
const
|
|
25464
|
+
const star = t.starred ? paint(mode, "yellow", "\u2605 ") : "";
|
|
25418
25465
|
const when2 = t.scheduledAt ?? t.dueAt;
|
|
25419
25466
|
const date6 = when2 ? paint(mode, "dim", ` (${shortDate(when2)})`) : "";
|
|
25420
|
-
return `${mark} ${
|
|
25467
|
+
return `${mark} ${star}${t.title ?? "(untitled)"}${date6}
|
|
25421
25468
|
${paint(mode, "dim", t.id)}`;
|
|
25422
25469
|
}
|
|
25423
25470
|
function renderToday(data, mode) {
|
|
@@ -25428,8 +25475,8 @@ function renderToday(data, mode) {
|
|
|
25428
25475
|
const header = paint(mode, "bold", `Today \xB7 ${result.date} \xB7 ${result.count} item(s)`);
|
|
25429
25476
|
const lines = result.items.map((item) => {
|
|
25430
25477
|
const tag = paint(mode, bucketColor(item.bucket), `[${item.bucket}]`);
|
|
25431
|
-
const
|
|
25432
|
-
return ` ${tag} ${item.title}${
|
|
25478
|
+
const star = item.starred ? paint(mode, "yellow", " \u2605") : "";
|
|
25479
|
+
return ` ${tag} ${item.title}${star} ${paint(mode, "dim", item.id)}`;
|
|
25433
25480
|
});
|
|
25434
25481
|
return [header, ...lines].join(`
|
|
25435
25482
|
`);
|
|
@@ -25555,7 +25602,6 @@ function shortDate(iso) {
|
|
|
25555
25602
|
|
|
25556
25603
|
// src/today.ts
|
|
25557
25604
|
var OPEN_STATUSES = new Set(["todo", "in_progress"]);
|
|
25558
|
-
var PRIORITY_RANK = { high: 0, medium: 1, low: 2, none: 3 };
|
|
25559
25605
|
function toDate(value) {
|
|
25560
25606
|
if (value == null)
|
|
25561
25607
|
return null;
|
|
@@ -25584,7 +25630,7 @@ function selectToday(tasks3, now) {
|
|
|
25584
25630
|
id: task.id,
|
|
25585
25631
|
title: task.title,
|
|
25586
25632
|
status: task.status,
|
|
25587
|
-
|
|
25633
|
+
starred: task.starred ?? false,
|
|
25588
25634
|
bucket,
|
|
25589
25635
|
scheduledAt: scheduled ? scheduled.toISOString() : null,
|
|
25590
25636
|
dueAt: due ? due.toISOString() : null
|
|
@@ -25615,9 +25661,9 @@ function compareItems(a, b) {
|
|
|
25615
25661
|
const byBucket = BUCKET_RANK[a.bucket] - BUCKET_RANK[b.bucket];
|
|
25616
25662
|
if (byBucket !== 0)
|
|
25617
25663
|
return byBucket;
|
|
25618
|
-
const
|
|
25619
|
-
if (
|
|
25620
|
-
return
|
|
25664
|
+
const byStar = Number(b.starred) - Number(a.starred);
|
|
25665
|
+
if (byStar !== 0)
|
|
25666
|
+
return byStar;
|
|
25621
25667
|
const at = a.scheduledAt ?? a.dueAt ?? "";
|
|
25622
25668
|
const bt = b.scheduledAt ?? b.dueAt ?? "";
|
|
25623
25669
|
return at.localeCompare(bt);
|
|
@@ -25714,7 +25760,7 @@ var HANDLERS = {
|
|
|
25714
25760
|
id,
|
|
25715
25761
|
title: parsed.title,
|
|
25716
25762
|
tags: parsed.tags,
|
|
25717
|
-
...parsed.
|
|
25763
|
+
...parsed.starred ? { starred: parsed.starred } : {},
|
|
25718
25764
|
...parsed.area ? { areaName: parsed.area } : {},
|
|
25719
25765
|
...parsed.scheduledAt ? { scheduledAt: parsed.scheduledAt, allDay: parsed.allDay } : {}
|
|
25720
25766
|
});
|