@robbeverhelst/do 1.26.0 → 1.27.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 +515 -1
  2. package/package.json +1 -1
package/dist/do.js CHANGED
@@ -21061,6 +21061,520 @@ function parseCapture(input) {
21061
21061
  const title = input.replace(TAG_RE, " ").replace(PRIORITY_RE, " ").replace(AREA_RE, " ").replace(/\s+/g, " ").trim();
21062
21062
  return { title, tags, ...priority ? { priority } : {}, ...area ? { area } : {} };
21063
21063
  }
21064
+ // ../../packages/schema/src/presets/recipe.ts
21065
+ var presetEntitySchema = exports_external.enum(["habit", "list", "inventory"]);
21066
+ var recipeNodeBase = {
21067
+ ref: exports_external.string().min(1),
21068
+ parentRef: exports_external.string().min(1).nullish()
21069
+ };
21070
+ var recipeHabitNodeSchema = exports_external.object({
21071
+ ...recipeNodeBase,
21072
+ kind: exports_external.literal("habit"),
21073
+ title: exports_external.string().min(1),
21074
+ measurementType: habitMeasurementTypeSchema,
21075
+ targetValue: exports_external.number().nonnegative().nullish(),
21076
+ targetUnit: exports_external.string().min(1).nullish(),
21077
+ period: habitPeriodSchema.optional(),
21078
+ frequencyCount: exports_external.number().int().positive().optional()
21079
+ });
21080
+ var recipeShoppingItemSchema = exports_external.object({
21081
+ title: exports_external.string().min(1),
21082
+ quantity: exports_external.number().positive().nullish(),
21083
+ unit: exports_external.string().min(1).nullish(),
21084
+ notes: exports_external.string().min(1).nullish()
21085
+ });
21086
+ var recipeShoppingListNodeSchema = exports_external.object({
21087
+ ...recipeNodeBase,
21088
+ kind: exports_external.literal("shopping_list"),
21089
+ title: exports_external.string().min(1),
21090
+ notes: exports_external.string().min(1).nullish(),
21091
+ items: exports_external.array(recipeShoppingItemSchema).optional()
21092
+ });
21093
+ var recipeInventoryNodeSchema = exports_external.object({
21094
+ ...recipeNodeBase,
21095
+ kind: exports_external.literal("inventory_item"),
21096
+ title: exports_external.string().min(1),
21097
+ quantity: exports_external.number().min(0).optional(),
21098
+ unit: exports_external.string().min(1).nullish(),
21099
+ category: exports_external.string().min(1).nullish(),
21100
+ location: exports_external.string().min(1).nullish(),
21101
+ lowStockThreshold: exports_external.number().min(0).nullish()
21102
+ });
21103
+ var recipeNodeSchema = exports_external.discriminatedUnion("kind", [
21104
+ recipeHabitNodeSchema,
21105
+ recipeShoppingListNodeSchema,
21106
+ recipeInventoryNodeSchema
21107
+ ]);
21108
+ var presetRecipeSchema = exports_external.object({
21109
+ nodes: exports_external.array(recipeNodeSchema).min(1)
21110
+ });
21111
+ var presetSchema = exports_external.object({
21112
+ key: exports_external.string().min(1),
21113
+ entity: presetEntitySchema,
21114
+ name: exports_external.string().min(1),
21115
+ description: exports_external.string().min(1),
21116
+ icon: exports_external.string().min(1),
21117
+ color: exports_external.string().regex(/^#[0-9a-fA-F]{6}$/),
21118
+ category: exports_external.string().min(1),
21119
+ displayKind: exports_external.string().min(1).optional(),
21120
+ recipe: presetRecipeSchema
21121
+ });
21122
+ var presetInstallResultSchema = exports_external.object({
21123
+ key: exports_external.string().min(1),
21124
+ entity: presetEntitySchema,
21125
+ nodeIds: exports_external.array(exports_external.string()),
21126
+ nodeCount: exports_external.number().int().nonnegative()
21127
+ });
21128
+ // ../../packages/schema/src/presets/catalog.ts
21129
+ var habitPresets = [
21130
+ {
21131
+ key: "drink-water",
21132
+ entity: "habit",
21133
+ name: "Drink Water",
21134
+ description: "Stay hydrated \u2014 8 glasses a day.",
21135
+ icon: "\uD83D\uDCA7",
21136
+ color: "#38bdf8",
21137
+ category: "Health",
21138
+ displayKind: "water-cup",
21139
+ recipe: {
21140
+ nodes: [
21141
+ {
21142
+ ref: "habit",
21143
+ kind: "habit",
21144
+ title: "Drink Water",
21145
+ measurementType: "quantitative",
21146
+ targetValue: 8,
21147
+ targetUnit: "glasses",
21148
+ period: "day"
21149
+ }
21150
+ ]
21151
+ }
21152
+ },
21153
+ {
21154
+ key: "meditate",
21155
+ entity: "habit",
21156
+ name: "Meditate",
21157
+ description: "A daily 10-minute sit.",
21158
+ icon: "\uD83E\uDDD8",
21159
+ color: "#a78bfa",
21160
+ category: "Mindfulness",
21161
+ recipe: {
21162
+ nodes: [
21163
+ {
21164
+ ref: "habit",
21165
+ kind: "habit",
21166
+ title: "Meditate",
21167
+ measurementType: "duration",
21168
+ targetValue: 10,
21169
+ targetUnit: "min",
21170
+ period: "day"
21171
+ }
21172
+ ]
21173
+ }
21174
+ },
21175
+ {
21176
+ key: "steps",
21177
+ entity: "habit",
21178
+ name: "Steps",
21179
+ description: "Hit 10,000 steps a day.",
21180
+ icon: "\uD83D\uDC5F",
21181
+ color: "#34d399",
21182
+ category: "Fitness",
21183
+ recipe: {
21184
+ nodes: [
21185
+ {
21186
+ ref: "habit",
21187
+ kind: "habit",
21188
+ title: "Steps",
21189
+ measurementType: "quantitative",
21190
+ targetValue: 1e4,
21191
+ targetUnit: "steps",
21192
+ period: "day"
21193
+ }
21194
+ ]
21195
+ }
21196
+ },
21197
+ {
21198
+ key: "read",
21199
+ entity: "habit",
21200
+ name: "Read",
21201
+ description: "Read for 30 minutes a day.",
21202
+ icon: "\uD83D\uDCD6",
21203
+ color: "#f59e0b",
21204
+ category: "Growth",
21205
+ recipe: {
21206
+ nodes: [
21207
+ {
21208
+ ref: "habit",
21209
+ kind: "habit",
21210
+ title: "Read",
21211
+ measurementType: "duration",
21212
+ targetValue: 30,
21213
+ targetUnit: "min",
21214
+ period: "day"
21215
+ }
21216
+ ]
21217
+ }
21218
+ },
21219
+ {
21220
+ key: "stretch",
21221
+ entity: "habit",
21222
+ name: "Stretch",
21223
+ description: "Loosen up once a day.",
21224
+ icon: "\uD83E\uDD38",
21225
+ color: "#34d399",
21226
+ category: "Fitness",
21227
+ recipe: {
21228
+ nodes: [
21229
+ { ref: "habit", kind: "habit", title: "Stretch", measurementType: "binary", period: "day" }
21230
+ ]
21231
+ }
21232
+ },
21233
+ {
21234
+ key: "workout",
21235
+ entity: "habit",
21236
+ name: "Workout",
21237
+ description: "Train three times a week.",
21238
+ icon: "\uD83C\uDFCB\uFE0F",
21239
+ color: "#fb7185",
21240
+ category: "Fitness",
21241
+ recipe: {
21242
+ nodes: [
21243
+ {
21244
+ ref: "habit",
21245
+ kind: "habit",
21246
+ title: "Workout",
21247
+ measurementType: "binary",
21248
+ period: "week",
21249
+ frequencyCount: 3
21250
+ }
21251
+ ]
21252
+ }
21253
+ },
21254
+ {
21255
+ key: "vitamins",
21256
+ entity: "habit",
21257
+ name: "Vitamins",
21258
+ description: "Take your daily vitamins.",
21259
+ icon: "\uD83D\uDC8A",
21260
+ color: "#38bdf8",
21261
+ category: "Health",
21262
+ recipe: {
21263
+ nodes: [
21264
+ {
21265
+ ref: "habit",
21266
+ kind: "habit",
21267
+ title: "Vitamins",
21268
+ measurementType: "binary",
21269
+ period: "day"
21270
+ }
21271
+ ]
21272
+ }
21273
+ },
21274
+ {
21275
+ key: "journal",
21276
+ entity: "habit",
21277
+ name: "Journal",
21278
+ description: "Write a daily journal entry.",
21279
+ icon: "\uD83D\uDCD3",
21280
+ color: "#a78bfa",
21281
+ category: "Mindfulness",
21282
+ recipe: {
21283
+ nodes: [
21284
+ { ref: "habit", kind: "habit", title: "Journal", measurementType: "binary", period: "day" }
21285
+ ]
21286
+ }
21287
+ },
21288
+ {
21289
+ key: "sleep-by-11pm",
21290
+ entity: "habit",
21291
+ name: "Sleep by 11pm",
21292
+ description: "Lights out before eleven.",
21293
+ icon: "\uD83C\uDF19",
21294
+ color: "#818cf8",
21295
+ category: "Health",
21296
+ recipe: {
21297
+ nodes: [
21298
+ {
21299
+ ref: "habit",
21300
+ kind: "habit",
21301
+ title: "Sleep by 11pm",
21302
+ measurementType: "binary",
21303
+ period: "day"
21304
+ }
21305
+ ]
21306
+ }
21307
+ },
21308
+ {
21309
+ key: "no-smoking",
21310
+ entity: "habit",
21311
+ name: "No Smoking",
21312
+ description: "Stay smoke-free, one day at a time.",
21313
+ icon: "\uD83D\uDEAD",
21314
+ color: "#fb7185",
21315
+ category: "Abstinence",
21316
+ displayKind: "abstinence-streak",
21317
+ recipe: {
21318
+ nodes: [
21319
+ {
21320
+ ref: "habit",
21321
+ kind: "habit",
21322
+ title: "No Smoking",
21323
+ measurementType: "negative",
21324
+ targetValue: 0,
21325
+ period: "day"
21326
+ }
21327
+ ]
21328
+ }
21329
+ },
21330
+ {
21331
+ key: "no-alcohol",
21332
+ entity: "habit",
21333
+ name: "No Alcohol",
21334
+ description: "Keep the day alcohol-free.",
21335
+ icon: "\uD83D\uDEAB",
21336
+ color: "#fb7185",
21337
+ category: "Abstinence",
21338
+ displayKind: "abstinence-streak",
21339
+ recipe: {
21340
+ nodes: [
21341
+ {
21342
+ ref: "habit",
21343
+ kind: "habit",
21344
+ title: "No Alcohol",
21345
+ measurementType: "negative",
21346
+ targetValue: 0,
21347
+ period: "day"
21348
+ }
21349
+ ]
21350
+ }
21351
+ },
21352
+ {
21353
+ key: "no-sugar",
21354
+ entity: "habit",
21355
+ name: "No Sugar",
21356
+ description: "Skip the added sugar today.",
21357
+ icon: "\uD83C\uDF6D",
21358
+ color: "#fb7185",
21359
+ category: "Abstinence",
21360
+ displayKind: "abstinence-streak",
21361
+ recipe: {
21362
+ nodes: [
21363
+ {
21364
+ ref: "habit",
21365
+ kind: "habit",
21366
+ title: "No Sugar",
21367
+ measurementType: "negative",
21368
+ targetValue: 0,
21369
+ period: "day"
21370
+ }
21371
+ ]
21372
+ }
21373
+ },
21374
+ {
21375
+ key: "floss",
21376
+ entity: "habit",
21377
+ name: "Floss",
21378
+ description: "Floss once a day.",
21379
+ icon: "\uD83E\uDDB7",
21380
+ color: "#38bdf8",
21381
+ category: "Health",
21382
+ recipe: {
21383
+ nodes: [
21384
+ { ref: "habit", kind: "habit", title: "Floss", measurementType: "binary", period: "day" }
21385
+ ]
21386
+ }
21387
+ },
21388
+ {
21389
+ key: "morning-sunlight",
21390
+ entity: "habit",
21391
+ name: "Morning Sunlight",
21392
+ description: "Get daylight early to set your clock.",
21393
+ icon: "\uD83C\uDF05",
21394
+ color: "#f59e0b",
21395
+ category: "Health",
21396
+ recipe: {
21397
+ nodes: [
21398
+ {
21399
+ ref: "habit",
21400
+ kind: "habit",
21401
+ title: "Morning Sunlight",
21402
+ measurementType: "binary",
21403
+ period: "day"
21404
+ }
21405
+ ]
21406
+ }
21407
+ },
21408
+ {
21409
+ key: "gratitude",
21410
+ entity: "habit",
21411
+ name: "Gratitude (3)",
21412
+ description: "Note three things you're grateful for.",
21413
+ icon: "\uD83D\uDE4F",
21414
+ color: "#a78bfa",
21415
+ category: "Mindfulness",
21416
+ recipe: {
21417
+ nodes: [
21418
+ {
21419
+ ref: "habit",
21420
+ kind: "habit",
21421
+ title: "Gratitude (3)",
21422
+ measurementType: "quantitative",
21423
+ targetValue: 3,
21424
+ targetUnit: "notes",
21425
+ period: "day"
21426
+ }
21427
+ ]
21428
+ }
21429
+ }
21430
+ ];
21431
+ var shoppingItems2 = (...titles) => titles.map((title) => ({ title }));
21432
+ var listPresetDefs = [
21433
+ {
21434
+ key: "books-to-read",
21435
+ name: "Books to Read",
21436
+ description: "Your reading queue.",
21437
+ icon: "\uD83D\uDCDA",
21438
+ color: "#f59e0b",
21439
+ category: "Reading",
21440
+ title: "Books to Read",
21441
+ items: ["Atomic Habits", "Deep Work", "The Pragmatic Programmer"]
21442
+ },
21443
+ {
21444
+ key: "watchlist",
21445
+ name: "Watchlist",
21446
+ description: "Films and shows to watch.",
21447
+ icon: "\uD83C\uDFAC",
21448
+ color: "#a78bfa",
21449
+ category: "Entertainment",
21450
+ title: "Watchlist",
21451
+ items: ["Dune: Part Two", "The Bear", "Severance"]
21452
+ },
21453
+ {
21454
+ key: "groceries",
21455
+ name: "Groceries",
21456
+ description: "A weekly grocery run.",
21457
+ icon: "\uD83D\uDED2",
21458
+ color: "#34d399",
21459
+ category: "Food",
21460
+ title: "Groceries",
21461
+ items: ["Milk", "Eggs", "Bread", "Bananas", "Coffee", "Spinach"]
21462
+ },
21463
+ {
21464
+ key: "packing-list",
21465
+ name: "Packing List",
21466
+ description: "Don't forget the essentials.",
21467
+ icon: "\uD83E\uDDF3",
21468
+ color: "#38bdf8",
21469
+ category: "Travel",
21470
+ title: "Packing List",
21471
+ items: ["Passport", "Charger", "Toothbrush", "Headphones", "Adapter"]
21472
+ },
21473
+ {
21474
+ key: "wishlist",
21475
+ name: "Wishlist",
21476
+ description: "Things you'd love to have.",
21477
+ icon: "\u2B50",
21478
+ color: "#f59e0b",
21479
+ category: "Shopping",
21480
+ title: "Wishlist",
21481
+ items: ["New running shoes", "Standing desk", "E-reader"]
21482
+ },
21483
+ {
21484
+ key: "gift-ideas",
21485
+ name: "Gift Ideas",
21486
+ description: "Presents to remember.",
21487
+ icon: "\uD83C\uDF81",
21488
+ color: "#fb7185",
21489
+ category: "Gifts",
21490
+ title: "Gift Ideas",
21491
+ items: ["Mom \u2014 gardening gloves", "Dad \u2014 coffee beans", "Sam \u2014 board game"]
21492
+ },
21493
+ {
21494
+ key: "restaurants-to-try",
21495
+ name: "Restaurants to Try",
21496
+ description: "Where to eat next.",
21497
+ icon: "\uD83C\uDF7D\uFE0F",
21498
+ color: "#fb7185",
21499
+ category: "Food",
21500
+ title: "Restaurants to Try",
21501
+ items: ["Corner ramen spot", "New taqueria", "That rooftop place"]
21502
+ },
21503
+ {
21504
+ key: "places-to-travel",
21505
+ name: "Places to Travel",
21506
+ description: "Your someday-soon map.",
21507
+ icon: "\u2708\uFE0F",
21508
+ color: "#38bdf8",
21509
+ category: "Travel",
21510
+ title: "Places to Travel",
21511
+ items: ["Lisbon", "Kyoto", "Patagonia"]
21512
+ },
21513
+ {
21514
+ key: "home-maintenance",
21515
+ name: "Home Maintenance",
21516
+ description: "Keep the house in shape.",
21517
+ icon: "\uD83C\uDFE0",
21518
+ color: "#f59e0b",
21519
+ category: "Home",
21520
+ title: "Home Maintenance",
21521
+ items: ["Change HVAC filter", "Clean gutters", "Test smoke alarms", "Descale kettle"]
21522
+ }
21523
+ ];
21524
+ var shoppingListPresets = listPresetDefs.map((def) => ({
21525
+ key: def.key,
21526
+ entity: "list",
21527
+ name: def.name,
21528
+ description: def.description,
21529
+ icon: def.icon,
21530
+ color: def.color,
21531
+ category: def.category,
21532
+ recipe: {
21533
+ nodes: [
21534
+ { ref: "list", kind: "shopping_list", title: def.title, items: shoppingItems2(...def.items) }
21535
+ ]
21536
+ }
21537
+ }));
21538
+ var pantryStaples = [
21539
+ { title: "Rice", category: "Grains", unit: "kg", threshold: 1 },
21540
+ { title: "Pasta", category: "Grains", unit: "boxes", threshold: 2 },
21541
+ { title: "Olive oil", category: "Oils", unit: "bottles", threshold: 1 },
21542
+ { title: "Canned tomatoes", category: "Canned", unit: "cans", threshold: 3 },
21543
+ { title: "Black beans", category: "Canned", unit: "cans", threshold: 3 },
21544
+ { title: "Flour", category: "Baking", unit: "kg", threshold: 1 },
21545
+ { title: "Sugar", category: "Baking", unit: "kg", threshold: 1 },
21546
+ { title: "Coffee", category: "Beverages", unit: "bags", threshold: 1 },
21547
+ { title: "Salt", category: "Spices", unit: "boxes", threshold: 1 },
21548
+ { title: "Paper towels", category: "Household", unit: "rolls", threshold: 2 }
21549
+ ];
21550
+ var inventoryPresets = [
21551
+ {
21552
+ key: "pantry-staples",
21553
+ entity: "inventory",
21554
+ name: "Pantry Staples",
21555
+ description: "Stock the essentials and get a heads-up before they run out.",
21556
+ icon: "\uD83E\uDD6B",
21557
+ color: "#34d399",
21558
+ category: "Home",
21559
+ recipe: {
21560
+ nodes: pantryStaples.map((staple, index2) => ({
21561
+ ref: `staple-${index2}`,
21562
+ kind: "inventory_item",
21563
+ title: staple.title,
21564
+ category: staple.category,
21565
+ location: "Pantry",
21566
+ unit: staple.unit,
21567
+ lowStockThreshold: staple.threshold
21568
+ }))
21569
+ }
21570
+ }
21571
+ ];
21572
+ var presetCatalog = [
21573
+ ...habitPresets,
21574
+ ...shoppingListPresets,
21575
+ ...inventoryPresets
21576
+ ];
21577
+ var presetsByKey = new Map(presetCatalog.map((preset) => [preset.key, preset]));
21064
21578
  // ../../node_modules/.bun/ulidx@2.4.1/node_modules/ulidx/dist/node/index.js
21065
21579
  import crypto from "crypto";
21066
21580
 
@@ -21313,7 +21827,7 @@ function parseCapture2(input) {
21313
21827
 
21314
21828
  // src/meta.ts
21315
21829
  var CLI_NAME = "do";
21316
- var VERSION = "1.26.0";
21830
+ var VERSION = "1.27.0";
21317
21831
  var API_PREFIX = "/api/v1";
21318
21832
  var DEFAULT_API_URL = "http://localhost:3001";
21319
21833
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robbeverhelst/do",
3
- "version": "1.26.0",
3
+ "version": "1.27.0",
4
4
  "private": false,
5
5
  "description": "do — the agent-drivable CLI over the public /api/v1 surface",
6
6
  "type": "module",