@hardfin/cli 0.1.1-dev.72 → 0.1.1-dev.73

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 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
@@ -384,7 +401,6 @@ so a new document cannot leave requests naming the version before it.
384
401
 
385
402
  ```sh
386
403
  hardfin login # approve this CLI in a browser
387
- hardfin login --device # approve on another machine, by typing a code
388
404
  hardfin login --read-only # sign in so that nothing can be changed
389
405
  hardfin status # what the CLI is configured with and signed in as
390
406
  hardfin logout # forget this machine, and ask Hardfin to revoke it
@@ -461,27 +477,13 @@ An agent that runs `hardfin login` reads its stderr, and you only see what the a
461
477
  on. So when output is JSON, which it is whenever stdout is not a terminal, the command writes
462
478
  one line of JSON on stderr before it starts waiting.
463
479
 
464
- | `event` | Also carries | The agent should |
465
- | ------------- | -------------------------------------------------------------------- | --------------------------------------------------- |
466
- | `sign_in_url` | `url`, `browserOpened`, `waitSeconds` | Show you `url`, saying whether a browser tab opened |
467
- | `device_code` | `userCode`, `verificationUri`, `url`, `browserOpened`, `waitSeconds` | Show you the code and where to enter it |
480
+ | `event` | Also carries | The agent should |
481
+ | ------------- | ------------------------------------- | --------------------------------------------------- |
482
+ | `sign_in_url` | `url`, `browserOpened`, `waitSeconds` | Show you `url`, saying whether a browser tab opened |
468
483
 
469
484
  The command then waits up to `waitSeconds` for you to approve, so the agent has to let it run
470
- that long. An agent with no way to open your browser, such as one in a cloud sandbox, signs
471
- in with `--device`.
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.
485
+ that long. An agent in a sandbox on your own machine signs in this way too. An agent whose
486
+ machine cannot reach your browser, such as one in a cloud sandbox, needs an API key.
485
487
 
486
488
  ### When a sign in stops working
487
489
 
@@ -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]="4a31fc43-cc3a-59be-a501-eb86f4115b3f")}catch(e){}}();
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 { ExpectedFailure as C, TimedOut as E, version$1 as S, LockHeld as T, CONFIG_FILE as _, isShipped as a, API_VERSION as b, toOutdatedTo as c, toJSON as d, toLastFailureCode as f, writeFailure as g, writeData as h, toUpdateCheckRefusal as i, toStateDirectory as l, toText as m, isReminderDue as n, toPackageDirectory as o, toPrintable as p, toCheck as r, noteNotices as s, PACKAGE as t, isJSONOutput as u, ConfigFailure as v, Interrupted as w, toTelemetry as x, toSettings as y };
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-CvjTUx-K.js.map
502
- //# debugId=4a31fc43-cc3a-59be-a501-eb86f4115b3f
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]="3bf6cdf0-d851-549b-9a43-bb3c8520e8ff")}catch(e){}}();
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]="4b83a8a0-ff55-5e3b-84fa-8061be9f33fb")}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-CC8Iqb14.js");
18
- const { startUpdateCheck, writeUpdateNotice } = await import("./notice-D6mbHF9O.js");
17
+ const { toCli, toParseExitCode, wasReportAttempted } = await import("./program-BsfVvLRA.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-CC8Iqb14.js");
39
+ const { toReported, writeCrash } = await import("./program-BsfVvLRA.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=3bf6cdf0-d851-549b-9a43-bb3c8520e8ff
60
+ //# debugId=4b83a8a0-ff55-5e3b-84fa-8061be9f33fb