@hardfin/cli 0.1.1-dev.72 → 0.1.1-dev.74
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/README.md +23 -20
- package/dist/{check-CvjTUx-K.js → check-8Ta7vSnU.js} +4 -4
- package/dist/cli.js +5 -5
- package/dist/completion-tree.json +1 -1
- package/dist/{notice-D6mbHF9O.js → notice-DWvcEHhw.js} +4 -4
- package/dist/{program-CC8Iqb14.js → program-CuFKCoDH.js} +1709 -962
- package/package.json +1 -1
- package/skills/hardfin-cli/SKILL.md +34 -18
- package/templates/AGENTS.md +9 -9
package/README.md
CHANGED
|
@@ -18,6 +18,23 @@ npm install -g @hardfin/cli
|
|
|
18
18
|
|
|
19
19
|
It needs Node 20.12 or later.
|
|
20
20
|
|
|
21
|
+
### For an agent
|
|
22
|
+
|
|
23
|
+
After installing, run `hardfin init` in the project the agent works in, then sign in:
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
hardfin init
|
|
27
|
+
hardfin login
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`init` writes the `hardfin-cli` skill and a Hardfin section in `AGENTS.md`. Coding agents
|
|
31
|
+
load both on their own. The skill says how to find records, count them, and read errors.
|
|
32
|
+
[Setting up a project for agents](#setting-up-a-project-for-agents) lists every file `init`
|
|
33
|
+
writes.
|
|
34
|
+
|
|
35
|
+
Outside a project, an agent reads `hardfin agent-guide <command>` before calling that
|
|
36
|
+
command. `hardfin agent-guide` with no command describes every command, in about 3,000 lines.
|
|
37
|
+
|
|
21
38
|
Previews of unreleased work are published from the `dev` branch.
|
|
22
39
|
|
|
23
40
|
```sh
|
|
@@ -289,6 +306,7 @@ Each command names its `path`, its `endpoint`, whether it `runs`, and its flags.
|
|
|
289
306
|
| `negatable` | Present when a boolean also takes a `--no-` form |
|
|
290
307
|
| `element` | The fields one value carries as `key=value`, for an array of objects |
|
|
291
308
|
| `elementRequired` | The fields of `element` every value must carry |
|
|
309
|
+
| `elementUuids` | The fields of `element` that take a UUID |
|
|
292
310
|
| `default` | The value used when the flag is not given |
|
|
293
311
|
|
|
294
312
|
A part that is absent means no. The description is read from the same declarations the parser
|
|
@@ -384,7 +402,6 @@ so a new document cannot leave requests naming the version before it.
|
|
|
384
402
|
|
|
385
403
|
```sh
|
|
386
404
|
hardfin login # approve this CLI in a browser
|
|
387
|
-
hardfin login --device # approve on another machine, by typing a code
|
|
388
405
|
hardfin login --read-only # sign in so that nothing can be changed
|
|
389
406
|
hardfin status # what the CLI is configured with and signed in as
|
|
390
407
|
hardfin logout # forget this machine, and ask Hardfin to revoke it
|
|
@@ -461,27 +478,13 @@ An agent that runs `hardfin login` reads its stderr, and you only see what the a
|
|
|
461
478
|
on. So when output is JSON, which it is whenever stdout is not a terminal, the command writes
|
|
462
479
|
one line of JSON on stderr before it starts waiting.
|
|
463
480
|
|
|
464
|
-
| `event` | Also carries
|
|
465
|
-
| ------------- |
|
|
466
|
-
| `sign_in_url` | `url`, `browserOpened`, `waitSeconds`
|
|
467
|
-
| `device_code` | `userCode`, `verificationUri`, `url`, `browserOpened`, `waitSeconds` | Show you the code and where to enter it |
|
|
481
|
+
| `event` | Also carries | The agent should |
|
|
482
|
+
| ------------- | ------------------------------------- | --------------------------------------------------- |
|
|
483
|
+
| `sign_in_url` | `url`, `browserOpened`, `waitSeconds` | Show you `url`, saying whether a browser tab opened |
|
|
468
484
|
|
|
469
485
|
The command then waits up to `waitSeconds` for you to approve, so the agent has to let it run
|
|
470
|
-
that long. An agent
|
|
471
|
-
in
|
|
472
|
-
|
|
473
|
-
### Signing in from a machine with no browser
|
|
474
|
-
|
|
475
|
-
`hardfin login --device` prints a short code and a page to enter it on, and waits. Approve
|
|
476
|
-
on your phone or any other machine, and the terminal finishes on its own.
|
|
477
|
-
|
|
478
|
-
```
|
|
479
|
-
Code WDJB-MJHT
|
|
480
|
-
At https://app.hardfin.com/device
|
|
481
|
-
```
|
|
482
|
-
|
|
483
|
-
The CLI refuses `--device` when the authorization server does not offer that grant, rather
|
|
484
|
-
than waiting for an endpoint that is not there.
|
|
486
|
+
that long. An agent in a sandbox on your own machine signs in this way too. An agent whose
|
|
487
|
+
machine cannot reach your browser, such as one in a cloud sandbox, needs an API key.
|
|
485
488
|
|
|
486
489
|
### When a sign in stops working
|
|
487
490
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="69a10817-e39f-57d1-8273-c76a835baa09")}catch(e){}}();
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
@@ -496,7 +496,7 @@ function writeCache(cache) {
|
|
|
496
496
|
} catch {}
|
|
497
497
|
}
|
|
498
498
|
//#endregion
|
|
499
|
-
export {
|
|
499
|
+
export { Interrupted as C, ExpectedFailure as S, TimedOut as T, ConfigFailure as _, isShipped as a, toTelemetry as b, toOutdatedTo as c, toJSON as d, toLastFailureCode as f, CONFIG_FILE as g, writeFailure as h, toUpdateCheckRefusal as i, toStateDirectory as l, writeData as m, isReminderDue as n, toPackageDirectory as o, toText as p, toCheck as r, noteNotices as s, PACKAGE as t, isJSONOutput as u, toSettings as v, LockHeld as w, version$1 as x, API_VERSION as y };
|
|
500
500
|
|
|
501
|
-
//# sourceMappingURL=check-
|
|
502
|
-
//# debugId=
|
|
501
|
+
//# sourceMappingURL=check-8Ta7vSnU.js.map
|
|
502
|
+
//# debugId=69a10817-e39f-57d1-8273-c76a835baa09
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f934d0aa-2ea6-57c6-811a-3942d764792d")}catch(e){}}();
|
|
4
4
|
import module from "node:module";
|
|
5
5
|
//#region src/cli.ts
|
|
6
6
|
module.enableCompileCache?.();
|
|
@@ -14,8 +14,8 @@ process.on("unhandledRejection", (error) => void toCrash(error));
|
|
|
14
14
|
try {
|
|
15
15
|
const answer = await toQuickAnswer(process.argv.slice(2));
|
|
16
16
|
if (answer === void 0) {
|
|
17
|
-
const { toCli, toParseExitCode, wasReportAttempted } = await import("./program-
|
|
18
|
-
const { startUpdateCheck, writeUpdateNotice } = await import("./notice-
|
|
17
|
+
const { toCli, toParseExitCode, wasReportAttempted } = await import("./program-CuFKCoDH.js");
|
|
18
|
+
const { startUpdateCheck, writeUpdateNotice } = await import("./notice-DWvcEHhw.js");
|
|
19
19
|
const pending = startUpdateCheck(process.argv.slice(2));
|
|
20
20
|
try {
|
|
21
21
|
await toCli().parseAsync(process.argv);
|
|
@@ -36,7 +36,7 @@ async function toCrash(error) {
|
|
|
36
36
|
isCrashing = true;
|
|
37
37
|
const isJSON = process.argv.includes("--json") || !process.stdout.isTTY;
|
|
38
38
|
try {
|
|
39
|
-
const { toReported, writeCrash } = await import("./program-
|
|
39
|
+
const { toReported, writeCrash } = await import("./program-CuFKCoDH.js");
|
|
40
40
|
writeCrash(error, isJSON);
|
|
41
41
|
await toReported(error, isJSON, void 0, "fatal");
|
|
42
42
|
} catch {
|
|
@@ -57,4 +57,4 @@ async function toQuickAnswer(args) {
|
|
|
57
57
|
export {};
|
|
58
58
|
|
|
59
59
|
//# sourceMappingURL=cli.js.map
|
|
60
|
-
//# debugId=
|
|
60
|
+
//# debugId=f934d0aa-2ea6-57c6-811a-3942d764792d
|