Skip to content

Commit d73cc3d

Browse files
Agents CLI: dex-agents-pi command for Pi agents (#1597)
Adds the dex-agents-pi CLI command (Pi coding tools routed through the runtime's hardened WorkspaceFiles, bash with timeouts and allow list, AGENTS.md loading with scope and owner checks, env-only API keys), additive runtime exports (WorkspaceFiles, WorkspaceFileRefusedError, non-blocking opens, read caps), and adds the package to the agents release pipeline.
1 parent 31c2735 commit d73cc3d

33 files changed

Lines changed: 7459 additions & 42 deletions

‎.github/workflows/agents-typescript-publish.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ jobs:
170170
for package in dex-agents dex-agents-vercel-ai dex-agents-openai-agents \
171171
dex-agents-mastra dex-agents-claude-agent-sdk dex-agents-pi \
172172
dex-agents-cli dex-agents-claude-sdk-cli dex-agents-openai-sdk-cli \
173-
dex-agents-vercel-ai-cli dex-agents-mastra-cli dex-agents-builtin-cli; do
173+
dex-agents-vercel-ai-cli dex-agents-mastra-cli dex-agents-builtin-cli dex-agents-pi-cli; do
174174
tarball="./dist/superdurable-${package}-${RELEASE_VERSION}.tgz"
175175
[[ -f "${tarball}" ]] || { echo "Missing ${tarball}" >&2; exit 1; }
176176
if npm view "@superdurable/${package}@${RELEASE_VERSION}" version >/dev/null 2>&1; then

‎agents/CHANGELOG.md‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,34 @@ for the Dex SDK and framework versions each release supports.
9696
has the command, file tools stay in the workspace, and the tool Step checks an
9797
approved call again. `ANTHROPIC_API_KEY` reaches Claude Code unchanged. See
9898
[cli/python/claude-sdk](cli/python/claude-sdk/README.md).
99+
- The **dex-agents-pi** command (`@superdurable/dex-agents-pi-cli`, not
100+
published yet): a Pi coding agent in the terminal on the shared CLI runtime,
101+
where Dex runs the agent loop and pi-ai makes each model call. The model is
102+
`<provider>/<model>` from pi-ai's catalog, and the key comes only from the
103+
provider's API key variable. pi-coding-agent's `read`, `grep`, `find`, `ls`,
104+
`write`, `edit`, and `bash` replace the runtime's file and shell tools, with
105+
the same rules: their file access goes through the runtime's workspace file
106+
layer. `bash` has the shell tool's 120-second default timeout
107+
(`pi.bash_timeout_seconds`) and its 600-second maximum, and a command that
108+
ran is a result with its exit status. `grep` and `find` walk the workspace
109+
themselves, without `rg` or `fd`; `grep` skips files over 1 MiB, and each
110+
call of either has a 10-second budget. Each model call adds the project's
111+
`AGENTS.md` files unless `pi.load_project_context` is `false`: a file loads
112+
only directly in its own directory, and above the workspace the file, and a
113+
link to it, must belong to you or root. See
114+
[cli/typescript/pi](cli/typescript/pi/README.md).
115+
- TypeScript CLI runtime: **WorkspaceFiles**, the workspace file layer of the
116+
local file tools, is exported for harnesses that bring their own file tools,
117+
with new methods **readFileWithVersion** (with an optional smaller
118+
**maximumBytes**), **replaceFileIfUnchanged**, **statExisting**, and
119+
**readDirectoryEntries**. A refusal throws the new
120+
**WorkspaceFileRefusedError**, a `ToolExecutionError` thrown before anything
121+
changed. See
122+
[cli/typescript/runtime](cli/typescript/runtime/README.md#the-harness-interface).
123+
- TypeScript CLI runtime: `read_file`, `edit_file`, and `search_files` open
124+
files without blocking, so a FIFO in the workspace fails at once as not a
125+
regular file, or is skipped by a search, instead of hanging the call, as in
126+
the Python runtime.
99127
- Python commands for the other harnesses, not published yet, on the shared
100128
CLI runtime: **dex-agents-openai-sdk** (OpenAI Agents SDK),
101129
**dex-agents-pydantic-ai** (Pydantic AI), **dex-agents-deepagents** (Deep

‎agents/README.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ adapter depends on the published core instead.
4242
| [`cli/typescript/mastra`](cli/typescript/mastra) | `@superdurable/dex-agents-mastra-cli`, not published yet | The `dex-agents-mastra` command: a Mastra agent in the terminal |
4343
| [`cli/typescript/builtin`](cli/typescript/builtin) | `@superdurable/dex-agents-builtin-cli`, not published yet | The `dex-agents-builtin` command: the Dex built-in agent loop without a framework in the terminal |
4444
| [`typescript/pi`](typescript/pi) | `@superdurable/dex-agents-pi`, not published yet | Pi: pi-ai models and Pi tools on the built-in agent loop, so Dex runs the loop, not Pi |
45+
| [`cli/typescript/pi`](cli/typescript/pi) | `@superdurable/dex-agents-pi-cli`, not published yet | The `dex-agents-pi` command: a Pi coding agent in the terminal |
4546

4647
## UI streams
4748

@@ -184,7 +185,7 @@ publish the released commit even if `main` has moved on.
184185
Both workflows stamp the release version first with
185186
[`script/stamp_agents_release_version.py`](script/stamp_agents_release_version.py).
186187
It sets one version in all fourteen `pyproject.toml` files (the thirteen
187-
published ones and `dex-agents-cli-testing`) and twelve `package.json`
188+
published ones and `dex-agents-cli-testing`) and thirteen `package.json`
188189
files, their lockfiles, and every constraint between agents packages: the
189190
adapters' on their core, and the CLI packages' on the core, their adapter,
190191
and the CLI runtime. Python pins `==<version>`; npm peer-depends on
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist/
2+
node_modules/

‎agents/cli/typescript/pi/.npmrc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
install-links=true

‎agents/cli/typescript/pi/LICENSE‎

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# License
2+
3+
Copyright (c) 2026 Super Durable, Inc.
4+
5+
Portions of this software are licensed as follows:
6+
7+
- Legacy Materials remain under their original licenses as described in
8+
`LEGACY_NOTICES.md`.
9+
- Third-Party Materials remain under the licenses provided by their owners.
10+
- The `docs/` and `examples/` directories are not licensed under the
11+
Sustainable Use License and retain their existing licensing status.
12+
- All other material owned or licensable by Super Durable, Inc. is available
13+
under the Sustainable Use License below.
14+
15+
See `LEGACY_NOTICES.md` for the applicable legacy and third-party notices.
16+
17+
## Sustainable Use License
18+
19+
Version 1.0
20+
21+
### Acceptance
22+
23+
By using the software, you agree to all of the terms and conditions below.
24+
25+
### Copyright License
26+
27+
The licensor grants you a non-exclusive, royalty-free, worldwide,
28+
non-sublicensable, non-transferable license to use, copy, distribute, make
29+
available, and prepare derivative works of the software, in each case subject
30+
to the limitations below.
31+
32+
### Limitations
33+
34+
You may use or modify the software only for your own internal business purposes
35+
or for non-commercial or personal use. You may distribute the software or
36+
provide it to others only if you do so free of charge for non-commercial
37+
purposes. You may not alter, remove, or obscure any licensing, copyright, or
38+
other notices of the licensor in the software. Any use of the licensor's
39+
trademarks is subject to applicable law.
40+
41+
### Patents
42+
43+
The licensor grants you a license, under any patent claims the licensor can
44+
license, or becomes able to license, to make, have made, use, sell, offer for
45+
sale, import and have imported the software, in each case subject to the
46+
limitations and conditions in this license. This license does not cover any
47+
patent claims that you cause to be infringed by modifications or additions to
48+
the software.
49+
50+
If you or your company make any written claim that the software infringes or
51+
contributes to infringement of any patent, your patent license for the software
52+
granted under these terms ends immediately. If your company makes such a claim,
53+
your patent license ends immediately for work on behalf of your company.
54+
55+
### Notices
56+
57+
You must ensure that anyone who gets a copy of any part of the software from
58+
you also gets a copy of these terms. If you modify the software, you must
59+
include in any modified copies of the software a prominent notice stating that
60+
you have modified the software.
61+
62+
### No Other Rights
63+
64+
These terms do not imply any licenses other than those expressly granted in
65+
these terms.
66+
67+
### Termination
68+
69+
If you use the software in violation of these terms, such use is not licensed,
70+
and your license will automatically terminate. If the licensor provides you
71+
with a notice of your violation, and you cease all violation of this license no
72+
later than 30 days after you receive that notice, your license will be
73+
reinstated retroactively. However, if you violate these terms after such
74+
reinstatement, any additional violation of these terms will cause your license
75+
to terminate automatically and permanently.
76+
77+
### No Liability
78+
79+
As far as the law allows, the software comes as is, without any warranty or
80+
condition, and the licensor will not be liable to you for any damages arising
81+
out of these terms or the use or nature of the software, under any kind of
82+
legal claim.
83+
84+
### Definitions
85+
86+
The "licensor" is the entity offering these terms.
87+
88+
The "software" is the software the licensor makes available under these terms,
89+
including any portion of it.
90+
91+
"You" refers to the individual or entity agreeing to these terms.
92+
93+
"Your company" is any legal entity, sole proprietorship, or other kind of
94+
organization that you work for, plus all organizations that have control over,
95+
are under the control of, or are under common control with that organization.
96+
Control means ownership of substantially all the assets of an entity, or the
97+
power to direct its management and policies by vote, contract, or otherwise.
98+
Control can be direct or indirect.
99+
100+
"Your license" is the license granted to you for the software under these
101+
terms.
102+
103+
"Use" means anything you do with the software requiring your license.
104+
105+
"Trademark" means trademarks, service marks, and similar rights.

0 commit comments

Comments
 (0)