@bankr/cli 0.3.37 → 0.3.43
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 +51 -156
- package/dist/cli.js +162 -150
- package/dist/commands/fees.js +17 -7
- package/dist/commands/llm.js +64 -0
- package/dist/commands/login.d.ts +75 -0
- package/dist/commands/login.js +321 -60
- package/dist/commands/{profile.d.ts → project.d.ts} +6 -6
- package/dist/commands/{profile.js → project.js} +65 -65
- package/dist/commands/prompt.d.ts +11 -0
- package/dist/commands/prompt.js +20 -11
- package/dist/commands/status.d.ts +5 -1
- package/dist/commands/status.js +54 -5
- package/dist/commands/update.js +2 -3
- package/dist/commands/x402.js +2 -2
- package/dist/lib/api.d.ts +29 -8
- package/dist/lib/api.js +26 -12
- package/dist/lib/config.d.ts +2 -1
- package/dist/lib/config.js +18 -2
- package/dist/lib/output.d.ts +2 -0
- package/dist/lib/output.js +4 -0
- package/dist/lib/statusUpdates.d.ts +14 -0
- package/dist/lib/statusUpdates.js +38 -0
- package/package.json +1 -1
package/dist/lib/output.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ export declare function brand(msg: string): void;
|
|
|
22
22
|
export declare function brandBold(msg: string): void;
|
|
23
23
|
export declare function success(msg: string): void;
|
|
24
24
|
export declare function error(msg: string): void;
|
|
25
|
+
/** Dim follow-up line for an error, on stderr so it stays with the headline. */
|
|
26
|
+
export declare function errorDetail(msg: string): void;
|
|
25
27
|
/** Collapses the error-then-exit epilogue every command repeats. */
|
|
26
28
|
export declare function fatal(message: string): never;
|
|
27
29
|
/** Same epilogue, for the spinner-driven variant that reports a caught error. */
|
package/dist/lib/output.js
CHANGED
|
@@ -40,6 +40,10 @@ export function success(msg) {
|
|
|
40
40
|
export function error(msg) {
|
|
41
41
|
console.error(chalk.red(`✗ ${msg}`));
|
|
42
42
|
}
|
|
43
|
+
/** Dim follow-up line for an error, on stderr so it stays with the headline. */
|
|
44
|
+
export function errorDetail(msg) {
|
|
45
|
+
console.error(chalk.dim(msg));
|
|
46
|
+
}
|
|
43
47
|
/** Collapses the error-then-exit epilogue every command repeats. */
|
|
44
48
|
export function fatal(message) {
|
|
45
49
|
error(message);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Ora } from "ora";
|
|
2
|
+
import { type JobStatusUpdate } from "./api.js";
|
|
3
|
+
/**
|
|
4
|
+
* The job carries every progress line the agent has emitted so far, so each
|
|
5
|
+
* poll re-sends the ones already on screen. Return only what's new, blanks
|
|
6
|
+
* dropped — a raw status can be an empty string.
|
|
7
|
+
*/
|
|
8
|
+
export declare function newStatusMessages(updates: JobStatusUpdate[] | undefined, alreadyShown: number): string[];
|
|
9
|
+
/**
|
|
10
|
+
* Persists each new progress line above `spin` as polling advances, so the run
|
|
11
|
+
* leaves a trail. Shared by `bankr agent <prompt>` and `agent status --wait`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function createStatusTrail(spin: Ora): (updates: JobStatusUpdate[] | undefined) => void;
|
|
14
|
+
//# sourceMappingURL=statusUpdates.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as output from "./output.js";
|
|
2
|
+
/**
|
|
3
|
+
* The job carries every progress line the agent has emitted so far, so each
|
|
4
|
+
* poll re-sends the ones already on screen. Return only what's new, blanks
|
|
5
|
+
* dropped — a raw status can be an empty string.
|
|
6
|
+
*/
|
|
7
|
+
export function newStatusMessages(updates, alreadyShown) {
|
|
8
|
+
const fresh = [];
|
|
9
|
+
for (const update of (updates ?? []).slice(alreadyShown)) {
|
|
10
|
+
const message = update.message?.trim();
|
|
11
|
+
if (message)
|
|
12
|
+
fresh.push(message);
|
|
13
|
+
}
|
|
14
|
+
return fresh;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Persists each new progress line above `spin` as polling advances, so the run
|
|
18
|
+
* leaves a trail. Shared by `bankr agent <prompt>` and `agent status --wait`.
|
|
19
|
+
*/
|
|
20
|
+
export function createStatusTrail(spin) {
|
|
21
|
+
let shown = 0;
|
|
22
|
+
return (updates) => {
|
|
23
|
+
const fresh = newStatusMessages(updates, shown);
|
|
24
|
+
shown = updates?.length ?? shown;
|
|
25
|
+
for (const message of fresh) {
|
|
26
|
+
spin.stopAndPersist({
|
|
27
|
+
symbol: output.fmt.dim("·"),
|
|
28
|
+
text: output.fmt.dim(message),
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
// stopAndPersist leaves the spinner stopped, so resume it. Only when ora is
|
|
32
|
+
// actually animating: disabled, start() just prints the text again, adding
|
|
33
|
+
// a redundant line per batch in pipes and CI logs.
|
|
34
|
+
if (fresh.length && spin.isEnabled)
|
|
35
|
+
spin.start();
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=statusUpdates.js.map
|