@helm-ai/cli 1.6.0 → 1.7.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.
- package/CHANGELOG.md +341 -0
- package/README.md +1 -0
- package/dist/cli.js +112 -6
- package/package.json +3 -2
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@helm-ai/cli` are listed here, newest first. The format
|
|
4
|
+
follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the
|
|
5
|
+
package uses [semantic versioning](https://semver.org/): a new command or flag is
|
|
6
|
+
a minor release, a fix is a patch, and a change to an existing command's shape is
|
|
7
|
+
a major release.
|
|
8
|
+
|
|
9
|
+
Dates are npm publish dates (UTC). Versions before 0.15.0 were installed from git
|
|
10
|
+
and never published to npm; their dates are when the version was cut.
|
|
11
|
+
|
|
12
|
+
For changes to the Helm app itself, see https://gethelm.ai/changelog.
|
|
13
|
+
|
|
14
|
+
## [Unreleased]
|
|
15
|
+
|
|
16
|
+
## [1.7.0] - 2026-12-02
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
- `outcome record` records a business result (a consult booked, a client
|
|
20
|
+
renewed) and credits the agent work that led to it, so agents learn what
|
|
21
|
+
works. `--ref` and `--toolkit` name the object in a connected tool; `--key`
|
|
22
|
+
counts a repeated result once.
|
|
23
|
+
- `outcome list` lists recorded results, filtered by company, result, source
|
|
24
|
+
or date.
|
|
25
|
+
- `doc create --type` sets the document type: note, sop, template,
|
|
26
|
+
meeting_notes, or the new deck (a presentation made of `:::card{…}` … `:::`
|
|
27
|
+
blocks).
|
|
28
|
+
- `doc list --type` filters by type, and the list shows a Type column.
|
|
29
|
+
- `doc create` and `doc update` take `--theme` (brand, light, dark, mono),
|
|
30
|
+
`--width` (normal, wide) and `--logo` / `--no-logo` for a deck.
|
|
31
|
+
|
|
32
|
+
## [1.6.0] - 2026-11-30
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
- `sequence update` renames a sequence and changes its exit-on-reply,
|
|
36
|
+
exit-on-bounce and transactional settings.
|
|
37
|
+
- `sequence emails` lists a sequence's emails in order.
|
|
38
|
+
- `sequence update-email` edits an email's subject, body (`--html-file`,
|
|
39
|
+
`--text-file`) or delay in place.
|
|
40
|
+
- `sequence remove-email`, `sequence reorder` and `sequence delete` (with `--yes`
|
|
41
|
+
to skip the confirmation).
|
|
42
|
+
|
|
43
|
+
## [1.5.0] - 2026-11-07
|
|
44
|
+
|
|
45
|
+
### Added
|
|
46
|
+
- `invoice create --already-billed` records a bill the client already got another
|
|
47
|
+
way (text, paper). It's saved as open, so it counts as owed, and nothing is sent.
|
|
48
|
+
|
|
49
|
+
## [1.4.0] - 2026-11-05
|
|
50
|
+
|
|
51
|
+
### Added
|
|
52
|
+
- Commands respect the member access preset of the person behind the API key. A
|
|
53
|
+
refusal names the area and level and doesn't ask you to log in again.
|
|
54
|
+
|
|
55
|
+
## [1.3.0] - 2026-11-04
|
|
56
|
+
|
|
57
|
+
### Added
|
|
58
|
+
- `calendar create --repeat <rule>` creates a repeating event.
|
|
59
|
+
- `calendar create --timezone <iana>` reads `--start` and `--end` without an offset
|
|
60
|
+
as wall-clock time in that zone, and a repeating event keeps its local time
|
|
61
|
+
across daylight saving.
|
|
62
|
+
|
|
63
|
+
## [1.2.0] - 2026-11-03
|
|
64
|
+
|
|
65
|
+
### Added
|
|
66
|
+
- `file list` and `file read` for Helm Files, with filters for company, project,
|
|
67
|
+
folder, kind and a text query. `file read --text` prints a file's extracted
|
|
68
|
+
text; `--save` downloads it.
|
|
69
|
+
|
|
70
|
+
## [1.1.0] - 2026-10-28
|
|
71
|
+
|
|
72
|
+
### Added
|
|
73
|
+
- `deal create` and `deal update` take `--next-step`, `--next-step-date`,
|
|
74
|
+
`--source` and `--lost-reason`.
|
|
75
|
+
|
|
76
|
+
## [1.0.0] - 2026-10-27
|
|
77
|
+
|
|
78
|
+
### Changed
|
|
79
|
+
- **Breaking:** Accounts are now Companies. The `account` command is now
|
|
80
|
+
`company`, and every `--account` flag (on `calendar`, `contact`, `deal`,
|
|
81
|
+
`estimate`, `hours`, `invoice`, `payment`, `project` and `subscription`) is now
|
|
82
|
+
`--company`. Update scripts that call the old names.
|
|
83
|
+
|
|
84
|
+
## [0.31.2] - 2026-10-23
|
|
85
|
+
|
|
86
|
+
### Changed
|
|
87
|
+
- Subscription payment links print Helm's link, which doesn't expire, in place of
|
|
88
|
+
the checkout page that expired within 24 hours. `subscription links` shows
|
|
89
|
+
"never" for these.
|
|
90
|
+
|
|
91
|
+
## [0.31.1] - 2026-10-18
|
|
92
|
+
|
|
93
|
+
### Fixed
|
|
94
|
+
- `task update`, `task complete` and `task comment` with `--as <agent>` only
|
|
95
|
+
accept an agent on the task's project.
|
|
96
|
+
|
|
97
|
+
## [0.31.0] - 2026-10-18
|
|
98
|
+
|
|
99
|
+
### Added
|
|
100
|
+
- `task owner --user <email>` makes a person a task's owner. An owner is one
|
|
101
|
+
person or one agent.
|
|
102
|
+
|
|
103
|
+
## [0.30.0] - 2026-10-18
|
|
104
|
+
|
|
105
|
+
### Added
|
|
106
|
+
- `task owner` names an agent as a task's owner without starting it on the work;
|
|
107
|
+
`--clear` removes the owner.
|
|
108
|
+
- `--as <agent>` on task updates, completions and comments posts the change as an
|
|
109
|
+
agent (admins only).
|
|
110
|
+
|
|
111
|
+
## [0.29.1] - 2026-10-18
|
|
112
|
+
|
|
113
|
+
### Fixed
|
|
114
|
+
- `--low-alert` help says the percent is of the newest hours added, not of
|
|
115
|
+
everything bought.
|
|
116
|
+
|
|
117
|
+
## [0.29.0] - 2026-10-15
|
|
118
|
+
|
|
119
|
+
### Added
|
|
120
|
+
- Hour plans: `hours create`, `hours update`, `hours plan`, `hours add`,
|
|
121
|
+
`hours void`, `hours activity` and `hours statement`, covering monthly and
|
|
122
|
+
prepaid plans, rollover, rounding, overage rates and low-hours alerts.
|
|
123
|
+
|
|
124
|
+
## [0.28.0] - 2026-10-15
|
|
125
|
+
|
|
126
|
+
### Added
|
|
127
|
+
- `hours balance` shows how many hours a client has left, by company, plan or
|
|
128
|
+
project.
|
|
129
|
+
|
|
130
|
+
## [0.27.0] - 2026-10-12
|
|
131
|
+
|
|
132
|
+
### Added
|
|
133
|
+
- `subscription links`, `subscription resend-link` and
|
|
134
|
+
`subscription cancel-link` for payment links that were sent and not yet paid.
|
|
135
|
+
|
|
136
|
+
## [0.26.0] - 2026-10-08
|
|
137
|
+
|
|
138
|
+
### Added
|
|
139
|
+
- `project create --stage` accepts `on_hold`, along with planning, active,
|
|
140
|
+
review, completed and archived.
|
|
141
|
+
|
|
142
|
+
## [0.25.0] - 2026-10-07
|
|
143
|
+
|
|
144
|
+
### Added
|
|
145
|
+
- `estimate get` and `estimate update`.
|
|
146
|
+
- `line-item update` and `line-item remove` edit an invoice or estimate after
|
|
147
|
+
it's created.
|
|
148
|
+
|
|
149
|
+
## [0.24.0] - 2026-10-07
|
|
150
|
+
|
|
151
|
+
### Added
|
|
152
|
+
- `invoice create` and `estimate create` take line items with `--item` (repeatable)
|
|
153
|
+
or `--items` (a JSON file).
|
|
154
|
+
- `estimate create --contact` and `--internal-notes`.
|
|
155
|
+
|
|
156
|
+
### Fixed
|
|
157
|
+
- Invoices and estimates created from the CLI are numbered the same way as the
|
|
158
|
+
app's.
|
|
159
|
+
|
|
160
|
+
## [0.23.0] - 2026-10-03
|
|
161
|
+
|
|
162
|
+
### Added
|
|
163
|
+
- `doc outline`, `doc blocks` and `doc patch` read and edit a document section by
|
|
164
|
+
section (`--replace`, `--insert-after`, `--insert-before`, `--delete`).
|
|
165
|
+
- `doc page update`, `doc page delete` and `doc page reorder` rename, move,
|
|
166
|
+
reorder and delete pages after the first.
|
|
167
|
+
|
|
168
|
+
## [0.22.0] - 2026-09-03
|
|
169
|
+
|
|
170
|
+
### Added
|
|
171
|
+
- Subscriptions: `subscription create`, `get`, `list`, `pause`, `resume`,
|
|
172
|
+
`cancel`, `refresh` and `mrr`.
|
|
173
|
+
|
|
174
|
+
## [0.21.0] - 2026-09-02
|
|
175
|
+
|
|
176
|
+
### Changed
|
|
177
|
+
- `form list` shows a form's hosted page when it has one.
|
|
178
|
+
|
|
179
|
+
## [0.20.0] - 2026-08-31
|
|
180
|
+
|
|
181
|
+
### Added
|
|
182
|
+
- `agent schedule create --output-channels` delivers a routine's results to more
|
|
183
|
+
than one place.
|
|
184
|
+
|
|
185
|
+
## [0.19.0] - 2026-08-31
|
|
186
|
+
|
|
187
|
+
### Added
|
|
188
|
+
- `agent schedule create --output-channel` accepts `slack_dm` and `email`.
|
|
189
|
+
|
|
190
|
+
## [0.18.0] - 2026-08-26
|
|
191
|
+
|
|
192
|
+
### Added
|
|
193
|
+
- `task comments` reads a task's comment thread.
|
|
194
|
+
|
|
195
|
+
## [0.17.0] - 2026-08-24
|
|
196
|
+
|
|
197
|
+
### Fixed
|
|
198
|
+
- `deal get` includes the revenue rollup: invoiced, collected, and what a won deal
|
|
199
|
+
is still owed.
|
|
200
|
+
|
|
201
|
+
## [0.16.0] - 2026-08-24
|
|
202
|
+
|
|
203
|
+
### Added
|
|
204
|
+
- `payment list` and `payment record`, including the deal a payment won.
|
|
205
|
+
- `invoice create --deal` links an invoice to a deal.
|
|
206
|
+
|
|
207
|
+
### Changed
|
|
208
|
+
- The CLI installs as `helm-ai` only. The short `helm` alias is gone, since it
|
|
209
|
+
clashes with the Kubernetes package manager.
|
|
210
|
+
- A README.
|
|
211
|
+
|
|
212
|
+
## [0.15.0] - 2026-08-24
|
|
213
|
+
|
|
214
|
+
First version published to npm.
|
|
215
|
+
|
|
216
|
+
### Added
|
|
217
|
+
- `pipeline update-stage --archived` parks a stage outside funnels and forecasts.
|
|
218
|
+
|
|
219
|
+
## [0.14.0] - 2026-08-14
|
|
220
|
+
|
|
221
|
+
### Added
|
|
222
|
+
- Email drafts: `email draft`, `email drafts`, `email update`, `email delete` and
|
|
223
|
+
`email identities`.
|
|
224
|
+
- `time update` and `time delete`, and `time log --date` and `--at` to log work
|
|
225
|
+
on another day.
|
|
226
|
+
- `deal create --contact` links a deal to a person.
|
|
227
|
+
|
|
228
|
+
### Fixed
|
|
229
|
+
- Multi-assign on tasks, and a `-v` flag collision.
|
|
230
|
+
|
|
231
|
+
## [0.13.0] - 2026-07-27
|
|
232
|
+
|
|
233
|
+
### Added
|
|
234
|
+
- Contact profile fields: phone, address, timezone, social links, lead source,
|
|
235
|
+
last contacted and next follow-up.
|
|
236
|
+
- `sequence create --transactional` for billing and account mail that still sends
|
|
237
|
+
to marketing unsubscribes.
|
|
238
|
+
|
|
239
|
+
## [0.12.3] - 2026-07-16
|
|
240
|
+
|
|
241
|
+
### Added
|
|
242
|
+
- Pipelines: `pipeline create`, `list`, `update`, `delete`, `add-stage`,
|
|
243
|
+
`update-stage` and `delete-stage`.
|
|
244
|
+
- `deal update`, and `deal create --pipeline`.
|
|
245
|
+
- `form update-field`, `remove-field`, `update-step` and `remove-step`.
|
|
246
|
+
|
|
247
|
+
### Fixed
|
|
248
|
+
- The login prompt points to the right place for your API key.
|
|
249
|
+
|
|
250
|
+
## [0.12.2] - 2026-07-11
|
|
251
|
+
|
|
252
|
+
### Added
|
|
253
|
+
- `--query` search on `contact list`, `account list` and `task list`.
|
|
254
|
+
|
|
255
|
+
## [0.12.1] - 2026-07-11
|
|
256
|
+
|
|
257
|
+
### Added
|
|
258
|
+
- Forms accept consent fields.
|
|
259
|
+
|
|
260
|
+
## [0.12.0] - 2026-07-08
|
|
261
|
+
|
|
262
|
+
### Added
|
|
263
|
+
- `doc page` adds pages to a document.
|
|
264
|
+
|
|
265
|
+
## [0.11.0] - 2026-06-21
|
|
266
|
+
|
|
267
|
+
### Added
|
|
268
|
+
- Workflow authoring: `workflow create`, `update`, `delete` and `schema`.
|
|
269
|
+
- `agent send-email` sends email as a named agent.
|
|
270
|
+
|
|
271
|
+
## [0.10.0] - 2026-06-11
|
|
272
|
+
|
|
273
|
+
### Added
|
|
274
|
+
- `task create --attach` and `task update --attach` attach files of any type.
|
|
275
|
+
|
|
276
|
+
## [0.9.0] - 2026-06-10
|
|
277
|
+
|
|
278
|
+
### Added
|
|
279
|
+
- Forms: `form create`, `get`, `list`, `add-field`, `add-step`, `status`, `stats`
|
|
280
|
+
and `submissions`.
|
|
281
|
+
- Product price tiers: `product tier`, `product add` and `product rm`.
|
|
282
|
+
- `sequence create` and `sequence add-email`.
|
|
283
|
+
|
|
284
|
+
## [0.8.1] - 2026-05-25
|
|
285
|
+
|
|
286
|
+
### Added
|
|
287
|
+
- `product update` and `product archive`.
|
|
288
|
+
|
|
289
|
+
### Fixed
|
|
290
|
+
- Output is flushed before the CLI exits.
|
|
291
|
+
- `deal delete` asks for a real confirmation.
|
|
292
|
+
|
|
293
|
+
## [0.8.0] - 2026-05-23
|
|
294
|
+
|
|
295
|
+
### Added
|
|
296
|
+
- `contact delete`, and `--all` / `--offset` paging on contact and account lists.
|
|
297
|
+
|
|
298
|
+
### Fixed
|
|
299
|
+
- CSV import checks for duplicates across every page of existing records.
|
|
300
|
+
|
|
301
|
+
## [0.7.1] - 2026-05-23
|
|
302
|
+
|
|
303
|
+
### Fixed
|
|
304
|
+
- CSV import of custom fields with dotted keys or a whole-object column.
|
|
305
|
+
|
|
306
|
+
## [0.7.0] - 2026-05-23
|
|
307
|
+
|
|
308
|
+
### Added
|
|
309
|
+
- Tags and custom fields on contacts and accounts.
|
|
310
|
+
- `account attach`, `detach` and `products` link products to an account.
|
|
311
|
+
|
|
312
|
+
### Fixed
|
|
313
|
+
- CSV import updates duplicates instead of skipping them.
|
|
314
|
+
|
|
315
|
+
## [0.6.0] - 2026-05-23
|
|
316
|
+
|
|
317
|
+
### Added
|
|
318
|
+
- `workflow list`, `get`, `run` and `runs`.
|
|
319
|
+
- `sequence list`, `get`, `enroll` and `enrollments`.
|
|
320
|
+
|
|
321
|
+
## [0.5.0] - 2026-05-22
|
|
322
|
+
|
|
323
|
+
### Added
|
|
324
|
+
- Products: `product create`, `get`, `list`, `attach` and `add-line`.
|
|
325
|
+
|
|
326
|
+
## [0.4.3] - 2026-05-04
|
|
327
|
+
|
|
328
|
+
### Added
|
|
329
|
+
- `template list` and `template apply` install built-in Program Templates.
|
|
330
|
+
- `task create --parent` for subtasks.
|
|
331
|
+
|
|
332
|
+
## [0.4.0] - 2026-04-27
|
|
333
|
+
|
|
334
|
+
### Added
|
|
335
|
+
- Profiles for working across several workspaces: `profile list`, `use` and
|
|
336
|
+
`current`.
|
|
337
|
+
|
|
338
|
+
## [0.3.1] - 2026-04-25
|
|
339
|
+
|
|
340
|
+
First release: login, accounts (now companies), contacts, deals, projects, tasks,
|
|
341
|
+
time, invoices, estimates, calendar, documents, agents, config and CSV import.
|
package/README.md
CHANGED
|
@@ -91,6 +91,7 @@ Every resource follows the same shape — `list`, `get <id>`, `create`, `update
|
|
|
91
91
|
| `form`, `sequence`, `email` | Capture and follow-up |
|
|
92
92
|
| `workflow`, `template` | Automations and reusable project structures |
|
|
93
93
|
| `agent` | AI staff — schedules, objectives, and runs |
|
|
94
|
+
| `outcome` | Business results agents learn from: `record` and `list` |
|
|
94
95
|
| `import` | Bulk import of people, companies, deals and tasks from CSV/JSON |
|
|
95
96
|
| `login`, `logout`, `whoami`, `profile`, `config` | Credentials and settings |
|
|
96
97
|
|
package/dist/cli.js
CHANGED
|
@@ -25,7 +25,7 @@ function renderSplash(ctx) {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
// src/version.ts
|
|
28
|
-
var version = "1.
|
|
28
|
+
var version = "1.7.0";
|
|
29
29
|
|
|
30
30
|
// src/commands/auth.ts
|
|
31
31
|
import prompts from "prompts";
|
|
@@ -883,6 +883,16 @@ var HelmClient = class _HelmClient {
|
|
|
883
883
|
return data;
|
|
884
884
|
}
|
|
885
885
|
};
|
|
886
|
+
outcomes = {
|
|
887
|
+
record: async (input) => {
|
|
888
|
+
const data = await this.request("record_outcome", "POST", input);
|
|
889
|
+
return data;
|
|
890
|
+
},
|
|
891
|
+
list: async (filters = {}) => {
|
|
892
|
+
const data = await this.request("list_outcomes", "GET", filters);
|
|
893
|
+
return data.outcomes ?? [];
|
|
894
|
+
}
|
|
895
|
+
};
|
|
886
896
|
sequences = {
|
|
887
897
|
list: async (filters = {}) => {
|
|
888
898
|
const data = await this.request("list_email_sequences", "GET", filters);
|
|
@@ -947,6 +957,9 @@ var HelmClient = class _HelmClient {
|
|
|
947
957
|
}
|
|
948
958
|
};
|
|
949
959
|
};
|
|
960
|
+
var DOCUMENT_TYPES = ["note", "sop", "template", "meeting_notes", "deck"];
|
|
961
|
+
var DECK_THEMES = ["brand", "light", "dark", "mono"];
|
|
962
|
+
var DECK_WIDTHS = ["normal", "wide"];
|
|
950
963
|
|
|
951
964
|
// src/lib/config.ts
|
|
952
965
|
import { readFileSync, writeFileSync, existsSync, mkdirSync, chmodSync, statSync } from "fs";
|
|
@@ -3576,6 +3589,26 @@ function readContent(opts) {
|
|
|
3576
3589
|
if (opts.content === "-") return readFileSync3(0, "utf8");
|
|
3577
3590
|
return opts.content;
|
|
3578
3591
|
}
|
|
3592
|
+
function parseDocType(value) {
|
|
3593
|
+
if (!DOCUMENT_TYPES.includes(value)) {
|
|
3594
|
+
throw new InvalidArgumentError3(`must be one of ${DOCUMENT_TYPES.join(", ")}`);
|
|
3595
|
+
}
|
|
3596
|
+
return value;
|
|
3597
|
+
}
|
|
3598
|
+
function parseDeckTheme(value) {
|
|
3599
|
+
if (!DECK_THEMES.includes(value)) {
|
|
3600
|
+
throw new InvalidArgumentError3(`must be one of ${DECK_THEMES.join(", ")}`);
|
|
3601
|
+
}
|
|
3602
|
+
return value;
|
|
3603
|
+
}
|
|
3604
|
+
function parseDeckWidth(value) {
|
|
3605
|
+
if (!DECK_WIDTHS.includes(value)) {
|
|
3606
|
+
throw new InvalidArgumentError3(`must be one of ${DECK_WIDTHS.join(", ")}`);
|
|
3607
|
+
}
|
|
3608
|
+
return value;
|
|
3609
|
+
}
|
|
3610
|
+
var DECK_THEME_HELP = `decks only: ${DECK_THEMES.join("|")} (brand: your brand color; dark: dark cards)`;
|
|
3611
|
+
var DECK_WIDTH_HELP = `decks only: ${DECK_WIDTHS.join("|")}`;
|
|
3579
3612
|
function parsePosition2(value) {
|
|
3580
3613
|
const n = Number(value);
|
|
3581
3614
|
if (!Number.isInteger(n) || n < 0) throw new InvalidArgumentError3("must be a whole number, 0 or more");
|
|
@@ -3583,7 +3616,7 @@ function parsePosition2(value) {
|
|
|
3583
3616
|
}
|
|
3584
3617
|
function registerDocCommands(parent) {
|
|
3585
3618
|
const cmd = parent.command("doc").alias("docs").description("Manage documents");
|
|
3586
|
-
cmd.command("list").description("List documents").option("-s, --status <status>", "draft|published|archived").option("--visibility <vis>", "private|workspace|shared|public").option("--category <cat>").option("--project <id>").option("-l, --limit <n>", "max rows", (v) => parseInt(v, 10), 50).option("-o, --output <format>").option("-p, --profile <name>").action(async (opts) => {
|
|
3619
|
+
cmd.command("list").description("List documents").option("-s, --status <status>", "draft|published|archived").option("--visibility <vis>", "private|workspace|shared|public").option("--category <cat>").option("--project <id>").option("--type <type>", `${DOCUMENT_TYPES.join("|")}`, parseDocType).option("-l, --limit <n>", "max rows", (v) => parseInt(v, 10), 50).option("-o, --output <format>").option("-p, --profile <name>").action(async (opts) => {
|
|
3587
3620
|
try {
|
|
3588
3621
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
3589
3622
|
const rows = await client.documents.list({
|
|
@@ -3591,10 +3624,12 @@ function registerDocCommands(parent) {
|
|
|
3591
3624
|
visibility: opts.visibility,
|
|
3592
3625
|
category: opts.category,
|
|
3593
3626
|
project_id: opts.project,
|
|
3627
|
+
document_type: opts.type,
|
|
3594
3628
|
limit: opts.limit
|
|
3595
3629
|
});
|
|
3596
3630
|
console.log(render(rows, [
|
|
3597
3631
|
{ header: "Title", get: (r) => r.title, truncate: 40 },
|
|
3632
|
+
{ header: "Type", get: (r) => r.document_type },
|
|
3598
3633
|
{ header: "Status", get: (r) => r.status },
|
|
3599
3634
|
{ header: "Visibility", get: (r) => r.visibility },
|
|
3600
3635
|
{ header: "Updated", get: (r) => r.updated_at?.slice(0, 10) },
|
|
@@ -3617,7 +3652,7 @@ function registerDocCommands(parent) {
|
|
|
3617
3652
|
return;
|
|
3618
3653
|
}
|
|
3619
3654
|
});
|
|
3620
|
-
cmd.command("create").description("Create a document (content from --content, --content-file, or stdin with -c -)").requiredOption("-t, --title <title>").option("-c, --content <text>", 'content as markdown (use "-" for stdin)').option("--content-file <path>", "read content from a file").option("-d, --description <text>").option("--project <id>").option("-s, --status <status>", "draft|published|archived", "draft").option("--visibility <vis>", "private|workspace|shared|public", "private").option("--category <cat>").option("--tag <tag...>").option("-p, --profile <name>").action(async (opts) => {
|
|
3655
|
+
cmd.command("create").description("Create a document (content from --content, --content-file, or stdin with -c -)").requiredOption("-t, --title <title>").option("-c, --content <text>", 'content as markdown (use "-" for stdin)').option("--content-file <path>", "read content from a file").option("-d, --description <text>").option("--project <id>").option("-s, --status <status>", "draft|published|archived", "draft").option("--visibility <vis>", "private|workspace|shared|public", "private").option("--category <cat>").option("--tag <tag...>").option("--type <type>", `${DOCUMENT_TYPES.join("|")} (default note; a deck is written as :::card{\u2026} \u2026 ::: blocks)`, parseDocType).option("--theme <theme>", `${DECK_THEME_HELP}; default brand`, parseDeckTheme).option("--width <width>", `${DECK_WIDTH_HELP}; default normal`, parseDeckWidth).option("--logo", "decks only: show the workspace logo on title cards").option("--no-logo", "decks only: hide the logo").option("-p, --profile <name>").action(async (opts) => {
|
|
3621
3656
|
try {
|
|
3622
3657
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
3623
3658
|
const doc = await client.documents.create({
|
|
@@ -3628,7 +3663,11 @@ function registerDocCommands(parent) {
|
|
|
3628
3663
|
status: opts.status,
|
|
3629
3664
|
visibility: opts.visibility,
|
|
3630
3665
|
category: opts.category,
|
|
3631
|
-
tags: opts.tag
|
|
3666
|
+
tags: opts.tag,
|
|
3667
|
+
document_type: opts.type,
|
|
3668
|
+
deck_theme: opts.theme,
|
|
3669
|
+
deck_width: opts.width,
|
|
3670
|
+
deck_logo: opts.logo
|
|
3632
3671
|
});
|
|
3633
3672
|
console.log(JSON.stringify(doc, null, 2));
|
|
3634
3673
|
} catch (err) {
|
|
@@ -3637,13 +3676,16 @@ function registerDocCommands(parent) {
|
|
|
3637
3676
|
return;
|
|
3638
3677
|
}
|
|
3639
3678
|
});
|
|
3640
|
-
cmd.command("update <id>").description("Update a document").option("-t, --title <title>").option("-c, --content <text>", 'use "-" for stdin').option("--content-file <path>").option("-s, --status <status>").option("-p, --profile <name>").action(async (id, opts) => {
|
|
3679
|
+
cmd.command("update <id>").description("Update a document").option("-t, --title <title>").option("-c, --content <text>", 'use "-" for stdin').option("--content-file <path>").option("-s, --status <status>").option("--theme <theme>", DECK_THEME_HELP, parseDeckTheme).option("--width <width>", DECK_WIDTH_HELP, parseDeckWidth).option("--logo", "decks only: show the workspace logo on title cards").option("--no-logo", "decks only: hide the logo").option("-p, --profile <name>").action(async (id, opts) => {
|
|
3641
3680
|
try {
|
|
3642
3681
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
3643
3682
|
const doc = await client.documents.update(id, {
|
|
3644
3683
|
title: opts.title,
|
|
3645
3684
|
content: readContent(opts),
|
|
3646
|
-
status: opts.status
|
|
3685
|
+
status: opts.status,
|
|
3686
|
+
deck_theme: opts.theme,
|
|
3687
|
+
deck_width: opts.width,
|
|
3688
|
+
deck_logo: opts.logo
|
|
3647
3689
|
});
|
|
3648
3690
|
console.log(JSON.stringify(doc, null, 2));
|
|
3649
3691
|
} catch (err) {
|
|
@@ -5214,6 +5256,69 @@ function registerEmailCommands(parent) {
|
|
|
5214
5256
|
});
|
|
5215
5257
|
}
|
|
5216
5258
|
|
|
5259
|
+
// src/commands/outcome.ts
|
|
5260
|
+
var RESULTS = ["success", "failure", "neutral"];
|
|
5261
|
+
function parseNumber(flag) {
|
|
5262
|
+
return (v) => {
|
|
5263
|
+
const n = Number(v);
|
|
5264
|
+
if (!Number.isFinite(n)) throw new Error(`${flag} must be a number (got "${v}").`);
|
|
5265
|
+
return n;
|
|
5266
|
+
};
|
|
5267
|
+
}
|
|
5268
|
+
function registerOutcomeCommands(parent) {
|
|
5269
|
+
const cmd = parent.command("outcome").description("Record and list business results that agents learn from");
|
|
5270
|
+
cmd.command("record <result> <label>").description('Record a result (success, failure or neutral), e.g. outcome record success "Consult booked" --company <id>').option("--company <id>", "the company it is about").option("--ref <id>", "id of the object in a connected tool (an ad campaign, a form, a booking)").option("--toolkit <slug>", "the connected tool --ref comes from, e.g. metaads").option("--runs <ids>", "agent run ids known to have caused it, comma-separated").option("--metric <name>", "measurement name, e.g. cost_per_lead").option("--metric-value <n>", "measurement value", parseNumber("--metric-value")).option("--metric-unit <unit>", "measurement unit, e.g. USD").option("--value <usd>", "what the result is worth, in USD", parseNumber("--value")).option("--at <iso>", "when it happened (ISO 8601, default: now)").option("--note <text>").option("--key <key>", "idempotency key: recording the same key again does nothing").option("-p, --profile <name>").action(async (result, label, opts) => {
|
|
5271
|
+
try {
|
|
5272
|
+
if (!RESULTS.includes(result)) throw new Error(`Result must be success, failure or neutral (got "${result}").`);
|
|
5273
|
+
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
5274
|
+
const out = await client.outcomes.record({
|
|
5275
|
+
result,
|
|
5276
|
+
label,
|
|
5277
|
+
company_id: opts.company,
|
|
5278
|
+
external_ref: opts.ref,
|
|
5279
|
+
toolkit: opts.toolkit,
|
|
5280
|
+
run_ids: opts.runs ? String(opts.runs).split(",").map((s) => s.trim()).filter(Boolean) : void 0,
|
|
5281
|
+
metric: opts.metric,
|
|
5282
|
+
metric_value: opts.metricValue,
|
|
5283
|
+
metric_unit: opts.metricUnit,
|
|
5284
|
+
value_usd: opts.value,
|
|
5285
|
+
occurred_at: opts.at,
|
|
5286
|
+
note: opts.note,
|
|
5287
|
+
idempotency_key: opts.key
|
|
5288
|
+
});
|
|
5289
|
+
console.log(JSON.stringify(out, null, 2));
|
|
5290
|
+
} catch (err) {
|
|
5291
|
+
console.error(formatErrorForCli(err));
|
|
5292
|
+
process.exitCode = 1;
|
|
5293
|
+
return;
|
|
5294
|
+
}
|
|
5295
|
+
});
|
|
5296
|
+
cmd.command("list").description("List recorded results, newest first").option("--company <id>").option("--result <result>", "success, failure or neutral").option("--source <source>", "system, agent, workflow, api or user").option("--since <date>", "on or after this date (ISO 8601)").option("-l, --limit <n>", "max rows (max 100)", (v) => parseInt(v, 10), 25).option("-o, --output <format>").option("-p, --profile <name>").action(async (opts) => {
|
|
5297
|
+
try {
|
|
5298
|
+
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
5299
|
+
const rows = await client.outcomes.list({
|
|
5300
|
+
company_id: opts.company,
|
|
5301
|
+
result: opts.result,
|
|
5302
|
+
source: opts.source,
|
|
5303
|
+
since: opts.since,
|
|
5304
|
+
limit: opts.limit
|
|
5305
|
+
});
|
|
5306
|
+
console.log(render(rows, [
|
|
5307
|
+
{ header: "What", get: (r) => r.what, truncate: 40 },
|
|
5308
|
+
{ header: "Result", get: (r) => r.result },
|
|
5309
|
+
{ header: "Company", get: (r) => r.company_name ?? "", truncate: 24 },
|
|
5310
|
+
{ header: "Source", get: (r) => r.source },
|
|
5311
|
+
{ header: "When", get: (r) => r.occurred_at?.slice(0, 16) },
|
|
5312
|
+
{ header: "ID", get: (r) => r.outcome_id, truncate: 8 }
|
|
5313
|
+
], opts.output ?? defaultFormat()));
|
|
5314
|
+
} catch (err) {
|
|
5315
|
+
console.error(formatErrorForCli(err));
|
|
5316
|
+
process.exitCode = 1;
|
|
5317
|
+
return;
|
|
5318
|
+
}
|
|
5319
|
+
});
|
|
5320
|
+
}
|
|
5321
|
+
|
|
5217
5322
|
// src/cli.ts
|
|
5218
5323
|
var program = new Command4();
|
|
5219
5324
|
program.name("helm-ai").description("Helm CLI \u2014 run your business operations (projects, CRM, billing, automations, AI agents) from the terminal").version(version, "-v, --version").addHelpText("beforeAll", () => process.stdout.isTTY ? renderSplash({ version }) : "");
|
|
@@ -5243,6 +5348,7 @@ registerTemplateCommands(program);
|
|
|
5243
5348
|
registerWorkflowCommands(program);
|
|
5244
5349
|
registerSequenceCommands(program);
|
|
5245
5350
|
registerEmailCommands(program);
|
|
5351
|
+
registerOutcomeCommands(program);
|
|
5246
5352
|
program.action(() => {
|
|
5247
5353
|
if (process.stdout.isTTY) {
|
|
5248
5354
|
process.stdout.write(renderSplash({ version }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helm-ai/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Command line interface for Helm",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/cli.js",
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"dist",
|
|
12
|
-
"README.md"
|
|
12
|
+
"README.md",
|
|
13
|
+
"CHANGELOG.md"
|
|
13
14
|
],
|
|
14
15
|
"scripts": {
|
|
15
16
|
"build": "tsup",
|