dayhand 0.0.0-stage → 0.14.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 (191) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +100 -2
  3. package/backend/convex/_generated/api.d.ts +181 -0
  4. package/backend/convex/_generated/api.js +23 -0
  5. package/backend/convex/_generated/dataModel.d.ts +60 -0
  6. package/backend/convex/_generated/server.d.ts +162 -0
  7. package/backend/convex/_generated/server.js +101 -0
  8. package/backend/convex/apiKeys.ts +171 -0
  9. package/backend/convex/app.ts +197 -0
  10. package/backend/convex/auth.config.ts +28 -0
  11. package/backend/convex/calendar.ts +61 -0
  12. package/backend/convex/calendarFeeds.ts +105 -0
  13. package/backend/convex/callLimits.ts +67 -0
  14. package/backend/convex/connections.ts +28 -0
  15. package/backend/convex/crons.ts +18 -0
  16. package/backend/convex/devices.ts +224 -0
  17. package/backend/convex/http.ts +56 -0
  18. package/backend/convex/lib/activity.ts +155 -0
  19. package/backend/convex/lib/agentControls.ts +146 -0
  20. package/backend/convex/lib/agentWork.ts +250 -0
  21. package/backend/convex/lib/appToken.ts +68 -0
  22. package/backend/convex/lib/approvals.ts +311 -0
  23. package/backend/convex/lib/args.ts +175 -0
  24. package/backend/convex/lib/backlogMd.ts +309 -0
  25. package/backend/convex/lib/backlogOps.ts +361 -0
  26. package/backend/convex/lib/brief.ts +132 -0
  27. package/backend/convex/lib/cimd.ts +57 -0
  28. package/backend/convex/lib/core.ts +380 -0
  29. package/backend/convex/lib/dates.ts +114 -0
  30. package/backend/convex/lib/env.ts +19 -0
  31. package/backend/convex/lib/exportPlan.ts +98 -0
  32. package/backend/convex/lib/findTasks.ts +119 -0
  33. package/backend/convex/lib/frontmatter.ts +165 -0
  34. package/backend/convex/lib/guide.ts +286 -0
  35. package/backend/convex/lib/health.ts +115 -0
  36. package/backend/convex/lib/http.ts +27 -0
  37. package/backend/convex/lib/ical.ts +243 -0
  38. package/backend/convex/lib/importFormats.ts +429 -0
  39. package/backend/convex/lib/importOps.ts +145 -0
  40. package/backend/convex/lib/jsonSchema.ts +50 -0
  41. package/backend/convex/lib/limits.ts +42 -0
  42. package/backend/convex/lib/mcpContent.ts +220 -0
  43. package/backend/convex/lib/mcpProtocol.ts +128 -0
  44. package/backend/convex/lib/mcpTools.ts +505 -0
  45. package/backend/convex/lib/oauthConfig.ts +59 -0
  46. package/backend/convex/lib/oauthPage.ts +125 -0
  47. package/backend/convex/lib/oauthRules.ts +159 -0
  48. package/backend/convex/lib/openapi.ts +230 -0
  49. package/backend/convex/lib/outputSchemas.ts +2901 -0
  50. package/backend/convex/lib/problem.ts +69 -0
  51. package/backend/convex/lib/proposals.ts +172 -0
  52. package/backend/convex/lib/repeat.ts +185 -0
  53. package/backend/convex/lib/restRoutes.ts +294 -0
  54. package/backend/convex/lib/rrule.ts +171 -0
  55. package/backend/convex/lib/secrets.ts +135 -0
  56. package/backend/convex/lib/settingsOps.ts +47 -0
  57. package/backend/convex/lib/taskOps.ts +304 -0
  58. package/backend/convex/lib/toolResults.ts +50 -0
  59. package/backend/convex/lib/validators.ts +143 -0
  60. package/backend/convex/lib/views.ts +145 -0
  61. package/backend/convex/lib/vtimezone.ts +151 -0
  62. package/backend/convex/lib/webhookEvents.ts +160 -0
  63. package/backend/convex/lib/webhookSign.ts +30 -0
  64. package/backend/convex/lib/webhookTarget.ts +75 -0
  65. package/backend/convex/mcp.ts +405 -0
  66. package/backend/convex/migrations.ts +91 -0
  67. package/backend/convex/oauth.ts +388 -0
  68. package/backend/convex/oauthHttp.ts +381 -0
  69. package/backend/convex/oauthOwner.ts +173 -0
  70. package/backend/convex/ops.ts +205 -0
  71. package/backend/convex/pairing.ts +178 -0
  72. package/backend/convex/rest.ts +254 -0
  73. package/backend/convex/restAccount.ts +56 -0
  74. package/backend/convex/restImport.ts +73 -0
  75. package/backend/convex/schema.ts +435 -0
  76. package/backend/convex/tsconfig.json +18 -0
  77. package/backend/convex/webhooks.ts +339 -0
  78. package/backend/package-lock.json +3068 -0
  79. package/backend/package.json +33 -0
  80. package/backend/scripts/app-token.mjs +79 -0
  81. package/backend/scripts/fetch-local-backend.mjs +72 -0
  82. package/backend/scripts/gen-output-schemas.mjs +60 -0
  83. package/backend/scripts/jwt.mjs +67 -0
  84. package/backend/scripts/local-backend-lib.mjs +123 -0
  85. package/backend/scripts/local-backend.mjs +81 -0
  86. package/backend/scripts/setup-convex.mjs +158 -0
  87. package/backend/scripts/setup-lib.mjs +338 -0
  88. package/backend/scripts/setup-output.mjs +108 -0
  89. package/backend/scripts/setup.mjs +344 -0
  90. package/backend/scripts/signing-key.mjs +61 -0
  91. package/backend/tsconfig.json +16 -0
  92. package/dist/backlog/folder.js +114 -0
  93. package/dist/bin/dayhand.js +10 -0
  94. package/dist/bin/hlm.js +12 -0
  95. package/dist/completion/cache.js +54 -0
  96. package/dist/completion/engine.js +187 -0
  97. package/dist/completion/scripts.js +82 -0
  98. package/dist/config/aliases.js +25 -0
  99. package/dist/config/env.js +68 -0
  100. package/dist/config/file.js +146 -0
  101. package/dist/config/paths.js +58 -0
  102. package/dist/config/resolve.js +53 -0
  103. package/dist/config/url.js +26 -0
  104. package/dist/core/editor.js +37 -0
  105. package/dist/core/exit.js +59 -0
  106. package/dist/core/io.js +14 -0
  107. package/dist/core/output.js +39 -0
  108. package/dist/core/prompt.js +55 -0
  109. package/dist/core/version.js +15 -0
  110. package/dist/core/words.js +36 -0
  111. package/dist/credentials/file.js +65 -0
  112. package/dist/credentials/index.js +29 -0
  113. package/dist/credentials/keychain.js +44 -0
  114. package/dist/credentials/store.js +39 -0
  115. package/dist/docs.js +116 -0
  116. package/dist/fields.js +33 -0
  117. package/dist/globals.js +16 -0
  118. package/dist/guide.js +36 -0
  119. package/dist/help.js +56 -0
  120. package/dist/i18n/dates.js +84 -0
  121. package/dist/i18n/de.js +240 -0
  122. package/dist/i18n/en.js +243 -0
  123. package/dist/i18n/es.js +240 -0
  124. package/dist/i18n/fr.js +240 -0
  125. package/dist/i18n/index.js +67 -0
  126. package/dist/i18n/ja.js +240 -0
  127. package/dist/i18n/pl.js +245 -0
  128. package/dist/i18n/pt-BR.js +240 -0
  129. package/dist/i18n/zh-Hans.js +240 -0
  130. package/dist/main.js +180 -0
  131. package/dist/man.js +56 -0
  132. package/dist/registry/agents.js +67 -0
  133. package/dist/registry/auth.js +168 -0
  134. package/dist/registry/backlog.js +106 -0
  135. package/dist/registry/calendar.js +103 -0
  136. package/dist/registry/dates.js +33 -0
  137. package/dist/registry/filters.js +98 -0
  138. package/dist/registry/index.js +24 -0
  139. package/dist/registry/integrations.js +245 -0
  140. package/dist/registry/local.js +89 -0
  141. package/dist/registry/model.js +104 -0
  142. package/dist/registry/ops.js +47 -0
  143. package/dist/registry/owner.js +349 -0
  144. package/dist/registry/packaged-backend.js +59 -0
  145. package/dist/registry/parse.js +129 -0
  146. package/dist/registry/server.js +252 -0
  147. package/dist/registry/system.js +220 -0
  148. package/dist/registry/tasks.js +512 -0
  149. package/dist/registry/types.js +1 -0
  150. package/dist/registry/ui.js +51 -0
  151. package/dist/registry/work.js +207 -0
  152. package/dist/render/format.js +146 -0
  153. package/dist/render/model.js +29 -0
  154. package/dist/render/style.js +24 -0
  155. package/dist/render/table.js +46 -0
  156. package/dist/render/views.js +256 -0
  157. package/dist/run.js +133 -0
  158. package/dist/setup.js +26 -0
  159. package/dist/skill.js +83 -0
  160. package/dist/topics.js +121 -0
  161. package/dist/transport/client.js +196 -0
  162. package/dist/ui/agents.js +12 -0
  163. package/dist/ui/api.js +99 -0
  164. package/dist/ui/app.js +62 -0
  165. package/dist/ui/budget.js +42 -0
  166. package/dist/ui/controller.js +368 -0
  167. package/dist/ui/effects.js +166 -0
  168. package/dist/ui/frame.js +206 -0
  169. package/dist/ui/handle.js +271 -0
  170. package/dist/ui/health.js +22 -0
  171. package/dist/ui/keys.js +120 -0
  172. package/dist/ui/line.js +56 -0
  173. package/dist/ui/lists.js +58 -0
  174. package/dist/ui/model.js +25 -0
  175. package/dist/ui/quickadd.js +66 -0
  176. package/dist/ui/rows.js +68 -0
  177. package/dist/ui/run.js +54 -0
  178. package/dist/ui/screens/agents.js +65 -0
  179. package/dist/ui/screens/board.js +41 -0
  180. package/dist/ui/screens/detail.js +142 -0
  181. package/dist/ui/screens/overlay.js +58 -0
  182. package/dist/ui/screens/screen.js +3 -0
  183. package/dist/ui/screens/today.js +60 -0
  184. package/dist/ui/screens/week.js +76 -0
  185. package/dist/ui/state.js +128 -0
  186. package/dist/ui/text.js +70 -0
  187. package/dist/when/calendar.js +95 -0
  188. package/dist/when/parse.js +314 -0
  189. package/man/dayhand.1 +1163 -0
  190. package/man/dh.1 +1 -0
  191. package/package.json +56 -4
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,101 @@
1
- # Temporary Holding Version
1
+ # dayhand
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ `dayhand` is the Dayhand command line client. Every command is one or more calls of the MCP tools the
4
+ agent uses (`/mcp`), so the terminal, the app and an agent share one set of operations, and
5
+ `dayhand call <tool> '<json>'` reaches any tool directly. `dayhand key`, `dayhand webhook` and `dayhand import`
6
+ use the REST API instead (`/api/v1`, backend 0.8.0, [docs/api.md](../docs/api.md)): keys that
7
+ only read or write and expire, for other tools; signed webhooks; importing Dayhand JSON,
8
+ iCalendar or Todoist CSV.
9
+
10
+ `dh` is the same command with a shorter name. On Debian and Ubuntu, debhelper has a `dh` of its
11
+ own (`/usr/bin/dh`), so type `dayhand` there. `hlm`, the name before Dayhand, still runs until
12
+ 1.0 and warns on every run; the `HLM_*` variables and the `hlm` config folder are read too
13
+ ([Renamed from Helm](../docs/rename.md)).
14
+
15
+ Requires Node.js 22.12 or newer; runs on macOS, Linux and Windows.
16
+
17
+ ```sh
18
+ npm i -g dayhand # or: brew install maiarowsky/tap/dayhand; without installing: npx dayhand
19
+ dayhand login --url https://<deployment>.convex.site # locally: http://127.0.0.1:3211
20
+ dayhand # Today
21
+ dayhand add Call the accountant --due "fri 2pm" -l home
22
+ dayhand list --due-before eow --search accountant
23
+ dayhand ui # full screen: Today, board, week, trash, agents (? lists the keys)
24
+ source <(dayhand completion bash) # or zsh, fish, powershell: dayhand help completion
25
+ ```
26
+
27
+ In a checkout, build and link it from this folder instead: `npm ci --ignore-scripts && npm run build && npm link`
28
+ (also the way to get it before the first release; [every way to install](../docs/install.md)).
29
+
30
+ The package includes the backend for `dayhand server start` and `dayhand server deploy`; no checkout
31
+ is needed. [Your own server](../docs/deploy.md#run-your-own-server-in-5-minutes) explains backend
32
+ selection and the writable per-version copy.
33
+
34
+ For key creation, automatic sign-in during server setup, and credential storage, see
35
+ [signing in](../docs/cli.md#topic-login). `config.toml` holds the URL, profiles, aliases and the color
36
+ default (`dayhand help config`); the key never goes into it.
37
+ Dates are English phrases resolved in your time zone (`dayhand help dates`, `dayhand when "next mon"`).
38
+
39
+ `dayhand ui` is the same client full screen, written with [Ink](https://github.com/vadimdemedes/ink)
40
+ (React for the terminal; Ink and React load only for this command). It shows Today, the board,
41
+ the week, the trash and agent controls, polls what is on screen every 12 s (`--interval`) within the key's
42
+ limits, keeps the last data with a red status line when the server cannot be reached, and
43
+ shows who made each change in a task's history. Keys follow vim and lazygit; `dayhand help ui`
44
+ lists them, and [docs/omarchy.md](../docs/omarchy.md) turns it into an Omarchy app. Its screens
45
+ come in English, Polish, German, Spanish, French, Brazilian Portuguese, Japanese and Simplified
46
+ Chinese: `--lang`, then `DAYHAND_LANG`, then the locale (`LC_ALL`, `LC_MESSAGES`, `LANG`). The rest
47
+ of the CLI, `--json`, error codes and the MCP tools stay English.
48
+
49
+ For agents and scripts: `DAYHAND_URL` and `DAYHAND_API_KEY` win over the file and the keychain,
50
+ `--json` prints exactly the tool's `structuredContent` (schemas in
51
+ [docs/schemas](../docs/schemas)), errors are one JSON line on stderr, exit codes are distinct
52
+ (2 usage, 3 key, 4 not found, 5 server unavailable or rate limited: retry with the same
53
+ `--client-id`), `--dry-run` shows a change checked by the backend without saving it, and `dayhand`
54
+ never prompts without a terminal.
55
+ Give each agent its own key of kind `agent`; history then shows its changes as `agent: <key name>`.
56
+ For session-start context, use [`dayhand prime`](../docs/cli.md#dayhand-prime).
57
+ [docs/skills/dayhand/SKILL.md](../docs/skills/dayhand/SKILL.md) provides the agent guidance as an Agent Skill.
58
+
59
+ The full reference is generated from the command registry: [docs/cli.md](../docs/cli.md),
60
+ the man page [man/dayhand.1](../man/dayhand.1) (in the package, so `man dayhand` works after a global
61
+ install) and the agent skill. Regenerating them and the published pages:
62
+ [CONTRIBUTING.md](../CONTRIBUTING.md#the-dayhand-cli). Releases: [docs/release.md](../docs/release.md).
63
+
64
+ ## Layout
65
+
66
+ ```
67
+ src/bin/dayhand.ts entry point (dayhand, dh); src/bin/hlm.ts runs it with a warning about the old name
68
+ src/main.ts commander program built from the registry; aliases; dayhand help
69
+ src/run.ts runs one command: context, output format, exit codes, --dry-run
70
+ src/registry/ the commands (single source for help, completion, docs/cli.md and tests)
71
+ src/transport/ MCP JSON-RPC, /devices and /api/v1 over HTTP
72
+ src/config/ environment, folders per system, config.toml, profiles, aliases
73
+ src/credentials/ API key: environment, OS keychain (@napi-rs/keyring), 0600 file
74
+ src/when/ English date phrases and calendar arithmetic in a time zone
75
+ src/render/ human (tables, colors, relative days) and plain (TSV) output
76
+ src/ui/ dayhand ui: controller (polling, changes, mouse), key reducer, screens as rows, Ink app
77
+ src/i18n/ dayhand ui's languages: en.ts is the source, one catalog per language, t() and plurals
78
+ src/completion/ dayhand __complete and the bash, zsh, fish and PowerShell scripts
79
+ src/docs.ts, man.ts, skill.ts docs/cli.md, man/dayhand.1 and the agent skill, rendered from the registry
80
+ src/registry/packaged-backend.ts the backend the package carries (backend/) and its per-version copy in the data folder
81
+ scripts/ gen-docs (npm run docs), pack-files (prepack), check-release (publish workflow)
82
+ backend/ the server's backend (setup scripts, convex/), copied from ../backend by prepack; not committed
83
+ tests/ unit tests (*.unit.test.ts) and tests against a real local Convex backend
84
+ ```
85
+
86
+ ## Tests
87
+
88
+ ```sh
89
+ (cd ../backend && npm ci --ignore-scripts) # the tests start the backend with its scripts
90
+ npm test # builds, then runs everything
91
+ npm run test:unit # pure tests only (dates, config, output, completion)
92
+ npm pack # create the release tarball locally (nothing is published)
93
+ ```
94
+
95
+ The tests never touch the real keychain or config folder: every run gets its own
96
+ `DAYHAND_CONFIG_DIR` and keys go to a file. `tests/tty.test.ts` drives prompts and `$EDITOR` on a
97
+ real pseudo-terminal with node-pty, which ships prebuilt binaries for macOS and Windows only;
98
+ on Linux without a build toolchain those tests are skipped. `tests/ui.test.ts` drives `dayhand ui`
99
+ the same way and reads the screen through a headless xterm (`tests/screen.ts`);
100
+ `DAYHAND_UI_SCREENS=<dir>` saves the screens it checks as text. `tests/shells.test.ts` runs the
101
+ completion scripts in whichever of bash, zsh, PowerShell and fish are installed.
@@ -0,0 +1,181 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * Generated `api` utility.
4
+ *
5
+ * THIS CODE IS AUTOMATICALLY GENERATED.
6
+ *
7
+ * To regenerate, run `npx convex dev`.
8
+ * @module
9
+ */
10
+
11
+ import type * as apiKeys from "../apiKeys.js";
12
+ import type * as app from "../app.js";
13
+ import type * as calendar from "../calendar.js";
14
+ import type * as calendarFeeds from "../calendarFeeds.js";
15
+ import type * as callLimits from "../callLimits.js";
16
+ import type * as connections from "../connections.js";
17
+ import type * as crons from "../crons.js";
18
+ import type * as devices from "../devices.js";
19
+ import type * as http from "../http.js";
20
+ import type * as lib_activity from "../lib/activity.js";
21
+ import type * as lib_agentControls from "../lib/agentControls.js";
22
+ import type * as lib_agentWork from "../lib/agentWork.js";
23
+ import type * as lib_appToken from "../lib/appToken.js";
24
+ import type * as lib_approvals from "../lib/approvals.js";
25
+ import type * as lib_args from "../lib/args.js";
26
+ import type * as lib_backlogMd from "../lib/backlogMd.js";
27
+ import type * as lib_backlogOps from "../lib/backlogOps.js";
28
+ import type * as lib_brief from "../lib/brief.js";
29
+ import type * as lib_cimd from "../lib/cimd.js";
30
+ import type * as lib_core from "../lib/core.js";
31
+ import type * as lib_dates from "../lib/dates.js";
32
+ import type * as lib_env from "../lib/env.js";
33
+ import type * as lib_exportPlan from "../lib/exportPlan.js";
34
+ import type * as lib_findTasks from "../lib/findTasks.js";
35
+ import type * as lib_frontmatter from "../lib/frontmatter.js";
36
+ import type * as lib_guide from "../lib/guide.js";
37
+ import type * as lib_health from "../lib/health.js";
38
+ import type * as lib_http from "../lib/http.js";
39
+ import type * as lib_ical from "../lib/ical.js";
40
+ import type * as lib_importFormats from "../lib/importFormats.js";
41
+ import type * as lib_importOps from "../lib/importOps.js";
42
+ import type * as lib_jsonSchema from "../lib/jsonSchema.js";
43
+ import type * as lib_limits from "../lib/limits.js";
44
+ import type * as lib_mcpContent from "../lib/mcpContent.js";
45
+ import type * as lib_mcpProtocol from "../lib/mcpProtocol.js";
46
+ import type * as lib_mcpTools from "../lib/mcpTools.js";
47
+ import type * as lib_oauthConfig from "../lib/oauthConfig.js";
48
+ import type * as lib_oauthPage from "../lib/oauthPage.js";
49
+ import type * as lib_oauthRules from "../lib/oauthRules.js";
50
+ import type * as lib_openapi from "../lib/openapi.js";
51
+ import type * as lib_outputSchemas from "../lib/outputSchemas.js";
52
+ import type * as lib_problem from "../lib/problem.js";
53
+ import type * as lib_proposals from "../lib/proposals.js";
54
+ import type * as lib_repeat from "../lib/repeat.js";
55
+ import type * as lib_restRoutes from "../lib/restRoutes.js";
56
+ import type * as lib_rrule from "../lib/rrule.js";
57
+ import type * as lib_secrets from "../lib/secrets.js";
58
+ import type * as lib_settingsOps from "../lib/settingsOps.js";
59
+ import type * as lib_taskOps from "../lib/taskOps.js";
60
+ import type * as lib_toolResults from "../lib/toolResults.js";
61
+ import type * as lib_validators from "../lib/validators.js";
62
+ import type * as lib_views from "../lib/views.js";
63
+ import type * as lib_vtimezone from "../lib/vtimezone.js";
64
+ import type * as lib_webhookEvents from "../lib/webhookEvents.js";
65
+ import type * as lib_webhookSign from "../lib/webhookSign.js";
66
+ import type * as lib_webhookTarget from "../lib/webhookTarget.js";
67
+ import type * as mcp from "../mcp.js";
68
+ import type * as migrations from "../migrations.js";
69
+ import type * as oauth from "../oauth.js";
70
+ import type * as oauthHttp from "../oauthHttp.js";
71
+ import type * as oauthOwner from "../oauthOwner.js";
72
+ import type * as ops from "../ops.js";
73
+ import type * as pairing from "../pairing.js";
74
+ import type * as rest from "../rest.js";
75
+ import type * as restAccount from "../restAccount.js";
76
+ import type * as restImport from "../restImport.js";
77
+ import type * as webhooks from "../webhooks.js";
78
+
79
+ import type {
80
+ ApiFromModules,
81
+ FilterApi,
82
+ FunctionReference,
83
+ } from "convex/server";
84
+
85
+ declare const fullApi: ApiFromModules<{
86
+ apiKeys: typeof apiKeys;
87
+ app: typeof app;
88
+ calendar: typeof calendar;
89
+ calendarFeeds: typeof calendarFeeds;
90
+ callLimits: typeof callLimits;
91
+ connections: typeof connections;
92
+ crons: typeof crons;
93
+ devices: typeof devices;
94
+ http: typeof http;
95
+ "lib/activity": typeof lib_activity;
96
+ "lib/agentControls": typeof lib_agentControls;
97
+ "lib/agentWork": typeof lib_agentWork;
98
+ "lib/appToken": typeof lib_appToken;
99
+ "lib/approvals": typeof lib_approvals;
100
+ "lib/args": typeof lib_args;
101
+ "lib/backlogMd": typeof lib_backlogMd;
102
+ "lib/backlogOps": typeof lib_backlogOps;
103
+ "lib/brief": typeof lib_brief;
104
+ "lib/cimd": typeof lib_cimd;
105
+ "lib/core": typeof lib_core;
106
+ "lib/dates": typeof lib_dates;
107
+ "lib/env": typeof lib_env;
108
+ "lib/exportPlan": typeof lib_exportPlan;
109
+ "lib/findTasks": typeof lib_findTasks;
110
+ "lib/frontmatter": typeof lib_frontmatter;
111
+ "lib/guide": typeof lib_guide;
112
+ "lib/health": typeof lib_health;
113
+ "lib/http": typeof lib_http;
114
+ "lib/ical": typeof lib_ical;
115
+ "lib/importFormats": typeof lib_importFormats;
116
+ "lib/importOps": typeof lib_importOps;
117
+ "lib/jsonSchema": typeof lib_jsonSchema;
118
+ "lib/limits": typeof lib_limits;
119
+ "lib/mcpContent": typeof lib_mcpContent;
120
+ "lib/mcpProtocol": typeof lib_mcpProtocol;
121
+ "lib/mcpTools": typeof lib_mcpTools;
122
+ "lib/oauthConfig": typeof lib_oauthConfig;
123
+ "lib/oauthPage": typeof lib_oauthPage;
124
+ "lib/oauthRules": typeof lib_oauthRules;
125
+ "lib/openapi": typeof lib_openapi;
126
+ "lib/outputSchemas": typeof lib_outputSchemas;
127
+ "lib/problem": typeof lib_problem;
128
+ "lib/proposals": typeof lib_proposals;
129
+ "lib/repeat": typeof lib_repeat;
130
+ "lib/restRoutes": typeof lib_restRoutes;
131
+ "lib/rrule": typeof lib_rrule;
132
+ "lib/secrets": typeof lib_secrets;
133
+ "lib/settingsOps": typeof lib_settingsOps;
134
+ "lib/taskOps": typeof lib_taskOps;
135
+ "lib/toolResults": typeof lib_toolResults;
136
+ "lib/validators": typeof lib_validators;
137
+ "lib/views": typeof lib_views;
138
+ "lib/vtimezone": typeof lib_vtimezone;
139
+ "lib/webhookEvents": typeof lib_webhookEvents;
140
+ "lib/webhookSign": typeof lib_webhookSign;
141
+ "lib/webhookTarget": typeof lib_webhookTarget;
142
+ mcp: typeof mcp;
143
+ migrations: typeof migrations;
144
+ oauth: typeof oauth;
145
+ oauthHttp: typeof oauthHttp;
146
+ oauthOwner: typeof oauthOwner;
147
+ ops: typeof ops;
148
+ pairing: typeof pairing;
149
+ rest: typeof rest;
150
+ restAccount: typeof restAccount;
151
+ restImport: typeof restImport;
152
+ webhooks: typeof webhooks;
153
+ }>;
154
+
155
+ /**
156
+ * A utility for referencing Convex functions in your app's public API.
157
+ *
158
+ * Usage:
159
+ * ```js
160
+ * const myFunctionReference = api.myModule.myFunction;
161
+ * ```
162
+ */
163
+ export declare const api: FilterApi<
164
+ typeof fullApi,
165
+ FunctionReference<any, "public">
166
+ >;
167
+
168
+ /**
169
+ * A utility for referencing Convex functions in your app's internal API.
170
+ *
171
+ * Usage:
172
+ * ```js
173
+ * const myFunctionReference = internal.myModule.myFunction;
174
+ * ```
175
+ */
176
+ export declare const internal: FilterApi<
177
+ typeof fullApi,
178
+ FunctionReference<any, "internal">
179
+ >;
180
+
181
+ export declare const components: {};
@@ -0,0 +1,23 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * Generated `api` utility.
4
+ *
5
+ * THIS CODE IS AUTOMATICALLY GENERATED.
6
+ *
7
+ * To regenerate, run `npx convex dev`.
8
+ * @module
9
+ */
10
+
11
+ import { anyApi, componentsGeneric } from "convex/server";
12
+
13
+ /**
14
+ * A utility for referencing Convex functions in your app's API.
15
+ *
16
+ * Usage:
17
+ * ```js
18
+ * const myFunctionReference = api.myModule.myFunction;
19
+ * ```
20
+ */
21
+ export const api = anyApi;
22
+ export const internal = anyApi;
23
+ export const components = componentsGeneric();
@@ -0,0 +1,60 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * Generated data model types.
4
+ *
5
+ * THIS CODE IS AUTOMATICALLY GENERATED.
6
+ *
7
+ * To regenerate, run `npx convex dev`.
8
+ * @module
9
+ */
10
+
11
+ import type {
12
+ DataModelFromSchemaDefinition,
13
+ DocumentByName,
14
+ TableNamesInDataModel,
15
+ SystemTableNames,
16
+ } from "convex/server";
17
+ import type { GenericId } from "convex/values";
18
+ import schema from "../schema.js";
19
+
20
+ /**
21
+ * The names of all of your Convex tables.
22
+ */
23
+ export type TableNames = TableNamesInDataModel<DataModel>;
24
+
25
+ /**
26
+ * The type of a document stored in Convex.
27
+ *
28
+ * @typeParam TableName - A string literal type of the table name (like "users").
29
+ */
30
+ export type Doc<TableName extends TableNames> = DocumentByName<
31
+ DataModel,
32
+ TableName
33
+ >;
34
+
35
+ /**
36
+ * An identifier for a document in Convex.
37
+ *
38
+ * Convex documents are uniquely identified by their `Id`, which is accessible
39
+ * on the `_id` field. To learn more, see [Document IDs](https://docs.convex.dev/using/document-ids).
40
+ *
41
+ * Documents can be loaded using `db.get(tableName, id)` in query and mutation functions.
42
+ *
43
+ * IDs are just strings at runtime, but this type can be used to distinguish them from other
44
+ * strings when type checking.
45
+ *
46
+ * @typeParam TableName - A string literal type of the table name (like "users").
47
+ */
48
+ export type Id<TableName extends TableNames | SystemTableNames> =
49
+ GenericId<TableName>;
50
+
51
+ /**
52
+ * A type describing your Convex data model.
53
+ *
54
+ * This type includes information about what tables you have, the type of
55
+ * documents stored in those tables, and the indexes defined on them.
56
+ *
57
+ * This type is used to parameterize methods like `queryGeneric` and
58
+ * `mutationGeneric` to make them type-safe.
59
+ */
60
+ export type DataModel = DataModelFromSchemaDefinition<typeof schema>;