@robbeverhelst/do 1.36.0 → 1.38.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 +201 -35
  2. package/package.json +1 -1
package/dist/do.js CHANGED
@@ -4533,7 +4533,8 @@ var inventoryItems = pgTable("inventory_items", {
4533
4533
  location: text("location"),
4534
4534
  lowStockThreshold: doublePrecision("low_stock_threshold"),
4535
4535
  expiresAt: timestamp("expires_at", { withTimezone: true }),
4536
- notes: text("notes")
4536
+ notes: text("notes"),
4537
+ facet: jsonb("facet").$type()
4537
4538
  }, (t) => [
4538
4539
  index("inventory_items_tenant_idx").on(t.tenantId)
4539
4540
  ]);
@@ -20084,9 +20085,78 @@ var shoppingListDetailSchema = shoppingListViewSchema.extend({
20084
20085
  items: exports_external.array(shoppingItemSchema)
20085
20086
  });
20086
20087
  var setShoppingItemCheckedInputSchema = exports_external.object({ isChecked: exports_external.boolean() }).strict();
20088
+ // ../../packages/schema/src/presets/facets.ts
20089
+ var MEDIA_SHELF_DISPLAY_KIND = "media-shelf";
20090
+ var bookStatusValues = ["to-read", "reading", "read"];
20091
+ var bookStatusSchema = exports_external.enum(bookStatusValues);
20092
+ var mediaShelfFacetSchema = exports_external.object({
20093
+ author: exports_external.string().min(1).max(200).nullish(),
20094
+ coverUrl: exports_external.string().url().max(2048).nullish(),
20095
+ status: bookStatusSchema.default("to-read"),
20096
+ rating: exports_external.number().int().min(1).max(5).nullish()
20097
+ }).strict();
20098
+ var PANTRY_DISPLAY_KIND = "pantry";
20099
+ var WARDROBE_DISPLAY_KIND = "wardrobe";
20100
+ var TOOLS_DISPLAY_KIND = "tools";
20101
+ var MEDS_DISPLAY_KIND = "meds";
20102
+ var INVENTORY_AREA_KINDS = [
20103
+ PANTRY_DISPLAY_KIND,
20104
+ WARDROBE_DISPLAY_KIND,
20105
+ TOOLS_DISPLAY_KIND,
20106
+ MEDS_DISPLAY_KIND
20107
+ ];
20108
+ var INVENTORY_DISPLAY_KINDS = ["default", ...INVENTORY_AREA_KINDS];
20109
+ var isoDateString = exports_external.string().regex(/^\d{4}-\d{2}-\d{2}$/, "must be an ISO date (YYYY-MM-DD)");
20110
+ var wardrobeSeasonValues = ["spring", "summer", "autumn", "winter", "all-season"];
20111
+ var wardrobeSeasonSchema = exports_external.enum(wardrobeSeasonValues);
20112
+ var toolConditionValues = ["new", "good", "worn", "broken"];
20113
+ var toolConditionSchema = exports_external.enum(toolConditionValues);
20114
+ var pantryFacetSchema = exports_external.object({
20115
+ brand: exports_external.string().min(1).max(200).nullish(),
20116
+ openedAt: isoDateString.nullish()
20117
+ }).strict();
20118
+ var wardrobeFacetSchema = exports_external.object({
20119
+ size: exports_external.string().min(1).max(50).nullish(),
20120
+ season: wardrobeSeasonSchema.nullish(),
20121
+ color: exports_external.string().min(1).max(50).nullish()
20122
+ }).strict();
20123
+ var toolsFacetSchema = exports_external.object({
20124
+ brand: exports_external.string().min(1).max(200).nullish(),
20125
+ condition: toolConditionSchema.nullish(),
20126
+ lastServicedAt: isoDateString.nullish()
20127
+ }).strict();
20128
+ var medsFacetSchema = exports_external.object({
20129
+ dose: exports_external.string().min(1).max(100).nullish(),
20130
+ refillBy: isoDateString.nullish(),
20131
+ prescription: exports_external.boolean().nullish()
20132
+ }).strict();
20133
+ var WATCH_SHELF_DISPLAY_KIND = "watch-shelf";
20134
+ var watchKindValues = ["movie", "show"];
20135
+ var watchKindSchema = exports_external.enum(watchKindValues);
20136
+ var watchStatusValues = ["to-watch", "watching", "watched"];
20137
+ var watchStatusSchema = exports_external.enum(watchStatusValues);
20138
+ var watchFacetSchema = exports_external.object({
20139
+ kind: watchKindSchema.default("movie"),
20140
+ status: watchStatusSchema.default("to-watch"),
20141
+ rating: exports_external.number().int().min(1).max(5).nullish(),
20142
+ year: exports_external.number().int().min(1888).max(2200).nullish(),
20143
+ posterUrl: exports_external.string().url().max(2048).nullish()
20144
+ }).strict();
20145
+ var facetSchemasByDisplayKind = {
20146
+ [MEDIA_SHELF_DISPLAY_KIND]: mediaShelfFacetSchema,
20147
+ [PANTRY_DISPLAY_KIND]: pantryFacetSchema,
20148
+ [WARDROBE_DISPLAY_KIND]: wardrobeFacetSchema,
20149
+ [TOOLS_DISPLAY_KIND]: toolsFacetSchema,
20150
+ [MEDS_DISPLAY_KIND]: medsFacetSchema,
20151
+ [WATCH_SHELF_DISPLAY_KIND]: watchFacetSchema
20152
+ };
20153
+
20087
20154
  // ../../packages/schema/src/contracts/inventory.ts
20155
+ var inventoryDisplayKindSchema = exports_external.enum(INVENTORY_DISPLAY_KINDS);
20156
+ var inventoryItemFacetSchema = exports_external.record(exports_external.string(), exports_external.unknown());
20088
20157
  var inventoryItemSchema = createSelectSchema(inventoryItems, {
20089
- expiresAt: exports_external.coerce.date().nullable()
20158
+ expiresAt: exports_external.coerce.date().nullable(),
20159
+ facet: inventoryItemFacetSchema.nullable()
20090
20160
  });
20091
20161
  var createInventoryItemInputSchema = exports_external.object({
20092
20162
  id: ulidSchema,
@@ -20098,7 +20168,9 @@ var createInventoryItemInputSchema = exports_external.object({
20098
20168
  location: exports_external.string().nullish(),
20099
20169
  lowStockThreshold: exports_external.number().min(0).nullish(),
20100
20170
  expiresAt: exports_external.coerce.date().nullish(),
20101
- notes: exports_external.string().nullish()
20171
+ notes: exports_external.string().nullish(),
20172
+ displayKind: inventoryDisplayKindSchema.optional(),
20173
+ facet: inventoryItemFacetSchema.nullish()
20102
20174
  });
20103
20175
  var updateInventoryItemInputSchema = exports_external.object({
20104
20176
  title: exports_external.string().min(1).optional(),
@@ -20109,11 +20181,14 @@ var updateInventoryItemInputSchema = exports_external.object({
20109
20181
  location: exports_external.string().nullish(),
20110
20182
  lowStockThreshold: exports_external.number().min(0).nullish(),
20111
20183
  expiresAt: exports_external.coerce.date().nullish(),
20112
- notes: exports_external.string().nullish()
20184
+ notes: exports_external.string().nullish(),
20185
+ displayKind: inventoryDisplayKindSchema.optional(),
20186
+ facet: inventoryItemFacetSchema.nullish()
20113
20187
  }).strict();
20114
20188
  var inventoryItemViewSchema = inventoryItemSchema.extend({
20115
20189
  title: exports_external.string(),
20116
20190
  parentId: ulidSchema.nullable(),
20191
+ displayKind: exports_external.string(),
20117
20192
  createdAt: exports_external.coerce.date(),
20118
20193
  updatedAt: exports_external.coerce.date(),
20119
20194
  deletedAt: exports_external.coerce.date().nullable()
@@ -21116,32 +21191,6 @@ function parseCapture(input) {
21116
21191
  const title = input.replace(TAG_RE, " ").replace(PRIORITY_RE, " ").replace(AREA_RE, " ").replace(/\s+/g, " ").trim();
21117
21192
  return { title, tags, ...priority ? { priority } : {}, ...area ? { area } : {} };
21118
21193
  }
21119
- // ../../packages/schema/src/presets/facets.ts
21120
- var MEDIA_SHELF_DISPLAY_KIND = "media-shelf";
21121
- var bookStatusValues = ["to-read", "reading", "read"];
21122
- var bookStatusSchema = exports_external.enum(bookStatusValues);
21123
- var mediaShelfFacetSchema = exports_external.object({
21124
- author: exports_external.string().min(1).max(200).nullish(),
21125
- coverUrl: exports_external.string().url().max(2048).nullish(),
21126
- status: bookStatusSchema.default("to-read"),
21127
- rating: exports_external.number().int().min(1).max(5).nullish()
21128
- }).strict();
21129
- var WATCH_SHELF_DISPLAY_KIND = "watch-shelf";
21130
- var watchKindValues = ["movie", "show"];
21131
- var watchKindSchema = exports_external.enum(watchKindValues);
21132
- var watchStatusValues = ["to-watch", "watching", "watched"];
21133
- var watchStatusSchema = exports_external.enum(watchStatusValues);
21134
- var watchFacetSchema = exports_external.object({
21135
- kind: watchKindSchema.default("movie"),
21136
- status: watchStatusSchema.default("to-watch"),
21137
- rating: exports_external.number().int().min(1).max(5).nullish(),
21138
- year: exports_external.number().int().min(1888).max(2200).nullish(),
21139
- posterUrl: exports_external.string().url().max(2048).nullish()
21140
- }).strict();
21141
- var facetSchemasByDisplayKind = {
21142
- [MEDIA_SHELF_DISPLAY_KIND]: mediaShelfFacetSchema,
21143
- [WATCH_SHELF_DISPLAY_KIND]: watchFacetSchema
21144
- };
21145
21194
  // ../../packages/schema/src/presets/recipe.ts
21146
21195
  var presetEntitySchema = exports_external.enum([
21147
21196
  "habit",
@@ -21678,6 +21727,27 @@ var habitPresets = [
21678
21727
  ]
21679
21728
  }
21680
21729
  },
21730
+ {
21731
+ key: "daily-practice",
21732
+ entity: "habit",
21733
+ name: "Daily Practice",
21734
+ description: "Show up every day and build the grid.",
21735
+ icon: "\uD83D\uDDD3\uFE0F",
21736
+ color: "#34d399",
21737
+ category: "Growth",
21738
+ displayKind: "calendar-heatmap",
21739
+ recipe: {
21740
+ nodes: [
21741
+ {
21742
+ ref: "habit",
21743
+ kind: "habit",
21744
+ title: "Daily Practice",
21745
+ measurementType: "binary",
21746
+ period: "day"
21747
+ }
21748
+ ]
21749
+ }
21750
+ },
21681
21751
  {
21682
21752
  key: "meditate",
21683
21753
  entity: "habit",
@@ -21686,6 +21756,7 @@ var habitPresets = [
21686
21756
  icon: "\uD83E\uDDD8",
21687
21757
  color: "#a78bfa",
21688
21758
  category: "Mindfulness",
21759
+ displayKind: "duration-timer",
21689
21760
  recipe: {
21690
21761
  nodes: [
21691
21762
  {
@@ -21708,6 +21779,7 @@ var habitPresets = [
21708
21779
  icon: "\uD83D\uDC5F",
21709
21780
  color: "#34d399",
21710
21781
  category: "Fitness",
21782
+ displayKind: "counter",
21711
21783
  recipe: {
21712
21784
  nodes: [
21713
21785
  {
@@ -21785,19 +21857,44 @@ var habitPresets = [
21785
21857
  key: "workout",
21786
21858
  entity: "habit",
21787
21859
  name: "Workout",
21788
- description: "Train three times a week.",
21860
+ description: "Get a 30-minute session in.",
21789
21861
  icon: "\uD83C\uDFCB\uFE0F",
21790
21862
  color: "#fb7185",
21791
21863
  category: "Fitness",
21864
+ displayKind: "duration-timer",
21792
21865
  recipe: {
21793
21866
  nodes: [
21794
21867
  {
21795
21868
  ref: "habit",
21796
21869
  kind: "habit",
21797
21870
  title: "Workout",
21798
- measurementType: "binary",
21799
- period: "week",
21800
- frequencyCount: 3
21871
+ measurementType: "duration",
21872
+ targetValue: 30,
21873
+ targetUnit: "min",
21874
+ period: "day"
21875
+ }
21876
+ ]
21877
+ }
21878
+ },
21879
+ {
21880
+ key: "focus",
21881
+ entity: "habit",
21882
+ name: "Focus",
21883
+ description: "Bank 25 minutes of deep work.",
21884
+ icon: "\uD83C\uDFAF",
21885
+ color: "#6366f1",
21886
+ category: "Growth",
21887
+ displayKind: "duration-timer",
21888
+ recipe: {
21889
+ nodes: [
21890
+ {
21891
+ ref: "habit",
21892
+ kind: "habit",
21893
+ title: "Focus",
21894
+ measurementType: "duration",
21895
+ targetValue: 25,
21896
+ targetUnit: "min",
21897
+ period: "day"
21801
21898
  }
21802
21899
  ]
21803
21900
  }
@@ -22025,6 +22122,75 @@ var habitPresets = [
22025
22122
  ]
22026
22123
  }
22027
22124
  },
22125
+ {
22126
+ key: "caffeine",
22127
+ entity: "habit",
22128
+ name: "Caffeine",
22129
+ description: "Stay under 400 mg of caffeine a day.",
22130
+ icon: "\u2615",
22131
+ color: "#a16207",
22132
+ category: "Health",
22133
+ displayKind: "counter",
22134
+ recipe: {
22135
+ nodes: [
22136
+ {
22137
+ ref: "habit",
22138
+ kind: "habit",
22139
+ title: "Caffeine",
22140
+ measurementType: "quantitative",
22141
+ targetValue: 400,
22142
+ targetUnit: "mg",
22143
+ period: "day"
22144
+ }
22145
+ ]
22146
+ }
22147
+ },
22148
+ {
22149
+ key: "screen-time",
22150
+ entity: "habit",
22151
+ name: "Screen Time",
22152
+ description: "Keep screen time to 120 minutes a day.",
22153
+ icon: "\uD83D\uDCF1",
22154
+ color: "#818cf8",
22155
+ category: "Health",
22156
+ displayKind: "counter",
22157
+ recipe: {
22158
+ nodes: [
22159
+ {
22160
+ ref: "habit",
22161
+ kind: "habit",
22162
+ title: "Screen Time",
22163
+ measurementType: "quantitative",
22164
+ targetValue: 120,
22165
+ targetUnit: "min",
22166
+ period: "day"
22167
+ }
22168
+ ]
22169
+ }
22170
+ },
22171
+ {
22172
+ key: "pages",
22173
+ entity: "habit",
22174
+ name: "Pages",
22175
+ description: "Read 30 pages a day.",
22176
+ icon: "\uD83D\uDCC4",
22177
+ color: "#f59e0b",
22178
+ category: "Growth",
22179
+ displayKind: "counter",
22180
+ recipe: {
22181
+ nodes: [
22182
+ {
22183
+ ref: "habit",
22184
+ kind: "habit",
22185
+ title: "Pages",
22186
+ measurementType: "quantitative",
22187
+ targetValue: 30,
22188
+ targetUnit: "pages",
22189
+ period: "day"
22190
+ }
22191
+ ]
22192
+ }
22193
+ },
22028
22194
  {
22029
22195
  key: "gratitude",
22030
22196
  entity: "habit",
@@ -22901,7 +23067,7 @@ function parseCapture2(input) {
22901
23067
 
22902
23068
  // src/meta.ts
22903
23069
  var CLI_NAME = "do";
22904
- var VERSION = "1.36.0";
23070
+ var VERSION = "1.38.0";
22905
23071
  var API_PREFIX = "/api/v1";
22906
23072
  var DEFAULT_API_URL = "http://localhost:3001";
22907
23073
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robbeverhelst/do",
3
- "version": "1.36.0",
3
+ "version": "1.38.0",
4
4
  "private": false,
5
5
  "description": "do — the agent-drivable CLI over the public /api/v1 surface",
6
6
  "type": "module",