@robbeverhelst/do 1.276.0 → 1.278.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 +152 -11
  2. package/package.json +1 -1
package/dist/do.js CHANGED
@@ -3973,7 +3973,8 @@ var notificationType = pgEnum("notification_type", [
3973
3973
  "habit_reminder",
3974
3974
  "echo",
3975
3975
  "card",
3976
- "bank_link"
3976
+ "bank_link",
3977
+ "import_failed"
3977
3978
  ]);
3978
3979
  var notificationDomain = pgEnum("notification_domain", [
3979
3980
  "task",
@@ -4806,6 +4807,7 @@ var moneyGoalLines = pgTable("money_goal_lines", {
4806
4807
  paid: numeric("paid", { precision: 14, scale: 2 }).notNull().default("0"),
4807
4808
  note: text("note"),
4808
4809
  dueOn: date("due_on"),
4810
+ documentId: text("document_id").references(() => nodes.id, { onDelete: "set null" }),
4809
4811
  sortOrder: integer("sort_order").notNull().default(0),
4810
4812
  createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
4811
4813
  updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
@@ -21527,16 +21529,22 @@ var postRunSchema = object({
21527
21529
  status: runStatusSchema,
21528
21530
  steps: array(runStepSchema).max(12).optional()
21529
21531
  });
21530
- var POST_RECEIPT_ABOUT_VALUES = ["red_flags"];
21532
+ var POST_RECEIPT_ABOUT_VALUES = ["red_flags", "saved"];
21531
21533
  var postReceiptInputSchema = object({
21532
21534
  nodeId: ulidSchema,
21533
21535
  parts: array(ulidSchema).min(1).max(10).optional(),
21534
21536
  about: _enum2(POST_RECEIPT_ABOUT_VALUES).optional()
21535
21537
  }).strict();
21538
+ var postReceiptPartSchema = object({
21539
+ id: string2(),
21540
+ type: string2(),
21541
+ title: string2()
21542
+ });
21536
21543
  var postReceiptSchema = object({
21537
21544
  nodeId: string2(),
21538
21545
  nodeType: string2(),
21539
21546
  parts: array(string2()).optional(),
21547
+ partNodes: array(postReceiptPartSchema).optional(),
21540
21548
  about: _enum2(POST_RECEIPT_ABOUT_VALUES).optional()
21541
21549
  });
21542
21550
  var POST_TITLE_MAX = 200;
@@ -22166,7 +22174,8 @@ var healthLabAnalyteViewSchema = object({
22166
22174
  title: string2(),
22167
22175
  dose: string2().nullable(),
22168
22176
  schedule: healthMedicationScheduleSchema,
22169
- habitId: string2().nullable()
22177
+ habitId: string2().nullable(),
22178
+ startedOn: string2().nullable()
22170
22179
  }).nullable()
22171
22180
  });
22172
22181
  var healthLabOverviewSchema = object({
@@ -22225,7 +22234,7 @@ var setHealthLabAnalyteInputSchema = object({
22225
22234
 
22226
22235
  // ../../packages/schema/src/contracts/files.ts
22227
22236
  var FILE_TEXT_MAX = 1e6;
22228
- var FILE_SOURCES = ["upload", "chat", "doccle_zip", "scan"];
22237
+ var FILE_SOURCES = ["upload", "chat", "doccle", "doccle_zip", "scan"];
22229
22238
  var fileSourceSchema = union([
22230
22239
  _enum2(FILE_SOURCES),
22231
22240
  string2().regex(/^gmail:[A-Za-z0-9_-]{1,200}$/, "gmail:<message id>")
@@ -23029,7 +23038,16 @@ var planVsRecordMoveSchema = object({
23029
23038
  usually: string2(),
23030
23039
  words: string2(),
23031
23040
  days: number2().int(),
23032
- of: number2().int()
23041
+ of: number2().int(),
23042
+ latestId: string2().nullable().optional()
23043
+ });
23044
+ var planVsRecordEveningSchema = object({
23045
+ kept: number2().int(),
23046
+ of: number2().int(),
23047
+ days: number2().int(),
23048
+ weekdays: number2().int(),
23049
+ confidence: _enum2(["high", "medium", "low"]),
23050
+ words: string2()
23033
23051
  });
23034
23052
  var planVsRecordSuggestionSchema = object({
23035
23053
  templateId: string2(),
@@ -23047,7 +23065,8 @@ var planVsRecordSchema = object({
23047
23065
  week: array(planVsRecordDaySchema),
23048
23066
  hours: array(planVsRecordHoursSchema),
23049
23067
  moves: array(planVsRecordMoveSchema),
23050
- suggestion: planVsRecordSuggestionSchema.nullable()
23068
+ suggestion: planVsRecordSuggestionSchema.nullable(),
23069
+ evening: planVsRecordEveningSchema.nullable().default(null)
23051
23070
  });
23052
23071
 
23053
23072
  // ../../packages/schema/src/contracts/settings.ts
@@ -24573,8 +24592,11 @@ var moneyGoalContributionSchema = object({
24573
24592
  counterpartyName: string2().nullable(),
24574
24593
  accountTitle: string2()
24575
24594
  });
24595
+ var moneyGoalLineViewSchema = moneyGoalLineSchema.extend({
24596
+ documentTitle: string2().nullable().default(null)
24597
+ });
24576
24598
  var moneyGoalDetailSchema = moneyGoalViewSchema.extend({
24577
- lines: array(moneyGoalLineSchema),
24599
+ lines: array(moneyGoalLineViewSchema),
24578
24600
  contributions: array(moneyGoalContributionSchema)
24579
24601
  });
24580
24602
  var createMoneyGoalInputSchema = object({
@@ -24598,6 +24620,7 @@ var createMoneyGoalLineInputSchema = object({
24598
24620
  paid: nonNegativeAmount.optional(),
24599
24621
  note: string2().trim().max(200).nullish(),
24600
24622
  dueOn: keyDateDaySchema.nullish(),
24623
+ documentId: ulidSchema.nullish(),
24601
24624
  sortOrder: number2().int().min(0).max(1e5).optional()
24602
24625
  }).strict();
24603
24626
  var updateMoneyGoalLineInputSchema = createMoneyGoalLineInputSchema.omit({ id: true }).partial().strict();
@@ -25189,7 +25212,14 @@ var PLANNING_RULE_KIND_LABELS = {
25189
25212
  // ../../packages/schema/src/contracts/runs.ts
25190
25213
  var runThemeValues = ["generic", "skyrim", "pokemon", "oblivion", "rdr2", "gta"];
25191
25214
  var runThemeSchema = _enum2(runThemeValues);
25192
- var runPlayStatusValues = ["planned", "playing", "paused", "finished", "dropped"];
25215
+ var runPlayStatusValues = [
25216
+ "planned",
25217
+ "playing",
25218
+ "paused",
25219
+ "blocked",
25220
+ "finished",
25221
+ "dropped"
25222
+ ];
25193
25223
  var runPlayStatusSchema = _enum2(runPlayStatusValues);
25194
25224
  var name = string2().trim().min(1).max(200);
25195
25225
  var text5 = string2().trim().max(2000);
@@ -25309,6 +25339,7 @@ var runTeamMemberSchema = object({
25309
25339
  nature: shortText.nullish(),
25310
25340
  types: array(shortText).max(2).optional(),
25311
25341
  moves: array(shortText).max(4).optional(),
25342
+ hp: number2().int().min(0).max(100).nullish(),
25312
25343
  note: shortText.nullish(),
25313
25344
  status: _enum2(["team", "plan", "boxed"]).default("team")
25314
25345
  }).strict();
@@ -28233,7 +28264,7 @@ function parseCapture2(input, now) {
28233
28264
 
28234
28265
  // src/meta.ts
28235
28266
  var CLI_NAME = "do";
28236
- var VERSION = "1.276.0";
28267
+ var VERSION = "1.278.0";
28237
28268
  var API_PREFIX = "/api/v1";
28238
28269
  var DEFAULT_API_URL = "http://localhost:3001";
28239
28270
 
@@ -29142,7 +29173,7 @@ var ENTITIES = [
29142
29173
  { name: "game", description: "only the runs of this game item id", query: "gameId" },
29143
29174
  {
29144
29175
  name: "status",
29145
- description: "only this status (planned, playing, paused, finished, dropped)",
29176
+ description: "only this status (planned, playing, paused, blocked, finished, dropped)",
29146
29177
  query: "status"
29147
29178
  },
29148
29179
  { name: "theme", description: "only this theme pack (skyrim, pokemon, \u2026)", query: "theme" }
@@ -30991,6 +31022,66 @@ var COMMAND_SPECS = [
30991
31022
  returns: "DocumentFiled",
30992
31023
  notes: "GET /api/v1/documents/filed?source=. Off (403) until DOCUMENTS_IMPORT_ENABLED=true."
30993
31024
  },
31025
+ {
31026
+ path: ["documents", "doccle", "status"],
31027
+ summary: "Your Doccle import: whether it's connected, archive after import, how the last run went and why it's stuck, if it is.",
31028
+ args: [],
31029
+ flags: [],
31030
+ scopes: ["documents:read"],
31031
+ returns: "DoccleStatus",
31032
+ notes: "GET /api/v1/documents/doccle. The import files your Doccle mailbox into Papers every night (03:30 Brussels). `failure` says why it stopped (credentials, captcha, changed, unavailable) and what to do. Never shows the login."
31033
+ },
31034
+ {
31035
+ path: ["documents", "doccle", "sync"],
31036
+ summary: "Run your Doccle import now: each new Doccle document becomes a paper (sender, date, PDF), nothing twice.",
31037
+ args: [],
31038
+ flags: [],
31039
+ scopes: ["documents:write"],
31040
+ returns: "DoccleSyncResult",
31041
+ notes: "POST /api/v1/documents/doccle/sync. Deduped on Doccle's id and on the PDF's hash (so papers from a Doccle ZIP export aren't filed again). outcome: ok, failed (see failure), not_connected, off (DOCUMENTS_IMPORT_ENABLED isn't on), busy (a run is going)."
31042
+ },
31043
+ {
31044
+ path: ["documents", "doccle", "connect"],
31045
+ summary: "Give do your Doccle login so the nightly import can run. do checks it with Doccle first and keeps it sealed.",
31046
+ args: [],
31047
+ flags: [
31048
+ { name: "username", type: "string", description: "Your Doccle username (required)." },
31049
+ {
31050
+ name: "password-stdin",
31051
+ type: "boolean",
31052
+ description: "Read the password from the first line of stdin (else DO_DOCCLE_PASSWORD)."
31053
+ }
31054
+ ],
31055
+ scopes: ["documents:write"],
31056
+ returns: "DoccleStatus",
31057
+ notes: "PUT /api/v1/documents/doccle/login. The password is never a flag (shell history): pipe it in with --password-stdin or set DO_DOCCLE_PASSWORD. 422 when Doccle refuses the login or asks for a captcha (nothing is kept), 503 when Doccle is down. The login is never returned."
31058
+ },
31059
+ {
31060
+ path: ["documents", "doccle", "disconnect"],
31061
+ summary: "Forget your Doccle login: the nightly import stops. The papers it filed stay.",
31062
+ args: [],
31063
+ flags: [
31064
+ { name: "allow-destructive", type: "boolean", description: "Required to forget the login." }
31065
+ ],
31066
+ scopes: ["documents:write"],
31067
+ returns: "DoccleStatus",
31068
+ notes: "DELETE /api/v1/documents/doccle/login. Gated behind --allow-destructive."
31069
+ },
31070
+ {
31071
+ path: ["documents", "doccle", "set"],
31072
+ summary: "Change your Doccle import's setting: archive each document in Doccle once it's filed.",
31073
+ args: [],
31074
+ flags: [
31075
+ {
31076
+ name: "archive",
31077
+ type: "string",
31078
+ description: "on or off (off by default): archive in Doccle after import."
31079
+ }
31080
+ ],
31081
+ scopes: ["documents:write"],
31082
+ returns: "DoccleStatus",
31083
+ notes: "PATCH /api/v1/documents/doccle with { archiveAfterImport }."
31084
+ },
30994
31085
  {
30995
31086
  path: ["documents", "unmatched"],
30996
31087
  summary: "List the papers that ask for money (an amount due) and have no payment linked yet, oldest due first.",
@@ -32970,7 +33061,7 @@ var COMMAND_SPECS = [
32970
33061
  },
32971
33062
  {
32972
33063
  path: ["money", "goal-line-update"],
32973
- summary: "Edit a goal's line (what's planned or paid).",
33064
+ summary: "Edit a goal's line (what's planned or paid, its paper in Admin via documentId).",
32974
33065
  args: [{ name: "id", required: true, description: "Line ULID." }],
32975
33066
  flags: [{ name: "data", type: "string", description: "UpdateMoneyGoalLineInput JSON." }],
32976
33067
  scopes: ["finance:write"],
@@ -36008,6 +36099,40 @@ var HANDLERS = {
36008
36099
  }),
36009
36100
  render: renderRecord
36010
36101
  }),
36102
+ "documents doccle status": async ({ requireClient }) => ({
36103
+ data: await requireClient().get("/documents/doccle"),
36104
+ render: renderRecord
36105
+ }),
36106
+ "documents doccle sync": async ({ requireClient }) => ({
36107
+ data: await requireClient().post("/documents/doccle/sync", {}),
36108
+ render: renderRecord
36109
+ }),
36110
+ "documents doccle connect": async ({ io, flags, requireClient }) => {
36111
+ const username = requireFlag(flags, "username", "documents doccle connect needs --username");
36112
+ const password = await readDocclePassword(io, flags);
36113
+ return {
36114
+ data: await requireClient().put("/documents/doccle/login", { username, password }),
36115
+ render: renderRecord
36116
+ };
36117
+ },
36118
+ "documents doccle disconnect": async ({ flags, requireClient }) => {
36119
+ assertDestructiveAllowed(flags, "forget the Doccle login");
36120
+ return {
36121
+ data: await requireClient().delete("/documents/doccle/login"),
36122
+ render: renderRecord
36123
+ };
36124
+ },
36125
+ "documents doccle set": async ({ flags, requireClient }) => {
36126
+ const archive = requireFlag(flags, "archive", "documents doccle set needs --archive on|off");
36127
+ if (archive !== "on" && archive !== "off")
36128
+ throw usageError("--archive takes on or off");
36129
+ return {
36130
+ data: await requireClient().patch("/documents/doccle", {
36131
+ archiveAfterImport: archive === "on"
36132
+ }),
36133
+ render: renderRecord
36134
+ };
36135
+ },
36011
36136
  "documents unmatched": async ({ requireClient }) => ({
36012
36137
  data: await requireClient().get("/documents/unmatched"),
36013
36138
  render: renderList
@@ -38492,6 +38617,22 @@ function redact(secret) {
38492
38617
  return "********";
38493
38618
  return `${secret.slice(0, 6)}\u2026${secret.slice(-2)}`;
38494
38619
  }
38620
+ var DOCCLE_PASSWORD_ENV = "DO_DOCCLE_PASSWORD";
38621
+ async function readDocclePassword(io, flags) {
38622
+ let password;
38623
+ if (flagBool(flags, "password-stdin")) {
38624
+ for await (const line of io.stdin ?? []) {
38625
+ password = line.replace(/\r?\n$/, "");
38626
+ break;
38627
+ }
38628
+ } else {
38629
+ password = io.env[DOCCLE_PASSWORD_ENV];
38630
+ }
38631
+ if (!password) {
38632
+ throw usageError(`documents doccle connect needs the password on stdin (--password-stdin) or in ${DOCCLE_PASSWORD_ENV}`);
38633
+ }
38634
+ return password;
38635
+ }
38495
38636
  var AGENT_KEY_ENV = "DO_AGENT_API_KEY";
38496
38637
  async function readAgentKey(io, flags) {
38497
38638
  if (flagBool(flags, "clear-key"))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robbeverhelst/do",
3
- "version": "1.276.0",
3
+ "version": "1.278.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",