@hardfin/cli 0.1.1-dev.60 → 0.1.1-dev.62

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
@@ -131,6 +131,10 @@ for.
131
131
  A person at a terminal reads one plain line on stderr. Anything else reads JSON, also on
132
132
  stderr, so a pipe still carries only the result.
133
133
 
134
+ JSON is written on one line when a program reads it, and indented when a terminal shows it.
135
+ The indentation of a page of records is close to half its size, which an agent would
136
+ otherwise have to read. Pipe a result through `jq .` to read it indented.
137
+
134
138
  | Field | Holds |
135
139
  | ----------- | ------------------------------------------------------------------------ |
136
140
  | `code` | A fixed name for the failure, such as `not_found` or `missing_flag` |
@@ -554,13 +558,17 @@ connector directory requires.
554
558
  A tool call runs the CLI itself, so an agent and a person get identical parsing, output and
555
559
  exit codes. Each call has these limits:
556
560
 
557
- | Limit | Value | Past it |
558
- | ---------------- | --------------------------------------- | ------------------------------------------ |
559
- | Time | 120 seconds | The command is stopped, and the call fails |
560
- | Commands running | 4 at once | The next call waits for one to finish |
561
- | One argument | 128 KiB | Refused, pointing at the `input` argument |
562
- | Standard input | The call's `input` argument, or nothing | Always closed, so `--input -` never waits |
563
- | One result | 200,000 characters | Cut, with a line saying it is not complete |
561
+ | Limit | Value | Past it |
562
+ | ---------------- | --------------------------------------- | -------------------------------------------------------- |
563
+ | Time | 120 seconds | The command is stopped, and the call fails |
564
+ | Commands running | 4 at once | The next call waits for one to finish |
565
+ | One argument | 128 KiB | Refused, pointing at the `input` argument |
566
+ | Standard input | The call's `input` argument, or nothing | Always closed, so `--input -` never waits |
567
+ | One result | 200,000 characters | A list is shortened to the records that fit, and says so |
568
+
569
+ A list that is too long comes back as valid JSON holding the records that fit, with
570
+ `truncated` saying how many were shown, how many were asked for, and to narrow the list or
571
+ count with `--limit 1`. An asset is about 6 kB, so 30 fit in one result.
564
572
 
565
573
  A failed call also carries the failure as `structuredContent`, with the same `code`,
566
574
  `message`, `errors`, `requestId` and `status` the CLI prints, plus `exitCode`. A file that is
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]="7b79fe1d-6296-5c3c-a667-7257662abc80")}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]="32c6ff44-5b5a-5c1d-a718-7808ccc648a2")}catch(e){}}();
4
4
  import module from "node:module";
5
5
  //#region src/cli.ts
6
6
  module.enableCompileCache?.();
@@ -14,7 +14,7 @@ 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-BP83nk1M.js");
17
+ const { toCli, toParseExitCode, wasReportAttempted } = await import("./program-JKHwms47.js");
18
18
  try {
19
19
  await toCli().parseAsync(process.argv);
20
20
  } catch (error) {
@@ -33,7 +33,7 @@ async function toCrash(error) {
33
33
  isCrashing = true;
34
34
  const isJSON = process.argv.includes("--json") || !process.stdout.isTTY;
35
35
  try {
36
- const { toReported, writeCrash } = await import("./program-BP83nk1M.js");
36
+ const { toReported, writeCrash } = await import("./program-JKHwms47.js");
37
37
  writeCrash(error, isJSON);
38
38
  await toReported(error, isJSON, void 0, "fatal");
39
39
  } catch {
@@ -54,4 +54,4 @@ async function toQuickAnswer(args) {
54
54
  export {};
55
55
 
56
56
  //# sourceMappingURL=cli.js.map
57
- //# debugId=7b79fe1d-6296-5c3c-a667-7257662abc80
57
+ //# debugId=32c6ff44-5b5a-5c1d-a718-7808ccc648a2