@robbeverhelst/do 1.29.0 → 1.31.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.
Files changed (2) hide show
  1. package/dist/do.js +835 -686
  2. package/package.json +1 -1
package/dist/do.js CHANGED
@@ -4517,6 +4517,7 @@ var shoppingItems = pgTable("shopping_items", {
4517
4517
  isChecked: boolean("is_checked").notNull().default(false),
4518
4518
  sortOrder: integer("sort_order").notNull().default(0),
4519
4519
  notes: text("notes"),
4520
+ facet: jsonb("facet").$type(),
4520
4521
  createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow()
4521
4522
  }, (t) => [
4522
4523
  index("shopping_items_list_order_idx").on(t.listId, t.sortOrder),
@@ -19580,6 +19581,14 @@ var linkGoogleInputSchema = exports_external.object({
19580
19581
  code: exports_external.string().min(1),
19581
19582
  state: exports_external.string().min(1)
19582
19583
  });
19584
+ // ../../packages/schema/src/contracts/books.ts
19585
+ var bookCoverQuerySchema = exports_external.object({
19586
+ title: exports_external.string().min(1).max(300)
19587
+ });
19588
+ var bookCoverResultSchema = exports_external.object({
19589
+ coverUrl: exports_external.string().url().nullable(),
19590
+ author: exports_external.string().nullable()
19591
+ });
19583
19592
  // ../../packages/schema/src/contracts/tasks.ts
19584
19593
  var taskSchema = createSelectSchema(tasks, {
19585
19594
  scheduledAt: exports_external.coerce.date().nullable(),
@@ -20013,8 +20022,10 @@ var reviewDayStatSchema = exports_external.object({
20013
20022
  var reviewStatsSchema = exports_external.array(reviewDayStatSchema);
20014
20023
  // ../../packages/schema/src/contracts/shopping.ts
20015
20024
  var shoppingListSchema = createSelectSchema(shoppingLists);
20025
+ var itemFacetSchema = exports_external.record(exports_external.string(), exports_external.unknown());
20016
20026
  var shoppingItemSchema = createSelectSchema(shoppingItems, {
20017
- createdAt: exports_external.coerce.date()
20027
+ createdAt: exports_external.coerce.date(),
20028
+ facet: itemFacetSchema.nullable()
20018
20029
  });
20019
20030
  var shoppingItemInputSchema = exports_external.object({
20020
20031
  id: ulidSchema,
@@ -20023,13 +20034,15 @@ var shoppingItemInputSchema = exports_external.object({
20023
20034
  unit: exports_external.string().nullish(),
20024
20035
  isChecked: exports_external.boolean().optional(),
20025
20036
  sortOrder: exports_external.number().int().min(0).optional(),
20026
- notes: exports_external.string().nullish()
20037
+ notes: exports_external.string().nullish(),
20038
+ facet: itemFacetSchema.nullish()
20027
20039
  });
20028
20040
  var createShoppingListInputSchema = exports_external.object({
20029
20041
  id: ulidSchema,
20030
20042
  title: exports_external.string().min(1),
20031
20043
  parentId: ulidSchema.nullish(),
20032
20044
  notes: exports_external.string().nullish(),
20045
+ displayKind: exports_external.string().min(1).optional(),
20033
20046
  items: exports_external.array(shoppingItemInputSchema).optional()
20034
20047
  });
20035
20048
  var updateShoppingListInputSchema = exports_external.object({
@@ -20041,6 +20054,7 @@ var updateShoppingListInputSchema = exports_external.object({
20041
20054
  var shoppingListViewSchema = shoppingListSchema.extend({
20042
20055
  title: exports_external.string(),
20043
20056
  parentId: ulidSchema.nullable(),
20057
+ displayKind: exports_external.string(),
20044
20058
  createdAt: exports_external.coerce.date(),
20045
20059
  updatedAt: exports_external.coerce.date(),
20046
20060
  deletedAt: exports_external.coerce.date().nullable(),
@@ -21062,11 +21076,25 @@ function parseCapture(input) {
21062
21076
  const title = input.replace(TAG_RE, " ").replace(PRIORITY_RE, " ").replace(AREA_RE, " ").replace(/\s+/g, " ").trim();
21063
21077
  return { title, tags, ...priority ? { priority } : {}, ...area ? { area } : {} };
21064
21078
  }
21079
+ // ../../packages/schema/src/presets/facets.ts
21080
+ var MEDIA_SHELF_DISPLAY_KIND = "media-shelf";
21081
+ var bookStatusValues = ["to-read", "reading", "read"];
21082
+ var bookStatusSchema = exports_external.enum(bookStatusValues);
21083
+ var mediaShelfFacetSchema = exports_external.object({
21084
+ author: exports_external.string().min(1).max(200).nullish(),
21085
+ coverUrl: exports_external.string().url().max(2048).nullish(),
21086
+ status: bookStatusSchema.default("to-read"),
21087
+ rating: exports_external.number().int().min(1).max(5).nullish()
21088
+ }).strict();
21089
+ var facetSchemasByDisplayKind = {
21090
+ [MEDIA_SHELF_DISPLAY_KIND]: mediaShelfFacetSchema
21091
+ };
21065
21092
  // ../../packages/schema/src/presets/recipe.ts
21066
21093
  var presetEntitySchema = exports_external.enum([
21067
21094
  "habit",
21068
21095
  "list",
21069
21096
  "inventory",
21097
+ "library",
21070
21098
  "routine",
21071
21099
  "area",
21072
21100
  "project",
@@ -21093,13 +21121,15 @@ var recipeShoppingItemSchema = exports_external.object({
21093
21121
  title: exports_external.string().min(1),
21094
21122
  quantity: exports_external.number().positive().nullish(),
21095
21123
  unit: exports_external.string().min(1).nullish(),
21096
- notes: exports_external.string().min(1).nullish()
21124
+ notes: exports_external.string().min(1).nullish(),
21125
+ facet: itemFacetSchema.nullish()
21097
21126
  });
21098
21127
  var recipeShoppingListNodeSchema = exports_external.object({
21099
21128
  ...recipeNodeBase,
21100
21129
  kind: exports_external.literal("shopping_list"),
21101
21130
  title: exports_external.string().min(1),
21102
21131
  notes: exports_external.string().min(1).nullish(),
21132
+ displayKind: exports_external.string().min(1).optional(),
21103
21133
  items: exports_external.array(recipeShoppingItemSchema).optional()
21104
21134
  });
21105
21135
  var recipeInventoryNodeSchema = exports_external.object({
@@ -21218,252 +21248,671 @@ var presetInstallResultSchema = exports_external.object({
21218
21248
  nodeCount: exports_external.number().int().nonnegative()
21219
21249
  });
21220
21250
  var MS_PER_DAY = 24 * 60 * 60 * 1000;
21221
- // ../../packages/schema/src/presets/catalog.ts
21222
- var habitPresets = [
21251
+ // ../../packages/schema/src/presets/features/areas.ts
21252
+ var areaBundleDefs = [
21223
21253
  {
21224
- key: "drink-water",
21225
- entity: "habit",
21226
- name: "Drink Water",
21227
- description: "Stay hydrated \u2014 8 glasses a day.",
21228
- icon: "\uD83D\uDCA7",
21254
+ key: "life-setup",
21255
+ name: "Life Setup",
21256
+ description: "Nine areas of responsibility to organise your whole life.",
21257
+ icon: "\uD83C\uDF31",
21258
+ color: "#34d399",
21259
+ areas: [
21260
+ { title: "Health", color: "green", icon: "heart-pulse" },
21261
+ { title: "Finances", color: "amber", icon: "wallet" },
21262
+ { title: "Career", color: "blue", icon: "briefcase" },
21263
+ { title: "Relationships", color: "rose", icon: "users" },
21264
+ { title: "Home", color: "teal", icon: "house" },
21265
+ { title: "Personal Growth", color: "purple", icon: "sprout" },
21266
+ { title: "Recreation", color: "amber", icon: "gamepad-2" },
21267
+ { title: "Admin", color: "slate", icon: "file-text" },
21268
+ { title: "Community", color: "red", icon: "hand-heart" }
21269
+ ]
21270
+ },
21271
+ {
21272
+ key: "student-life",
21273
+ name: "Student Life",
21274
+ description: "Keep coursework, exams and the rest of life in balance.",
21275
+ icon: "\uD83C\uDF93",
21229
21276
  color: "#38bdf8",
21230
- category: "Health",
21231
- displayKind: "water-cup",
21232
- featured: true,
21233
- recipe: {
21234
- nodes: [
21235
- {
21236
- ref: "habit",
21237
- kind: "habit",
21238
- title: "Drink Water",
21239
- measurementType: "quantitative",
21240
- targetValue: 8,
21241
- targetUnit: "glasses",
21242
- period: "day"
21243
- }
21244
- ]
21245
- }
21277
+ areas: [
21278
+ { title: "Coursework", color: "blue", icon: "book-open" },
21279
+ { title: "Exams", color: "red", icon: "graduation-cap" },
21280
+ { title: "Finances", color: "amber", icon: "wallet" },
21281
+ { title: "Social", color: "rose", icon: "users" },
21282
+ { title: "Health", color: "green", icon: "heart-pulse" },
21283
+ { title: "Career Prep", color: "purple", icon: "briefcase" }
21284
+ ]
21246
21285
  },
21247
21286
  {
21248
- key: "meditate",
21249
- entity: "habit",
21250
- name: "Meditate",
21251
- description: "A daily 10-minute sit.",
21252
- icon: "\uD83E\uDDD8",
21287
+ key: "founder",
21288
+ name: "Founder",
21289
+ description: "The hats a founder wears, as areas to steward.",
21290
+ icon: "\uD83D\uDE80",
21253
21291
  color: "#a78bfa",
21254
- category: "Mindfulness",
21292
+ areas: [
21293
+ { title: "Product", color: "purple", icon: "box" },
21294
+ { title: "Sales", color: "green", icon: "trending-up" },
21295
+ { title: "Fundraising", color: "amber", icon: "banknote" },
21296
+ { title: "Team", color: "blue", icon: "users" },
21297
+ { title: "Finances", color: "slate", icon: "wallet" },
21298
+ { title: "Personal", color: "rose", icon: "heart" }
21299
+ ]
21300
+ },
21301
+ {
21302
+ key: "new-parent",
21303
+ name: "New Parent",
21304
+ description: "Stay on top of life with a newborn.",
21305
+ icon: "\uD83C\uDF7C",
21306
+ color: "#f472b6",
21307
+ areas: [
21308
+ { title: "Baby Care", color: "rose", icon: "baby" },
21309
+ { title: "Health", color: "green", icon: "heart-pulse" },
21310
+ { title: "Home", color: "teal", icon: "house" },
21311
+ { title: "Finances", color: "amber", icon: "wallet" },
21312
+ { title: "Relationship", color: "purple", icon: "heart" },
21313
+ { title: "Self-care", color: "blue", icon: "sparkles" }
21314
+ ]
21315
+ }
21316
+ ];
21317
+ var areaPresets = areaBundleDefs.map((def) => ({
21318
+ key: def.key,
21319
+ entity: "area",
21320
+ name: def.name,
21321
+ description: def.description,
21322
+ icon: def.icon,
21323
+ color: def.color,
21324
+ category: "Life Setup",
21325
+ featured: def.key === "life-setup",
21326
+ recipe: {
21327
+ nodes: def.areas.map((area, index2) => ({
21328
+ ref: `area-${index2}`,
21329
+ kind: "area",
21330
+ title: area.title,
21331
+ color: area.color,
21332
+ icon: area.icon
21333
+ }))
21334
+ }
21335
+ }));
21336
+
21337
+ // ../../packages/schema/src/presets/features/automations.ts
21338
+ var automationPresets = [
21339
+ {
21340
+ key: "auto-low-stock-groceries",
21341
+ entity: "automation",
21342
+ name: "Low stock \u2192 add to groceries",
21343
+ description: "When an inventory item runs low, make a task to restock it.",
21344
+ icon: "\uD83E\uDD6B",
21345
+ color: "#34d399",
21346
+ category: "Automations",
21255
21347
  recipe: {
21256
21348
  nodes: [
21257
21349
  {
21258
- ref: "habit",
21259
- kind: "habit",
21260
- title: "Meditate",
21261
- measurementType: "duration",
21262
- targetValue: 10,
21263
- targetUnit: "min",
21264
- period: "day"
21350
+ ref: "automation",
21351
+ kind: "automation",
21352
+ name: "Low stock \u2192 add to groceries",
21353
+ trigger: { entity: "inventory", action: "updated" },
21354
+ condition: { path: "value.lowStock", op: "eq", value: true },
21355
+ action: { type: "create_task", title: "Restock low groceries", priority: "medium" }
21265
21356
  }
21266
21357
  ]
21267
21358
  }
21268
21359
  },
21269
21360
  {
21270
- key: "steps",
21271
- entity: "habit",
21272
- name: "Steps",
21273
- description: "Hit 10,000 steps a day.",
21274
- icon: "\uD83D\uDC5F",
21275
- color: "#34d399",
21276
- category: "Fitness",
21361
+ key: "auto-habit-missed-nudge",
21362
+ entity: "automation",
21363
+ name: "Habit missed 3\xD7 \u2192 nudge",
21364
+ description: "Get a gentle nudge when you miss a habit three times.",
21365
+ icon: "\uD83D\uDD14",
21366
+ color: "#fb7185",
21367
+ category: "Automations",
21277
21368
  recipe: {
21278
21369
  nodes: [
21279
21370
  {
21280
- ref: "habit",
21281
- kind: "habit",
21282
- title: "Steps",
21283
- measurementType: "quantitative",
21284
- targetValue: 1e4,
21285
- targetUnit: "steps",
21286
- period: "day"
21371
+ ref: "automation",
21372
+ kind: "automation",
21373
+ name: "Habit missed 3\xD7 \u2192 nudge",
21374
+ trigger: { entity: "habits", action: "updated" },
21375
+ condition: { path: "value.missedStreak", op: "eq", value: 3 },
21376
+ action: {
21377
+ type: "notify",
21378
+ title: "Don't break the chain",
21379
+ body: "You've missed this habit three times \u2014 jump back in today."
21380
+ }
21287
21381
  }
21288
21382
  ]
21289
21383
  }
21290
21384
  },
21291
21385
  {
21292
- key: "read",
21293
- entity: "habit",
21294
- name: "Read",
21295
- description: "Read for 30 minutes a day.",
21296
- icon: "\uD83D\uDCD6",
21386
+ key: "auto-task-overdue-bump",
21387
+ entity: "automation",
21388
+ name: "Task overdue \u2192 bump priority",
21389
+ description: "When a task goes overdue, raise a high-priority follow-up.",
21390
+ icon: "\u23F0",
21297
21391
  color: "#f59e0b",
21298
- category: "Growth",
21392
+ category: "Automations",
21299
21393
  recipe: {
21300
21394
  nodes: [
21301
21395
  {
21302
- ref: "habit",
21303
- kind: "habit",
21304
- title: "Read",
21305
- measurementType: "duration",
21306
- targetValue: 30,
21307
- targetUnit: "min",
21308
- period: "day"
21396
+ ref: "automation",
21397
+ kind: "automation",
21398
+ name: "Task overdue \u2192 bump priority",
21399
+ trigger: { entity: "tasks", action: "updated" },
21400
+ condition: { path: "value.overdue", op: "eq", value: true },
21401
+ action: { type: "create_task", title: "Reprioritise overdue task", priority: "high" }
21309
21402
  }
21310
21403
  ]
21311
21404
  }
21312
21405
  },
21313
21406
  {
21314
- key: "stretch",
21315
- entity: "habit",
21316
- name: "Stretch",
21317
- description: "Loosen up once a day.",
21318
- icon: "\uD83E\uDD38",
21407
+ key: "auto-weekly-review",
21408
+ entity: "automation",
21409
+ name: "Weekly review reminder",
21410
+ description: "Reschedule your weekly review a week out each time you finish it.",
21411
+ icon: "\uD83D\uDDD3\uFE0F",
21319
21412
  color: "#34d399",
21320
- category: "Fitness",
21413
+ category: "Automations",
21321
21414
  recipe: {
21322
21415
  nodes: [
21323
- { ref: "habit", kind: "habit", title: "Stretch", measurementType: "binary", period: "day" }
21416
+ {
21417
+ ref: "automation",
21418
+ kind: "automation",
21419
+ name: "Weekly review reminder",
21420
+ trigger: { entity: "tasks", action: "updated" },
21421
+ condition: { path: "value.title", op: "contains", value: "Weekly Review" },
21422
+ action: { type: "schedule_task", offsetMinutes: 10080 }
21423
+ }
21324
21424
  ]
21325
21425
  }
21326
21426
  },
21327
21427
  {
21328
- key: "workout",
21329
- entity: "habit",
21330
- name: "Workout",
21331
- description: "Train three times a week.",
21332
- icon: "\uD83C\uDFCB\uFE0F",
21333
- color: "#fb7185",
21334
- category: "Fitness",
21428
+ key: "auto-finished-book-rate",
21429
+ entity: "automation",
21430
+ name: "Finished book \u2192 rate it",
21431
+ description: "When you finish a book, make a task to rate it.",
21432
+ icon: "\uD83D\uDCDA",
21433
+ color: "#f59e0b",
21434
+ category: "Automations",
21335
21435
  recipe: {
21336
21436
  nodes: [
21337
21437
  {
21338
- ref: "habit",
21339
- kind: "habit",
21340
- title: "Workout",
21341
- measurementType: "binary",
21342
- period: "week",
21343
- frequencyCount: 3
21438
+ ref: "automation",
21439
+ kind: "automation",
21440
+ name: "Finished book \u2192 rate it",
21441
+ trigger: { entity: "books", action: "updated" },
21442
+ condition: { path: "value.status", op: "eq", value: "finished" },
21443
+ action: {
21444
+ type: "create_task",
21445
+ title: "Rate the book you just finished",
21446
+ priority: "low"
21447
+ }
21344
21448
  }
21345
21449
  ]
21346
21450
  }
21347
- },
21451
+ }
21452
+ ];
21453
+
21454
+ // ../../packages/schema/src/presets/features/challenges.ts
21455
+ var challengePresetDefs = [
21348
21456
  {
21349
- key: "vitamins",
21457
+ key: "challenge-75-hard",
21458
+ name: "75 Hard",
21459
+ description: "75 days of two workouts, water, reading and a clean diet.",
21460
+ icon: "\uD83D\uDD25",
21461
+ color: "#fb7185",
21462
+ metric: "habits.checked_in",
21463
+ target: 75,
21464
+ durationDays: 75
21465
+ },
21466
+ {
21467
+ key: "challenge-no-sugar",
21468
+ name: "30-Day No Sugar",
21469
+ description: "Cut added sugar for 30 days.",
21470
+ icon: "\uD83C\uDF6D",
21471
+ color: "#f472b6",
21472
+ metric: "habits.checked_in",
21473
+ target: 30,
21474
+ durationDays: 30
21475
+ },
21476
+ {
21477
+ key: "challenge-couch-to-5k",
21478
+ name: "Couch-to-5K",
21479
+ description: "Run your first 5K in nine weeks.",
21480
+ icon: "\uD83C\uDFC3",
21481
+ color: "#34d399",
21482
+ metric: "habits.checked_in",
21483
+ target: 27,
21484
+ durationDays: 63
21485
+ },
21486
+ {
21487
+ key: "challenge-dry-january",
21488
+ name: "Dry January",
21489
+ description: "An alcohol-free month to reset.",
21490
+ icon: "\uD83D\uDEAB",
21491
+ color: "#38bdf8",
21492
+ metric: "habits.checked_in",
21493
+ target: 31,
21494
+ durationDays: 31
21495
+ },
21496
+ {
21497
+ key: "challenge-meditation",
21498
+ name: "31-Day Meditation",
21499
+ description: "Sit every day for a month.",
21500
+ icon: "\uD83E\uDDD8",
21501
+ color: "#a78bfa",
21502
+ metric: "habits.checked_in",
21503
+ target: 31,
21504
+ durationDays: 31
21505
+ },
21506
+ {
21507
+ key: "challenge-no-spend",
21508
+ name: "No-Spend Month",
21509
+ description: "Thirty days of buying only the essentials.",
21510
+ icon: "\uD83D\uDCB8",
21511
+ color: "#f59e0b",
21512
+ metric: "habits.checked_in",
21513
+ target: 30,
21514
+ durationDays: 30
21515
+ }
21516
+ ];
21517
+ var challengePresets = challengePresetDefs.map((def) => ({
21518
+ key: def.key,
21519
+ entity: "challenge",
21520
+ name: def.name,
21521
+ description: def.description,
21522
+ icon: def.icon,
21523
+ color: def.color,
21524
+ category: "Challenges",
21525
+ featured: def.key === "challenge-couch-to-5k",
21526
+ recipe: {
21527
+ nodes: [
21528
+ {
21529
+ ref: "challenge",
21530
+ kind: "challenge",
21531
+ title: def.name,
21532
+ description: def.description,
21533
+ metric: def.metric,
21534
+ target: def.target,
21535
+ durationDays: def.durationDays
21536
+ }
21537
+ ]
21538
+ }
21539
+ }));
21540
+
21541
+ // ../../packages/schema/src/presets/features/contacts.ts
21542
+ var contactCircleDefs = [
21543
+ {
21544
+ key: "inner-circle",
21545
+ name: "Inner Circle",
21546
+ description: "The people you check in with weekly.",
21547
+ cadence: "every week",
21548
+ tag: "1w"
21549
+ },
21550
+ {
21551
+ key: "close-friends",
21552
+ name: "Close Friends",
21553
+ description: "Friends worth a message every couple of weeks.",
21554
+ cadence: "every 2 weeks",
21555
+ tag: "2w"
21556
+ },
21557
+ {
21558
+ key: "keep-warm",
21559
+ name: "Keep Warm",
21560
+ description: "People to keep warm with a monthly hello.",
21561
+ cadence: "every month",
21562
+ tag: "1m"
21563
+ },
21564
+ {
21565
+ key: "network",
21566
+ name: "Network",
21567
+ description: "Professional contacts to touch base with quarterly.",
21568
+ cadence: "every 3 months",
21569
+ tag: "3m"
21570
+ },
21571
+ {
21572
+ key: "birthday-only",
21573
+ name: "Birthday Only",
21574
+ description: "People you reach out to on their birthday.",
21575
+ cadence: "on their birthday",
21576
+ tag: "birthday"
21577
+ }
21578
+ ];
21579
+ var contactPresets = contactCircleDefs.map((def) => ({
21580
+ key: def.key,
21581
+ entity: "contact",
21582
+ name: def.name,
21583
+ description: def.description,
21584
+ icon: "\uD83D\uDC65",
21585
+ color: "#38bdf8",
21586
+ category: "Keep in Touch",
21587
+ featured: def.key === "inner-circle",
21588
+ recipe: {
21589
+ nodes: [
21590
+ {
21591
+ ref: "contact",
21592
+ kind: "contact",
21593
+ title: def.name,
21594
+ notes: `Keep-in-touch circle \u2014 reach out ${def.cadence}. Rename to a person and set their cadence.`,
21595
+ tags: ["keep-in-touch", def.tag]
21596
+ }
21597
+ ]
21598
+ }
21599
+ }));
21600
+
21601
+ // ../../packages/schema/src/presets/features/habits.ts
21602
+ var habitPresets = [
21603
+ {
21604
+ key: "drink-water",
21350
21605
  entity: "habit",
21351
- name: "Vitamins",
21352
- description: "Take your daily vitamins.",
21353
- icon: "\uD83D\uDC8A",
21606
+ name: "Drink Water",
21607
+ description: "Stay hydrated \u2014 8 glasses a day.",
21608
+ icon: "\uD83D\uDCA7",
21354
21609
  color: "#38bdf8",
21355
21610
  category: "Health",
21611
+ displayKind: "water-cup",
21612
+ featured: true,
21356
21613
  recipe: {
21357
21614
  nodes: [
21358
21615
  {
21359
21616
  ref: "habit",
21360
21617
  kind: "habit",
21361
- title: "Vitamins",
21362
- measurementType: "binary",
21618
+ title: "Drink Water",
21619
+ measurementType: "quantitative",
21620
+ targetValue: 8,
21621
+ targetUnit: "glasses",
21363
21622
  period: "day"
21364
21623
  }
21365
21624
  ]
21366
21625
  }
21367
21626
  },
21368
21627
  {
21369
- key: "journal",
21628
+ key: "meditate",
21370
21629
  entity: "habit",
21371
- name: "Journal",
21372
- description: "Write a daily journal entry.",
21373
- icon: "\uD83D\uDCD3",
21630
+ name: "Meditate",
21631
+ description: "A daily 10-minute sit.",
21632
+ icon: "\uD83E\uDDD8",
21374
21633
  color: "#a78bfa",
21375
21634
  category: "Mindfulness",
21376
21635
  recipe: {
21377
21636
  nodes: [
21378
- { ref: "habit", kind: "habit", title: "Journal", measurementType: "binary", period: "day" }
21637
+ {
21638
+ ref: "habit",
21639
+ kind: "habit",
21640
+ title: "Meditate",
21641
+ measurementType: "duration",
21642
+ targetValue: 10,
21643
+ targetUnit: "min",
21644
+ period: "day"
21645
+ }
21379
21646
  ]
21380
21647
  }
21381
21648
  },
21382
21649
  {
21383
- key: "sleep-by-11pm",
21650
+ key: "steps",
21384
21651
  entity: "habit",
21385
- name: "Sleep by 11pm",
21386
- description: "Lights out before eleven.",
21387
- icon: "\uD83C\uDF19",
21388
- color: "#818cf8",
21389
- category: "Health",
21652
+ name: "Steps",
21653
+ description: "Hit 10,000 steps a day.",
21654
+ icon: "\uD83D\uDC5F",
21655
+ color: "#34d399",
21656
+ category: "Fitness",
21390
21657
  recipe: {
21391
21658
  nodes: [
21392
21659
  {
21393
21660
  ref: "habit",
21394
21661
  kind: "habit",
21395
- title: "Sleep by 11pm",
21396
- measurementType: "binary",
21662
+ title: "Steps",
21663
+ measurementType: "quantitative",
21664
+ targetValue: 1e4,
21665
+ targetUnit: "steps",
21397
21666
  period: "day"
21398
21667
  }
21399
21668
  ]
21400
21669
  }
21401
21670
  },
21402
21671
  {
21403
- key: "no-smoking",
21672
+ key: "read",
21404
21673
  entity: "habit",
21405
- name: "No Smoking",
21406
- description: "Stay smoke-free, one day at a time.",
21407
- icon: "\uD83D\uDEAD",
21408
- color: "#fb7185",
21409
- category: "Abstinence",
21410
- displayKind: "abstinence-streak",
21674
+ name: "Read",
21675
+ description: "Read for 30 minutes a day.",
21676
+ icon: "\uD83D\uDCD6",
21677
+ color: "#f59e0b",
21678
+ category: "Growth",
21411
21679
  recipe: {
21412
21680
  nodes: [
21413
21681
  {
21414
21682
  ref: "habit",
21415
21683
  kind: "habit",
21416
- title: "No Smoking",
21417
- measurementType: "negative",
21418
- targetValue: 0,
21684
+ title: "Read",
21685
+ measurementType: "duration",
21686
+ targetValue: 30,
21687
+ targetUnit: "min",
21419
21688
  period: "day"
21420
21689
  }
21421
21690
  ]
21422
21691
  }
21423
21692
  },
21424
21693
  {
21425
- key: "no-alcohol",
21694
+ key: "stretch",
21426
21695
  entity: "habit",
21427
- name: "No Alcohol",
21428
- description: "Keep the day alcohol-free.",
21429
- icon: "\uD83D\uDEAB",
21430
- color: "#fb7185",
21431
- category: "Abstinence",
21432
- displayKind: "abstinence-streak",
21696
+ name: "Stretch",
21697
+ description: "Loosen up once a day.",
21698
+ icon: "\uD83E\uDD38",
21699
+ color: "#34d399",
21700
+ category: "Fitness",
21433
21701
  recipe: {
21434
21702
  nodes: [
21435
- {
21436
- ref: "habit",
21437
- kind: "habit",
21438
- title: "No Alcohol",
21439
- measurementType: "negative",
21440
- targetValue: 0,
21441
- period: "day"
21442
- }
21703
+ { ref: "habit", kind: "habit", title: "Stretch", measurementType: "binary", period: "day" }
21443
21704
  ]
21444
21705
  }
21445
21706
  },
21446
21707
  {
21447
- key: "no-sugar",
21708
+ key: "workout",
21448
21709
  entity: "habit",
21449
- name: "No Sugar",
21450
- description: "Skip the added sugar today.",
21451
- icon: "\uD83C\uDF6D",
21710
+ name: "Workout",
21711
+ description: "Train three times a week.",
21712
+ icon: "\uD83C\uDFCB\uFE0F",
21452
21713
  color: "#fb7185",
21453
- category: "Abstinence",
21454
- displayKind: "abstinence-streak",
21714
+ category: "Fitness",
21455
21715
  recipe: {
21456
21716
  nodes: [
21457
21717
  {
21458
21718
  ref: "habit",
21459
21719
  kind: "habit",
21460
- title: "No Sugar",
21461
- measurementType: "negative",
21462
- targetValue: 0,
21463
- period: "day"
21464
- }
21465
- ]
21466
- }
21720
+ title: "Workout",
21721
+ measurementType: "binary",
21722
+ period: "week",
21723
+ frequencyCount: 3
21724
+ }
21725
+ ]
21726
+ }
21727
+ },
21728
+ {
21729
+ key: "vitamins",
21730
+ entity: "habit",
21731
+ name: "Vitamins",
21732
+ description: "Take your daily vitamins.",
21733
+ icon: "\uD83D\uDC8A",
21734
+ color: "#38bdf8",
21735
+ category: "Health",
21736
+ recipe: {
21737
+ nodes: [
21738
+ {
21739
+ ref: "habit",
21740
+ kind: "habit",
21741
+ title: "Vitamins",
21742
+ measurementType: "binary",
21743
+ period: "day"
21744
+ }
21745
+ ]
21746
+ }
21747
+ },
21748
+ {
21749
+ key: "journal",
21750
+ entity: "habit",
21751
+ name: "Journal",
21752
+ description: "Write a daily journal entry.",
21753
+ icon: "\uD83D\uDCD3",
21754
+ color: "#a78bfa",
21755
+ category: "Mindfulness",
21756
+ recipe: {
21757
+ nodes: [
21758
+ { ref: "habit", kind: "habit", title: "Journal", measurementType: "binary", period: "day" }
21759
+ ]
21760
+ }
21761
+ },
21762
+ {
21763
+ key: "sleep-by-11pm",
21764
+ entity: "habit",
21765
+ name: "Sleep by 11pm",
21766
+ description: "Lights out before eleven.",
21767
+ icon: "\uD83C\uDF19",
21768
+ color: "#818cf8",
21769
+ category: "Health",
21770
+ recipe: {
21771
+ nodes: [
21772
+ {
21773
+ ref: "habit",
21774
+ kind: "habit",
21775
+ title: "Sleep by 11pm",
21776
+ measurementType: "binary",
21777
+ period: "day"
21778
+ }
21779
+ ]
21780
+ }
21781
+ },
21782
+ {
21783
+ key: "weight",
21784
+ entity: "habit",
21785
+ name: "Weight",
21786
+ description: "Log your weight to watch the trend.",
21787
+ icon: "\u2696\uFE0F",
21788
+ color: "#38bdf8",
21789
+ category: "Health",
21790
+ displayKind: "trend-chart",
21791
+ recipe: {
21792
+ nodes: [
21793
+ {
21794
+ ref: "habit",
21795
+ kind: "habit",
21796
+ title: "Weight",
21797
+ measurementType: "quantitative",
21798
+ targetValue: 70,
21799
+ targetUnit: "kg",
21800
+ period: "day"
21801
+ }
21802
+ ]
21803
+ }
21804
+ },
21805
+ {
21806
+ key: "mood",
21807
+ entity: "habit",
21808
+ name: "Mood",
21809
+ description: "Rate your mood 1\u20135 and track how it moves.",
21810
+ icon: "\uD83D\uDE42",
21811
+ color: "#a78bfa",
21812
+ category: "Mindfulness",
21813
+ displayKind: "trend-chart",
21814
+ recipe: {
21815
+ nodes: [
21816
+ {
21817
+ ref: "habit",
21818
+ kind: "habit",
21819
+ title: "Mood",
21820
+ measurementType: "quantitative",
21821
+ targetValue: 5,
21822
+ targetUnit: "/5",
21823
+ period: "day"
21824
+ }
21825
+ ]
21826
+ }
21827
+ },
21828
+ {
21829
+ key: "sleep-duration",
21830
+ entity: "habit",
21831
+ name: "Sleep",
21832
+ description: "Log hours slept and watch the trend.",
21833
+ icon: "\uD83D\uDE34",
21834
+ color: "#818cf8",
21835
+ category: "Health",
21836
+ displayKind: "trend-chart",
21837
+ recipe: {
21838
+ nodes: [
21839
+ {
21840
+ ref: "habit",
21841
+ kind: "habit",
21842
+ title: "Sleep",
21843
+ measurementType: "duration",
21844
+ targetValue: 8,
21845
+ targetUnit: "h",
21846
+ period: "day"
21847
+ }
21848
+ ]
21849
+ }
21850
+ },
21851
+ {
21852
+ key: "no-smoking",
21853
+ entity: "habit",
21854
+ name: "No Smoking",
21855
+ description: "Stay smoke-free, one day at a time.",
21856
+ icon: "\uD83D\uDEAD",
21857
+ color: "#fb7185",
21858
+ category: "Abstinence",
21859
+ displayKind: "abstinence-streak",
21860
+ recipe: {
21861
+ nodes: [
21862
+ {
21863
+ ref: "habit",
21864
+ kind: "habit",
21865
+ title: "No Smoking",
21866
+ measurementType: "negative",
21867
+ targetValue: 0,
21868
+ period: "day"
21869
+ }
21870
+ ]
21871
+ }
21872
+ },
21873
+ {
21874
+ key: "no-alcohol",
21875
+ entity: "habit",
21876
+ name: "No Alcohol",
21877
+ description: "Keep the day alcohol-free.",
21878
+ icon: "\uD83D\uDEAB",
21879
+ color: "#fb7185",
21880
+ category: "Abstinence",
21881
+ displayKind: "abstinence-streak",
21882
+ recipe: {
21883
+ nodes: [
21884
+ {
21885
+ ref: "habit",
21886
+ kind: "habit",
21887
+ title: "No Alcohol",
21888
+ measurementType: "negative",
21889
+ targetValue: 0,
21890
+ period: "day"
21891
+ }
21892
+ ]
21893
+ }
21894
+ },
21895
+ {
21896
+ key: "no-sugar",
21897
+ entity: "habit",
21898
+ name: "No Sugar",
21899
+ description: "Skip the added sugar today.",
21900
+ icon: "\uD83C\uDF6D",
21901
+ color: "#fb7185",
21902
+ category: "Abstinence",
21903
+ displayKind: "abstinence-streak",
21904
+ recipe: {
21905
+ nodes: [
21906
+ {
21907
+ ref: "habit",
21908
+ kind: "habit",
21909
+ title: "No Sugar",
21910
+ measurementType: "negative",
21911
+ targetValue: 0,
21912
+ period: "day"
21913
+ }
21914
+ ]
21915
+ }
21467
21916
  },
21468
21917
  {
21469
21918
  key: "floss",
@@ -21522,18 +21971,46 @@ var habitPresets = [
21522
21971
  }
21523
21972
  }
21524
21973
  ];
21974
+
21975
+ // ../../packages/schema/src/presets/features/inventory.ts
21976
+ var pantryStaples = [
21977
+ { title: "Rice", category: "Grains", unit: "kg", threshold: 1 },
21978
+ { title: "Pasta", category: "Grains", unit: "boxes", threshold: 2 },
21979
+ { title: "Olive oil", category: "Oils", unit: "bottles", threshold: 1 },
21980
+ { title: "Canned tomatoes", category: "Canned", unit: "cans", threshold: 3 },
21981
+ { title: "Black beans", category: "Canned", unit: "cans", threshold: 3 },
21982
+ { title: "Flour", category: "Baking", unit: "kg", threshold: 1 },
21983
+ { title: "Sugar", category: "Baking", unit: "kg", threshold: 1 },
21984
+ { title: "Coffee", category: "Beverages", unit: "bags", threshold: 1 },
21985
+ { title: "Salt", category: "Spices", unit: "boxes", threshold: 1 },
21986
+ { title: "Paper towels", category: "Household", unit: "rolls", threshold: 2 }
21987
+ ];
21988
+ var inventoryPresets = [
21989
+ {
21990
+ key: "pantry-staples",
21991
+ entity: "inventory",
21992
+ name: "Pantry Staples",
21993
+ description: "Stock the essentials and get a heads-up before they run out.",
21994
+ icon: "\uD83E\uDD6B",
21995
+ color: "#34d399",
21996
+ category: "Home",
21997
+ recipe: {
21998
+ nodes: pantryStaples.map((staple, index2) => ({
21999
+ ref: `staple-${index2}`,
22000
+ kind: "inventory_item",
22001
+ title: staple.title,
22002
+ category: staple.category,
22003
+ location: "Pantry",
22004
+ unit: staple.unit,
22005
+ lowStockThreshold: staple.threshold
22006
+ }))
22007
+ }
22008
+ }
22009
+ ];
22010
+
22011
+ // ../../packages/schema/src/presets/features/lists.ts
21525
22012
  var shoppingItems2 = (...titles) => titles.map((title) => ({ title }));
21526
22013
  var listPresetDefs = [
21527
- {
21528
- key: "books-to-read",
21529
- name: "Books to Read",
21530
- description: "Your reading queue.",
21531
- icon: "\uD83D\uDCDA",
21532
- color: "#f59e0b",
21533
- category: "Reading",
21534
- title: "Books to Read",
21535
- items: ["Atomic Habits", "Deep Work", "The Pragmatic Programmer"]
21536
- },
21537
22014
  {
21538
22015
  key: "watchlist",
21539
22016
  name: "Watchlist",
@@ -21615,332 +22092,69 @@ var listPresetDefs = [
21615
22092
  items: ["Change HVAC filter", "Clean gutters", "Test smoke alarms", "Descale kettle"]
21616
22093
  }
21617
22094
  ];
21618
- var shoppingListPresets = listPresetDefs.map((def) => ({
21619
- key: def.key,
21620
- entity: "list",
21621
- name: def.name,
21622
- description: def.description,
21623
- icon: def.icon,
21624
- color: def.color,
21625
- category: def.category,
21626
- featured: def.key === "groceries",
22095
+ var booksToRead = [
22096
+ { title: "Atomic Habits", author: "James Clear" },
22097
+ { title: "Deep Work", author: "Cal Newport" },
22098
+ { title: "The Pragmatic Programmer", author: "Andrew Hunt" }
22099
+ ];
22100
+ var booksToReadPreset = {
22101
+ key: "books-to-read",
22102
+ entity: "library",
22103
+ name: "Books to Read",
22104
+ description: "Your reading queue \u2014 covers, status and ratings.",
22105
+ icon: "\uD83D\uDCDA",
22106
+ color: "#f59e0b",
22107
+ category: "Reading",
22108
+ displayKind: MEDIA_SHELF_DISPLAY_KIND,
21627
22109
  recipe: {
21628
22110
  nodes: [
21629
- { ref: "list", kind: "shopping_list", title: def.title, items: shoppingItems2(...def.items) }
22111
+ {
22112
+ ref: "list",
22113
+ kind: "shopping_list",
22114
+ title: "Books to Read",
22115
+ displayKind: MEDIA_SHELF_DISPLAY_KIND,
22116
+ items: booksToRead.map((book) => ({
22117
+ title: book.title,
22118
+ facet: { author: book.author, status: "to-read" }
22119
+ }))
22120
+ }
21630
22121
  ]
21631
22122
  }
21632
- }));
21633
- var pantryStaples = [
21634
- { title: "Rice", category: "Grains", unit: "kg", threshold: 1 },
21635
- { title: "Pasta", category: "Grains", unit: "boxes", threshold: 2 },
21636
- { title: "Olive oil", category: "Oils", unit: "bottles", threshold: 1 },
21637
- { title: "Canned tomatoes", category: "Canned", unit: "cans", threshold: 3 },
21638
- { title: "Black beans", category: "Canned", unit: "cans", threshold: 3 },
21639
- { title: "Flour", category: "Baking", unit: "kg", threshold: 1 },
21640
- { title: "Sugar", category: "Baking", unit: "kg", threshold: 1 },
21641
- { title: "Coffee", category: "Beverages", unit: "bags", threshold: 1 },
21642
- { title: "Salt", category: "Spices", unit: "boxes", threshold: 1 },
21643
- { title: "Paper towels", category: "Household", unit: "rolls", threshold: 2 }
22123
+ };
22124
+ var shoppingListPresets = [
22125
+ booksToReadPreset,
22126
+ ...listPresetDefs.map((def) => ({
22127
+ key: def.key,
22128
+ entity: "list",
22129
+ name: def.name,
22130
+ description: def.description,
22131
+ icon: def.icon,
22132
+ color: def.color,
22133
+ category: def.category,
22134
+ featured: def.key === "groceries",
22135
+ recipe: {
22136
+ nodes: [
22137
+ {
22138
+ ref: "list",
22139
+ kind: "shopping_list",
22140
+ title: def.title,
22141
+ items: shoppingItems2(...def.items)
22142
+ }
22143
+ ]
22144
+ }
22145
+ }))
21644
22146
  ];
21645
- var inventoryPresets = [
21646
- {
21647
- key: "pantry-staples",
21648
- entity: "inventory",
21649
- name: "Pantry Staples",
21650
- description: "Stock the essentials and get a heads-up before they run out.",
21651
- icon: "\uD83E\uDD6B",
21652
- color: "#34d399",
21653
- category: "Home",
21654
- recipe: {
21655
- nodes: pantryStaples.map((staple, index2) => ({
21656
- ref: `staple-${index2}`,
21657
- kind: "inventory_item",
21658
- title: staple.title,
21659
- category: staple.category,
21660
- location: "Pantry",
21661
- unit: staple.unit,
21662
- lowStockThreshold: staple.threshold
21663
- }))
21664
- }
21665
- }
21666
- ];
21667
- var routinePresetDefs = [
21668
- {
21669
- key: "morning-routine",
21670
- name: "Morning Routine",
21671
- description: "Start the day with intention.",
21672
- icon: "\uD83C\uDF05",
21673
- color: "#f59e0b",
21674
- category: "Daily",
21675
- displayKind: "routine-checklist",
21676
- steps: ["Make the bed", "Drink a glass of water", "Stretch", "Plan the day"]
21677
- },
21678
- {
21679
- key: "evening-wind-down",
21680
- name: "Evening Wind-Down",
21681
- description: "Ease into a restful night.",
21682
- icon: "\uD83C\uDF19",
21683
- color: "#818cf8",
21684
- category: "Daily",
21685
- steps: ["Dim the lights", "Tidy up", "Read a few pages", "Lights out"]
21686
- },
21687
- {
21688
- key: "deep-work-block",
21689
- name: "Deep Work Block",
21690
- description: "Set up for focused, distraction-free work.",
21691
- icon: "\uD83C\uDFAF",
21692
- color: "#a78bfa",
21693
- category: "Work",
21694
- steps: ["Silence notifications", "Pick one task", "Start a 50-min timer", "Take a break"]
21695
- },
21696
- {
21697
- key: "gym-session",
21698
- name: "Gym Session",
21699
- description: "A repeatable workout flow.",
21700
- icon: "\uD83C\uDFCB\uFE0F",
21701
- color: "#fb7185",
21702
- category: "Fitness",
21703
- steps: ["Warm up", "Main lifts", "Accessory work", "Cool down & stretch"]
21704
- },
21705
- {
21706
- key: "weekly-review",
21707
- name: "Weekly Review",
21708
- description: "Close the week and set up the next.",
21709
- icon: "\uD83D\uDDD3\uFE0F",
21710
- color: "#34d399",
21711
- category: "Work",
21712
- steps: ["Clear the inbox", "Review last week", "Check goals", "Plan next week"]
21713
- },
21714
- {
21715
- key: "leaving-the-house",
21716
- name: "Leaving the House",
21717
- description: "Never forget the essentials.",
21718
- icon: "\uD83D\uDEAA",
21719
- color: "#38bdf8",
21720
- category: "Daily",
21721
- steps: ["Keys", "Wallet", "Phone", "Lock the door"]
21722
- },
21723
- {
21724
- key: "skincare-routine",
21725
- name: "Skincare AM/PM",
21726
- description: "A simple morning and night skincare flow.",
21727
- icon: "\uD83E\uDDF4",
21728
- color: "#f472b6",
21729
- category: "Self-care",
21730
- steps: ["Cleanse", "Treat", "Moisturise", "SPF (AM only)"]
21731
- },
21732
- {
21733
- key: "shutdown-ritual",
21734
- name: "Shutdown Ritual",
21735
- description: "End the workday cleanly.",
21736
- icon: "\uD83D\uDD0C",
21737
- color: "#a78bfa",
21738
- category: "Work",
21739
- steps: ["Review what got done", "Note tomorrow's top task", "Close all tabs", "Step away"]
21740
- }
21741
- ];
21742
- var routinePresets = routinePresetDefs.map((def) => ({
21743
- key: def.key,
21744
- entity: "routine",
21745
- name: def.name,
21746
- description: def.description,
21747
- icon: def.icon,
21748
- color: def.color,
21749
- category: def.category,
21750
- ...def.displayKind ? { displayKind: def.displayKind } : {},
21751
- featured: def.key === "morning-routine",
21752
- recipe: {
21753
- nodes: [
21754
- {
21755
- ref: "routine",
21756
- kind: "routine",
21757
- title: def.name,
21758
- steps: def.steps.map((title) => ({ title }))
21759
- }
21760
- ]
21761
- }
21762
- }));
21763
- var areaBundleDefs = [
21764
- {
21765
- key: "life-setup",
21766
- name: "Life Setup",
21767
- description: "Nine areas of responsibility to organise your whole life.",
21768
- icon: "\uD83C\uDF31",
21769
- color: "#34d399",
21770
- areas: [
21771
- { title: "Health", color: "green", icon: "heart-pulse" },
21772
- { title: "Finances", color: "amber", icon: "wallet" },
21773
- { title: "Career", color: "blue", icon: "briefcase" },
21774
- { title: "Relationships", color: "rose", icon: "users" },
21775
- { title: "Home", color: "teal", icon: "house" },
21776
- { title: "Personal Growth", color: "purple", icon: "sprout" },
21777
- { title: "Recreation", color: "amber", icon: "gamepad-2" },
21778
- { title: "Admin", color: "slate", icon: "file-text" },
21779
- { title: "Community", color: "red", icon: "hand-heart" }
21780
- ]
21781
- },
21782
- {
21783
- key: "student-life",
21784
- name: "Student Life",
21785
- description: "Keep coursework, exams and the rest of life in balance.",
21786
- icon: "\uD83C\uDF93",
21787
- color: "#38bdf8",
21788
- areas: [
21789
- { title: "Coursework", color: "blue", icon: "book-open" },
21790
- { title: "Exams", color: "red", icon: "graduation-cap" },
21791
- { title: "Finances", color: "amber", icon: "wallet" },
21792
- { title: "Social", color: "rose", icon: "users" },
21793
- { title: "Health", color: "green", icon: "heart-pulse" },
21794
- { title: "Career Prep", color: "purple", icon: "briefcase" }
21795
- ]
21796
- },
21797
- {
21798
- key: "founder",
21799
- name: "Founder",
21800
- description: "The hats a founder wears, as areas to steward.",
21801
- icon: "\uD83D\uDE80",
21802
- color: "#a78bfa",
21803
- areas: [
21804
- { title: "Product", color: "purple", icon: "box" },
21805
- { title: "Sales", color: "green", icon: "trending-up" },
21806
- { title: "Fundraising", color: "amber", icon: "banknote" },
21807
- { title: "Team", color: "blue", icon: "users" },
21808
- { title: "Finances", color: "slate", icon: "wallet" },
21809
- { title: "Personal", color: "rose", icon: "heart" }
21810
- ]
21811
- },
21812
- {
21813
- key: "new-parent",
21814
- name: "New Parent",
21815
- description: "Stay on top of life with a newborn.",
21816
- icon: "\uD83C\uDF7C",
21817
- color: "#f472b6",
21818
- areas: [
21819
- { title: "Baby Care", color: "rose", icon: "baby" },
21820
- { title: "Health", color: "green", icon: "heart-pulse" },
21821
- { title: "Home", color: "teal", icon: "house" },
21822
- { title: "Finances", color: "amber", icon: "wallet" },
21823
- { title: "Relationship", color: "purple", icon: "heart" },
21824
- { title: "Self-care", color: "blue", icon: "sparkles" }
21825
- ]
21826
- }
21827
- ];
21828
- var areaPresets = areaBundleDefs.map((def) => ({
21829
- key: def.key,
21830
- entity: "area",
21831
- name: def.name,
21832
- description: def.description,
21833
- icon: def.icon,
21834
- color: def.color,
21835
- category: "Life Setup",
21836
- featured: def.key === "life-setup",
21837
- recipe: {
21838
- nodes: def.areas.map((area, index2) => ({
21839
- ref: `area-${index2}`,
21840
- kind: "area",
21841
- title: area.title,
21842
- color: area.color,
21843
- icon: area.icon
21844
- }))
21845
- }
21846
- }));
21847
- var projectPresetDefs = [
21848
- {
21849
- key: "plan-a-trip",
21850
- name: "Plan a Trip",
21851
- description: "From idea to itinerary.",
21852
- icon: "\uD83E\uDDF3",
21853
- color: "#38bdf8",
21854
- category: "Personal",
21855
- milestones: ["Pick dates & destination", "Book flights", "Book stay", "Plan itinerary", "Pack"]
21856
- },
21857
- {
21858
- key: "job-search",
21859
- name: "Job Search",
21860
- description: "Run a focused job hunt.",
21861
- icon: "\uD83D\uDCBC",
21862
- color: "#a78bfa",
21863
- category: "Career",
21864
- milestones: ["Update CV", "Build a target list", "Apply", "Interview prep", "Negotiate offer"]
21865
- },
21866
- {
21867
- key: "move-house",
21868
- name: "Move House",
21869
- description: "Keep a move from overwhelming you.",
21870
- icon: "\uD83D\uDCE6",
21871
- color: "#f59e0b",
21872
- category: "Home",
21873
- milestones: ["Declutter", "Book movers", "Pack room by room", "Change address", "Unpack"]
21874
- },
21875
- {
21876
- key: "side-project",
21877
- name: "Launch a Side Project",
21878
- description: "Ship something on the side.",
21879
- icon: "\uD83D\uDEE0\uFE0F",
21880
- color: "#34d399",
21881
- category: "Career",
21882
- milestones: ["Define the MVP", "Build it", "Test with users", "Launch", "Gather feedback"]
21883
- },
21884
- {
21885
- key: "plan-an-event",
21886
- name: "Plan an Event",
21887
- description: "Pull off a gathering without the stress.",
21888
- icon: "\uD83C\uDF89",
21889
- color: "#fb7185",
21890
- category: "Personal",
21891
- milestones: [
21892
- "Set date & budget",
21893
- "Invite guests",
21894
- "Book venue",
21895
- "Order food",
21896
- "Day-of run sheet"
21897
- ]
21898
- },
21899
- {
21900
- key: "learn-a-skill",
21901
- name: "Learn a Skill",
21902
- description: "Go from beginner to capable.",
21903
- icon: "\uD83D\uDCDA",
21904
- color: "#f59e0b",
21905
- category: "Growth",
21906
- milestones: [
21907
- "Pick a resource",
21908
- "Daily practice",
21909
- "Build a project",
21910
- "Get feedback",
21911
- "Teach someone"
21912
- ]
21913
- }
21914
- ];
21915
- var projectPresets = projectPresetDefs.map((def) => ({
21916
- key: def.key,
21917
- entity: "project",
21918
- name: def.name,
21919
- description: def.description,
21920
- icon: def.icon,
21921
- color: def.color,
21922
- category: def.category,
21923
- featured: def.key === "plan-a-trip",
21924
- recipe: {
21925
- nodes: [
21926
- {
21927
- ref: "project",
21928
- kind: "project",
21929
- title: def.name,
21930
- milestones: def.milestones.map((title) => ({ title }))
21931
- }
21932
- ]
21933
- }
21934
- }));
21935
- var recipeNode = (def) => ({
21936
- ref: def.ref,
21937
- kind: "recipe",
21938
- title: def.title,
21939
- ...def.servings ? { servings: def.servings } : {},
21940
- ...def.tags ? { tags: def.tags } : {},
21941
- ingredients: def.ingredients.map((name) => ({ name }))
21942
- });
21943
- var mealPresets = [
22147
+
22148
+ // ../../packages/schema/src/presets/features/meals.ts
22149
+ var recipeNode = (def) => ({
22150
+ ref: def.ref,
22151
+ kind: "recipe",
22152
+ title: def.title,
22153
+ ...def.servings ? { servings: def.servings } : {},
22154
+ ...def.tags ? { tags: def.tags } : {},
22155
+ ingredients: def.ingredients.map((name) => ({ name }))
22156
+ });
22157
+ var mealPresets = [
21944
22158
  {
21945
22159
  key: "weeknight-dinners",
21946
22160
  entity: "recipe",
@@ -22129,265 +22343,197 @@ var mealPresets = [
22129
22343
  }
22130
22344
  }
22131
22345
  ];
22132
- var contactCircleDefs = [
22346
+
22347
+ // ../../packages/schema/src/presets/features/projects.ts
22348
+ var projectPresetDefs = [
22133
22349
  {
22134
- key: "inner-circle",
22135
- name: "Inner Circle",
22136
- description: "The people you check in with weekly.",
22137
- cadence: "every week",
22138
- tag: "1w"
22350
+ key: "plan-a-trip",
22351
+ name: "Plan a Trip",
22352
+ description: "From idea to itinerary.",
22353
+ icon: "\uD83E\uDDF3",
22354
+ color: "#38bdf8",
22355
+ category: "Personal",
22356
+ milestones: ["Pick dates & destination", "Book flights", "Book stay", "Plan itinerary", "Pack"]
22139
22357
  },
22140
22358
  {
22141
- key: "close-friends",
22142
- name: "Close Friends",
22143
- description: "Friends worth a message every couple of weeks.",
22144
- cadence: "every 2 weeks",
22145
- tag: "2w"
22359
+ key: "job-search",
22360
+ name: "Job Search",
22361
+ description: "Run a focused job hunt.",
22362
+ icon: "\uD83D\uDCBC",
22363
+ color: "#a78bfa",
22364
+ category: "Career",
22365
+ milestones: ["Update CV", "Build a target list", "Apply", "Interview prep", "Negotiate offer"]
22146
22366
  },
22147
22367
  {
22148
- key: "keep-warm",
22149
- name: "Keep Warm",
22150
- description: "People to keep warm with a monthly hello.",
22151
- cadence: "every month",
22152
- tag: "1m"
22368
+ key: "move-house",
22369
+ name: "Move House",
22370
+ description: "Keep a move from overwhelming you.",
22371
+ icon: "\uD83D\uDCE6",
22372
+ color: "#f59e0b",
22373
+ category: "Home",
22374
+ milestones: ["Declutter", "Book movers", "Pack room by room", "Change address", "Unpack"]
22153
22375
  },
22154
22376
  {
22155
- key: "network",
22156
- name: "Network",
22157
- description: "Professional contacts to touch base with quarterly.",
22158
- cadence: "every 3 months",
22159
- tag: "3m"
22377
+ key: "side-project",
22378
+ name: "Launch a Side Project",
22379
+ description: "Ship something on the side.",
22380
+ icon: "\uD83D\uDEE0\uFE0F",
22381
+ color: "#34d399",
22382
+ category: "Career",
22383
+ milestones: ["Define the MVP", "Build it", "Test with users", "Launch", "Gather feedback"]
22160
22384
  },
22161
22385
  {
22162
- key: "birthday-only",
22163
- name: "Birthday Only",
22164
- description: "People you reach out to on their birthday.",
22165
- cadence: "on their birthday",
22166
- tag: "birthday"
22386
+ key: "plan-an-event",
22387
+ name: "Plan an Event",
22388
+ description: "Pull off a gathering without the stress.",
22389
+ icon: "\uD83C\uDF89",
22390
+ color: "#fb7185",
22391
+ category: "Personal",
22392
+ milestones: [
22393
+ "Set date & budget",
22394
+ "Invite guests",
22395
+ "Book venue",
22396
+ "Order food",
22397
+ "Day-of run sheet"
22398
+ ]
22399
+ },
22400
+ {
22401
+ key: "learn-a-skill",
22402
+ name: "Learn a Skill",
22403
+ description: "Go from beginner to capable.",
22404
+ icon: "\uD83D\uDCDA",
22405
+ color: "#f59e0b",
22406
+ category: "Growth",
22407
+ milestones: [
22408
+ "Pick a resource",
22409
+ "Daily practice",
22410
+ "Build a project",
22411
+ "Get feedback",
22412
+ "Teach someone"
22413
+ ]
22167
22414
  }
22168
22415
  ];
22169
- var contactPresets = contactCircleDefs.map((def) => ({
22416
+ var projectPresets = projectPresetDefs.map((def) => ({
22170
22417
  key: def.key,
22171
- entity: "contact",
22418
+ entity: "project",
22172
22419
  name: def.name,
22173
- description: def.description,
22174
- icon: "\uD83D\uDC65",
22175
- color: "#38bdf8",
22176
- category: "Keep in Touch",
22177
- featured: def.key === "inner-circle",
22420
+ description: def.description,
22421
+ icon: def.icon,
22422
+ color: def.color,
22423
+ category: def.category,
22424
+ featured: def.key === "plan-a-trip",
22178
22425
  recipe: {
22179
22426
  nodes: [
22180
22427
  {
22181
- ref: "contact",
22182
- kind: "contact",
22428
+ ref: "project",
22429
+ kind: "project",
22183
22430
  title: def.name,
22184
- notes: `Keep-in-touch circle \u2014 reach out ${def.cadence}. Rename to a person and set their cadence.`,
22185
- tags: ["keep-in-touch", def.tag]
22431
+ milestones: def.milestones.map((title) => ({ title }))
22186
22432
  }
22187
22433
  ]
22188
22434
  }
22189
22435
  }));
22190
- var challengePresetDefs = [
22436
+
22437
+ // ../../packages/schema/src/presets/features/routines.ts
22438
+ var routinePresetDefs = [
22191
22439
  {
22192
- key: "challenge-75-hard",
22193
- name: "75 Hard",
22194
- description: "75 days of two workouts, water, reading and a clean diet.",
22195
- icon: "\uD83D\uDD25",
22196
- color: "#fb7185",
22197
- metric: "habits.checked_in",
22198
- target: 75,
22199
- durationDays: 75
22440
+ key: "morning-routine",
22441
+ name: "Morning Routine",
22442
+ description: "Start the day with intention.",
22443
+ icon: "\uD83C\uDF05",
22444
+ color: "#f59e0b",
22445
+ category: "Daily",
22446
+ displayKind: "routine-checklist",
22447
+ steps: ["Make the bed", "Drink a glass of water", "Stretch", "Plan the day"]
22200
22448
  },
22201
22449
  {
22202
- key: "challenge-no-sugar",
22203
- name: "30-Day No Sugar",
22204
- description: "Cut added sugar for 30 days.",
22205
- icon: "\uD83C\uDF6D",
22206
- color: "#f472b6",
22207
- metric: "habits.checked_in",
22208
- target: 30,
22209
- durationDays: 30
22450
+ key: "evening-wind-down",
22451
+ name: "Evening Wind-Down",
22452
+ description: "Ease into a restful night.",
22453
+ icon: "\uD83C\uDF19",
22454
+ color: "#818cf8",
22455
+ category: "Daily",
22456
+ steps: ["Dim the lights", "Tidy up", "Read a few pages", "Lights out"]
22210
22457
  },
22211
22458
  {
22212
- key: "challenge-couch-to-5k",
22213
- name: "Couch-to-5K",
22214
- description: "Run your first 5K in nine weeks.",
22215
- icon: "\uD83C\uDFC3",
22459
+ key: "deep-work-block",
22460
+ name: "Deep Work Block",
22461
+ description: "Set up for focused, distraction-free work.",
22462
+ icon: "\uD83C\uDFAF",
22463
+ color: "#a78bfa",
22464
+ category: "Work",
22465
+ steps: ["Silence notifications", "Pick one task", "Start a 50-min timer", "Take a break"]
22466
+ },
22467
+ {
22468
+ key: "gym-session",
22469
+ name: "Gym Session",
22470
+ description: "A repeatable workout flow.",
22471
+ icon: "\uD83C\uDFCB\uFE0F",
22472
+ color: "#fb7185",
22473
+ category: "Fitness",
22474
+ steps: ["Warm up", "Main lifts", "Accessory work", "Cool down & stretch"]
22475
+ },
22476
+ {
22477
+ key: "weekly-review",
22478
+ name: "Weekly Review",
22479
+ description: "Close the week and set up the next.",
22480
+ icon: "\uD83D\uDDD3\uFE0F",
22216
22481
  color: "#34d399",
22217
- metric: "habits.checked_in",
22218
- target: 27,
22219
- durationDays: 63
22482
+ category: "Work",
22483
+ steps: ["Clear the inbox", "Review last week", "Check goals", "Plan next week"]
22220
22484
  },
22221
22485
  {
22222
- key: "challenge-dry-january",
22223
- name: "Dry January",
22224
- description: "An alcohol-free month to reset.",
22225
- icon: "\uD83D\uDEAB",
22486
+ key: "leaving-the-house",
22487
+ name: "Leaving the House",
22488
+ description: "Never forget the essentials.",
22489
+ icon: "\uD83D\uDEAA",
22226
22490
  color: "#38bdf8",
22227
- metric: "habits.checked_in",
22228
- target: 31,
22229
- durationDays: 31
22491
+ category: "Daily",
22492
+ steps: ["Keys", "Wallet", "Phone", "Lock the door"]
22230
22493
  },
22231
22494
  {
22232
- key: "challenge-meditation",
22233
- name: "31-Day Meditation",
22234
- description: "Sit every day for a month.",
22235
- icon: "\uD83E\uDDD8",
22236
- color: "#a78bfa",
22237
- metric: "habits.checked_in",
22238
- target: 31,
22239
- durationDays: 31
22495
+ key: "skincare-routine",
22496
+ name: "Skincare AM/PM",
22497
+ description: "A simple morning and night skincare flow.",
22498
+ icon: "\uD83E\uDDF4",
22499
+ color: "#f472b6",
22500
+ category: "Self-care",
22501
+ steps: ["Cleanse", "Treat", "Moisturise", "SPF (AM only)"]
22240
22502
  },
22241
22503
  {
22242
- key: "challenge-no-spend",
22243
- name: "No-Spend Month",
22244
- description: "Thirty days of buying only the essentials.",
22245
- icon: "\uD83D\uDCB8",
22246
- color: "#f59e0b",
22247
- metric: "habits.checked_in",
22248
- target: 30,
22249
- durationDays: 30
22504
+ key: "shutdown-ritual",
22505
+ name: "Shutdown Ritual",
22506
+ description: "End the workday cleanly.",
22507
+ icon: "\uD83D\uDD0C",
22508
+ color: "#a78bfa",
22509
+ category: "Work",
22510
+ steps: ["Review what got done", "Note tomorrow's top task", "Close all tabs", "Step away"]
22250
22511
  }
22251
22512
  ];
22252
- var challengePresets = challengePresetDefs.map((def) => ({
22513
+ var routinePresets = routinePresetDefs.map((def) => ({
22253
22514
  key: def.key,
22254
- entity: "challenge",
22515
+ entity: "routine",
22255
22516
  name: def.name,
22256
22517
  description: def.description,
22257
22518
  icon: def.icon,
22258
22519
  color: def.color,
22259
- category: "Challenges",
22260
- featured: def.key === "challenge-couch-to-5k",
22520
+ category: def.category,
22521
+ ...def.displayKind ? { displayKind: def.displayKind } : {},
22522
+ featured: def.key === "morning-routine",
22261
22523
  recipe: {
22262
22524
  nodes: [
22263
22525
  {
22264
- ref: "challenge",
22265
- kind: "challenge",
22526
+ ref: "routine",
22527
+ kind: "routine",
22266
22528
  title: def.name,
22267
- description: def.description,
22268
- metric: def.metric,
22269
- target: def.target,
22270
- durationDays: def.durationDays
22529
+ steps: def.steps.map((title) => ({ title }))
22271
22530
  }
22272
22531
  ]
22273
22532
  }
22274
22533
  }));
22275
- var automationPresets = [
22276
- {
22277
- key: "auto-low-stock-groceries",
22278
- entity: "automation",
22279
- name: "Low stock \u2192 add to groceries",
22280
- description: "When an inventory item runs low, make a task to restock it.",
22281
- icon: "\uD83E\uDD6B",
22282
- color: "#34d399",
22283
- category: "Automations",
22284
- recipe: {
22285
- nodes: [
22286
- {
22287
- ref: "automation",
22288
- kind: "automation",
22289
- name: "Low stock \u2192 add to groceries",
22290
- trigger: { entity: "inventory", action: "updated" },
22291
- condition: { path: "value.lowStock", op: "eq", value: true },
22292
- action: { type: "create_task", title: "Restock low groceries", priority: "medium" }
22293
- }
22294
- ]
22295
- }
22296
- },
22297
- {
22298
- key: "auto-habit-missed-nudge",
22299
- entity: "automation",
22300
- name: "Habit missed 3\xD7 \u2192 nudge",
22301
- description: "Get a gentle nudge when you miss a habit three times.",
22302
- icon: "\uD83D\uDD14",
22303
- color: "#fb7185",
22304
- category: "Automations",
22305
- recipe: {
22306
- nodes: [
22307
- {
22308
- ref: "automation",
22309
- kind: "automation",
22310
- name: "Habit missed 3\xD7 \u2192 nudge",
22311
- trigger: { entity: "habits", action: "updated" },
22312
- condition: { path: "value.missedStreak", op: "eq", value: 3 },
22313
- action: {
22314
- type: "notify",
22315
- title: "Don't break the chain",
22316
- body: "You've missed this habit three times \u2014 jump back in today."
22317
- }
22318
- }
22319
- ]
22320
- }
22321
- },
22322
- {
22323
- key: "auto-task-overdue-bump",
22324
- entity: "automation",
22325
- name: "Task overdue \u2192 bump priority",
22326
- description: "When a task goes overdue, raise a high-priority follow-up.",
22327
- icon: "\u23F0",
22328
- color: "#f59e0b",
22329
- category: "Automations",
22330
- recipe: {
22331
- nodes: [
22332
- {
22333
- ref: "automation",
22334
- kind: "automation",
22335
- name: "Task overdue \u2192 bump priority",
22336
- trigger: { entity: "tasks", action: "updated" },
22337
- condition: { path: "value.overdue", op: "eq", value: true },
22338
- action: { type: "create_task", title: "Reprioritise overdue task", priority: "high" }
22339
- }
22340
- ]
22341
- }
22342
- },
22343
- {
22344
- key: "auto-weekly-review",
22345
- entity: "automation",
22346
- name: "Weekly review reminder",
22347
- description: "Reschedule your weekly review a week out each time you finish it.",
22348
- icon: "\uD83D\uDDD3\uFE0F",
22349
- color: "#34d399",
22350
- category: "Automations",
22351
- recipe: {
22352
- nodes: [
22353
- {
22354
- ref: "automation",
22355
- kind: "automation",
22356
- name: "Weekly review reminder",
22357
- trigger: { entity: "tasks", action: "updated" },
22358
- condition: { path: "value.title", op: "contains", value: "Weekly Review" },
22359
- action: { type: "schedule_task", offsetMinutes: 10080 }
22360
- }
22361
- ]
22362
- }
22363
- },
22364
- {
22365
- key: "auto-finished-book-rate",
22366
- entity: "automation",
22367
- name: "Finished book \u2192 rate it",
22368
- description: "When you finish a book, make a task to rate it.",
22369
- icon: "\uD83D\uDCDA",
22370
- color: "#f59e0b",
22371
- category: "Automations",
22372
- recipe: {
22373
- nodes: [
22374
- {
22375
- ref: "automation",
22376
- kind: "automation",
22377
- name: "Finished book \u2192 rate it",
22378
- trigger: { entity: "books", action: "updated" },
22379
- condition: { path: "value.status", op: "eq", value: "finished" },
22380
- action: {
22381
- type: "create_task",
22382
- title: "Rate the book you just finished",
22383
- priority: "low"
22384
- }
22385
- }
22386
- ]
22387
- }
22388
- }
22389
- ];
22390
- var presetCatalog = [
22534
+
22535
+ // ../../packages/schema/src/presets/features/index.ts
22536
+ var featurePresets = [
22391
22537
  ...habitPresets,
22392
22538
  ...shoppingListPresets,
22393
22539
  ...inventoryPresets,
@@ -22399,6 +22545,9 @@ var presetCatalog = [
22399
22545
  ...challengePresets,
22400
22546
  ...automationPresets
22401
22547
  ];
22548
+
22549
+ // ../../packages/schema/src/presets/catalog.ts
22550
+ var presetCatalog = featurePresets;
22402
22551
  var presetsByKey = new Map(presetCatalog.map((preset) => [preset.key, preset]));
22403
22552
  // ../../node_modules/.bun/ulidx@2.4.1/node_modules/ulidx/dist/node/index.js
22404
22553
  import crypto from "crypto";
@@ -22652,7 +22801,7 @@ function parseCapture2(input) {
22652
22801
 
22653
22802
  // src/meta.ts
22654
22803
  var CLI_NAME = "do";
22655
- var VERSION = "1.29.0";
22804
+ var VERSION = "1.31.0";
22656
22805
  var API_PREFIX = "/api/v1";
22657
22806
  var DEFAULT_API_URL = "http://localhost:3001";
22658
22807