@robbeverhelst/do 1.283.0 → 1.284.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 +50 -4
  2. package/package.json +1 -1
package/dist/do.js CHANGED
@@ -5822,6 +5822,7 @@ var journalImportItems = pgTable("journal_import_items", {
5822
5822
  body: text("body"),
5823
5823
  rating: doublePrecision("rating"),
5824
5824
  ratingQuestion: text("rating_question"),
5825
+ sleep: doublePrecision("sleep"),
5825
5826
  highlight: text("highlight"),
5826
5827
  milestoneCandidate: boolean("milestone_candidate").notNull().default(false),
5827
5828
  health: boolean("health").notNull().default(false),
@@ -22474,6 +22475,7 @@ var journalImportItemInputSchema = object({
22474
22475
  body: string2().trim().min(1).max(20000).nullish(),
22475
22476
  rating: number2().min(1).max(10).nullish(),
22476
22477
  ratingQuestion: string2().trim().min(1).max(80).nullish(),
22478
+ sleep: number2().min(0).max(24).nullish(),
22477
22479
  highlight: string2().trim().min(1).max(200).nullish(),
22478
22480
  milestoneCandidate: boolean3().default(false),
22479
22481
  health: boolean3().default(false),
@@ -22502,6 +22504,7 @@ var journalImportItemSchema = object({
22502
22504
  body: string2().nullable(),
22503
22505
  rating: number2().nullable(),
22504
22506
  ratingQuestion: string2().nullable(),
22507
+ sleep: number2().nullable().default(null),
22505
22508
  highlight: string2().nullable(),
22506
22509
  milestoneCandidate: boolean3(),
22507
22510
  health: boolean3(),
@@ -22526,6 +22529,7 @@ var journalImportOverviewSchema = object({
22526
22529
  ratings: number2().int(),
22527
22530
  unclearRatings: array(string2()),
22528
22531
  milestoneCandidates: number2().int(),
22532
+ sleep: number2().int().default(0),
22529
22533
  health: number2().int(),
22530
22534
  links: number2().int()
22531
22535
  }),
@@ -23548,7 +23552,8 @@ var foodWeekSchema = object({
23548
23552
  points: array(object({ day: civilDate, value: number2() })),
23549
23553
  trend: array(object({ day: civilDate, value: number2() })),
23550
23554
  latest: number2().nullable(),
23551
- perWeek: number2().nullable()
23555
+ perWeek: number2().nullable(),
23556
+ source: metricSourceSchema.nullable()
23552
23557
  }),
23553
23558
  numbers: object({
23554
23559
  completeDays: number2().int(),
@@ -25305,6 +25310,7 @@ var runQuestSchema = object({
25305
25310
  status: runQuestStatusSchema.default("active"),
25306
25311
  objective: text5.nullish(),
25307
25312
  hint: shortText.nullish(),
25313
+ reward: shortText.nullish(),
25308
25314
  place: shortText.nullish(),
25309
25315
  steps: array(object({
25310
25316
  text: shortText.pipe(string2().min(1)),
@@ -25336,7 +25342,7 @@ var runChoiceSchema = object({
25336
25342
  var runHomeSchema = object({
25337
25343
  ref: ref.nullish(),
25338
25344
  name,
25339
- role: _enum2(["home", "collector", "storage", "planned"]).default("home"),
25345
+ role: _enum2(["home", "collector", "storage", "planned", "later"]).default("home"),
25340
25346
  place: shortText.nullish(),
25341
25347
  upgrades: array(object({ name, done: boolean3().default(false) }).strict()).max(40).optional(),
25342
25348
  steward: shortText.nullish(),
@@ -26057,7 +26063,8 @@ var animalHandoverTripSchema = object({
26057
26063
  houseNote: string2().nullable(),
26058
26064
  holidayMode: animalHolidayModeSchema,
26059
26065
  sharedUntil: string2().nullable(),
26060
- agentNote: string2().nullable()
26066
+ agentNote: string2().nullable(),
26067
+ calendar: string2().nullable()
26061
26068
  });
26062
26069
  var animalHandoverAnimalSchema = object({
26063
26070
  id: ulidSchema,
@@ -26074,6 +26081,7 @@ var animalHandoverAnimalSchema = object({
26074
26081
  var animalHandoverContactSchema = object({
26075
26082
  id: ulidSchema,
26076
26083
  title: string2(),
26084
+ kind: _enum2(["vet", "member"]),
26077
26085
  label: string2().nullable(),
26078
26086
  phone: string2().nullable()
26079
26087
  });
@@ -26088,6 +26096,7 @@ var animalHandoverSchema = object({
26088
26096
  contacts: array(animalHandoverContactSchema),
26089
26097
  supplies: array(animalHandoverSupplySchema),
26090
26098
  habits: array(animalHandoverHabitSchema),
26099
+ sensors: boolean3(),
26091
26100
  generatedAt: exports_coerce.date()
26092
26101
  });
26093
26102
  var animalHolidayModeInputSchema = animalHolidayModeSchema.partial().extend({ periodId: ulidSchema }).strict().refine((v) => Object.keys(v).length > 1, { message: "Turn at least one switch." });
@@ -28361,7 +28370,7 @@ function parseCapture2(input, now) {
28361
28370
 
28362
28371
  // src/meta.ts
28363
28372
  var CLI_NAME = "do";
28364
- var VERSION = "1.283.0";
28373
+ var VERSION = "1.284.0";
28365
28374
  var API_PREFIX = "/api/v1";
28366
28375
  var DEFAULT_API_URL = "http://localhost:3001";
28367
28376
 
@@ -29845,6 +29854,41 @@ var HEALTH = /\b(symptoms?|stomach|nausea|headaches?|migraine|doctor|GP|medicati
29845
29854
  var NOISE = /\b(PR monitor|GitHub daily|deploy(?:ment)? watch\w*|cron|heartbeat|sales prospects?)\b/i;
29846
29855
  var MILESTONE = /\b(first|went live|is live|win:|moved in|arrived|wedding|engaged)\b/i;
29847
29856
  var PR_REF = /\bPR\s*#\d+/gi;
29857
+ var SLEPT = /\bslept\s*~?\s*(\d{1,2})\s*h(?:\s*(\d{1,2}))?/i;
29858
+ var SLEEP_HOURS = /\bsleep\s*:?\s*~?\s*(\d{1,2}(?:\.\d+)?)\s*h\b/i;
29859
+ var atClock = (word) => [
29860
+ new RegExp(`\\b${word}\\b\\D{0,12}?(\\d{1,2})[:.h](\\d{2})`, "i"),
29861
+ new RegExp(`(\\d{1,2})[:.h](\\d{2})\\D{0,6}?\\b${word}\\b`, "i")
29862
+ ];
29863
+ var BED_AT = atClock("(?:bed|asleep|lights out)");
29864
+ var WOKE_AT = atClock("(?:woke(?: up)?|wake(?: up)?|awake|got up|up at)");
29865
+ function sleepOf(raw) {
29866
+ const lines = raw.map(plain);
29867
+ for (const line of lines) {
29868
+ const slept = SLEPT.exec(line);
29869
+ if (slept)
29870
+ return Number(slept[1]) + Number(slept[2] ?? 0) / 60;
29871
+ const hours = SLEEP_HOURS.exec(line);
29872
+ if (hours)
29873
+ return Number(hours[1]);
29874
+ }
29875
+ const clock = (patterns) => {
29876
+ for (const line of lines) {
29877
+ for (const re of patterns) {
29878
+ const m = re.exec(line);
29879
+ if (m)
29880
+ return Number(m[1]) * 60 + Number(m[2]);
29881
+ }
29882
+ }
29883
+ return null;
29884
+ };
29885
+ const bed = clock(BED_AT);
29886
+ const woke = clock(WOKE_AT);
29887
+ if (bed === null || woke === null)
29888
+ return null;
29889
+ const minutes = (woke - bed + 24 * 60) % (24 * 60);
29890
+ return minutes >= 120 && minutes <= 16 * 60 ? Math.round(minutes / 60 * 100) / 100 : null;
29891
+ }
29848
29892
  var TASK_DONE = /^\s*[-*]\s*\[x\]/i;
29849
29893
  function section(text, heading) {
29850
29894
  const lines = text.split(/\r?\n/);
@@ -29910,6 +29954,7 @@ function parseDailyNote(path, day, text) {
29910
29954
  }
29911
29955
  const milestoneLine = all.find((l) => MILESTONE.test(l) && !HEALTH.test(l) && !NOISE.test(l) && plain(l).length > 0);
29912
29956
  const highlight = milestoneLine ? firstSentence(plain(milestoneLine), 80) : null;
29957
+ const sleep = sleepOf(all);
29913
29958
  const prs = (text.match(PR_REF) ?? []).length;
29914
29959
  const tasks = all.filter((l) => TASK_DONE.test(l)).length;
29915
29960
  return {
@@ -29922,6 +29967,7 @@ function parseDailyNote(path, day, text) {
29922
29967
  body,
29923
29968
  rating,
29924
29969
  ratingQuestion,
29970
+ ...sleep !== null ? { sleep } : {},
29925
29971
  highlight,
29926
29972
  milestoneCandidate: Boolean(highlight),
29927
29973
  health,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robbeverhelst/do",
3
- "version": "1.283.0",
3
+ "version": "1.284.0",
4
4
  "private": false,
5
5
  "description": "do — the agent-drivable CLI over the public /api/v1 surface",
6
6
  "homepage": "https://github.com/robbeverhelst/do/tree/main/apps/cli",