@evolvingmachines/evolve 0.0.55-project-sable.20260916.db0bc0bb

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.
Files changed (98) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +25 -0
  3. package/dist/chunk-5GVMBEYI.js +11 -0
  4. package/dist/chunk-HQJI3HHU.js +1 -0
  5. package/dist/chunk-JS2UTK2I.js +427 -0
  6. package/dist/cli/index.cjs +73 -0
  7. package/dist/cli/index.d.cts +270 -0
  8. package/dist/cli/index.d.ts +270 -0
  9. package/dist/cli/index.js +54 -0
  10. package/dist/index.cjs +669 -0
  11. package/dist/index.d.cts +5023 -0
  12. package/dist/index.d.ts +5023 -0
  13. package/dist/index.js +230 -0
  14. package/dist/managed-modal-IJW62SSK.js +4 -0
  15. package/dist/resumable-HFSICSH3.js +1 -0
  16. package/dist/tar-GVC4KE52.js +1 -0
  17. package/dist/types-DlpTxdR_.d.cts +4777 -0
  18. package/dist/types-DlpTxdR_.d.ts +4777 -0
  19. package/dist/upload-KPYDMWFJ.js +1 -0
  20. package/docs-agents/SKILL.md +138 -0
  21. package/docs-agents/index.md +81 -0
  22. package/docs-agents/python/01-getting-started.md +511 -0
  23. package/docs-agents/python/02-configuration.md +855 -0
  24. package/docs-agents/python/03-runtime.md +899 -0
  25. package/docs-agents/python/04-streaming.md +451 -0
  26. package/docs-agents/python/05-swarm-pipeline.md +953 -0
  27. package/docs-agents/python/index.md +122 -0
  28. package/docs-agents/typescript/01-getting-started.md +494 -0
  29. package/docs-agents/typescript/02-configuration.md +841 -0
  30. package/docs-agents/typescript/03-runtime.md +864 -0
  31. package/docs-agents/typescript/04-streaming.md +478 -0
  32. package/docs-agents/typescript/05-swarm-pipeline.md +957 -0
  33. package/docs-agents/typescript/index.md +121 -0
  34. package/docs-evals/SKILL.md +112 -0
  35. package/docs-evals/cli-reference/agent.mdx +67 -0
  36. package/docs-evals/cli-reference/analysis.mdx +91 -0
  37. package/docs-evals/cli-reference/analyze.mdx +74 -0
  38. package/docs-evals/cli-reference/auth.mdx +60 -0
  39. package/docs-evals/cli-reference/check.mdx +146 -0
  40. package/docs-evals/cli-reference/dataset.mdx +133 -0
  41. package/docs-evals/cli-reference/index.mdx +108 -0
  42. package/docs-evals/cli-reference/job.mdx +239 -0
  43. package/docs-evals/cli-reference/run.mdx +196 -0
  44. package/docs-evals/cli-reference/secrets.mdx +95 -0
  45. package/docs-evals/cli-reference/skill.mdx +51 -0
  46. package/docs-evals/cli-reference/skills.mdx +81 -0
  47. package/docs-evals/cli-reference/trial.mdx +112 -0
  48. package/docs-evals/cli-reference/upload.mdx +36 -0
  49. package/docs-evals/core-concepts/agents.mdx +106 -0
  50. package/docs-evals/core-concepts/analyze.mdx +86 -0
  51. package/docs-evals/core-concepts/check.mdx +51 -0
  52. package/docs-evals/core-concepts/datasets.mdx +138 -0
  53. package/docs-evals/core-concepts/index.mdx +42 -0
  54. package/docs-evals/core-concepts/jobs.mdx +136 -0
  55. package/docs-evals/core-concepts/models.mdx +68 -0
  56. package/docs-evals/core-concepts/sandboxes.mdx +52 -0
  57. package/docs-evals/core-concepts/secrets.mdx +41 -0
  58. package/docs-evals/core-concepts/skills.mdx +42 -0
  59. package/docs-evals/core-concepts/tasks.mdx +216 -0
  60. package/docs-evals/core-concepts/trial-outputs.mdx +103 -0
  61. package/docs-evals/core-concepts/trials.mdx +103 -0
  62. package/docs-evals/core-concepts/upload.mdx +45 -0
  63. package/docs-evals/dashboard/checks.mdx +15 -0
  64. package/docs-evals/dashboard/datasets.mdx +24 -0
  65. package/docs-evals/dashboard/jobs.mdx +65 -0
  66. package/docs-evals/dashboard/traces.mdx +15 -0
  67. package/docs-evals/dashboard/trial-viewer.mdx +30 -0
  68. package/docs-evals/docs.json +180 -0
  69. package/docs-evals/getting-started/installation.mdx +56 -0
  70. package/docs-evals/getting-started/quick-start.mdx +85 -0
  71. package/docs-evals/index.mdx +36 -0
  72. package/docs-evals/sdk/python.mdx +139 -0
  73. package/docs-evals/sdk/typescript.mdx +141 -0
  74. package/docs-evals/sdk-reference/agents.mdx +105 -0
  75. package/docs-evals/sdk-reference/analyses.mdx +125 -0
  76. package/docs-evals/sdk-reference/auth.mdx +76 -0
  77. package/docs-evals/sdk-reference/checks.mdx +166 -0
  78. package/docs-evals/sdk-reference/datasets.mdx +305 -0
  79. package/docs-evals/sdk-reference/errors.mdx +199 -0
  80. package/docs-evals/sdk-reference/index.mdx +58 -0
  81. package/docs-evals/sdk-reference/jobs.mdx +731 -0
  82. package/docs-evals/sdk-reference/meta.mdx +52 -0
  83. package/docs-evals/sdk-reference/skills.mdx +68 -0
  84. package/docs-evals/sdk-reference/trials.mdx +232 -0
  85. package/docs-evals/sdk-reference/types.mdx +272 -0
  86. package/docs-evals/snippets/global-options.mdx +13 -0
  87. package/docs-evals/snippets/list-flags.mdx +23 -0
  88. package/harness-capabilities.json +430 -0
  89. package/hosted-error-codes.json +120 -0
  90. package/package.json +163 -0
  91. package/skills/create-adapter/SKILL.md +287 -0
  92. package/skills/create-task/SKILL.md +491 -0
  93. package/skills/evolve/SKILL.md +39 -0
  94. package/skills/publish/SKILL.md +142 -0
  95. package/skills/rewardkit/SKILL.md +330 -0
  96. package/spec/atif/README.md +45 -0
  97. package/spec/atif/trajectory.schema.json +865 -0
  98. package/spec/openapi.yaml +13447 -0
@@ -0,0 +1,270 @@
1
+ #!/usr/bin/env node
2
+ import { T as Trial, a as TrialAnalysis, A as AgentInput, J as JobCreate, P as PublishDatasetInput, D as DatasetVersion, b as DatasetImport, C as Check, c as JobEvent, d as DatasetFailedTask, e as DatasetImportProgress, R as Rubric, f as JobSecretInline, g as JobSecretRef, h as TraceEvent } from '../types-DlpTxdR_.cjs';
3
+
4
+ /**
5
+ * evolve — the CLI for Evolve hosted datasets & jobs.
6
+ *
7
+ * Noun-verb grammar over the hosted client: `evolve <noun> <verb>`, plus
8
+ * first-class top-level commands that need no noun — `run` (which takes
9
+ * `job start`'s flags), `analyze`, and `upload`, each spelled, helped and
10
+ * dispatched as a command in its own right (Harbor registers all three the
11
+ * same way, as top-level commands: their cli/main.py). Singular
12
+ * nouns are canonical; `job`/`trial`/`analysis`/`dataset` also answer to
13
+ * their plurals as hidden aliases, but `agents` does NOT — that word is
14
+ * reserved for the managed-agents CLI and refuses with the reason — and
15
+ * `skills` is not the plural of `skill`: it is the one local group, serving
16
+ * the bundled skill files a coding agent reads as its manual (skills.ts),
17
+ * with no API call. `session` is the managed-agents lane's first noun here —
18
+ * list and inspect the sessions your SDK runs recorded, headless. Every
19
+ * other command speaks ONLY through the SDK clients (datasets() / agents() /
20
+ * jobs() / trials() / analyses() / skills() / auth() / sessions()) — no raw
21
+ * HTTP lives here.
22
+ *
23
+ * Output: human tables on a TTY, tab-separated rows when piped, --json for
24
+ * the rendered machine shape (NDJSON for --watch event streams), -q for
25
+ * ids-only lists. Exit codes: 0 success (watch: job COMPLETED / publish
26
+ * COMPLETED / every analysis completed), 1 runtime/API failure (watch:
27
+ * FAILED or CANCELLED / any analysis failed), 2 usage error.
28
+ */
29
+
30
+ /** Usage-level error: bad command line, not a runtime failure. Exit code 2. */
31
+ declare class CliUsageError extends Error {
32
+ constructor(message: string);
33
+ }
34
+ declare const USAGE: string;
35
+ interface Invocation {
36
+ /** Canonical "<group> <verb>", or "help" / "version". */
37
+ command: string;
38
+ positionals: string[];
39
+ flags: Record<string, string | number | boolean | string[]>;
40
+ }
41
+ declare function parseArgs(argv: string[]): Invocation;
42
+ /**
43
+ * -c reads real YAML through the standard `yaml` package — the hand-rolled
44
+ * subset reader is retired. PyYAML's reading is the contract, so the schema is
45
+ * YAML 1.1 (`yes`/`on` are booleans, `012` is octal, a flow mapping is a whole
46
+ * sequence item) with two carve-outs: the 1.1 spec's bare `y`/`n` booleans,
47
+ * which PyYAML never adopted — `n: 3` keeps its key — and the 1.1 spec's
48
+ * number shapes PyYAML never adopted either, where a float needs a dot and a
49
+ * signed exponent and an integer may not be zero-padded, so `e3`, `1e3`, `08`
50
+ * and `0:0` stay the strings a caller wrote. The schema is PINNED, not
51
+ * merely defaulted: PyYAML's resolver has no mode but 1.1 and reads a file the
52
+ * same way whatever its `%YAML` directive says, while this library lets an
53
+ * explicit `%YAML 1.2` swap in the 1.2 core schema. One file, one reading.
54
+ * Three refusals sit on top of the library: a second document, an unresolvable
55
+ * tag (both PyYAML refusals too), and a duplicate key — PyYAML silently keeps
56
+ * the last value, and that silence is exactly the corruption a config file
57
+ * cannot afford. Every refusal names its `source` and carries `:line` wherever
58
+ * the parser places the problem — the library's alias-bomb guard fires at
59
+ * resolution, after parsing, and has no position to give. An empty or
60
+ * comment-only file is an empty object.
61
+ */
62
+ declare function parseYamlConfig(text: string, source: string): unknown;
63
+ /** A path into the parsed config: object keys and list indices, root first. */
64
+ type ConfigPath = (string | number)[];
65
+ /**
66
+ * `parseYamlConfig` plus a `locate` that answers "what line does this path
67
+ * start on", so a schema refusal can point at the file the way a parse
68
+ * refusal already does. JSON configs have no locator — JSON.parse keeps no
69
+ * positions — and every message treats the line as optional for that reason.
70
+ */
71
+ declare function parseYamlConfigLocated(text: string, source: string): {
72
+ value: unknown;
73
+ locate: (path: ConfigPath) => number | undefined;
74
+ };
75
+ /**
76
+ * Parse repeatable --ak key=value pairs into the wire's agents[].kwargs
77
+ * object. The `config` key gets the channel's one client-side mechanic: a
78
+ * string value is a LOCAL settings file (the server never reads a client
79
+ * path), resolved here to its parsed content — JSON or TOML by extension,
80
+ * with a both-ways attempt for anything else. Every other key rides verbatim;
81
+ * acceptance is the server's.
82
+ */
83
+ declare function parseAgentKwargs(pairs: string[], read?: (path: string) => string): Record<string, unknown>;
84
+ /**
85
+ * Read a local prompt file for `analyze -p` / `run --analyze-prompt` — Harbor's
86
+ * `-p/--prompt` (their cli/analyze.py:252-255), whose TEXT replaces the platform's
87
+ * default body as the analyzer's instruction template (analyzer.py:130-134
88
+ * `prompt_path.read_text()`). Read verbatim, no parsing: the tokens
89
+ * (`{trial_path}`, `{task_section}`, `{criteria_guidance}`) are rendered
90
+ * server-side. Ruled here: the file must be readable and non-empty; the
91
+ * server stores it whole at any length (no invented number) and refuses
92
+ * only an empty or NUL-bearing one typed (`invalid_input` naming
93
+ * `analyze.prompt`).
94
+ */
95
+ declare function loadPromptFile(path: string, read?: (path: string) => string): string;
96
+ /**
97
+ * Read and parse a local rubric file for `analyze -r` / `run --analyze-rubric`
98
+ * into the spec's Rubric shape — Harbor's own loader law (their
99
+ * cli/quality_checker/models.py load_rubric): TOML, YAML, or JSON by
100
+ * extension, anything else refused by name. Ruled here: the shape, unknown
101
+ * fields refused naming them, and the two spec MINIMUMS — a non-empty
102
+ * criteria list, and each criterion's three fields present as non-empty
103
+ * strings. The server owns the rest of the bounds (criteria count, field
104
+ * lengths, the snake_case name grammar) and refuses them typed
105
+ * (`invalid_rubric`).
106
+ */
107
+ declare function loadRubricFile(path: string, read?: (path: string) => string): Rubric;
108
+ /**
109
+ * Parse repeatable --secret NAME[@LABEL][=ENVNAME] references into the wire's
110
+ * secrets[] objects. The grammar splits on the FIRST '=' (everything after it
111
+ * is the in-sandbox env name) and then the FIRST '@' (everything after it is
112
+ * the label), so neither delimiter is legal inside the parts — which matches
113
+ * the server's vocabularies (env-var-shaped names, [A-Za-z0-9._-] labels).
114
+ * Only the shape is ruled here; name/label semantics (reserved names, the
115
+ * 'default' fallback, the ambiguity refusal) are the server's.
116
+ */
117
+ declare function parseSecretRefs(values: string[]): JobSecretRef[];
118
+ /**
119
+ * Parse repeatable --secret-inline NAME[@LABEL]:DELIVERY=VALUE entries into
120
+ * the wire's inline secrets[] objects. DELIVERY sits BEFORE the '=' so the
121
+ * value — everything after the FIRST '=' — is passed through byte-for-byte
122
+ * and may contain '=', ':' and '@' unescaped. The head splits on its FIRST
123
+ * '@' (label) and LAST ':' (delivery), matching the label grammar
124
+ * ([A-Za-z0-9._-], no ':' possible). Only the shape is ruled here;
125
+ * name/label semantics and the collision refusal are the server's.
126
+ */
127
+ declare function parseInlineSecrets(values: string[]): JobSecretInline[];
128
+ /** Parse repeatable KEY=VALUE pairs into an env map. */
129
+ declare function parseEnvPairs(pairs: string[], flag: string): Record<string, string>;
130
+ /**
131
+ * Build the POST /api/jobs body from a parsed `job start` / `run` invocation:
132
+ * -c loads a base config in the spec's own vocabulary, then every explicitly
133
+ * passed flag overrides the corresponding field. -i/-x/-l are stamped onto
134
+ * EVERY dataset selector — per-selector filters with one flag grammar, so a
135
+ * glob that matches nothing in one dataset simply filters nothing there.
136
+ */
137
+ declare function buildJobInput(inv: Invocation, read?: (path: string) => string): JobCreate;
138
+ /**
139
+ * Build the datasets().publish() input from a parsed `dataset publish`
140
+ * invocation. `--name`/`--version` are optional with `--dir` (a corpus
141
+ * carrying a dataset.toml manifest supplies them server-side — Harbor's
142
+ * dataset layout — and the SDK refuses before uploading when neither the
143
+ * flags nor a manifest exist) and with `--from hub:…` (the server defaults
144
+ * them from the resolved package). A git or `--from <url>` source requires
145
+ * both — its corpus is only fetched after the server accepts the publish.
146
+ *
147
+ * `--from` takes the FETCHABLE sources, one flag for both spellings: a plain
148
+ * https URL is a public tarball (`archive_url` on the wire), and the `hub:`
149
+ * prefix marks a Harbor hub package whose reference part is exactly Harbor's
150
+ * own grammar (`org/name[@ref]` — their CLI takes the same reference as a
151
+ * bare positional; the prefix exists only because this one flag also accepts
152
+ * URLs).
153
+ */
154
+ declare function buildPublishInput(inv: Invocation): PublishDatasetInput;
155
+ /**
156
+ * Build the agents().create() input from a parsed `agent add` invocation.
157
+ * `--install-script` names a FILE; its contents are what the SDK uploads.
158
+ */
159
+ declare function buildAgentInput(inv: Invocation, readScript?: (path: string) => string): AgentInput;
160
+ interface CliIO {
161
+ out(line: string): void;
162
+ err(line: string): void;
163
+ /**
164
+ * True when stdout is an interactive terminal. Drives the table-vs-TSV
165
+ * split on list commands; TERM=dumb counts as non-interactive. Defaults to
166
+ * false when absent so redirected output always gets machine-safe rows.
167
+ */
168
+ tty?: boolean;
169
+ /**
170
+ * Ask the human a yes/no question — the destructive-verb prompt. Present
171
+ * only when stdin can actually answer (an interactive terminal); absent,
172
+ * a destructive verb must be told --yes, exactly Harbor's non-TTY
173
+ * posture. The question rides stderr so stdout stays machine-clean.
174
+ */
175
+ confirm?(question: string): Promise<boolean>;
176
+ }
177
+ interface ListColumn<T> {
178
+ key: string;
179
+ header: string;
180
+ cell(row: T): string;
181
+ }
182
+ /** Exported for its test, like trialDetailLines above it. */
183
+ declare const TRIAL_COLUMNS: ListColumn<Trial>[];
184
+ /**
185
+ * Full-detail rendering of one trial — evolve trial show. Exported for
186
+ * tests, like the other line renderers.
187
+ */
188
+ declare function trialDetailLines(run: Trial): string[];
189
+ /**
190
+ * Full-detail rendering of one analysis run — evolve analysis show. The same
191
+ * facts `trial show` folds into its `analysis` rows, standing on their own:
192
+ * status and model, one row per criterion verdict, the summary, the
193
+ * analyzer's own metered spend (four decimals like every analyzer-spend
194
+ * figure — an analysis costs cents), and the typed failure when there is
195
+ * one. Exported for tests, like the other line renderers.
196
+ */
197
+ declare function analysisDetailLines(analysis: TrialAnalysis): string[];
198
+ /**
199
+ * One trace event line — evolve trial download --stream trace-parsed, and
200
+ * every other verb that prints a parsed transcript. Null for a line the
201
+ * rendering HIDES: a harness's own `usage` event (owner's law 2026-09-10 —
202
+ * tokens and money shown anywhere come from the gateway meter, never from
203
+ * what a harness prints; the raw event still rides `--json`). The gateway
204
+ * meter's usage event (`gatewayUsageOf`) renders as a money line: model,
205
+ * tokens in / out (cached), cost as the gateway priced it, the call's start
206
+ * instant.
207
+ */
208
+ declare function traceEventLine(event: TraceEvent): string | null;
209
+ /**
210
+ * Compact one-line rendering of one live-progress change for --watch — the
211
+ * poll-line adaptation of Harbor's publish progress display (their overall
212
+ * bar is spinner + "M of N" + description + elapsed/remaining, rich Live at
213
+ * 10 fps: REFERENCES/Harbor src/harbor/cli/publish.py:231-238; ours is a
214
+ * line per observed server write, so it keeps the M-of-N and elapsed columns
215
+ * and drops the animation). During the copy phase the line states "N of M
216
+ * images already banked" — Harbor's "skipped (exists)" idea (publish.py:388)
217
+ * in this platform's banked vocabulary.
218
+ */
219
+ declare function importProgressLine(progress: DatasetImportProgress, nowMs?: number): string;
220
+ /**
221
+ * The settled progress record for the final --watch block: wall-clock per
222
+ * phase, the publish's image economics (built / mirrored / banked), and the
223
+ * CodeBuild copy-minutes meter — the shape of Harbor publish's settle
224
+ * summary (per-item Build/Upload timing table + "Published N, skipped M
225
+ * task(s) in X.XXs": REFERENCES/Harbor src/harbor/cli/publish.py:288-315).
226
+ */
227
+ declare function progressSettleLines(progress: DatasetImportProgress): string[];
228
+ /** Compact one-line rendering of one publish status change for --watch. */
229
+ declare function importStatusLine(job: DatasetImport): string;
230
+ /**
231
+ * Compact one-line rendering of one version state change for --watch's
232
+ * settle phase: the version's own walk (BUILDING, then READY/ARCHIVED or
233
+ * FAILED).
234
+ */
235
+ declare function versionStatusLine(version: DatasetVersion): string;
236
+ /** Compact one-line rendering of one SSE event for --watch. */
237
+ declare function eventLine(event: JobEvent): string;
238
+ /**
239
+ * The settled wave, one row per analyzed trial — Harbor's "Trial Analyses"
240
+ * table carried over: the criterion verdicts, the analyzer's own cost, and a
241
+ * summary excerpt. A failed analysis renders its typed failure in place of
242
+ * verdicts and repeats it in full below the table — never a silent absence.
243
+ * Exported for its test, like the other line renderers.
244
+ */
245
+ declare function analysisResultLines(runs: Trial[]): string[];
246
+ /**
247
+ * Harbor's check renderers (cli/analyze.py:29-81), as lines: ONE task
248
+ * prints its checks table (Check | Outcome | Explanation, the criterion
249
+ * titled) and the agent cost; several print the summary table (Task | Pass
250
+ * | Fail | N/A | Cost ($)) with an errored task's row dashed, then one
251
+ * `❌ task: reason` line per failed task and the total agent cost — their
252
+ * `_render_checks_table` / `_render_check_summary`. A task that is still
253
+ * queued or running has no verdict yet and prints its status in the
254
+ * outcome column.
255
+ */
256
+ declare function checkResultLines(check: Check): string[];
257
+ /** The record head for `check show` and the verb's return: id, status, source, policy, then Harbor's tables. */
258
+ declare function checkDetailLines(check: Check): string[];
259
+ /**
260
+ * The partial-publish model's honest ending for `dataset publish --watch`:
261
+ * "built N of M tasks — K failed to build", plus where the reasons live and
262
+ * the one fix (a re-publish — versions are immutable). Empty on a fully
263
+ * built version, so the common case keeps its exact output.
264
+ */
265
+ declare function buildSettleSummaryLines(version: DatasetVersion, job: DatasetImport): string[];
266
+ /** One live line per failed task outcome during `dataset publish --watch`. */
267
+ declare function failedTaskOutcomeLine(entry: DatasetFailedTask): string;
268
+ declare function runCli(argv: string[], io?: CliIO): Promise<number>;
269
+
270
+ export { type CliIO, CliUsageError, type Invocation, TRIAL_COLUMNS, USAGE, analysisDetailLines, analysisResultLines, buildAgentInput, buildJobInput, buildPublishInput, buildSettleSummaryLines, checkDetailLines, checkResultLines, eventLine, failedTaskOutcomeLine, importProgressLine, importStatusLine, loadPromptFile, loadRubricFile, parseAgentKwargs, parseArgs, parseEnvPairs, parseInlineSecrets, parseSecretRefs, parseYamlConfig, parseYamlConfigLocated, progressSettleLines, runCli, traceEventLine, trialDetailLines, versionStatusLine };
@@ -0,0 +1,270 @@
1
+ #!/usr/bin/env node
2
+ import { T as Trial, a as TrialAnalysis, A as AgentInput, J as JobCreate, P as PublishDatasetInput, D as DatasetVersion, b as DatasetImport, C as Check, c as JobEvent, d as DatasetFailedTask, e as DatasetImportProgress, R as Rubric, f as JobSecretInline, g as JobSecretRef, h as TraceEvent } from '../types-DlpTxdR_.js';
3
+
4
+ /**
5
+ * evolve — the CLI for Evolve hosted datasets & jobs.
6
+ *
7
+ * Noun-verb grammar over the hosted client: `evolve <noun> <verb>`, plus
8
+ * first-class top-level commands that need no noun — `run` (which takes
9
+ * `job start`'s flags), `analyze`, and `upload`, each spelled, helped and
10
+ * dispatched as a command in its own right (Harbor registers all three the
11
+ * same way, as top-level commands: their cli/main.py). Singular
12
+ * nouns are canonical; `job`/`trial`/`analysis`/`dataset` also answer to
13
+ * their plurals as hidden aliases, but `agents` does NOT — that word is
14
+ * reserved for the managed-agents CLI and refuses with the reason — and
15
+ * `skills` is not the plural of `skill`: it is the one local group, serving
16
+ * the bundled skill files a coding agent reads as its manual (skills.ts),
17
+ * with no API call. `session` is the managed-agents lane's first noun here —
18
+ * list and inspect the sessions your SDK runs recorded, headless. Every
19
+ * other command speaks ONLY through the SDK clients (datasets() / agents() /
20
+ * jobs() / trials() / analyses() / skills() / auth() / sessions()) — no raw
21
+ * HTTP lives here.
22
+ *
23
+ * Output: human tables on a TTY, tab-separated rows when piped, --json for
24
+ * the rendered machine shape (NDJSON for --watch event streams), -q for
25
+ * ids-only lists. Exit codes: 0 success (watch: job COMPLETED / publish
26
+ * COMPLETED / every analysis completed), 1 runtime/API failure (watch:
27
+ * FAILED or CANCELLED / any analysis failed), 2 usage error.
28
+ */
29
+
30
+ /** Usage-level error: bad command line, not a runtime failure. Exit code 2. */
31
+ declare class CliUsageError extends Error {
32
+ constructor(message: string);
33
+ }
34
+ declare const USAGE: string;
35
+ interface Invocation {
36
+ /** Canonical "<group> <verb>", or "help" / "version". */
37
+ command: string;
38
+ positionals: string[];
39
+ flags: Record<string, string | number | boolean | string[]>;
40
+ }
41
+ declare function parseArgs(argv: string[]): Invocation;
42
+ /**
43
+ * -c reads real YAML through the standard `yaml` package — the hand-rolled
44
+ * subset reader is retired. PyYAML's reading is the contract, so the schema is
45
+ * YAML 1.1 (`yes`/`on` are booleans, `012` is octal, a flow mapping is a whole
46
+ * sequence item) with two carve-outs: the 1.1 spec's bare `y`/`n` booleans,
47
+ * which PyYAML never adopted — `n: 3` keeps its key — and the 1.1 spec's
48
+ * number shapes PyYAML never adopted either, where a float needs a dot and a
49
+ * signed exponent and an integer may not be zero-padded, so `e3`, `1e3`, `08`
50
+ * and `0:0` stay the strings a caller wrote. The schema is PINNED, not
51
+ * merely defaulted: PyYAML's resolver has no mode but 1.1 and reads a file the
52
+ * same way whatever its `%YAML` directive says, while this library lets an
53
+ * explicit `%YAML 1.2` swap in the 1.2 core schema. One file, one reading.
54
+ * Three refusals sit on top of the library: a second document, an unresolvable
55
+ * tag (both PyYAML refusals too), and a duplicate key — PyYAML silently keeps
56
+ * the last value, and that silence is exactly the corruption a config file
57
+ * cannot afford. Every refusal names its `source` and carries `:line` wherever
58
+ * the parser places the problem — the library's alias-bomb guard fires at
59
+ * resolution, after parsing, and has no position to give. An empty or
60
+ * comment-only file is an empty object.
61
+ */
62
+ declare function parseYamlConfig(text: string, source: string): unknown;
63
+ /** A path into the parsed config: object keys and list indices, root first. */
64
+ type ConfigPath = (string | number)[];
65
+ /**
66
+ * `parseYamlConfig` plus a `locate` that answers "what line does this path
67
+ * start on", so a schema refusal can point at the file the way a parse
68
+ * refusal already does. JSON configs have no locator — JSON.parse keeps no
69
+ * positions — and every message treats the line as optional for that reason.
70
+ */
71
+ declare function parseYamlConfigLocated(text: string, source: string): {
72
+ value: unknown;
73
+ locate: (path: ConfigPath) => number | undefined;
74
+ };
75
+ /**
76
+ * Parse repeatable --ak key=value pairs into the wire's agents[].kwargs
77
+ * object. The `config` key gets the channel's one client-side mechanic: a
78
+ * string value is a LOCAL settings file (the server never reads a client
79
+ * path), resolved here to its parsed content — JSON or TOML by extension,
80
+ * with a both-ways attempt for anything else. Every other key rides verbatim;
81
+ * acceptance is the server's.
82
+ */
83
+ declare function parseAgentKwargs(pairs: string[], read?: (path: string) => string): Record<string, unknown>;
84
+ /**
85
+ * Read a local prompt file for `analyze -p` / `run --analyze-prompt` — Harbor's
86
+ * `-p/--prompt` (their cli/analyze.py:252-255), whose TEXT replaces the platform's
87
+ * default body as the analyzer's instruction template (analyzer.py:130-134
88
+ * `prompt_path.read_text()`). Read verbatim, no parsing: the tokens
89
+ * (`{trial_path}`, `{task_section}`, `{criteria_guidance}`) are rendered
90
+ * server-side. Ruled here: the file must be readable and non-empty; the
91
+ * server stores it whole at any length (no invented number) and refuses
92
+ * only an empty or NUL-bearing one typed (`invalid_input` naming
93
+ * `analyze.prompt`).
94
+ */
95
+ declare function loadPromptFile(path: string, read?: (path: string) => string): string;
96
+ /**
97
+ * Read and parse a local rubric file for `analyze -r` / `run --analyze-rubric`
98
+ * into the spec's Rubric shape — Harbor's own loader law (their
99
+ * cli/quality_checker/models.py load_rubric): TOML, YAML, or JSON by
100
+ * extension, anything else refused by name. Ruled here: the shape, unknown
101
+ * fields refused naming them, and the two spec MINIMUMS — a non-empty
102
+ * criteria list, and each criterion's three fields present as non-empty
103
+ * strings. The server owns the rest of the bounds (criteria count, field
104
+ * lengths, the snake_case name grammar) and refuses them typed
105
+ * (`invalid_rubric`).
106
+ */
107
+ declare function loadRubricFile(path: string, read?: (path: string) => string): Rubric;
108
+ /**
109
+ * Parse repeatable --secret NAME[@LABEL][=ENVNAME] references into the wire's
110
+ * secrets[] objects. The grammar splits on the FIRST '=' (everything after it
111
+ * is the in-sandbox env name) and then the FIRST '@' (everything after it is
112
+ * the label), so neither delimiter is legal inside the parts — which matches
113
+ * the server's vocabularies (env-var-shaped names, [A-Za-z0-9._-] labels).
114
+ * Only the shape is ruled here; name/label semantics (reserved names, the
115
+ * 'default' fallback, the ambiguity refusal) are the server's.
116
+ */
117
+ declare function parseSecretRefs(values: string[]): JobSecretRef[];
118
+ /**
119
+ * Parse repeatable --secret-inline NAME[@LABEL]:DELIVERY=VALUE entries into
120
+ * the wire's inline secrets[] objects. DELIVERY sits BEFORE the '=' so the
121
+ * value — everything after the FIRST '=' — is passed through byte-for-byte
122
+ * and may contain '=', ':' and '@' unescaped. The head splits on its FIRST
123
+ * '@' (label) and LAST ':' (delivery), matching the label grammar
124
+ * ([A-Za-z0-9._-], no ':' possible). Only the shape is ruled here;
125
+ * name/label semantics and the collision refusal are the server's.
126
+ */
127
+ declare function parseInlineSecrets(values: string[]): JobSecretInline[];
128
+ /** Parse repeatable KEY=VALUE pairs into an env map. */
129
+ declare function parseEnvPairs(pairs: string[], flag: string): Record<string, string>;
130
+ /**
131
+ * Build the POST /api/jobs body from a parsed `job start` / `run` invocation:
132
+ * -c loads a base config in the spec's own vocabulary, then every explicitly
133
+ * passed flag overrides the corresponding field. -i/-x/-l are stamped onto
134
+ * EVERY dataset selector — per-selector filters with one flag grammar, so a
135
+ * glob that matches nothing in one dataset simply filters nothing there.
136
+ */
137
+ declare function buildJobInput(inv: Invocation, read?: (path: string) => string): JobCreate;
138
+ /**
139
+ * Build the datasets().publish() input from a parsed `dataset publish`
140
+ * invocation. `--name`/`--version` are optional with `--dir` (a corpus
141
+ * carrying a dataset.toml manifest supplies them server-side — Harbor's
142
+ * dataset layout — and the SDK refuses before uploading when neither the
143
+ * flags nor a manifest exist) and with `--from hub:…` (the server defaults
144
+ * them from the resolved package). A git or `--from <url>` source requires
145
+ * both — its corpus is only fetched after the server accepts the publish.
146
+ *
147
+ * `--from` takes the FETCHABLE sources, one flag for both spellings: a plain
148
+ * https URL is a public tarball (`archive_url` on the wire), and the `hub:`
149
+ * prefix marks a Harbor hub package whose reference part is exactly Harbor's
150
+ * own grammar (`org/name[@ref]` — their CLI takes the same reference as a
151
+ * bare positional; the prefix exists only because this one flag also accepts
152
+ * URLs).
153
+ */
154
+ declare function buildPublishInput(inv: Invocation): PublishDatasetInput;
155
+ /**
156
+ * Build the agents().create() input from a parsed `agent add` invocation.
157
+ * `--install-script` names a FILE; its contents are what the SDK uploads.
158
+ */
159
+ declare function buildAgentInput(inv: Invocation, readScript?: (path: string) => string): AgentInput;
160
+ interface CliIO {
161
+ out(line: string): void;
162
+ err(line: string): void;
163
+ /**
164
+ * True when stdout is an interactive terminal. Drives the table-vs-TSV
165
+ * split on list commands; TERM=dumb counts as non-interactive. Defaults to
166
+ * false when absent so redirected output always gets machine-safe rows.
167
+ */
168
+ tty?: boolean;
169
+ /**
170
+ * Ask the human a yes/no question — the destructive-verb prompt. Present
171
+ * only when stdin can actually answer (an interactive terminal); absent,
172
+ * a destructive verb must be told --yes, exactly Harbor's non-TTY
173
+ * posture. The question rides stderr so stdout stays machine-clean.
174
+ */
175
+ confirm?(question: string): Promise<boolean>;
176
+ }
177
+ interface ListColumn<T> {
178
+ key: string;
179
+ header: string;
180
+ cell(row: T): string;
181
+ }
182
+ /** Exported for its test, like trialDetailLines above it. */
183
+ declare const TRIAL_COLUMNS: ListColumn<Trial>[];
184
+ /**
185
+ * Full-detail rendering of one trial — evolve trial show. Exported for
186
+ * tests, like the other line renderers.
187
+ */
188
+ declare function trialDetailLines(run: Trial): string[];
189
+ /**
190
+ * Full-detail rendering of one analysis run — evolve analysis show. The same
191
+ * facts `trial show` folds into its `analysis` rows, standing on their own:
192
+ * status and model, one row per criterion verdict, the summary, the
193
+ * analyzer's own metered spend (four decimals like every analyzer-spend
194
+ * figure — an analysis costs cents), and the typed failure when there is
195
+ * one. Exported for tests, like the other line renderers.
196
+ */
197
+ declare function analysisDetailLines(analysis: TrialAnalysis): string[];
198
+ /**
199
+ * One trace event line — evolve trial download --stream trace-parsed, and
200
+ * every other verb that prints a parsed transcript. Null for a line the
201
+ * rendering HIDES: a harness's own `usage` event (owner's law 2026-09-10 —
202
+ * tokens and money shown anywhere come from the gateway meter, never from
203
+ * what a harness prints; the raw event still rides `--json`). The gateway
204
+ * meter's usage event (`gatewayUsageOf`) renders as a money line: model,
205
+ * tokens in / out (cached), cost as the gateway priced it, the call's start
206
+ * instant.
207
+ */
208
+ declare function traceEventLine(event: TraceEvent): string | null;
209
+ /**
210
+ * Compact one-line rendering of one live-progress change for --watch — the
211
+ * poll-line adaptation of Harbor's publish progress display (their overall
212
+ * bar is spinner + "M of N" + description + elapsed/remaining, rich Live at
213
+ * 10 fps: REFERENCES/Harbor src/harbor/cli/publish.py:231-238; ours is a
214
+ * line per observed server write, so it keeps the M-of-N and elapsed columns
215
+ * and drops the animation). During the copy phase the line states "N of M
216
+ * images already banked" — Harbor's "skipped (exists)" idea (publish.py:388)
217
+ * in this platform's banked vocabulary.
218
+ */
219
+ declare function importProgressLine(progress: DatasetImportProgress, nowMs?: number): string;
220
+ /**
221
+ * The settled progress record for the final --watch block: wall-clock per
222
+ * phase, the publish's image economics (built / mirrored / banked), and the
223
+ * CodeBuild copy-minutes meter — the shape of Harbor publish's settle
224
+ * summary (per-item Build/Upload timing table + "Published N, skipped M
225
+ * task(s) in X.XXs": REFERENCES/Harbor src/harbor/cli/publish.py:288-315).
226
+ */
227
+ declare function progressSettleLines(progress: DatasetImportProgress): string[];
228
+ /** Compact one-line rendering of one publish status change for --watch. */
229
+ declare function importStatusLine(job: DatasetImport): string;
230
+ /**
231
+ * Compact one-line rendering of one version state change for --watch's
232
+ * settle phase: the version's own walk (BUILDING, then READY/ARCHIVED or
233
+ * FAILED).
234
+ */
235
+ declare function versionStatusLine(version: DatasetVersion): string;
236
+ /** Compact one-line rendering of one SSE event for --watch. */
237
+ declare function eventLine(event: JobEvent): string;
238
+ /**
239
+ * The settled wave, one row per analyzed trial — Harbor's "Trial Analyses"
240
+ * table carried over: the criterion verdicts, the analyzer's own cost, and a
241
+ * summary excerpt. A failed analysis renders its typed failure in place of
242
+ * verdicts and repeats it in full below the table — never a silent absence.
243
+ * Exported for its test, like the other line renderers.
244
+ */
245
+ declare function analysisResultLines(runs: Trial[]): string[];
246
+ /**
247
+ * Harbor's check renderers (cli/analyze.py:29-81), as lines: ONE task
248
+ * prints its checks table (Check | Outcome | Explanation, the criterion
249
+ * titled) and the agent cost; several print the summary table (Task | Pass
250
+ * | Fail | N/A | Cost ($)) with an errored task's row dashed, then one
251
+ * `❌ task: reason` line per failed task and the total agent cost — their
252
+ * `_render_checks_table` / `_render_check_summary`. A task that is still
253
+ * queued or running has no verdict yet and prints its status in the
254
+ * outcome column.
255
+ */
256
+ declare function checkResultLines(check: Check): string[];
257
+ /** The record head for `check show` and the verb's return: id, status, source, policy, then Harbor's tables. */
258
+ declare function checkDetailLines(check: Check): string[];
259
+ /**
260
+ * The partial-publish model's honest ending for `dataset publish --watch`:
261
+ * "built N of M tasks — K failed to build", plus where the reasons live and
262
+ * the one fix (a re-publish — versions are immutable). Empty on a fully
263
+ * built version, so the common case keeps its exact output.
264
+ */
265
+ declare function buildSettleSummaryLines(version: DatasetVersion, job: DatasetImport): string[];
266
+ /** One live line per failed task outcome during `dataset publish --watch`. */
267
+ declare function failedTaskOutcomeLine(entry: DatasetFailedTask): string;
268
+ declare function runCli(argv: string[], io?: CliIO): Promise<number>;
269
+
270
+ export { type CliIO, CliUsageError, type Invocation, TRIAL_COLUMNS, USAGE, analysisDetailLines, analysisResultLines, buildAgentInput, buildJobInput, buildPublishInput, buildSettleSummaryLines, checkDetailLines, checkResultLines, eventLine, failedTaskOutcomeLine, importProgressLine, importStatusLine, loadPromptFile, loadRubricFile, parseAgentKwargs, parseArgs, parseEnvPairs, parseInlineSecrets, parseSecretRefs, parseYamlConfig, parseYamlConfigLocated, progressSettleLines, runCli, traceEventLine, trialDetailLines, versionStatusLine };