@yaag/extension 0.8.0 → 0.8.1
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/docs/cli.md
CHANGED
|
@@ -40,6 +40,9 @@ Warning: describe imports the module and executes its top level. Keep program mo
|
|
|
40
40
|
A bad invocation prints this usage text on stderr and exits with code 2. Those
|
|
41
41
|
argv errors have no troubleshooting entry: the usage text is the fix.
|
|
42
42
|
|
|
43
|
+
The `--config` and `--no-config` flags select the config layers of a Run. See
|
|
44
|
+
[Configuration](configuration.md#locations).
|
|
45
|
+
|
|
43
46
|
## Tools
|
|
44
47
|
|
|
45
48
|
### yaag_run
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Configuration
|
|
2
|
+
|
|
3
|
+
yaag reads up to three config files at the start of a Run. Their merged
|
|
4
|
+
content is the configuration of that Run. yaag reads them one time, at Run
|
|
5
|
+
start. A config edit during a Run changes nothing until the next Run.
|
|
6
|
+
|
|
7
|
+
## Locations
|
|
8
|
+
|
|
9
|
+
| Layer | Location |
|
|
10
|
+
|---|---|
|
|
11
|
+
| Global | `$YAAG_CONFIG_DIR/config.json` when `YAAG_CONFIG_DIR` is set. Else `$XDG_CONFIG_HOME/yaag/config.json` when `XDG_CONFIG_HOME` is an absolute path. Else `~/.config/yaag/config.json`. |
|
|
12
|
+
| Project | `.yaag/config.json` in the Program Directory of the Run. |
|
|
13
|
+
| Run | The file that `yaag run --config <file>` or the `config` option of the `yaag_run` tool gives. Give it one time only. |
|
|
14
|
+
|
|
15
|
+
The Program Directory is the nearest directory that contains `.yaag/`. yaag
|
|
16
|
+
searches upward from the directory of the program file. For an Inline Program,
|
|
17
|
+
the search starts in the working directory.
|
|
18
|
+
|
|
19
|
+
A global or project file that does not exist is an empty layer. A `--config`
|
|
20
|
+
file that does not exist stops the Run at the start.
|
|
21
|
+
|
|
22
|
+
## Supported fields
|
|
23
|
+
|
|
24
|
+
A config file is plain JSON. [`examples/config.json`](examples/config.json)
|
|
25
|
+
shows the full surface:
|
|
26
|
+
|
|
27
|
+
<!-- embed: docs/examples/config.json -->
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"agents": {
|
|
32
|
+
"extensions": ["./extensions/team-conventions.ts", "npm:@acme/pi-guardrails"]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
| Field | Type | Effect |
|
|
38
|
+
|---|---|---|
|
|
39
|
+
| `agents.extensions` | array of strings | Extensions that every Agent of the Run loads, as extra `pi -e` arguments. |
|
|
40
|
+
|
|
41
|
+
An entry is an extension path or an `npm:`/`git:` specifier. A relative path
|
|
42
|
+
resolves against the directory of the config file that declares it. An `npm:`
|
|
43
|
+
or `git:` specifier installs from the Agent working directory.
|
|
44
|
+
|
|
45
|
+
Validation is strict. An unknown key, or a value with a wrong type, stops the
|
|
46
|
+
Run at the start.
|
|
47
|
+
|
|
48
|
+
## How the layers merge
|
|
49
|
+
|
|
50
|
+
The extension lists concatenate in this order: global, then project, then run,
|
|
51
|
+
then the `extensions` of the spawn call itself. yaag removes duplicates by
|
|
52
|
+
resolved path. The first occurrence keeps its place. The merged list loads on
|
|
53
|
+
top of the extensions a spawn call declares — a config never removes one.
|
|
54
|
+
|
|
55
|
+
## Opt out
|
|
56
|
+
|
|
57
|
+
`--no-config` (CLI) or `noConfig: true` (tool) makes the Run ignore the global
|
|
58
|
+
config and the project config. It does not ignore an explicit `--config` file.
|
|
59
|
+
Thus `--no-config --config ./one.json` gives the Run one known config file.
|
|
60
|
+
|
|
61
|
+
`configExtensions: false` on one spawn call or one Agent Definition opts that
|
|
62
|
+
one Agent out. The Agent then loads only the extensions its own call declares:
|
|
63
|
+
|
|
64
|
+
<!-- embed: @yaag/runtime/src/types.ts -->
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
/**
|
|
68
|
+
* Load the Effective Config's `agents.extensions` for this Agent. Default
|
|
69
|
+
* true; false spawns with only the extensions this call declares (ADR-0040).
|
|
70
|
+
*/
|
|
71
|
+
readonly configExtensions?: boolean;
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Errors
|
|
75
|
+
|
|
76
|
+
A config file that yaag cannot read or parse, or that fails validation, stops
|
|
77
|
+
the Run at the start with exit code 1. The message names the file. See
|
|
78
|
+
[A config file is missing or invalid](troubleshooting.md#a-config-file-is-missing-or-invalid).
|
|
79
|
+
|
|
80
|
+
## Record and resume
|
|
81
|
+
|
|
82
|
+
The Run record stores the `--config` path, never the file content. A
|
|
83
|
+
`yaag_run` call that gives `resume` alone reads the stored path again, and
|
|
84
|
+
yaag reads every layer again at that moment. An extension list that changed
|
|
85
|
+
since the recording is a Divergence at the first spawn it changes: a strict
|
|
86
|
+
replay stops there, and a resume goes live there. See
|
|
87
|
+
[Replay or resume mismatch](troubleshooting.md#replay-or-resume-mismatch).
|
package/docs/getting-started.md
CHANGED
|
@@ -50,4 +50,5 @@ argument schema of the program.
|
|
|
50
50
|
- [Authoring](authoring.md) — how to write a program.
|
|
51
51
|
- [Examples](examples.md) — five programs, from minimal to record and resume.
|
|
52
52
|
- [CLI reference](cli.md) — every flag and every tool parameter.
|
|
53
|
+
- [Configuration](configuration.md#locations) — the three config files a Run reads.
|
|
53
54
|
- [Troubleshooting](troubleshooting.md) — the errors you can meet.
|
package/docs/troubleshooting.md
CHANGED
|
@@ -126,7 +126,8 @@ file at the start of a Run. A `--config` file that is not there, or any config
|
|
|
126
126
|
file that yaag cannot read or parse, stops the Run at the start (exit 1).
|
|
127
127
|
|
|
128
128
|
Fix: correct the path or the file. Give `--no-config` to ignore the global
|
|
129
|
-
config and the project config.
|
|
129
|
+
config and the project config. [Configuration](configuration.md#locations)
|
|
130
|
+
names the three locations and the supported fields.
|
|
130
131
|
|
|
131
132
|
Plain usage errors of the CLI exit with code 2 and print the usage text. See
|
|
132
133
|
[the CLI reference](cli.md#usage).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yaag/extension",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@earendil-works/pi-tui": "^0.84.0",
|
|
28
|
-
"@yaag/cli": "0.8.
|
|
29
|
-
"@yaag/runtime": "0.8.
|
|
30
|
-
"@yaag/tui": "0.8.
|
|
28
|
+
"@yaag/cli": "0.8.1",
|
|
29
|
+
"@yaag/runtime": "0.8.1",
|
|
30
|
+
"@yaag/tui": "0.8.1",
|
|
31
31
|
"nanoid": "^6.0.1"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
package/src/docs/docs-root.ts
CHANGED
|
@@ -8,12 +8,13 @@ import { fileURLToPath } from "node:url";
|
|
|
8
8
|
/** Absolute path of the shipped `docs/` folder, with no trailing separator. */
|
|
9
9
|
export const DOCS_ROOT = fileURLToPath(new URL("../../docs", import.meta.url));
|
|
10
10
|
|
|
11
|
-
/** The
|
|
11
|
+
/** The shipped pages, in reading order. */
|
|
12
12
|
export const DOC_PAGES = [
|
|
13
13
|
"getting-started.md",
|
|
14
14
|
"authoring.md",
|
|
15
15
|
"examples.md",
|
|
16
16
|
"cli.md",
|
|
17
|
+
"configuration.md",
|
|
17
18
|
"troubleshooting.md",
|
|
18
19
|
] as const;
|
|
19
20
|
|
|
@@ -28,7 +28,7 @@ export function yaagPromptBlock(directories: readonly string[]): string {
|
|
|
28
28
|
"",
|
|
29
29
|
"Full authoring surface (defineAgent, args schemas, ask limits, worktrees, model fallback):",
|
|
30
30
|
"read `<program dir>/.yaag/types/runtime/index.d.ts`.",
|
|
31
|
-
`Shipped docs (${DOCS_ROOT}): getting-started.md, authoring.md, examples.md, cli.md, troubleshooting.md.`,
|
|
31
|
+
`Shipped docs (${DOCS_ROOT}): getting-started.md, authoring.md, examples.md, cli.md, configuration.md, troubleshooting.md.`,
|
|
32
32
|
].join("\n");
|
|
33
33
|
}
|
|
34
34
|
|