@intentic/agent-cli 1.310.0 → 1.311.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 +30 -30
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
#
|
|
1
|
+
# agent-cli
|
|
2
2
|
|
|
3
|
-
The
|
|
3
|
+
The process contract, budgeted output and in-process test runner that the agent-facing CLIs `iq`, `fileq` and `webq` share, so a failure never reads as an empty answer.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
```mermaid
|
|
6
|
+
flowchart LR
|
|
7
|
+
agent["Agent shell<br/>pipes into head, drops stderr"] --> bin["iq · fileq · webq"]
|
|
8
|
+
bin --> run(["agent-cli<br/>runAgentCli"])
|
|
9
|
+
run --> app["The tool's stricli app<br/>loaded lazily"]
|
|
10
|
+
app --> out["stdout<br/>capsule, clipped body, errors"]
|
|
11
|
+
out --> agent
|
|
12
|
+
```
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
- The reader is an agent: it pipes into `head`, sends stderr to `/dev/null` and cannot tell a crash from an empty
|
|
15
|
+
answer. So `runAgentCli` treats EPIPE as a clean stop, writes errors to stdout, reports a module graph that will
|
|
16
|
+
not load as a broken install, and clamps the exit code to 0 content, 1 none, 2 anything else.
|
|
17
|
+
- The app is passed as a `load` thunk, never a static import, so an engine or native module that fails to load
|
|
18
|
+
fails inside the contract's catch and gets reported.
|
|
19
|
+
- `capsule` prints the line an agent reads first plus one `note:` per caveat; `clip` cuts markdown to a token budget
|
|
20
|
+
on a line boundary and always names the file that holds the whole answer.
|
|
21
|
+
- `toolHome` gives each tool its own directory: `<NAME>_HOME`, else `$XDG_CACHE_HOME/<name>`, else `~/.cache/<name>`.
|
|
22
|
+
- Each tool's end-to-end suites use `captureCli` from `./testing`, which runs the app in process and returns what
|
|
23
|
+
a shell would see.
|
|
12
24
|
|
|
13
|
-
|
|
14
|
-
`head`. Errors go to **stdout**, because `<tool> … 2>/dev/null` is a reflex and a failure routed to stderr
|
|
15
|
-
reads as an empty answer. The app loads through a thunk so a broken module graph dies as a sentence naming the
|
|
16
|
-
install, not as a stack the same reflex swallows. Exit codes are 0 content / 1 none / 2 anything else.
|
|
17
|
-
- **The output shape** ([src/output.ts](src/output.ts)). One capsule line, one `note:` per caveat, then content
|
|
18
|
-
cut on a line boundary with a trailer naming the budget it hit and the file holding the rest. A body that
|
|
19
|
-
stops mid-thought with no trailer is the failure mode this exists to prevent.
|
|
20
|
-
- **The rest of the floor**: one XDG home per tool ([src/env.ts](src/env.ts)), one version resolver that finds
|
|
21
|
-
the manifest by walking to it ([src/version.ts](src/version.ts)), one non-negative parser for counts and
|
|
22
|
-
budgets ([src/flags.ts](src/flags.ts)), one in-process test seam ([src/testing.ts](src/testing.ts)).
|
|
25
|
+
## Key files
|
|
23
26
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
`
|
|
27
|
+
- [src/run.ts](src/run.ts) — `runAgentCli`: the process contract every rule above lives in.
|
|
28
|
+
- [src/output.ts](src/output.ts) — `capsule` and `clip`, the capsule-then-content shape these CLIs print.
|
|
29
|
+
- [src/env.ts](src/env.ts) — `toolHome` and `toolOutDir`, where a tool's own files go.
|
|
30
|
+
- [src/testing.ts](src/testing.ts) — `captureCli`, the in-process runner the tools' suites drive.
|
|
31
|
+
- [src/flags.ts](src/flags.ts) — `countParser`, which refuses negative, infinite and NaN budgets.
|
|
27
32
|
|
|
28
|
-
##
|
|
33
|
+
## Commands
|
|
29
34
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
clipped answer from reading as a whole one.
|
|
34
|
-
- [src/env.ts](src/env.ts) — `<NAME>_HOME` → `XDG_CACHE_HOME` → `~/.cache/<name>`, and the shared `out` leaf.
|
|
35
|
-
- [src/flags.ts](src/flags.ts) — the count parser, and why stricli's own is not it.
|
|
36
|
-
- [src/testing.ts](src/testing.ts) — runs an app through the same `run` seam `cli.ts` uses, capturing stdout: no
|
|
37
|
-
build artifact, no child process.
|
|
35
|
+
```sh
|
|
36
|
+
pnpm --filter @intentic/agent-cli test
|
|
37
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentic/agent-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.311.0",
|
|
4
4
|
"description": "The process contract, budgeted output and test seam every agent-facing CLI in this repo keeps",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@intentic/base": "1.
|
|
89
|
-
"@intentic/constants": "1.
|
|
88
|
+
"@intentic/base": "1.311.0",
|
|
89
|
+
"@intentic/constants": "1.311.0",
|
|
90
90
|
"@stricli/core": "1.3.0",
|
|
91
91
|
"tslib": "2.8.1"
|
|
92
92
|
},
|