@yaag/cli 0.6.2 → 0.8.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 +31 -0
- package/assets/types/runtime/agent/agent.d.ts +16 -1
- package/assets/types/runtime/agent/define-agent.d.ts +20 -3
- package/assets/types/runtime/agent/spawn-extensions.d.ts +39 -0
- package/assets/types/runtime/agent/spawn-request.d.ts +24 -0
- package/assets/types/runtime/agent/spawn.d.ts +3 -0
- package/assets/types/runtime/ask/ask-exchange-events.d.ts +7 -1
- package/assets/types/runtime/ask/ask-exchange-options.d.ts +12 -0
- package/assets/types/runtime/ask/index.d.ts +1 -0
- package/assets/types/runtime/cassette/cassette-schema.d.ts +1 -0
- package/assets/types/runtime/cassette/cassette.d.ts +5 -0
- package/assets/types/runtime/cassette/replay-divergence.d.ts +10 -2
- package/assets/types/runtime/config/config-file.d.ts +22 -0
- package/assets/types/runtime/config/config-issues.d.ts +12 -0
- package/assets/types/runtime/config/config-paths.d.ts +22 -0
- package/assets/types/runtime/config/config-schema.d.ts +17 -0
- package/assets/types/runtime/config/effective-config.d.ts +42 -0
- package/assets/types/runtime/config/index.d.ts +8 -0
- package/assets/types/runtime/errors.d.ts +16 -2
- package/assets/types/runtime/events.d.ts +18 -0
- package/assets/types/runtime/extension/extension-paths.d.ts +10 -2
- package/assets/types/runtime/index.d.ts +4 -2
- package/assets/types/runtime/model/index.d.ts +8 -1
- package/assets/types/runtime/model/model-error-history.d.ts +20 -0
- package/assets/types/runtime/model/model-failure.d.ts +18 -0
- package/assets/types/runtime/model/model-fallback.d.ts +13 -0
- package/assets/types/runtime/model/model-match.d.ts +31 -0
- package/assets/types/runtime/model/model-resolution.d.ts +44 -6
- package/assets/types/runtime/model/model-swap.d.ts +27 -0
- package/assets/types/runtime/model/recorded-resolution.d.ts +37 -0
- package/assets/types/runtime/model/resolution-loop.d.ts +47 -0
- package/assets/types/runtime/run/run.d.ts +7 -0
- package/assets/types/runtime/summary/index.d.ts +1 -1
- package/assets/types/runtime/summary/summary-agent.d.ts +8 -0
- package/assets/types/runtime/summary/summary-fallbacks.d.ts +30 -0
- package/assets/types/runtime/summary/summary.d.ts +3 -1
- package/assets/types/runtime/transport/fake-transport.d.ts +9 -1
- package/assets/types/runtime/transport/index.d.ts +1 -0
- package/assets/types/runtime/transport/stderr-tail.d.ts +12 -0
- package/assets/types/runtime/transport/transport.d.ts +15 -0
- package/assets/types/runtime/types.d.ts +33 -5
- package/assets/types/runtime/wire-constants.d.ts +2 -0
- package/package.json +3 -3
- package/src/argv.ts +23 -4
- package/src/cli.ts +9 -0
- package/src/config/index.ts +8 -0
- package/src/config/program-directory.ts +34 -0
- package/src/config/run-config.ts +54 -0
- package/src/terminal/render.ts +3 -0
- package/src/terminal/run-invocation.ts +4 -1
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# @yaag/cli
|
|
2
|
+
|
|
3
|
+
The `yaag` CLI. It runs an Orchestration Program on Bun, describes one, and
|
|
4
|
+
prepares a workspace for authoring.
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
bun add @yaag/cli
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The CLI needs Bun. Install Bun with `curl -fsSL https://bun.sh/install | bash`.
|
|
13
|
+
|
|
14
|
+
## Commands
|
|
15
|
+
|
|
16
|
+
- `yaag run <program.ts>` — run an Orchestration Program. `--args <json>`,
|
|
17
|
+
`--record <file>`, `--resume <file>`, `--replay <file>`, `--quiet`.
|
|
18
|
+
- `yaag describe <program.ts>` — report the name, description, and args schema.
|
|
19
|
+
- `yaag setup-workspace [dir]` — create `.yaag/` with the editor types.
|
|
20
|
+
|
|
21
|
+
`yaag` with no valid command prints its usage text and exits with code 2.
|
|
22
|
+
|
|
23
|
+
## Docs
|
|
24
|
+
|
|
25
|
+
The full doc set ships with `@yaag/extension`:
|
|
26
|
+
|
|
27
|
+
- [`getting-started.md`](../../packages/extension/docs/getting-started.md)
|
|
28
|
+
- [`authoring.md`](../../packages/extension/docs/authoring.md)
|
|
29
|
+
- [`examples.md`](../../packages/extension/docs/examples.md)
|
|
30
|
+
- [`cli.md`](../../packages/extension/docs/cli.md)
|
|
31
|
+
- [`troubleshooting.md`](../../packages/extension/docs/troubleshooting.md)
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import type { Static, TSchema } from "typebox";
|
|
2
2
|
import type { EventSink } from "../events.ts";
|
|
3
|
+
import type { ModelErrorHistory, ModelResolution } from "../model/index.ts";
|
|
3
4
|
import type { AgentStats, AgentTransport } from "../transport/index.ts";
|
|
4
5
|
import type { AskOptions, Handle, ResolvedSpawnOptions, StructuredAskOptions } from "../types.ts";
|
|
6
|
+
/** The mid-Ask Model Resolution one Agent's spawn handed it (ADR-0038). */
|
|
7
|
+
export interface AgentModelFallback {
|
|
8
|
+
readonly resolution: ModelResolution;
|
|
9
|
+
/** The Agent-wide attempt history, shared with its spawn loop. */
|
|
10
|
+
readonly history: ModelErrorHistory;
|
|
11
|
+
/** The model candidate this Agent's spawn settled on. */
|
|
12
|
+
readonly candidate: string;
|
|
13
|
+
}
|
|
5
14
|
export interface AgentOptions {
|
|
6
15
|
readonly name: string;
|
|
7
16
|
readonly cwd: string;
|
|
@@ -10,6 +19,11 @@ export interface AgentOptions {
|
|
|
10
19
|
readonly emit: EventSink;
|
|
11
20
|
/** The options this Agent was spawned with, for the ADR-0014 Ask hash. */
|
|
12
21
|
readonly spawnOptions: ResolvedSpawnOptions;
|
|
22
|
+
/**
|
|
23
|
+
* Mid-Ask Model Resolution for this Agent, sharing the spawn loop's history.
|
|
24
|
+
* Absent when the spawn named no candidate: there is nothing to fall back from.
|
|
25
|
+
*/
|
|
26
|
+
readonly modelFallback?: AgentModelFallback;
|
|
13
27
|
/** Definition-owned defaults merged below explicit per-Ask options. */
|
|
14
28
|
readonly askDefaults?: AskOptions;
|
|
15
29
|
/** Definition identity recorded on its Asks, outside replay identity. */
|
|
@@ -27,8 +41,9 @@ export declare class Agent implements Handle {
|
|
|
27
41
|
readonly name: string;
|
|
28
42
|
readonly cwd: string;
|
|
29
43
|
readonly branch: string | undefined;
|
|
30
|
-
readonly model: string;
|
|
31
44
|
constructor(options: AgentOptions);
|
|
45
|
+
/** The model pi reports for this Agent now; a mid-Ask swap updates it. */
|
|
46
|
+
get model(): string;
|
|
32
47
|
ask<Schema extends TSchema>(prompt: string, options: StructuredAskOptions<Schema>): Promise<Static<Schema>>;
|
|
33
48
|
ask(prompt: string, options?: AskOptions): Promise<string>;
|
|
34
49
|
/** True when the Agent was killed mid-Ask, so its cost is a floor (ADR-0012). */
|
|
@@ -12,10 +12,18 @@ export interface AgentConfig {
|
|
|
12
12
|
/**
|
|
13
13
|
* Model id handed to `pi --model`. Unset = pi's default. An array is an ordered
|
|
14
14
|
* fallback list, a function picks the next candidate from the failures so far,
|
|
15
|
-
* and any pattern may carry an inline thinking suffix (`"opus-5:medium"`)
|
|
15
|
+
* and any pattern may carry an inline thinking suffix (`"opus-5:medium"`),
|
|
16
|
+
* which wins over `thinking`. Each attempt settles the model first, then the
|
|
17
|
+
* thinking level for that model. yaag starts a new attempt only when pi
|
|
18
|
+
* reports `not_found`, `auth`, or `rate_limited` (ADR-0037).
|
|
16
19
|
*/
|
|
17
20
|
readonly model?: ModelSpec;
|
|
18
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Thinking budget for the Agent's turns, as a level or a resolver. The
|
|
23
|
+
* resolver runs again for each attempt, with the model that settled for that
|
|
24
|
+
* attempt. A resolver kept in a definition is frozen policy, so it must stay
|
|
25
|
+
* pure and synchronous (ADR-0037).
|
|
26
|
+
*/
|
|
19
27
|
readonly thinking?: ThinkingSpec;
|
|
20
28
|
/** Allow-list of tool names. Unset = pi's default tool set. */
|
|
21
29
|
readonly tools?: readonly string[];
|
|
@@ -25,6 +33,13 @@ export interface AgentConfig {
|
|
|
25
33
|
readonly skills?: readonly string[];
|
|
26
34
|
/** Deny-list of skill names, applied after `skills`. */
|
|
27
35
|
readonly disallowedSkills?: readonly string[];
|
|
36
|
+
/**
|
|
37
|
+
* Load the Effective Config's `agents.extensions` for Agents of this
|
|
38
|
+
* definition. Default true. A spawn's own `SpawnOptions.configExtensions`
|
|
39
|
+
* wins over this value; spawn *overrides* stay topology-only, so the opt-out
|
|
40
|
+
* is not one of them (ADR-0019, ADR-0040).
|
|
41
|
+
*/
|
|
42
|
+
readonly configExtensions?: boolean;
|
|
28
43
|
/** Ask options applied to every Ask on this Agent unless overridden per call. */
|
|
29
44
|
readonly askDefaults?: AskOptions;
|
|
30
45
|
}
|
|
@@ -40,7 +55,9 @@ export interface AgentDefinition {
|
|
|
40
55
|
* Throws a TypeError when `name` is missing or blank, or when `cwd`/`worktree`
|
|
41
56
|
* appear — those are topology, chosen at spawn time, not baked into a definition.
|
|
42
57
|
* The config is defensively copied and deep-frozen, so later mutation of the
|
|
43
|
-
* caller's arrays cannot change the definition.
|
|
58
|
+
* caller's arrays cannot change the definition. `defineAgent` also copies and
|
|
59
|
+
* freezes a model array, so a later change of the caller's array cannot change
|
|
60
|
+
* Model Resolution (ADR-0037).
|
|
44
61
|
*/
|
|
45
62
|
export declare function defineAgent(config: AgentConfig): AgentDefinition;
|
|
46
63
|
/** True only for values produced by `defineAgent`. */
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ConfigExtension } from "../config/index.ts";
|
|
2
|
+
/** Everything one spawn needs to turn declarations into `-e` arguments. */
|
|
3
|
+
export interface SpawnExtensionRequest {
|
|
4
|
+
/** Effective Config entries in merge order: global → project → run (spec rule 3). */
|
|
5
|
+
readonly configExtensions: readonly ConfigExtension[];
|
|
6
|
+
/** `SpawnOptions.extensions`, resolved against the program file as before. */
|
|
7
|
+
readonly declared?: readonly string[] | undefined;
|
|
8
|
+
/** False when the spawn or its definition opted out (spec rule 7). */
|
|
9
|
+
readonly useConfigExtensions: boolean;
|
|
10
|
+
/** Orchestration Program source path, the base of a relative spawn declaration. */
|
|
11
|
+
readonly programFile?: string | undefined;
|
|
12
|
+
/** Agent working directory, the project install root for `npm:`/`git:`. */
|
|
13
|
+
readonly projectRoot: string;
|
|
14
|
+
}
|
|
15
|
+
/** The two projections of one Agent's extensions: what launches, and what identifies. */
|
|
16
|
+
export interface SpawnExtensions {
|
|
17
|
+
/** Absolute launch-ready `-e` arguments, deduplicated, in final order. */
|
|
18
|
+
readonly resolvedPaths: readonly string[];
|
|
19
|
+
/** The surviving declarations behind them, same order, unresolved (ADR-0040). */
|
|
20
|
+
readonly declared: readonly string[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Resolves the extensions of one Agent: config-sourced first, spawn-declared
|
|
24
|
+
* last, deduplicated by resolved path with the first occurrence keeping its
|
|
25
|
+
* place. Returns undefined when nothing is declared at all, so an
|
|
26
|
+
* extension-free spawn keeps its request shape.
|
|
27
|
+
*
|
|
28
|
+
* The two bases are deliberately different: a relative *path* from a config
|
|
29
|
+
* file resolves against that file's directory, while an `npm:`/`git:`
|
|
30
|
+
* specifier still installs from the Agent working directory (`projectRoot`).
|
|
31
|
+
* An uninstalled specifier passes through verbatim and dedups by its literal
|
|
32
|
+
* string.
|
|
33
|
+
*
|
|
34
|
+
* A declaration joins `declared` only when it contributed at least one new
|
|
35
|
+
* resolved path, so the identity list describes what actually ran. Two
|
|
36
|
+
* different declarations that resolve to the same path therefore keep only the
|
|
37
|
+
* first, which is machine-dependent by nature of the resolution itself.
|
|
38
|
+
*/
|
|
39
|
+
export declare function resolveSpawnExtensions(request: SpawnExtensionRequest): Promise<SpawnExtensions | undefined>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ModelSelection } from "../model/index.ts";
|
|
2
|
+
import type { OpenOptions } from "../transport/index.ts";
|
|
3
|
+
import type { ResolvedSpawnOptions, SpawnOptions } from "../types.ts";
|
|
4
|
+
/** Everything one spawn needs to build its open request, before a model settles. */
|
|
5
|
+
export interface OpenRequestOptions {
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly cwd: string;
|
|
8
|
+
readonly spawnOptions: SpawnOptions;
|
|
9
|
+
readonly resolvedExtensionPaths?: readonly string[];
|
|
10
|
+
readonly declaredExtensions?: readonly string[];
|
|
11
|
+
readonly sessionDir: string | undefined;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Builds one spawn's open request from its options.
|
|
15
|
+
*
|
|
16
|
+
* A caller that has not settled a model yet passes the declared options: the
|
|
17
|
+
* request then carries a literal `model`/`thinking` and carries none for an
|
|
18
|
+
* array or resolver spec. That request is what a Cassette-backed factory peeks
|
|
19
|
+
* at, which is why the resume peek blanks model and thinking before it compares
|
|
20
|
+
* the request with the recorded spawn (ADR-0039).
|
|
21
|
+
*/
|
|
22
|
+
export declare function openRequest(options: OpenRequestOptions): OpenOptions;
|
|
23
|
+
/** Replaces the caller's `model`/`thinking` forms with one attempt's settled selection. */
|
|
24
|
+
export declare function withSelection(options: SpawnOptions, selection: ModelSelection): ResolvedSpawnOptions;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ConfigExtension } from "../config/index.ts";
|
|
1
2
|
import type { EventSink } from "../events.ts";
|
|
2
3
|
import type { RunContext } from "../run/index.ts";
|
|
3
4
|
import type { TransportFactory } from "../transport/index.ts";
|
|
@@ -9,6 +10,8 @@ export interface SpawnDependencies {
|
|
|
9
10
|
readonly emit: EventSink;
|
|
10
11
|
readonly sessionDir: string | undefined;
|
|
11
12
|
readonly programFile: string | undefined;
|
|
13
|
+
/** Effective Config entries, in merge order; empty when the Run has no config. */
|
|
14
|
+
readonly configExtensions: readonly ConfigExtension[];
|
|
12
15
|
}
|
|
13
16
|
/** A RunContext spawn function that can synchronously stop accepting new Agents. */
|
|
14
17
|
export interface SpawnGate {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AgentActivity, AskOutputChannel, EventSink } from "../events.ts";
|
|
2
|
+
import type { ModelFallback } from "../model/index.ts";
|
|
2
3
|
import type { NodeSnapshot } from "../node/index.ts";
|
|
3
4
|
import type { SettlementCause } from "./stall-watchdog.ts";
|
|
4
5
|
/** What one finished Ask reports in its `ask_end` Lifecycle Event. */
|
|
@@ -9,7 +10,10 @@ export interface AskEndOutcome {
|
|
|
9
10
|
readonly maxFrameGapMs: number | undefined;
|
|
10
11
|
readonly cause?: SettlementCause;
|
|
11
12
|
}
|
|
12
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Emits the Ask-scoped Lifecycle Events for one exchange, plus the Agent-scoped
|
|
15
|
+
* `model_fallback` this exchange's fallback loop reports.
|
|
16
|
+
*/
|
|
13
17
|
export declare class AskEvents {
|
|
14
18
|
#private;
|
|
15
19
|
constructor(emit: EventSink, agent: string, index: number);
|
|
@@ -18,6 +22,8 @@ export declare class AskEvents {
|
|
|
18
22
|
output: (channel: AskOutputChannel, text: string) => void;
|
|
19
23
|
/** Composes the Nested Node path from this Ask's identity, then reports it. */
|
|
20
24
|
node: (snapshot: NodeSnapshot) => void;
|
|
25
|
+
/** Not Ask-scoped: a fallback names the Agent only, like the spawn-time loop. */
|
|
26
|
+
fallback: (fallback: ModelFallback) => void;
|
|
21
27
|
/** A `normal` cause is the absent default, so ordinary settlements stay lean. */
|
|
22
28
|
end(outcome: AskEndOutcome): void;
|
|
23
29
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ReportResultTool } from "../ask-contract/index.ts";
|
|
2
2
|
import type { EventSink } from "../events.ts";
|
|
3
|
+
import type { ModelErrorHistory, ModelResolution } from "../model/index.ts";
|
|
3
4
|
import type { AgentTransport, Connection, Frame } from "../transport/index.ts";
|
|
4
5
|
import type { ResolvedSpawnOptions } from "../types.ts";
|
|
5
6
|
import type { EffectiveAskOptions } from "./ask-hash.ts";
|
|
@@ -7,6 +8,15 @@ import type { EffectiveAskOptions } from "./ask-hash.ts";
|
|
|
7
8
|
export interface FrameObserver {
|
|
8
9
|
observe(frame: Frame): void;
|
|
9
10
|
}
|
|
11
|
+
/** Mid-Ask Model Resolution for one Agent, shared with its spawn-time loop. */
|
|
12
|
+
export interface AskModelFallback {
|
|
13
|
+
readonly resolution: ModelResolution;
|
|
14
|
+
readonly history: ModelErrorHistory;
|
|
15
|
+
/** The model candidate the Agent runs right now; a failure is attributed to it. */
|
|
16
|
+
currentModel(): string;
|
|
17
|
+
/** Reports the candidate a successful swap applied, and the model pi now reports. */
|
|
18
|
+
onSwapped(candidate: string, reportedModel: string): void;
|
|
19
|
+
}
|
|
10
20
|
/** Options that connect one Ask exchange to its Agent's identity and event stream. */
|
|
11
21
|
export interface AskExchangeOptions {
|
|
12
22
|
readonly agent: string;
|
|
@@ -23,6 +33,8 @@ export interface AskExchangeOptions {
|
|
|
23
33
|
readonly emit: EventSink;
|
|
24
34
|
/** The Agent's persistent usage accumulator; fed frames only during live Asks. */
|
|
25
35
|
readonly usage: FrameObserver;
|
|
36
|
+
/** Mid-Ask Model Resolution; absent when this Agent's spawn named no candidate. */
|
|
37
|
+
readonly modelFallback: AskModelFallback | undefined;
|
|
26
38
|
/** Kills the Agent on ASK_TIMEOUT and destructive stalls — the one upward capability. */
|
|
27
39
|
readonly close: () => void;
|
|
28
40
|
/** Test-only override for the fixed duration-limit grace. */
|
|
@@ -3,5 +3,6 @@
|
|
|
3
3
|
* Files inside this directory import each other directly.
|
|
4
4
|
*/
|
|
5
5
|
export { exchangeAsk } from "./ask-exchange.ts";
|
|
6
|
+
export type { AskModelFallback } from "./ask-exchange-options.ts";
|
|
6
7
|
export { askHash, askMarkerContext, type EffectiveAskOptions } from "./ask-hash.ts";
|
|
7
8
|
export type { SettlementCause } from "./stall-watchdog.ts";
|
|
@@ -30,6 +30,7 @@ export declare const CassetteSchema: Type.TObject<{
|
|
|
30
30
|
name: Type.TString;
|
|
31
31
|
cwd: Type.TString;
|
|
32
32
|
worktree: Type.TOptional<Type.TLiteral<true>>;
|
|
33
|
+
declaredExtensions: Type.TOptional<Type.TArray<Type.TString>>;
|
|
33
34
|
}>;
|
|
34
35
|
model: Type.TString;
|
|
35
36
|
sessionFile: Type.TOptional<Type.TString>;
|
|
@@ -67,6 +67,11 @@ export interface CassetteSpawn {
|
|
|
67
67
|
readonly disallowedSkills?: readonly string[];
|
|
68
68
|
/** Deterministic request, present only when the Agent requested a worktree. */
|
|
69
69
|
readonly worktree?: true;
|
|
70
|
+
/**
|
|
71
|
+
* Declared extensions in declaration order, unresolved so a Cassette matches
|
|
72
|
+
* across machines (ADR-0040). Absent when the Agent ran no extension.
|
|
73
|
+
*/
|
|
74
|
+
readonly declaredExtensions?: readonly string[];
|
|
70
75
|
}
|
|
71
76
|
/** The frames attributed to one Ask marker. */
|
|
72
77
|
export interface CassetteAsk {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AskMarker, OpenOptions } from "../transport/index.ts";
|
|
2
|
-
import type { CassetteAgent } from "./cassette.ts";
|
|
1
|
+
import type { AskMarker, OpenOptions, RecordedSpawnSelection } from "../transport/index.ts";
|
|
2
|
+
import type { CassetteAgent, CassetteSpawn } from "./cassette.ts";
|
|
3
3
|
/** A pure description of the first strict replay identity mismatch. */
|
|
4
4
|
export interface ReplayMismatch {
|
|
5
5
|
readonly kind: "unexpected-spawn" | "spawn-options" | "changed-ask" | "extra-ask";
|
|
@@ -17,3 +17,11 @@ export declare const replayMismatch: {
|
|
|
17
17
|
};
|
|
18
18
|
/** Converts a detected mismatch into strict replay's public failure. */
|
|
19
19
|
export declare function strictReplay(mismatch: ReplayMismatch): never;
|
|
20
|
+
/**
|
|
21
|
+
* True when a live spawn matches the recorded one on every identity field
|
|
22
|
+
* except the resolved model and thinking, so a resume may adopt the recorded
|
|
23
|
+
* selection instead of re-running Model Resolution (ADR-0039).
|
|
24
|
+
*/
|
|
25
|
+
export declare function spawnMatchesExceptModel(expected: CassetteSpawn, actual: OpenOptions): boolean;
|
|
26
|
+
/** The recorded resolved selection of one Agent, or `undefined` when none is recorded. */
|
|
27
|
+
export declare function recordedSpawnSelection(agent: CassetteAgent | null): RecordedSpawnSelection | undefined;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type YaagConfigDocument } from "./config-schema.ts";
|
|
2
|
+
/** One config file that contributed to the Effective Config. */
|
|
3
|
+
export interface ConfigLayer {
|
|
4
|
+
/** The file this layer was read from. */
|
|
5
|
+
readonly file: string;
|
|
6
|
+
/** The file's own directory: relative paths inside it resolve here (spec rule 4). */
|
|
7
|
+
readonly directory: string;
|
|
8
|
+
readonly document: YaagConfigDocument;
|
|
9
|
+
}
|
|
10
|
+
/** Whether an absent file is an empty layer or a Run-start failure. */
|
|
11
|
+
export interface ReadConfigOptions {
|
|
12
|
+
/** True for the explicit Run Config: a missing file is then an error. */
|
|
13
|
+
readonly required: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Reads, parses, and validates one config layer.
|
|
17
|
+
*
|
|
18
|
+
* A missing file at a discovered location yields `undefined` (an empty layer);
|
|
19
|
+
* a missing explicit Run Config fails. Any other errno — `EACCES`, say — always
|
|
20
|
+
* throws: a config yaag cannot read is not an empty config.
|
|
21
|
+
*/
|
|
22
|
+
export declare function readConfigLayer(path: string, options: ReadConfigOptions): Promise<ConfigLayer | undefined>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TLocalizedValidationError } from "typebox/error";
|
|
2
|
+
/**
|
|
3
|
+
* Turns TypeBox errors into config diagnostics that name the offending key
|
|
4
|
+
* (spec rule 2).
|
|
5
|
+
*
|
|
6
|
+
* A strict object reports an unknown key twice: once at the key itself with the
|
|
7
|
+
* unhelpful `"schema is false"`, and once at the owning object carrying the key
|
|
8
|
+
* name. Neither alone reads well, so the pair collapses into one line. Every
|
|
9
|
+
* other keyword delegates to the shared formatter, which stays untouched
|
|
10
|
+
* because args validation and ADR-0032 steering text depend on its wording.
|
|
11
|
+
*/
|
|
12
|
+
export declare function describeConfigIssues(value: unknown, errors: Iterable<TLocalizedValidationError>): readonly string[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The part of the environment this module reads. It is structural on purpose:
|
|
3
|
+
* the vendored declaration tree compiles with no ambient Node globals.
|
|
4
|
+
*/
|
|
5
|
+
export interface ConfigEnvironment {
|
|
6
|
+
readonly [name: string]: string | undefined;
|
|
7
|
+
}
|
|
8
|
+
/** Every config layer lives in a file with this name. */
|
|
9
|
+
export declare const CONFIG_FILE_NAME = "config.json";
|
|
10
|
+
/** The Project Config directory inside a Program Directory. */
|
|
11
|
+
export declare const PROJECT_CONFIG_DIR = ".yaag";
|
|
12
|
+
/**
|
|
13
|
+
* Resolves the Global Config path: `YAAG_CONFIG_DIR`, then an absolute
|
|
14
|
+
* `XDG_CONFIG_HOME`, then `$HOME/.config`. A relative `XDG_CONFIG_HOME` is
|
|
15
|
+
* ignored (XDG spec), exactly as in `resolveCheckpointDirectory`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function resolveGlobalConfigPath(env?: ConfigEnvironment): string;
|
|
18
|
+
/**
|
|
19
|
+
* Resolves the Project Config path under a Program Directory. The Program
|
|
20
|
+
* Directory is an input: this module never walks upward looking for `.yaag/`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function projectConfigPath(programDirectory: string): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Static, Type } from "typebox";
|
|
2
|
+
/**
|
|
3
|
+
* The config document of one layer (spec rule 1): plain JSON, namespaced as
|
|
4
|
+
* `{ "agents": { "extensions": ["..."] } }`.
|
|
5
|
+
*
|
|
6
|
+
* Every node sets `additionalProperties: false` on purpose (spec rule 2) — the
|
|
7
|
+
* opposite choice from `cassette-schema.ts`, which tolerates unknown fields so
|
|
8
|
+
* a newer artifact still loads. A config file is hand-written, so an unknown
|
|
9
|
+
* key is a typo the author wants named, not forward compatibility.
|
|
10
|
+
*/
|
|
11
|
+
export declare const YaagConfigSchema: Type.TObject<{
|
|
12
|
+
agents: Type.TOptional<Type.TObject<{
|
|
13
|
+
extensions: Type.TOptional<Type.TArray<Type.TString>>;
|
|
14
|
+
}>>;
|
|
15
|
+
}>;
|
|
16
|
+
/** The validated shape of one config file. */
|
|
17
|
+
export type YaagConfigDocument = Static<typeof YaagConfigSchema>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type ConfigEnvironment } from "./config-paths.ts";
|
|
2
|
+
/** Which of the three layers a config value came from. */
|
|
3
|
+
export type ConfigLayerName = "global" | "project" | "run";
|
|
4
|
+
/** One extension declaration, kept exactly as written, with its resolution base. */
|
|
5
|
+
export interface ConfigExtension {
|
|
6
|
+
/** The declaration as written in the config file; never resolved here. */
|
|
7
|
+
readonly declaration: string;
|
|
8
|
+
/** The declaring config file's own directory (spec rule 4). */
|
|
9
|
+
readonly baseDirectory: string;
|
|
10
|
+
readonly layer: ConfigLayerName;
|
|
11
|
+
/** The declaring file, for diagnostics. */
|
|
12
|
+
readonly file: string;
|
|
13
|
+
}
|
|
14
|
+
/** The merged configuration one Run reads at start. */
|
|
15
|
+
export interface EffectiveConfig {
|
|
16
|
+
/** Extension declarations, concatenated global → project → run (spec rule 3). */
|
|
17
|
+
readonly extensions: readonly ConfigExtension[];
|
|
18
|
+
/** Config files that contributed, in merge order. */
|
|
19
|
+
readonly files: readonly string[];
|
|
20
|
+
}
|
|
21
|
+
/** What to discover and read. */
|
|
22
|
+
export interface EffectiveConfigRequest {
|
|
23
|
+
/** Environment for Global Config discovery; defaults to `process.env`. */
|
|
24
|
+
readonly env?: ConfigEnvironment;
|
|
25
|
+
/** Program Directory of the Run; absent means no Project Config layer. */
|
|
26
|
+
readonly programDirectory?: string;
|
|
27
|
+
/** Explicit Run Config path; a missing file here is an error. */
|
|
28
|
+
readonly configPath?: string;
|
|
29
|
+
/** Suppresses the discovered layers only; an explicit `configPath` survives (spec rule 8). */
|
|
30
|
+
readonly noConfig?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/** The Effective Config of a Run that found no config at all. */
|
|
33
|
+
export declare const EMPTY_EFFECTIVE_CONFIG: EffectiveConfig;
|
|
34
|
+
/**
|
|
35
|
+
* Locates, reads, validates, and merges the three config layers.
|
|
36
|
+
*
|
|
37
|
+
* The result is frozen: the Effective Config is read once at Run start, so a
|
|
38
|
+
* config edit mid-Run changes nothing until the next Run (spec rule 6). Nothing
|
|
39
|
+
* is resolved, existence-checked, or deduplicated here — dedup happens by
|
|
40
|
+
* resolved path once the spawn knows its base directories (ADR-0040).
|
|
41
|
+
*/
|
|
42
|
+
export declare function loadEffectiveConfig(request?: EffectiveConfigRequest): Promise<EffectiveConfig>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public surface of the `config/` module: the Global, Project, and Run Config
|
|
3
|
+
* layers and the frozen Effective Config a Run reads at start (ADR-0040).
|
|
4
|
+
* Files inside this directory import each other directly.
|
|
5
|
+
*/
|
|
6
|
+
export { CONFIG_FILE_NAME, type ConfigEnvironment, PROJECT_CONFIG_DIR, projectConfigPath, resolveGlobalConfigPath, } from "./config-paths.ts";
|
|
7
|
+
export type { YaagConfigDocument } from "./config-schema.ts";
|
|
8
|
+
export { type ConfigExtension, type ConfigLayerName, type EffectiveConfig, type EffectiveConfigRequest, EMPTY_EFFECTIVE_CONFIG, loadEffectiveConfig, } from "./effective-config.ts";
|
|
@@ -5,7 +5,9 @@ export interface AskLimitOutcome {
|
|
|
5
5
|
readonly kind: AskLimitKind;
|
|
6
6
|
readonly count: number;
|
|
7
7
|
}
|
|
8
|
+
import type { ModelError } from "./model/index.ts";
|
|
8
9
|
import type { AgentProgress } from "./transport/index.ts";
|
|
10
|
+
export type { ModelError } from "./model/index.ts";
|
|
9
11
|
export type { AgentProgress } from "./transport/index.ts";
|
|
10
12
|
/** The recorded result when yaag rejects an Ask because no frame arrived within `idleMs`. */
|
|
11
13
|
export interface AskStalledOutcome {
|
|
@@ -23,8 +25,12 @@ export interface AskInvalidOutputOutcome {
|
|
|
23
25
|
/** Final extraction or TypeBox diagnostics, localized to JSON paths. */
|
|
24
26
|
readonly errors: readonly string[];
|
|
25
27
|
}
|
|
28
|
+
/** The recorded history when every model candidate of one Model Resolution loop failed. */
|
|
29
|
+
export interface ModelResolutionOutcome {
|
|
30
|
+
readonly modelErrors: readonly ModelError[];
|
|
31
|
+
}
|
|
26
32
|
/** Why an Ask, spawn, or Run failed. Programs may branch on this; most won't. */
|
|
27
|
-
export type YaagErrorCode = "AGENT_FAILED" | "AGENT_DIED" | "AGENT_BUSY" | "ASK_TIMEOUT" | "ASK_LIMIT" | "ASK_STALLED" | "ASK_INVALID_OUTPUT" | "ARGS_INVALID" | "OPTIONS_CONFLICT" | "REPLAY_DIVERGED" | "RESUME_REFUSED" | "RUN_CLOSED" | "RUN_STOPPED" | "WORKTREE_REFUSED" | "SPAWN_FAILED";
|
|
33
|
+
export type YaagErrorCode = "AGENT_FAILED" | "AGENT_DIED" | "AGENT_BUSY" | "ASK_TIMEOUT" | "ASK_LIMIT" | "ASK_STALLED" | "ASK_INVALID_OUTPUT" | "ARGS_INVALID" | "CONFIG_INVALID" | "OPTIONS_CONFLICT" | "REPLAY_DIVERGED" | "RESUME_REFUSED" | "RUN_CLOSED" | "RUN_STOPPED" | "WORKTREE_REFUSED" | "MODEL_RESOLUTION_FAILED" | "SPAWN_FAILED";
|
|
28
34
|
/** The single error class of the runtime (ADR-0003). */
|
|
29
35
|
export declare class YaagError extends Error {
|
|
30
36
|
readonly code: YaagErrorCode;
|
|
@@ -44,7 +50,13 @@ export declare class YaagError extends Error {
|
|
|
44
50
|
readonly steeringEfforts?: number;
|
|
45
51
|
/** Localized extraction or schema errors, present only for `ASK_INVALID_OUTPUT`. */
|
|
46
52
|
readonly errors?: readonly string[];
|
|
47
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Failed model candidates, present only for `MODEL_RESOLUTION_FAILED`. It
|
|
55
|
+
* holds one entry for each attempt, oldest first. A candidate that already
|
|
56
|
+
* failed with `not_found` or `auth` is refused again (ADR-0037).
|
|
57
|
+
*/
|
|
58
|
+
readonly modelErrors?: readonly ModelError[];
|
|
59
|
+
constructor(code: YaagErrorCode, message: string, agent?: string, options?: AskLimitOutcome | AskStalledOutcome | AskInvalidOutputOutcome | ModelResolutionOutcome);
|
|
48
60
|
}
|
|
49
61
|
/** Builds the runtime's uniform agent-scoped error message. */
|
|
50
62
|
export declare function agentError(agent: string, code: YaagErrorCode, message: string): YaagError;
|
|
@@ -52,5 +64,7 @@ export declare function agentError(agent: string, code: YaagErrorCode, message:
|
|
|
52
64
|
export declare function askLimitError(agent: string, outcome: AskLimitOutcome): YaagError;
|
|
53
65
|
/** The ASK_STALLED rejection for one tripped idle watch. */
|
|
54
66
|
export declare function askStalledError(agent: string, outcome: AskStalledOutcome): YaagError;
|
|
67
|
+
/** The MODEL_RESOLUTION_FAILED rejection for an exhausted or self-repeating resolver. */
|
|
68
|
+
export declare function modelResolutionError(agent: string, errors: readonly ModelError[], refusedCandidate?: string): YaagError;
|
|
55
69
|
/** Narrows an unknown rejection reason to a YaagError. */
|
|
56
70
|
export declare function isYaagError(value: unknown): value is YaagError;
|
|
@@ -7,8 +7,10 @@
|
|
|
7
7
|
* dedicated fd arrives with the extension.
|
|
8
8
|
*/
|
|
9
9
|
import type { SettlementCause } from "./ask/index.ts";
|
|
10
|
+
import type { ModelErrorReason } from "./model/index.ts";
|
|
10
11
|
import type { TokenBreakdown, WorktreeResolution } from "./transport/index.ts";
|
|
11
12
|
export type { SettlementCause } from "./ask/index.ts";
|
|
13
|
+
export type { ModelErrorReason } from "./model/index.ts";
|
|
12
14
|
/**
|
|
13
15
|
* A Run's outcome (ADR-0022). `paused` arrives with the pause slice.
|
|
14
16
|
* `interrupted` is not terminal: only an in-flight Checkpoint carries it, and a
|
|
@@ -112,6 +114,22 @@ export type LifecycleEventBody = {
|
|
|
112
114
|
* Watchdog settled it from observed state, so its usage is an undercount.
|
|
113
115
|
*/
|
|
114
116
|
readonly cause?: SettlementCause;
|
|
117
|
+
} | {
|
|
118
|
+
/**
|
|
119
|
+
* One failed Model Resolution attempt and the candidate that replaced it.
|
|
120
|
+
* yaag emits it at spawn time and inside an Ask (ADR-0037, ADR-0038).
|
|
121
|
+
* A resolver that gives up emits none: the Run fails with
|
|
122
|
+
* MODEL_RESOLUTION_FAILED, which already carries the full history.
|
|
123
|
+
*/
|
|
124
|
+
readonly type: "model_fallback";
|
|
125
|
+
readonly agent: string;
|
|
126
|
+
/** The candidate pattern that failed, after inline-suffix stripping. */
|
|
127
|
+
readonly failedModel: string;
|
|
128
|
+
readonly reason: ModelErrorReason;
|
|
129
|
+
/** 0-based index of the failed attempt, as the resolver's history numbers it. */
|
|
130
|
+
readonly attempt: number;
|
|
131
|
+
/** The candidate resolution picked next. */
|
|
132
|
+
readonly resolvedModel: string;
|
|
115
133
|
} | {
|
|
116
134
|
readonly type: "agent_usage";
|
|
117
135
|
readonly agent: string;
|
|
@@ -3,14 +3,22 @@ import { type ExtensionInstallRoots } from "./extension-package.ts";
|
|
|
3
3
|
export interface ExtensionResolutionOptions extends ExtensionInstallRoots {
|
|
4
4
|
/** Orchestration Program source path, required by relative declarations. */
|
|
5
5
|
readonly programFile?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Directory a relative declaration resolves against, and which wins over
|
|
8
|
+
* `programFile`: a config-sourced entry resolves from its own config file's
|
|
9
|
+
* directory (ADR-0040, spec rule 4).
|
|
10
|
+
*/
|
|
11
|
+
readonly baseDirectory?: string;
|
|
6
12
|
}
|
|
7
13
|
/**
|
|
8
14
|
* Resolves declared extensions into launch-ready `pi -e` arguments before transport opening.
|
|
9
15
|
*
|
|
10
|
-
* Filesystem declarations are resolved against
|
|
16
|
+
* Filesystem declarations are resolved against `baseDirectory` when given, and against
|
|
17
|
+
* the Orchestration Program directory otherwise, and are
|
|
11
18
|
* checked for existence. `npm:`/`git:` specifiers expand to the entry points of the
|
|
12
19
|
* already-installed package (project install shadows the user install); an uninstalled
|
|
13
20
|
* specifier passes through verbatim so pi temp-installs it. Results retain declaration
|
|
14
|
-
* order. Rejects missing paths and a relative declaration
|
|
21
|
+
* order. Rejects missing paths, and a relative declaration that has neither
|
|
22
|
+
* `baseDirectory` nor `programFile`.
|
|
15
23
|
*/
|
|
16
24
|
export declare function resolveExtensionPaths(declarations: readonly string[], options?: ExtensionResolutionOptions): Promise<readonly string[]>;
|
|
@@ -2,7 +2,9 @@ export type { AgentConfig, AgentDefinition } from "./agent/index.ts";
|
|
|
2
2
|
export { agentDefinitionConfig, defineAgent, isAgentDefinition } from "./agent/index.ts";
|
|
3
3
|
export type { Cassette, CassetteAgent, CassetteArtifact, CassetteAsk, CassetteGit, CassetteRun, CassetteSink, CassetteSpawn, } from "./cassette/index.ts";
|
|
4
4
|
export { assertReplayable, CASSETTE_VERSION, loadCassette, recordingTransport, replayTransport, resumeTransport, } from "./cassette/index.ts";
|
|
5
|
-
export type {
|
|
5
|
+
export type { ConfigEnvironment, ConfigExtension, ConfigLayerName, EffectiveConfig, EffectiveConfigRequest, } from "./config/index.ts";
|
|
6
|
+
export { EMPTY_EFFECTIVE_CONFIG, loadEffectiveConfig, PROJECT_CONFIG_DIR, } from "./config/index.ts";
|
|
7
|
+
export type { AskInvalidOutputOutcome, AskLimitKind, AskLimitOutcome, AskStalledOutcome, ModelResolutionOutcome, YaagErrorCode, } from "./errors.ts";
|
|
6
8
|
export { isYaagError, YaagError } from "./errors.ts";
|
|
7
9
|
export type { AgentActivity, AskOutputChannel, EventSink, LifecycleEvent, LifecycleEventBody, NodeState, NodeUsage, StampedEventSink, } from "./events.ts";
|
|
8
10
|
export type { ModelError, ModelErrorReason, ModelResolver, ModelSelection, ModelSpec, ThinkingResolver, ThinkingSpec, } from "./model/index.ts";
|
|
@@ -11,7 +13,7 @@ export { agentAskPath, childPath, DEFAULT_NODE_DECODERS, NodeTracker, sanitizeNo
|
|
|
11
13
|
export { prompt, promptGist } from "./prompt/index.ts";
|
|
12
14
|
export type { OrchestrationProgram, ProgramDefinition, RunContext, RunOptions, } from "./run/index.ts";
|
|
13
15
|
export { defineRun, executeRun, isOrchestrationProgram, programDefinition } from "./run/index.ts";
|
|
14
|
-
export type { AgentInfo, AgentState, AskingAgentInfo, EndedRunSummary, ExitedAgentInfo, IdleAgentInfo, NodeInfo, RunningRunSummary, RunOutcome, RunState, RunSummary, } from "./summary/index.ts";
|
|
16
|
+
export type { AgentInfo, AgentState, AskingAgentInfo, EndedRunSummary, ExitedAgentInfo, IdleAgentInfo, ModelFallbackInfo, NodeInfo, RunningRunSummary, RunOutcome, RunState, RunSummary, } from "./summary/index.ts";
|
|
15
17
|
export { applyEvent, initialSummary } from "./summary/index.ts";
|
|
16
18
|
export type { AgentStats, AgentTransport, AskMarker, AskMarkerContext, AskPlayback, DiscoveredSkill, Frame, ReapPath, ReapTarget, SkillProbeFactory, TokenBreakdown, TransportFactory, TransportStartup, TransportStartupObserver, WorktreeResolution, } from "./transport/index.ts";
|
|
17
19
|
export { readSystemPromptSidecar, reap, worktreeTransport } from "./transport/index.ts";
|
|
@@ -2,5 +2,12 @@
|
|
|
2
2
|
* Public surface of the `model/` module: model resolution.
|
|
3
3
|
* Files inside this directory import each other directly.
|
|
4
4
|
*/
|
|
5
|
-
export {
|
|
5
|
+
export { ModelErrorHistory } from "./model-error-history.ts";
|
|
6
|
+
export { classifyAskFailure, classifyModelFailure } from "./model-failure.ts";
|
|
7
|
+
export type { ModelFallback, ModelFallbackSink } from "./model-fallback.ts";
|
|
8
|
+
export type { AvailableModel } from "./model-match.ts";
|
|
9
|
+
export { type ModelError, type ModelErrorReason, type ModelResolution, type ModelResolver, type ModelSelection, type ModelSpec, normalizeModelResolution, type ThinkingResolver, type ThinkingSpec, } from "./model-resolution.ts";
|
|
10
|
+
export { type ModelSwapResult, swapModel } from "./model-swap.ts";
|
|
11
|
+
export { type RecordedResolution, type RecordedResolutionOptions, type RecordedSpawnSelection, resolveRecordedModel, } from "./recorded-resolution.ts";
|
|
12
|
+
export { type FallbackLoopOptions, type ResolutionLoopOptions, resolveModel, retryOnModelFailure, } from "./resolution-loop.ts";
|
|
6
13
|
export type { ThinkingLevel } from "./thinking-level.ts";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ModelError, ModelErrorReason } from "./model-resolution.ts";
|
|
2
|
+
/**
|
|
3
|
+
* The Model Resolution attempt history of one Agent.
|
|
4
|
+
*
|
|
5
|
+
* The spawn-time loop and every mid-Ask fallback loop of the same Agent share
|
|
6
|
+
* one history, so a resolver sees every candidate that already failed, whenever
|
|
7
|
+
* it failed.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ModelErrorHistory {
|
|
10
|
+
#private;
|
|
11
|
+
/** Every failed attempt so far, oldest first. */
|
|
12
|
+
get errors(): readonly ModelError[];
|
|
13
|
+
/**
|
|
14
|
+
* Appends one failed attempt and returns it; the attempt number is the
|
|
15
|
+
* history length before the push.
|
|
16
|
+
*/
|
|
17
|
+
record(reason: ModelErrorReason, failedModel: string): ModelError;
|
|
18
|
+
/** True when this candidate already failed for a reason a retry cannot fix. */
|
|
19
|
+
failedPermanently(candidate: string): boolean;
|
|
20
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ModelErrorReason } from "./model-resolution.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Classifies a spawn or Ask failure into a Model Resolution trigger, or
|
|
4
|
+
* `undefined` for a generic failure that must stay an ordinary failure.
|
|
5
|
+
*
|
|
6
|
+
* Evaluation order is `not_found` → `auth` → `rate_limited`, first match wins:
|
|
7
|
+
* a "model not found" diagnostic may also mention API keys in its help text, so
|
|
8
|
+
* the most specific table has to be consulted first.
|
|
9
|
+
*/
|
|
10
|
+
export declare function classifyModelFailure(error: unknown): ModelErrorReason | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Classifies one Ask rejection into a Model Resolution trigger.
|
|
13
|
+
*
|
|
14
|
+
* Only AGENT_FAILED can be a trigger: ASK_STALLED is generic and never enters
|
|
15
|
+
* resolution (ADR-0029), ASK_LIMIT/ASK_TIMEOUT/ASK_INVALID_OUTPUT are yaag's own
|
|
16
|
+
* verdicts, and AGENT_DIED leaves nothing to swap a model on.
|
|
17
|
+
*/
|
|
18
|
+
export declare function classifyAskFailure(error: unknown): ModelErrorReason | undefined;
|