@robbeverhelst/do 1.29.0 → 1.30.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 +82 -25
  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({
@@ -21524,16 +21554,6 @@ var habitPresets = [
21524
21554
  ];
21525
21555
  var shoppingItems2 = (...titles) => titles.map((title) => ({ title }));
21526
21556
  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
21557
  {
21538
21558
  key: "watchlist",
21539
21559
  name: "Watchlist",
@@ -21615,21 +21635,58 @@ var listPresetDefs = [
21615
21635
  items: ["Change HVAC filter", "Clean gutters", "Test smoke alarms", "Descale kettle"]
21616
21636
  }
21617
21637
  ];
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",
21638
+ var booksToRead = [
21639
+ { title: "Atomic Habits", author: "James Clear" },
21640
+ { title: "Deep Work", author: "Cal Newport" },
21641
+ { title: "The Pragmatic Programmer", author: "Andrew Hunt" }
21642
+ ];
21643
+ var booksToReadPreset = {
21644
+ key: "books-to-read",
21645
+ entity: "library",
21646
+ name: "Books to Read",
21647
+ description: "Your reading queue \u2014 covers, status and ratings.",
21648
+ icon: "\uD83D\uDCDA",
21649
+ color: "#f59e0b",
21650
+ category: "Reading",
21651
+ displayKind: MEDIA_SHELF_DISPLAY_KIND,
21627
21652
  recipe: {
21628
21653
  nodes: [
21629
- { ref: "list", kind: "shopping_list", title: def.title, items: shoppingItems2(...def.items) }
21654
+ {
21655
+ ref: "list",
21656
+ kind: "shopping_list",
21657
+ title: "Books to Read",
21658
+ displayKind: MEDIA_SHELF_DISPLAY_KIND,
21659
+ items: booksToRead.map((book) => ({
21660
+ title: book.title,
21661
+ facet: { author: book.author, status: "to-read" }
21662
+ }))
21663
+ }
21630
21664
  ]
21631
21665
  }
21632
- }));
21666
+ };
21667
+ var shoppingListPresets = [
21668
+ booksToReadPreset,
21669
+ ...listPresetDefs.map((def) => ({
21670
+ key: def.key,
21671
+ entity: "list",
21672
+ name: def.name,
21673
+ description: def.description,
21674
+ icon: def.icon,
21675
+ color: def.color,
21676
+ category: def.category,
21677
+ featured: def.key === "groceries",
21678
+ recipe: {
21679
+ nodes: [
21680
+ {
21681
+ ref: "list",
21682
+ kind: "shopping_list",
21683
+ title: def.title,
21684
+ items: shoppingItems2(...def.items)
21685
+ }
21686
+ ]
21687
+ }
21688
+ }))
21689
+ ];
21633
21690
  var pantryStaples = [
21634
21691
  { title: "Rice", category: "Grains", unit: "kg", threshold: 1 },
21635
21692
  { title: "Pasta", category: "Grains", unit: "boxes", threshold: 2 },
@@ -22652,7 +22709,7 @@ function parseCapture2(input) {
22652
22709
 
22653
22710
  // src/meta.ts
22654
22711
  var CLI_NAME = "do";
22655
- var VERSION = "1.29.0";
22712
+ var VERSION = "1.30.0";
22656
22713
  var API_PREFIX = "/api/v1";
22657
22714
  var DEFAULT_API_URL = "http://localhost:3001";
22658
22715
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robbeverhelst/do",
3
- "version": "1.29.0",
3
+ "version": "1.30.0",
4
4
  "private": false,
5
5
  "description": "do — the agent-drivable CLI over the public /api/v1 surface",
6
6
  "type": "module",