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