@robbeverhelst/do 1.276.0 → 1.277.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 +133 -5
  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",
@@ -21533,10 +21534,16 @@ var postReceiptInputSchema = object({
21533
21534
  parts: array(ulidSchema).min(1).max(10).optional(),
21534
21535
  about: _enum2(POST_RECEIPT_ABOUT_VALUES).optional()
21535
21536
  }).strict();
21537
+ var postReceiptPartSchema = object({
21538
+ id: string2(),
21539
+ type: string2(),
21540
+ title: string2()
21541
+ });
21536
21542
  var postReceiptSchema = object({
21537
21543
  nodeId: string2(),
21538
21544
  nodeType: string2(),
21539
21545
  parts: array(string2()).optional(),
21546
+ partNodes: array(postReceiptPartSchema).optional(),
21540
21547
  about: _enum2(POST_RECEIPT_ABOUT_VALUES).optional()
21541
21548
  });
21542
21549
  var POST_TITLE_MAX = 200;
@@ -22225,7 +22232,7 @@ var setHealthLabAnalyteInputSchema = object({
22225
22232
 
22226
22233
  // ../../packages/schema/src/contracts/files.ts
22227
22234
  var FILE_TEXT_MAX = 1e6;
22228
- var FILE_SOURCES = ["upload", "chat", "doccle_zip", "scan"];
22235
+ var FILE_SOURCES = ["upload", "chat", "doccle", "doccle_zip", "scan"];
22229
22236
  var fileSourceSchema = union([
22230
22237
  _enum2(FILE_SOURCES),
22231
22238
  string2().regex(/^gmail:[A-Za-z0-9_-]{1,200}$/, "gmail:<message id>")
@@ -23029,7 +23036,16 @@ var planVsRecordMoveSchema = object({
23029
23036
  usually: string2(),
23030
23037
  words: string2(),
23031
23038
  days: number2().int(),
23032
- of: number2().int()
23039
+ of: number2().int(),
23040
+ latestId: string2().nullable().optional()
23041
+ });
23042
+ var planVsRecordEveningSchema = object({
23043
+ kept: number2().int(),
23044
+ of: number2().int(),
23045
+ days: number2().int(),
23046
+ weekdays: number2().int(),
23047
+ confidence: _enum2(["high", "medium", "low"]),
23048
+ words: string2()
23033
23049
  });
23034
23050
  var planVsRecordSuggestionSchema = object({
23035
23051
  templateId: string2(),
@@ -23047,7 +23063,8 @@ var planVsRecordSchema = object({
23047
23063
  week: array(planVsRecordDaySchema),
23048
23064
  hours: array(planVsRecordHoursSchema),
23049
23065
  moves: array(planVsRecordMoveSchema),
23050
- suggestion: planVsRecordSuggestionSchema.nullable()
23066
+ suggestion: planVsRecordSuggestionSchema.nullable(),
23067
+ evening: planVsRecordEveningSchema.nullable().default(null)
23051
23068
  });
23052
23069
 
23053
23070
  // ../../packages/schema/src/contracts/settings.ts
@@ -25309,6 +25326,7 @@ var runTeamMemberSchema = object({
25309
25326
  nature: shortText.nullish(),
25310
25327
  types: array(shortText).max(2).optional(),
25311
25328
  moves: array(shortText).max(4).optional(),
25329
+ hp: number2().int().min(0).max(100).nullish(),
25312
25330
  note: shortText.nullish(),
25313
25331
  status: _enum2(["team", "plan", "boxed"]).default("team")
25314
25332
  }).strict();
@@ -28233,7 +28251,7 @@ function parseCapture2(input, now) {
28233
28251
 
28234
28252
  // src/meta.ts
28235
28253
  var CLI_NAME = "do";
28236
- var VERSION = "1.276.0";
28254
+ var VERSION = "1.277.0";
28237
28255
  var API_PREFIX = "/api/v1";
28238
28256
  var DEFAULT_API_URL = "http://localhost:3001";
28239
28257
 
@@ -30991,6 +31009,66 @@ var COMMAND_SPECS = [
30991
31009
  returns: "DocumentFiled",
30992
31010
  notes: "GET /api/v1/documents/filed?source=. Off (403) until DOCUMENTS_IMPORT_ENABLED=true."
30993
31011
  },
31012
+ {
31013
+ path: ["documents", "doccle", "status"],
31014
+ summary: "Your Doccle import: whether it's connected, archive after import, how the last run went and why it's stuck, if it is.",
31015
+ args: [],
31016
+ flags: [],
31017
+ scopes: ["documents:read"],
31018
+ returns: "DoccleStatus",
31019
+ 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."
31020
+ },
31021
+ {
31022
+ path: ["documents", "doccle", "sync"],
31023
+ summary: "Run your Doccle import now: each new Doccle document becomes a paper (sender, date, PDF), nothing twice.",
31024
+ args: [],
31025
+ flags: [],
31026
+ scopes: ["documents:write"],
31027
+ returns: "DoccleSyncResult",
31028
+ 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)."
31029
+ },
31030
+ {
31031
+ path: ["documents", "doccle", "connect"],
31032
+ summary: "Give do your Doccle login so the nightly import can run. do checks it with Doccle first and keeps it sealed.",
31033
+ args: [],
31034
+ flags: [
31035
+ { name: "username", type: "string", description: "Your Doccle username (required)." },
31036
+ {
31037
+ name: "password-stdin",
31038
+ type: "boolean",
31039
+ description: "Read the password from the first line of stdin (else DO_DOCCLE_PASSWORD)."
31040
+ }
31041
+ ],
31042
+ scopes: ["documents:write"],
31043
+ returns: "DoccleStatus",
31044
+ 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."
31045
+ },
31046
+ {
31047
+ path: ["documents", "doccle", "disconnect"],
31048
+ summary: "Forget your Doccle login: the nightly import stops. The papers it filed stay.",
31049
+ args: [],
31050
+ flags: [
31051
+ { name: "allow-destructive", type: "boolean", description: "Required to forget the login." }
31052
+ ],
31053
+ scopes: ["documents:write"],
31054
+ returns: "DoccleStatus",
31055
+ notes: "DELETE /api/v1/documents/doccle/login. Gated behind --allow-destructive."
31056
+ },
31057
+ {
31058
+ path: ["documents", "doccle", "set"],
31059
+ summary: "Change your Doccle import's setting: archive each document in Doccle once it's filed.",
31060
+ args: [],
31061
+ flags: [
31062
+ {
31063
+ name: "archive",
31064
+ type: "string",
31065
+ description: "on or off (off by default): archive in Doccle after import."
31066
+ }
31067
+ ],
31068
+ scopes: ["documents:write"],
31069
+ returns: "DoccleStatus",
31070
+ notes: "PATCH /api/v1/documents/doccle with { archiveAfterImport }."
31071
+ },
30994
31072
  {
30995
31073
  path: ["documents", "unmatched"],
30996
31074
  summary: "List the papers that ask for money (an amount due) and have no payment linked yet, oldest due first.",
@@ -36008,6 +36086,40 @@ var HANDLERS = {
36008
36086
  }),
36009
36087
  render: renderRecord
36010
36088
  }),
36089
+ "documents doccle status": async ({ requireClient }) => ({
36090
+ data: await requireClient().get("/documents/doccle"),
36091
+ render: renderRecord
36092
+ }),
36093
+ "documents doccle sync": async ({ requireClient }) => ({
36094
+ data: await requireClient().post("/documents/doccle/sync", {}),
36095
+ render: renderRecord
36096
+ }),
36097
+ "documents doccle connect": async ({ io, flags, requireClient }) => {
36098
+ const username = requireFlag(flags, "username", "documents doccle connect needs --username");
36099
+ const password = await readDocclePassword(io, flags);
36100
+ return {
36101
+ data: await requireClient().put("/documents/doccle/login", { username, password }),
36102
+ render: renderRecord
36103
+ };
36104
+ },
36105
+ "documents doccle disconnect": async ({ flags, requireClient }) => {
36106
+ assertDestructiveAllowed(flags, "forget the Doccle login");
36107
+ return {
36108
+ data: await requireClient().delete("/documents/doccle/login"),
36109
+ render: renderRecord
36110
+ };
36111
+ },
36112
+ "documents doccle set": async ({ flags, requireClient }) => {
36113
+ const archive = requireFlag(flags, "archive", "documents doccle set needs --archive on|off");
36114
+ if (archive !== "on" && archive !== "off")
36115
+ throw usageError("--archive takes on or off");
36116
+ return {
36117
+ data: await requireClient().patch("/documents/doccle", {
36118
+ archiveAfterImport: archive === "on"
36119
+ }),
36120
+ render: renderRecord
36121
+ };
36122
+ },
36011
36123
  "documents unmatched": async ({ requireClient }) => ({
36012
36124
  data: await requireClient().get("/documents/unmatched"),
36013
36125
  render: renderList
@@ -38492,6 +38604,22 @@ function redact(secret) {
38492
38604
  return "********";
38493
38605
  return `${secret.slice(0, 6)}\u2026${secret.slice(-2)}`;
38494
38606
  }
38607
+ var DOCCLE_PASSWORD_ENV = "DO_DOCCLE_PASSWORD";
38608
+ async function readDocclePassword(io, flags) {
38609
+ let password;
38610
+ if (flagBool(flags, "password-stdin")) {
38611
+ for await (const line of io.stdin ?? []) {
38612
+ password = line.replace(/\r?\n$/, "");
38613
+ break;
38614
+ }
38615
+ } else {
38616
+ password = io.env[DOCCLE_PASSWORD_ENV];
38617
+ }
38618
+ if (!password) {
38619
+ throw usageError(`documents doccle connect needs the password on stdin (--password-stdin) or in ${DOCCLE_PASSWORD_ENV}`);
38620
+ }
38621
+ return password;
38622
+ }
38495
38623
  var AGENT_KEY_ENV = "DO_AGENT_API_KEY";
38496
38624
  async function readAgentKey(io, flags) {
38497
38625
  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.277.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",