@almyty/agents 1.2.0 → 1.4.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/README.md +98 -19
- package/dist/args.d.ts +28 -0
- package/dist/args.js +80 -0
- package/dist/exit-codes.d.ts +26 -0
- package/dist/exit-codes.js +32 -0
- package/dist/format.d.ts +185 -0
- package/dist/format.js +408 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.js +322 -192
- package/dist/version.d.ts +2 -0
- package/dist/version.js +22 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @almyty/agents
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Run, inspect and debug almyty agents from the command line.
|
|
4
4
|
|
|
5
5
|
## Quick start
|
|
6
6
|
|
|
@@ -14,25 +14,99 @@ $ npx @almyty/agents run my-agent --input '{"text": "hello"}' --watch
|
|
|
14
14
|
|
|
15
15
|
| Command | Description |
|
|
16
16
|
|---------|-------------|
|
|
17
|
-
| `list
|
|
18
|
-
| `get <name\|id>` |
|
|
19
|
-
| `run <name\|id
|
|
20
|
-
| `runs <name\|id>` |
|
|
21
|
-
| `
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
| `list` | Every agent in your organization, with mode and status |
|
|
18
|
+
| `get <name\|id>` | One agent: mode, status, model config, pipeline shape, tools |
|
|
19
|
+
| `run <name\|id>` | Invoke a workflow agent, or start an autonomous run |
|
|
20
|
+
| `runs <name\|id>` | Recent autonomous runs, newest first |
|
|
21
|
+
| `inspect <name\|id> <runId>` | One autonomous run in full: steps, models, cost, error |
|
|
22
|
+
| `executions <name\|id>` | Recent workflow executions, newest first |
|
|
23
|
+
| `trace <name\|id> <execId>` | Where a workflow execution's calls went, hop by hop |
|
|
24
|
+
| `cancel <name\|id> <runId>` | Cancel an in-flight autonomous run |
|
|
25
|
+
|
|
26
|
+
`<name|id>` accepts an agent name (case-insensitive, spaces or dashes),
|
|
27
|
+
a slug, or a UUID.
|
|
28
|
+
|
|
29
|
+
A **workflow** agent's history lives under `executions` and `trace`; an
|
|
30
|
+
**autonomous** agent's lives under `runs` and `inspect`. `get` tells you
|
|
31
|
+
which mode an agent is in, and `runs`/`executions` point you at the
|
|
32
|
+
other one when you ask the wrong pair.
|
|
24
33
|
|
|
25
34
|
## Run options
|
|
26
35
|
|
|
27
36
|
| Flag | Description |
|
|
28
37
|
|------|-------------|
|
|
29
|
-
| `--input '<json>'` | Input payload
|
|
30
|
-
| `--resume <conversation-id>` |
|
|
31
|
-
| `--watch` |
|
|
32
|
-
| `--
|
|
33
|
-
| `--max-steps <n>` | Autonomous:
|
|
34
|
-
| `--max-cost-cents <n>` | Autonomous:
|
|
35
|
-
| `--max-duration-ms <ms>` | Autonomous:
|
|
38
|
+
| `--input '<json>'` | Input payload. Parsed as JSON; a plain string is passed through as-is, which is what an autonomous agent usually wants. |
|
|
39
|
+
| `--resume <conversation-id>` | Autonomous: continue a previous conversation |
|
|
40
|
+
| `--watch` | Autonomous: stream steps until the run reaches a terminal state |
|
|
41
|
+
| `--timeout <s>` | Autonomous `--watch`: stop waiting after this long (default `300`) |
|
|
42
|
+
| `--max-steps <n>` | Autonomous: step ceiling |
|
|
43
|
+
| `--max-cost-cents <n>` | Autonomous: cost ceiling, in cents |
|
|
44
|
+
| `--max-duration-ms <ms>` | Autonomous: wall-clock ceiling |
|
|
45
|
+
| `--steps` | Workflow: print per-node detail even when the run succeeded |
|
|
46
|
+
| `--json` | Print the run object and nothing else |
|
|
47
|
+
|
|
48
|
+
`run` refuses a non-active agent before calling the API and tells you to
|
|
49
|
+
activate it, rather than printing the 400 body.
|
|
50
|
+
|
|
51
|
+
## List options
|
|
52
|
+
|
|
53
|
+
| Flag | Applies to | Description |
|
|
54
|
+
|------|-----------|-------------|
|
|
55
|
+
| `--limit <n>` | `runs`, `executions` | Rows per page (default `20`) |
|
|
56
|
+
| `--page <n>` | `runs`, `executions` | Page number (default `1`) |
|
|
57
|
+
|
|
58
|
+
## Global options
|
|
59
|
+
|
|
60
|
+
| Flag | Description |
|
|
61
|
+
|------|-------------|
|
|
62
|
+
| `--json` | Machine-readable output on every command |
|
|
63
|
+
| `--help`, `-h` | Show help |
|
|
64
|
+
| `--version`, `-v` | Print the version |
|
|
65
|
+
|
|
66
|
+
Both `--flag value` and `--flag=value` are accepted, and everything
|
|
67
|
+
after a bare `--` is treated as a positional argument.
|
|
68
|
+
|
|
69
|
+
## What you can see about a run
|
|
70
|
+
|
|
71
|
+
A routed call stamps attribution on whatever recorded it — the step for
|
|
72
|
+
an autonomous run, the node result for a workflow one. The CLI surfaces
|
|
73
|
+
it, so a multi-model agent can be read from a terminal:
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
$ npx @almyty/agents run research-bot --input "who acquired Figma" --watch
|
|
77
|
+
1. Searching for recent coverage… [claude-sonnet-4-5 · $0.0021 · 900 in / 12 out · 1.8s]
|
|
78
|
+
2. llm_call → tools: web_search [claude-sonnet-4-5 · $0.0009 · 1.2s]
|
|
79
|
+
3. Adobe's offer was abandoned in December 2023. [gpt-5-mini · attempt 2 · primary rate limited · $0.0004]
|
|
80
|
+
|
|
81
|
+
Run completed · answered by claude-sonnet-4-5, gpt-5-mini · $0.0034 · 5,120 tokens · 4.2s
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
A call with a pinned provider leaves no attribution, and the CLI prints
|
|
85
|
+
none rather than inventing a model name.
|
|
86
|
+
|
|
87
|
+
`trace` goes further, printing the hops the backend recorded: what the
|
|
88
|
+
routing policy chose, what it passed over, what the provider served, and
|
|
89
|
+
what each hop cost. A hop whose cost is not ours to know prints as
|
|
90
|
+
`cost opaque`, never as `$0`.
|
|
91
|
+
|
|
92
|
+
## Exit codes
|
|
93
|
+
|
|
94
|
+
| Code | Meaning |
|
|
95
|
+
|------|---------|
|
|
96
|
+
| `0` | success |
|
|
97
|
+
| `1` | unexpected error |
|
|
98
|
+
| `2` | usage error (bad flags, unknown command, missing argument) |
|
|
99
|
+
| `3` | not authenticated — run `npx @almyty/auth login` |
|
|
100
|
+
| `4` | no such agent, run, or execution |
|
|
101
|
+
| `5` | the run finished in a non-success state |
|
|
102
|
+
|
|
103
|
+
`5` is the one that matters in CI. The invoke endpoint answers `200`
|
|
104
|
+
with `status: "failed"`, and `--watch` returns on any terminal status,
|
|
105
|
+
so a failed run has to be turned into a non-zero exit deliberately:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
npx @almyty/agents run deploy-check --watch && ./ship.sh
|
|
109
|
+
```
|
|
36
110
|
|
|
37
111
|
## Environment variables
|
|
38
112
|
|
|
@@ -40,10 +114,13 @@ $ npx @almyty/agents run my-agent --input '{"text": "hello"}' --watch
|
|
|
40
114
|
|----------|-------------|
|
|
41
115
|
| `ALMYTY_TOKEN` | Auth token override |
|
|
42
116
|
| `ALMYTY_URL` | API URL override |
|
|
117
|
+
| `NO_COLOR` | Honoured; this CLI emits no ANSI colour anyway |
|
|
43
118
|
|
|
44
119
|
## Authentication
|
|
45
120
|
|
|
46
|
-
|
|
121
|
+
Run `npx @almyty/auth login` once. Credentials come from
|
|
122
|
+
`~/.almyty/credentials.json`, or from `ALMYTY_TOKEN`. With neither, every
|
|
123
|
+
command prints the login instruction and exits `3`.
|
|
47
124
|
|
|
48
125
|
## About almyty
|
|
49
126
|
|
|
@@ -51,8 +128,10 @@ almyty is the full-stack platform for AI agents, agnostic by design: any LLM, an
|
|
|
51
128
|
API turned into tools, served over MCP, A2A, UTCP, and Agent Skills. Open source,
|
|
52
129
|
no lock-in.
|
|
53
130
|
|
|
54
|
-
- Website
|
|
55
|
-
- Docs
|
|
56
|
-
- Source
|
|
131
|
+
- Website: https://almyty.com
|
|
132
|
+
- Docs: https://docs.almyty.com
|
|
133
|
+
- Source: https://github.com/almyty-inc/almyty
|
|
134
|
+
|
|
135
|
+
This CLI is part of the `@almyty/*` suite (versioned together at 1.x) and works with the almyty platform 0.1 and later.
|
|
57
136
|
|
|
58
137
|
Apache-2.0 © Almyty Inc.
|
package/dist/args.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Argument parsing shared in shape (not in code) by every almyty CLI.
|
|
3
|
+
*
|
|
4
|
+
* Conventions, so `almyty agents …` and `almyty auth …` never disagree:
|
|
5
|
+
* - long flags only for options: `--input`, `--json`, `--max-steps`
|
|
6
|
+
* - `--flag value` and `--flag=value` are both accepted. Only the
|
|
7
|
+
* space form used to work, so `--input='{"a":1}'` silently became a
|
|
8
|
+
* flag literally named `input={"a":1}` and the input was dropped.
|
|
9
|
+
* - `-h` / `--help` and `-v` / `--version` are the only short flags
|
|
10
|
+
* - a flag declared boolean never swallows the next token
|
|
11
|
+
* - the first bare word is the command; the rest are positional
|
|
12
|
+
*/
|
|
13
|
+
export interface ParsedArgs {
|
|
14
|
+
command?: string;
|
|
15
|
+
positional: string[];
|
|
16
|
+
flags: Record<string, string | boolean>;
|
|
17
|
+
}
|
|
18
|
+
/** Flags every almyty CLI understands, and which never take a value. */
|
|
19
|
+
export declare const COMMON_BOOLEAN_FLAGS: readonly ["help", "version", "json"];
|
|
20
|
+
export declare function parseArgs(argv: string[], booleanFlags?: readonly string[]): ParsedArgs;
|
|
21
|
+
/** A flag's value as a string, or undefined when it was absent or bare. */
|
|
22
|
+
export declare function flagString(flags: ParsedArgs['flags'], name: string): string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* A flag's value as a finite number. Throws a usage message rather than
|
|
25
|
+
* letting `NaN` reach the API, which answered a 400 with a validation
|
|
26
|
+
* body the user had to decode.
|
|
27
|
+
*/
|
|
28
|
+
export declare function flagNumber(flags: ParsedArgs['flags'], name: string): number | undefined;
|
package/dist/args.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Argument parsing shared in shape (not in code) by every almyty CLI.
|
|
3
|
+
*
|
|
4
|
+
* Conventions, so `almyty agents …` and `almyty auth …` never disagree:
|
|
5
|
+
* - long flags only for options: `--input`, `--json`, `--max-steps`
|
|
6
|
+
* - `--flag value` and `--flag=value` are both accepted. Only the
|
|
7
|
+
* space form used to work, so `--input='{"a":1}'` silently became a
|
|
8
|
+
* flag literally named `input={"a":1}` and the input was dropped.
|
|
9
|
+
* - `-h` / `--help` and `-v` / `--version` are the only short flags
|
|
10
|
+
* - a flag declared boolean never swallows the next token
|
|
11
|
+
* - the first bare word is the command; the rest are positional
|
|
12
|
+
*/
|
|
13
|
+
/** Flags every almyty CLI understands, and which never take a value. */
|
|
14
|
+
export const COMMON_BOOLEAN_FLAGS = ['help', 'version', 'json'];
|
|
15
|
+
export function parseArgs(argv, booleanFlags = COMMON_BOOLEAN_FLAGS) {
|
|
16
|
+
const booleans = new Set([...COMMON_BOOLEAN_FLAGS, ...booleanFlags]);
|
|
17
|
+
const result = { positional: [], flags: {} };
|
|
18
|
+
for (let i = 0; i < argv.length; i++) {
|
|
19
|
+
const arg = argv[i];
|
|
20
|
+
if (arg === '-h') {
|
|
21
|
+
result.flags.help = true;
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
if (arg === '-v') {
|
|
25
|
+
result.flags.version = true;
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (arg === '--') {
|
|
29
|
+
// Everything after `--` is positional, flags included.
|
|
30
|
+
result.positional.push(...argv.slice(i + 1));
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
if (arg.startsWith('--')) {
|
|
34
|
+
const body = arg.slice(2);
|
|
35
|
+
const eq = body.indexOf('=');
|
|
36
|
+
if (eq !== -1) {
|
|
37
|
+
result.flags[body.slice(0, eq)] = body.slice(eq + 1);
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
if (booleans.has(body)) {
|
|
41
|
+
result.flags[body] = true;
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
const next = argv[i + 1];
|
|
45
|
+
if (next !== undefined && !next.startsWith('--')) {
|
|
46
|
+
result.flags[body] = next;
|
|
47
|
+
i++;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
result.flags[body] = true;
|
|
51
|
+
}
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
if (!result.command)
|
|
55
|
+
result.command = arg;
|
|
56
|
+
else
|
|
57
|
+
result.positional.push(arg);
|
|
58
|
+
}
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
/** A flag's value as a string, or undefined when it was absent or bare. */
|
|
62
|
+
export function flagString(flags, name) {
|
|
63
|
+
const value = flags[name];
|
|
64
|
+
return typeof value === 'string' ? value : undefined;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* A flag's value as a finite number. Throws a usage message rather than
|
|
68
|
+
* letting `NaN` reach the API, which answered a 400 with a validation
|
|
69
|
+
* body the user had to decode.
|
|
70
|
+
*/
|
|
71
|
+
export function flagNumber(flags, name) {
|
|
72
|
+
const raw = flagString(flags, name);
|
|
73
|
+
if (raw === undefined)
|
|
74
|
+
return undefined;
|
|
75
|
+
const value = Number(raw);
|
|
76
|
+
if (!Number.isFinite(value)) {
|
|
77
|
+
throw new Error(`--${name} needs a number, got ${JSON.stringify(raw)}`);
|
|
78
|
+
}
|
|
79
|
+
return value;
|
|
80
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exit codes shared by every almyty CLI.
|
|
3
|
+
*
|
|
4
|
+
* Scripts need to tell "you are not logged in" apart from "that agent
|
|
5
|
+
* does not exist" apart from "the run you asked for failed" without
|
|
6
|
+
* grepping stderr. Every almyty CLI uses this same table, so
|
|
7
|
+
* `almyty agents run x || case $? in 3) almyty login;; esac` behaves
|
|
8
|
+
* the same whichever binary produced the code.
|
|
9
|
+
*/
|
|
10
|
+
export declare const EXIT: {
|
|
11
|
+
/** Success. */
|
|
12
|
+
readonly OK: 0;
|
|
13
|
+
/** Unexpected failure (a thrown error with no better classification). */
|
|
14
|
+
readonly ERROR: 1;
|
|
15
|
+
/** Bad or missing arguments, or an unknown command. */
|
|
16
|
+
readonly USAGE: 2;
|
|
17
|
+
/** No stored credential, or the API rejected the one we had. */
|
|
18
|
+
readonly AUTH: 3;
|
|
19
|
+
/** The named agent / gateway / skill / run does not exist. */
|
|
20
|
+
readonly NOT_FOUND: 4;
|
|
21
|
+
/** The command ran; the operation it asked for failed. */
|
|
22
|
+
readonly FAILED: 5;
|
|
23
|
+
};
|
|
24
|
+
export type ExitCode = (typeof EXIT)[keyof typeof EXIT];
|
|
25
|
+
/** One line per code, for `--help` output and READMEs. */
|
|
26
|
+
export declare const EXIT_CODE_HELP: string;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exit codes shared by every almyty CLI.
|
|
3
|
+
*
|
|
4
|
+
* Scripts need to tell "you are not logged in" apart from "that agent
|
|
5
|
+
* does not exist" apart from "the run you asked for failed" without
|
|
6
|
+
* grepping stderr. Every almyty CLI uses this same table, so
|
|
7
|
+
* `almyty agents run x || case $? in 3) almyty login;; esac` behaves
|
|
8
|
+
* the same whichever binary produced the code.
|
|
9
|
+
*/
|
|
10
|
+
export const EXIT = {
|
|
11
|
+
/** Success. */
|
|
12
|
+
OK: 0,
|
|
13
|
+
/** Unexpected failure (a thrown error with no better classification). */
|
|
14
|
+
ERROR: 1,
|
|
15
|
+
/** Bad or missing arguments, or an unknown command. */
|
|
16
|
+
USAGE: 2,
|
|
17
|
+
/** No stored credential, or the API rejected the one we had. */
|
|
18
|
+
AUTH: 3,
|
|
19
|
+
/** The named agent / gateway / skill / run does not exist. */
|
|
20
|
+
NOT_FOUND: 4,
|
|
21
|
+
/** The command ran; the operation it asked for failed. */
|
|
22
|
+
FAILED: 5,
|
|
23
|
+
};
|
|
24
|
+
/** One line per code, for `--help` output and READMEs. */
|
|
25
|
+
export const EXIT_CODE_HELP = [
|
|
26
|
+
' 0 success',
|
|
27
|
+
' 1 unexpected error',
|
|
28
|
+
' 2 usage error (bad flags, unknown command)',
|
|
29
|
+
' 3 not authenticated — run `almyty login`',
|
|
30
|
+
' 4 not found (agent, gateway, skill, or run)',
|
|
31
|
+
' 5 the operation ran and failed',
|
|
32
|
+
].join('\n');
|
package/dist/format.d.ts
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rendering for @almyty/agents.
|
|
3
|
+
*
|
|
4
|
+
* Pure functions, no I/O, so the shape of what a user sees is testable
|
|
5
|
+
* without a backend. The interesting part is attribution: a routed call
|
|
6
|
+
* stamps `routing` on the step / node result, and the CLI used to throw
|
|
7
|
+
* all of it away — so `agents run` could not answer "which model
|
|
8
|
+
* answered this, and what did it cost", which is the first question
|
|
9
|
+
* anyone asks about a multi-model agent.
|
|
10
|
+
*/
|
|
11
|
+
export interface RoutingAttribution {
|
|
12
|
+
modelId?: string;
|
|
13
|
+
modelVersionId?: string | null;
|
|
14
|
+
vendorModelId?: string;
|
|
15
|
+
providerId?: string | null;
|
|
16
|
+
rationale?: string;
|
|
17
|
+
attempt?: number;
|
|
18
|
+
tried?: Array<{
|
|
19
|
+
modelId: string;
|
|
20
|
+
reason: string;
|
|
21
|
+
}>;
|
|
22
|
+
rejected?: Array<{
|
|
23
|
+
modelId: string;
|
|
24
|
+
reason: string;
|
|
25
|
+
}>;
|
|
26
|
+
}
|
|
27
|
+
export interface RunStep {
|
|
28
|
+
type?: string;
|
|
29
|
+
input?: any;
|
|
30
|
+
output?: any;
|
|
31
|
+
cost?: number;
|
|
32
|
+
tokens?: {
|
|
33
|
+
input?: number;
|
|
34
|
+
output?: number;
|
|
35
|
+
};
|
|
36
|
+
duration?: number;
|
|
37
|
+
timestamp?: string;
|
|
38
|
+
error?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface AgentSummary {
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
slug?: string;
|
|
44
|
+
description?: string;
|
|
45
|
+
mode?: string;
|
|
46
|
+
status?: string;
|
|
47
|
+
pipeline?: {
|
|
48
|
+
nodes?: Array<{
|
|
49
|
+
id: string;
|
|
50
|
+
type: string;
|
|
51
|
+
label?: string;
|
|
52
|
+
}>;
|
|
53
|
+
};
|
|
54
|
+
modelConfig?: Record<string, unknown>;
|
|
55
|
+
tools?: Array<{
|
|
56
|
+
id: string;
|
|
57
|
+
name: string;
|
|
58
|
+
}>;
|
|
59
|
+
}
|
|
60
|
+
/** Terminal statuses that mean the run did what was asked. */
|
|
61
|
+
export declare const RUN_SUCCEEDED: Set<string>;
|
|
62
|
+
/** A status that will never change on its own. */
|
|
63
|
+
export declare const RUN_TERMINAL: Set<string>;
|
|
64
|
+
export declare function runSucceeded(status: string | undefined): boolean;
|
|
65
|
+
/** `$0.0042`, or `—` when nothing was recorded. A zero cost prints as $0. */
|
|
66
|
+
export declare function formatCost(cost: unknown): string;
|
|
67
|
+
export declare function formatTokens(tokens: unknown): string;
|
|
68
|
+
export declare function formatDuration(ms: unknown): string;
|
|
69
|
+
/** Whichever name a routed call gives for the model that answered. */
|
|
70
|
+
export declare function modelOf(routing: RoutingAttribution | undefined): string | null;
|
|
71
|
+
/**
|
|
72
|
+
* One line naming the model that answered and why it was picked.
|
|
73
|
+
* `null` when the call was not routed (a pinned provider leaves no
|
|
74
|
+
* attribution, and inventing one would be worse than saying nothing).
|
|
75
|
+
*/
|
|
76
|
+
export declare function formatRouting(routing: RoutingAttribution | undefined): string | null;
|
|
77
|
+
/** The routing attribution a step carries, wherever it was stamped. */
|
|
78
|
+
export declare function routingOfStep(step: RunStep | undefined): RoutingAttribution | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* One line per step, as `run --watch` streams them.
|
|
81
|
+
* Returns null for a step with nothing worth showing.
|
|
82
|
+
*/
|
|
83
|
+
export declare function formatStep(step: RunStep | undefined, index?: number): string | null;
|
|
84
|
+
/**
|
|
85
|
+
* The closing line of a run: status, what it cost, and which models
|
|
86
|
+
* answered. Someone reading a CI log should not have to open the UI to
|
|
87
|
+
* learn any of the three.
|
|
88
|
+
*/
|
|
89
|
+
export declare function formatRunSummary(run: {
|
|
90
|
+
status?: string;
|
|
91
|
+
totalCost?: number;
|
|
92
|
+
totalTokens?: number;
|
|
93
|
+
executionTime?: number;
|
|
94
|
+
steps?: RunStep[];
|
|
95
|
+
}): string;
|
|
96
|
+
/**
|
|
97
|
+
* The same closing line for a workflow execution, whose attribution
|
|
98
|
+
* lives per node rather than per step.
|
|
99
|
+
*/
|
|
100
|
+
export declare function formatExecutionSummary(execution: {
|
|
101
|
+
status?: string;
|
|
102
|
+
totalCost?: number;
|
|
103
|
+
totalTokens?: number;
|
|
104
|
+
executionTime?: number;
|
|
105
|
+
nodeResults?: Record<string, any>;
|
|
106
|
+
}): string;
|
|
107
|
+
/**
|
|
108
|
+
* Per-node detail for a workflow run: which node failed, what was tried,
|
|
109
|
+
* and what answered. This is what you would otherwise open the UI for.
|
|
110
|
+
*/
|
|
111
|
+
export declare function formatNodeResults(nodeResults: Record<string, any> | undefined): string[];
|
|
112
|
+
/** The full detail of one autonomous run, for `agents inspect`. */
|
|
113
|
+
export declare function formatRunDetail(run: {
|
|
114
|
+
id?: string;
|
|
115
|
+
agentId?: string;
|
|
116
|
+
status?: string;
|
|
117
|
+
mode?: string;
|
|
118
|
+
conversationId?: string;
|
|
119
|
+
createdAt?: string;
|
|
120
|
+
updatedAt?: string;
|
|
121
|
+
currentStep?: number;
|
|
122
|
+
maxSteps?: number;
|
|
123
|
+
totalCost?: number;
|
|
124
|
+
totalTokens?: number;
|
|
125
|
+
executionTime?: number;
|
|
126
|
+
error?: string;
|
|
127
|
+
output?: unknown;
|
|
128
|
+
steps?: RunStep[];
|
|
129
|
+
limits?: Record<string, unknown>;
|
|
130
|
+
}): string;
|
|
131
|
+
/**
|
|
132
|
+
* The hop-by-hop trace the backend assembles at
|
|
133
|
+
* /agents/:id/executions/:executionId/trace. An opaque hop is printed
|
|
134
|
+
* as opaque, never as zero — the backend is deliberate about that and
|
|
135
|
+
* flattening it here would undo the point.
|
|
136
|
+
*/
|
|
137
|
+
export declare function formatTrace(trace: {
|
|
138
|
+
executionId?: string;
|
|
139
|
+
strategyKey?: string;
|
|
140
|
+
strategyChosenBy?: string;
|
|
141
|
+
strategyFallbackReason?: string;
|
|
142
|
+
steps?: Array<{
|
|
143
|
+
nodeId: string;
|
|
144
|
+
type?: string;
|
|
145
|
+
durationMs?: number;
|
|
146
|
+
error?: string;
|
|
147
|
+
hops?: Array<{
|
|
148
|
+
layer?: string;
|
|
149
|
+
decidedBy?: string;
|
|
150
|
+
chosen?: string;
|
|
151
|
+
reason?: string;
|
|
152
|
+
alternatives?: string[];
|
|
153
|
+
latencyMs?: number;
|
|
154
|
+
costEstimateCents?: number | null;
|
|
155
|
+
opaqueCost?: boolean;
|
|
156
|
+
requestedModel?: string;
|
|
157
|
+
servedModel?: string;
|
|
158
|
+
divergent?: boolean;
|
|
159
|
+
capabilitiesDropped?: string[];
|
|
160
|
+
}>;
|
|
161
|
+
}>;
|
|
162
|
+
summary?: {
|
|
163
|
+
knownCostCents?: number;
|
|
164
|
+
opaqueHops?: number;
|
|
165
|
+
divergences?: unknown[];
|
|
166
|
+
capabilitiesDropped?: string[];
|
|
167
|
+
};
|
|
168
|
+
}): string;
|
|
169
|
+
/** One agent per block, for `agents list`. */
|
|
170
|
+
export declare function formatAgentLine(agent: AgentSummary): string;
|
|
171
|
+
/** Everything `agents get` knows, so the next question is not "and then?". */
|
|
172
|
+
export declare function formatAgentDetail(agent: AgentSummary): string;
|
|
173
|
+
/**
|
|
174
|
+
* The message for trying to run a non-active agent.
|
|
175
|
+
*
|
|
176
|
+
* The API answers 400 with a JSON body, and the CLI printed the body:
|
|
177
|
+
* `API error 400: {"success":false,"message":"Agent must be active to
|
|
178
|
+
* invoke","error":"AGENT_NOT_ACTIVE"}`. The agent's status is already
|
|
179
|
+
* in hand before the call, so say it plainly and skip the round trip.
|
|
180
|
+
*/
|
|
181
|
+
export declare function notActiveMessage(agent: {
|
|
182
|
+
name: string;
|
|
183
|
+
id: string;
|
|
184
|
+
status?: string;
|
|
185
|
+
}): string;
|