Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
name: CI

# Ruff and pytest read Python. A change that touches only the paths below cannot change their result:
# the extension has its own workflow (vscode-extension.yml), `docs/` is outside Ruff (`extend-exclude`)
# and outside `testpaths`, and no Python test reads either folder. GitHub runs this workflow when ANY
# changed file is left in the list, so a change that also touches another file still runs it.
# The order matters: a `!` pattern takes a file out, and the last pattern puts every Python file back
# (Ruff reads the three Python helpers inside `vscode/`). No check is required on `main`, so a run that
# is skipped blocks no merge.
on:
push:
branches: [main]
paths:
- "**"
- "!vscode/**"
- "!docs/**"
- "!.github/workflows/vscode-extension.yml"
- "**/*.py"
pull_request:
paths:
- "**"
- "!vscode/**"
- "!docs/**"
- "!.github/workflows/vscode-extension.yml"
- "**/*.py"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/vscode-extension.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The zycode VS Code extension (packages/pi-vscode).
# The zycode VS Code extension (vscode/).
#
# On a pull request that touches the extension: tests, and a linux-x64 VSIX with its smoke test.
# By hand (Actions > "VS Code extension" > Run workflow): the same for the chosen targets, and,
Expand All @@ -9,15 +9,15 @@
# and the environment allows deployments from `main` only.
# - Both registries name THIS FILE by its file name (`vscode-extension.yml`) in their trusted
# publisher entries. Do not rename it without changing both entries.
# - The first upload to each registry is a hand upload (packages/pi-vscode/RELEASING.md).
# - The first upload to each registry is a hand upload (vscode/RELEASING.md).

name: VS Code extension

on:
pull_request:
paths:
- ".github/workflows/vscode-extension.yml"
- "packages/pi-vscode/**"
- "vscode/**"
workflow_dispatch:
inputs:
publish:
Expand Down Expand Up @@ -64,9 +64,9 @@ jobs:
with:
node-version: 22
- run: npm ci
working-directory: packages/pi-vscode
working-directory: vscode
- run: npm run check
working-directory: packages/pi-vscode
working-directory: vscode

plan:
name: Targets
Expand Down Expand Up @@ -108,16 +108,16 @@ jobs:
with:
python-version: "3.12" # for THIRD-PARTY-NOTICES
- run: npm ci
working-directory: packages/pi-vscode
working-directory: vscode
- name: Download the agent, check its sha256, build, write the notices, package, check the VSIX
run: node scripts/package.mjs "$TARGET"
working-directory: packages/pi-vscode
working-directory: vscode
env:
TARGET: ${{ matrix.target }}
- uses: actions/upload-artifact@v6
with:
name: vsix-${{ matrix.target }}
path: packages/pi-vscode/out/*.vsix
path: vscode/out/*.vsix
if-no-files-found: error
retention-days: 14

Expand Down Expand Up @@ -148,8 +148,8 @@ jobs:
if: steps.has.outputs.linux_x64 == 'true'
run: |
npm ci
node scripts/smoke-vsix.mjs ../../vsix/*.vsix
working-directory: packages/pi-vscode
node scripts/smoke-vsix.mjs ../vsix/*.vsix
working-directory: vscode

publish:
name: Publish
Expand Down Expand Up @@ -179,25 +179,25 @@ jobs:
merge-multiple: true
- name: Install the pinned vsce and ovsx
run: npm ci
working-directory: packages/pi-vscode
working-directory: vscode
- name: Files to publish
run: |
ls -l vsix
sha256sum vsix/*.vsix
# A repeat of a half-done publish skips what is already there (--skip-duplicate).
- name: Open VSX
if: inputs.registries != 'marketplace'
working-directory: packages/pi-vscode
working-directory: vscode
run: |
set -eu
for f in ../../vsix/*.vsix; do
for f in ../vsix/*.vsix; do
npx --no-install ovsx publish --trusted-publishing --skip-duplicate "$f"
done
- name: Visual Studio Marketplace
if: inputs.registries != 'open-vsx'
working-directory: packages/pi-vscode
working-directory: vscode
run: |
set -eu
for f in ../../vsix/*.vsix; do
for f in ../vsix/*.vsix; do
npx --no-install vsce publish --oidc --skip-duplicate --packagePath "$f"
done
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ AgentMessage[] → transform_context() → convert_to_llm() → LangChain BaseMe
| `packages/pi-mcp/` | Optional extension `pi-mcp-py` (entry point `pi-mcp`): connects the MCP servers (stdio, http, sse) that an ACP client passes in `session/new`, one runner task per server, tools named `mcp__<server>__<tool>`, `/mcp` command. Core, harness and CLI have no MCP client; they hand the servers over as data (`ClientMcpServer`, `ExtensionAPI.client_mcp_servers`). Design: `docs/specs/2026-10-23-mcp-extension-design.md`. Its tests are left out of a run that did not install the package (the header says so) | — |
| `packaging/agent/` | Builds the agent as a one-file executable (PyInstaller; `build.py`, `zycode-agent.spec`, `entry.py`) and the smoke test over ACP with a fake model server (`smoke.py`). `.github/workflows/agent-binaries.yml` runs both on five platforms and attaches the archives to the GitHub Release after the `Release` workflow. A frozen build has no interpreter: `host.py` starts a frozen `child.py`, and only the OpenAI-format provider is in it. Design and the registry entry draft: `docs/specs/2026-10-31-agent-binaries.md` | — |
| `packages/pi-agent-cli/` | Standard-ACP CLI (`python -m pi_agent_cli`); config `agent.example.toml`, home `~/.pi-python`; TUI binary `zypi` under `tui/`. See [`packages/pi-agent-cli/AGENTS.md`](packages/pi-agent-cli/AGENTS.md) for spawn, config, first run (`--setup` and the terminal login that `initialize` offers to a client that can run one; `zypi` still gets `authMethods: []`), prompt pipeline, and the three permission modes `ask`, `auto` and `always-approve` (Auto: rules, and a model step for a `bash` call that no rule decides: `auto_rules.py`, `auto_classifier.py`, `auto_mode.py`, `permission_modes.py`; design `docs/specs/2026-11-02-auto-mode-design.md`; the pager offers all three, and a clean start is `ask`). The items on the ACP wire beyond standard ACP (`pi/session/delete`, `_meta.sessionId`, and others) are in the register `docs/specs/2026-11-05-acp-extension-registry.md` | — |
| `packages/pi-vscode/` | The VS Code extension `zycode.zycode` (TypeScript, `src/core/` has no `vscode` import). It is an ACP client and a chat view for zycode in VS Code: it starts the agent as a child process, shows permission questions and a diff for `write`/`edit`, runs the first-run setup in a terminal (a walkthrough, a banner and hints guide the first start; the agent's own `--setup` and `auth_required` carry it, no wire item and no agent change), lists past chats of the folder in a view (`session/list`, `session/load`, `pi/session/delete`), and offers the three permission modes `ask`, `auto` and `always-approve` in the chat menu (`always-approve` only after a modal warning, never restored for a new chat, a past chat or a restart, and not in an untrusted workspace; the `zycode.permissionMode` setting stays `ask`/`auto`; it moves the agent with the agent's own `pi/yolo_mode_changed`). The extension never writes `always-approve` through `set_config_option`. A Thinking menu shows `thinking_level` of `agent.toml`; agent 0.9.1 cannot change it live, so a change edits that one line (checked by parsing, after a modal), restarts the agent and reopens the chat (design section 7c). One VSIX per platform, each with the bundled `zycode-agent` binary of one Release (pin and sha256 in `agent-assets.json`). Not a Python package: ruff and pytest do not read it; `.github/workflows/vscode-extension.yml` runs `npm run check` and a `linux-x64` VSIX smoke test for a PR that changes it, and publishes (Trusted Publishing, by hand on `main`, environment `vscode-publish`). Version 1.0.0 is the first stable release (the pre-release 0.1.0 was uploaded by hand; the 1.0.0 run, run `43181052994` on 2026-11-12, was the first real OIDC publish and worked on the first try on Open VSX and the Marketplace, five targets, no token; the record is in `packages/pi-vscode/RELEASING.md`; stable = even minor, pre-release = odd minor). Do not rename that file or the environment: the registries name them. Local check: `cd packages/pi-vscode; npm run check`. Design: `docs/specs/2026-11-04-vscode-extension-design.md`; make and test a VSIX: `packages/pi-vscode/PACKAGING.md`; releases: `packages/pi-vscode/RELEASING.md` | — |
| `vscode/` | The VS Code extension `zycode.zycode` (TypeScript, `src/core/` has no `vscode` import). It is an ACP client and a chat view for zycode in VS Code: it starts the agent as a child process, shows permission questions and a diff for `write`/`edit`, runs the first-run setup in a terminal (a walkthrough, a banner and hints guide the first start; the agent's own `--setup` and `auth_required` carry it, no wire item and no agent change), lists past chats of the folder in a view (`session/list`, `session/load`, `pi/session/delete`), and offers the three permission modes `ask`, `auto` and `always-approve` in the chat menu (`always-approve` only after a modal warning, never restored for a new chat, a past chat or a restart, and not in an untrusted workspace; the `zycode.permissionMode` setting stays `ask`/`auto`; it moves the agent with the agent's own `pi/yolo_mode_changed`). The extension never writes `always-approve` through `set_config_option`. A Thinking menu shows `thinking_level` of `agent.toml`; agent 0.9.1 cannot change it live, so a change edits that one line (checked by parsing, after a modal), restarts the agent and reopens the chat (design section 7c). One VSIX per platform, each with the bundled `zycode-agent` binary of one Release (pin and sha256 in `agent-assets.json`). Not a Python package: pytest does not read it, and ruff reads only its three Python helpers (`scripts/python_licenses.py`, `test/support/fake_model.py`, `test/support/pty_answers.py`). `.github/workflows/vscode-extension.yml` runs `npm run check` and a `linux-x64` VSIX smoke test for a PR that changes it. `ci.yml` (Ruff, pytest) skips a PR that touches only `vscode/`, `docs/` and that workflow, with no `.py` file (a `paths` filter with `!` patterns; no check is required on `main`, so a skipped run blocks no merge). The same workflow publishes (Trusted Publishing, by hand on `main`, environment `vscode-publish`). Version 1.0.0 is the first stable release (the pre-release 0.1.0 was uploaded by hand; the 1.0.0 run, run `43181052994` on 2026-11-12, was the first real OIDC publish and worked on the first try on Open VSX and the Marketplace, five targets, no token; the record is in `vscode/RELEASING.md`; stable = even minor, pre-release = odd minor). Do not rename that file or the environment: the registries name them. Local check: `cd vscode; npm run check`. Design: `docs/specs/2026-11-04-vscode-extension-design.md`; make and test a VSIX: `vscode/PACKAGING.md`; releases: `vscode/RELEASING.md` | — |
| `web/` | Product site for zycode, live at `https://zycode.dev` (static Astro, Node ≥ 22.23.4; English at `/`, Chinese at `/zh/`; Cloudflare Workers static assets, no server of ours). Not a Python package: ruff and pytest do not read it; `.github/workflows/web-ci.yml` runs `npm run check` and `npm run build` for a PR that changes `web/`. A merge to `main` that changes `web/` deploys to `zycode.dev` by itself (Cloudflare Workers Builds, not GitHub Actions). Its claims must stay equal to the README table "Status" and to the benchmark report, and `en.ts` / `zh.ts` keep the same keys. See [`web/README.md`](web/README.md) for commands, deploy, the domain, and the Cloudflare settings that are not in the repository | — |

### Invariants
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@ After installing, set up config and start the TUI — see [TUI & Code-Agent Guid

### VS Code extension

The extension `zycode.zycode` ([`packages/pi-vscode`](packages/pi-vscode/README.md)) puts the zycode agent in a chat view in VS Code. It has the agent program inside, so you do not install the Python agent first. It is unofficial and not affiliated with pi or Microsoft.
The extension `zycode.zycode` ([`vscode`](vscode/README.md)) puts the zycode agent in a chat view in VS Code. It has the agent program inside, so you do not install the Python agent first. It is unofficial and not affiliated with pi or Microsoft.

- **VS Code:** install it from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=zycode.zycode), or run `code --install-extension zycode.zycode`.
- **VSCodium and other editors that use Open VSX:** install it from [Open VSX](https://open-vsx.org/extension/zycode/zycode).
- **Platforms:** version 1.0.0 is published on both registries for five platforms: `linux-x64`, `linux-arm64`, `darwin-arm64`, `darwin-x64` and `win32-x64`. Each one has the agent program inside.
- **What it has:** a chat view with a question card for each tool call that is not read-only; a **Show diff** button for `write` and `edit`; a getting-started guide and help for the first start (the setup runs in a VS Code terminal); a **Past chats** view; a mode menu (**Ask**, **Auto** and **Always approve**); and a **Thinking** menu.
- **Auto is not a sandbox.** It guards what a call writes or runs. It does not guard what a call reads or sends. Use a container or a virtual machine if you need a boundary. See the [extension README](packages/pi-vscode/README.md) for the three modes.
- **Limits:** the bundled agent is not code-signed, and it has only the OpenAI-format provider. The repository lists Windows and macOS as not verified. An install of 1.0.0 in a real VS Code is not measured yet. The release record is in [`RELEASING.md`](packages/pi-vscode/RELEASING.md).
- **Auto is not a sandbox.** It guards what a call writes or runs. It does not guard what a call reads or sends. Use a container or a virtual machine if you need a boundary. See the [extension README](vscode/README.md) for the three modes.
- **Limits:** the bundled agent is not code-signed, and it has only the OpenAI-format provider. The repository lists Windows and macOS as not verified. An install of 1.0.0 in a real VS Code is not measured yet. The release record is in [`RELEASING.md`](vscode/RELEASING.md).

### In Zed (custom agent)

Expand Down
Loading
Loading