mirror of
https://github.com/harivansh-afk/clanker-agent.git
synced 2026-04-16 06:02:43 +00:00
refactor: finish companion rename migration
Complete the remaining pi-to-companion rename across companion-os, web, vm-orchestrator, docker, and archived fixtures. Verification: - semantic rg sweeps for Pi/piConfig/getPi/.pi runtime references - npm run check in apps/companion-os (fails in this worktree: biome not found) Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
parent
e8fe3d54af
commit
536241053c
303 changed files with 3603 additions and 3602 deletions
|
|
@ -1,14 +1,14 @@
|
|||
> pi can help you create pi packages. Ask it to bundle your extensions, skills, prompt templates, or themes.
|
||||
> companion can help you create companion packages. Ask it to bundle your extensions, skills, prompt templates, or themes.
|
||||
|
||||
# Pi Packages
|
||||
# Companion Packages
|
||||
|
||||
Pi packages bundle extensions, skills, prompt templates, and themes so you can share them through npm or git. A package can declare resources in `package.json` under the `pi` key, or use conventional directories.
|
||||
Companion packages bundle extensions, skills, prompt templates, and themes so you can share them through npm or git. A package can declare resources in `package.json` under the `companion` key, or use conventional directories.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Install and Manage](#install-and-manage)
|
||||
- [Package Sources](#package-sources)
|
||||
- [Creating a Pi Package](#creating-a-pi-package)
|
||||
- [Creating a Companion Package](#creating-a-companion-package)
|
||||
- [Package Structure](#package-structure)
|
||||
- [Dependencies](#dependencies)
|
||||
- [Package Filtering](#package-filtering)
|
||||
|
|
@ -17,32 +17,32 @@ Pi packages bundle extensions, skills, prompt templates, and themes so you can s
|
|||
|
||||
## Install and Manage
|
||||
|
||||
> **Security:** Pi packages run with full system access. Extensions execute arbitrary code, and skills can instruct the model to perform any action including running executables. Review source code before installing third-party packages.
|
||||
> **Security:** Companion packages run with full system access. Extensions execute arbitrary code, and skills can instruct the model to perform any action including running executables. Review source code before installing third-party packages.
|
||||
|
||||
```bash
|
||||
pi install npm:@foo/bar@1.0.0
|
||||
pi install git:github.com/user/repo@v1
|
||||
pi install https://github.com/user/repo # raw URLs work too
|
||||
pi install /absolute/path/to/package
|
||||
pi install ./relative/path/to/package
|
||||
companion install npm:@foo/bar@1.0.0
|
||||
companion install git:github.com/user/repo@v1
|
||||
companion install https://github.com/user/repo # raw URLs work too
|
||||
companion install /absolute/path/to/package
|
||||
companion install ./relative/path/to/package
|
||||
|
||||
pi remove npm:@foo/bar
|
||||
pi list # show installed packages from settings
|
||||
pi update # update all non-pinned packages
|
||||
companion remove npm:@foo/bar
|
||||
companion list # show installed packages from settings
|
||||
companion update # update all non-pinned packages
|
||||
```
|
||||
|
||||
By default, `install` and `remove` write to global settings (`~/.pi/agent/settings.json`). Use `-l` to write to project settings (`.pi/settings.json`) instead. Project settings can be shared with your team, and pi installs any missing packages automatically on startup.
|
||||
By default, `install` and `remove` write to global settings (`~/.companion/agent/settings.json`). Use `-l` to write to project settings (`.companion/settings.json`) instead. Project settings can be shared with your team, and companion installs any missing packages automatically on startup.
|
||||
|
||||
To try a package without installing it, use `--extension` or `-e`. This installs to a temporary directory for the current run only:
|
||||
|
||||
```bash
|
||||
pi -e npm:@foo/bar
|
||||
pi -e git:github.com/user/repo
|
||||
companion -e npm:@foo/bar
|
||||
companion -e git:github.com/user/repo
|
||||
```
|
||||
|
||||
## Package Sources
|
||||
|
||||
Pi accepts three source types in settings and `pi install`.
|
||||
Companion accepts three source types in settings and `companion install`.
|
||||
|
||||
### npm
|
||||
|
||||
|
|
@ -51,9 +51,9 @@ npm:@scope/pkg@1.2.3
|
|||
npm:pkg
|
||||
```
|
||||
|
||||
- Versioned specs are pinned and skipped by `pi update`.
|
||||
- Versioned specs are pinned and skipped by `companion update`.
|
||||
- Global installs use `npm install -g`.
|
||||
- Project installs go under `.pi/npm/`.
|
||||
- Project installs go under `.companion/npm/`.
|
||||
|
||||
### git
|
||||
|
||||
|
|
@ -69,21 +69,21 @@ ssh://git@github.com/user/repo@v1
|
|||
- HTTPS and SSH URLs are both supported.
|
||||
- SSH URLs use your configured SSH keys automatically (respects `~/.ssh/config`).
|
||||
- For non-interactive runs (for example CI), you can set `GIT_TERMINAL_PROMPT=0` to disable credential prompts and set `GIT_SSH_COMMAND` (for example `ssh -o BatchMode=yes -o ConnectTimeout=5`) to fail fast.
|
||||
- Refs pin the package and skip `pi update`.
|
||||
- Cloned to `~/.pi/agent/git/<host>/<path>` (global) or `.pi/git/<host>/<path>` (project).
|
||||
- Refs pin the package and skip `companion update`.
|
||||
- Cloned to `~/.companion/agent/git/<host>/<path>` (global) or `.companion/git/<host>/<path>` (project).
|
||||
- Runs `npm install` after clone or pull if `package.json` exists.
|
||||
|
||||
**SSH examples:**
|
||||
|
||||
```bash
|
||||
# git@host:path shorthand (requires git: prefix)
|
||||
pi install git:git@github.com:user/repo
|
||||
companion install git:git@github.com:user/repo
|
||||
|
||||
# ssh:// protocol format
|
||||
pi install ssh://git@github.com/user/repo
|
||||
companion install ssh://git@github.com/user/repo
|
||||
|
||||
# With version ref
|
||||
pi install git:git@github.com:user/repo@v1.0.0
|
||||
companion install git:git@github.com:user/repo@v1.0.0
|
||||
```
|
||||
|
||||
### Local Paths
|
||||
|
|
@ -93,17 +93,17 @@ pi install git:git@github.com:user/repo@v1.0.0
|
|||
./relative/path/to/package
|
||||
```
|
||||
|
||||
Local paths point to files or directories on disk and are added to settings without copying. Relative paths are resolved against the settings file they appear in. If the path is a file, it loads as a single extension. If it is a directory, pi loads resources using package rules.
|
||||
Local paths point to files or directories on disk and are added to settings without copying. Relative paths are resolved against the settings file they appear in. If the path is a file, it loads as a single extension. If it is a directory, companion loads resources using package rules.
|
||||
|
||||
## Creating a Pi Package
|
||||
## Creating a Companion Package
|
||||
|
||||
Add a `pi` manifest to `package.json` or use conventional directories. Include the `pi-package` keyword for discoverability.
|
||||
Add a `companion` manifest to `package.json` or use conventional directories. Include the `companion-package` keyword for discoverability.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "my-package",
|
||||
"keywords": ["pi-package"],
|
||||
"pi": {
|
||||
"keywords": ["companion-package"],
|
||||
"companion": {
|
||||
"extensions": ["./extensions"],
|
||||
"skills": ["./skills"],
|
||||
"prompts": ["./prompts"],
|
||||
|
|
@ -116,13 +116,13 @@ Paths are relative to the package root. Arrays support glob patterns and `!exclu
|
|||
|
||||
### Gallery Metadata
|
||||
|
||||
The [package gallery](https://shittycodingagent.ai/packages) displays packages tagged with `pi-package`. Add `video` or `image` fields to show a preview:
|
||||
The [package gallery](https://shittycodingagent.ai/packages) displays packages tagged with `companion-package`. Add `video` or `image` fields to show a preview:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "my-package",
|
||||
"keywords": ["pi-package"],
|
||||
"pi": {
|
||||
"keywords": ["companion-package"],
|
||||
"companion": {
|
||||
"extensions": ["./extensions"],
|
||||
"video": "https://example.com/demo.mp4",
|
||||
"image": "https://example.com/screenshot.png"
|
||||
|
|
@ -139,7 +139,7 @@ If both are set, video takes precedence.
|
|||
|
||||
### Convention Directories
|
||||
|
||||
If no `pi` manifest is present, pi auto-discovers resources from these directories:
|
||||
If no `companion` manifest is present, companion auto-discovers resources from these directories:
|
||||
|
||||
- `extensions/` loads `.ts` and `.js` files
|
||||
- `skills/` recursively finds `SKILL.md` folders and loads top-level `.md` files as skills
|
||||
|
|
@ -148,11 +148,11 @@ If no `pi` manifest is present, pi auto-discovers resources from these directori
|
|||
|
||||
## Dependencies
|
||||
|
||||
Third party runtime dependencies belong in `dependencies` in `package.json`. Dependencies that do not register extensions, skills, prompt templates, or themes also belong in `dependencies`. When pi installs a package from npm or git, it runs `npm install`, so those dependencies are installed automatically.
|
||||
Third party runtime dependencies belong in `dependencies` in `package.json`. Dependencies that do not register extensions, skills, prompt templates, or themes also belong in `dependencies`. When companion installs a package from npm or git, it runs `npm install`, so those dependencies are installed automatically.
|
||||
|
||||
Pi bundles core packages for extensions and skills. If you import any of these, list them in `peerDependencies` with a `"*"` range and do not bundle them: `@mariozechner/pi-ai`, `@mariozechner/pi-agent-core`, `@mariozechner/pi-coding-agent`, `@mariozechner/pi-tui`, `@sinclair/typebox`.
|
||||
Companion bundles core packages for extensions and skills. If you import any of these, list them in `peerDependencies` with a `"*"` range and do not bundle them: `@mariozechner/companion-ai`, `@mariozechner/companion-agent-core`, `@mariozechner/companion-coding-agent`, `@mariozechner/companion-tui`, `@sinclair/typebox`.
|
||||
|
||||
Other pi packages must be bundled in your tarball. Add them to `dependencies` and `bundledDependencies`, then reference their resources through `node_modules/` paths. Pi loads packages with separate module roots, so separate installs do not collide or share modules.
|
||||
Other companion packages must be bundled in your tarball. Add them to `dependencies` and `bundledDependencies`, then reference their resources through `node_modules/` paths. Companion loads packages with separate module roots, so separate installs do not collide or share modules.
|
||||
|
||||
Example:
|
||||
|
||||
|
|
@ -162,7 +162,7 @@ Example:
|
|||
"shitty-extensions": "^1.0.1"
|
||||
},
|
||||
"bundledDependencies": ["shitty-extensions"],
|
||||
"pi": {
|
||||
"companion": {
|
||||
"extensions": ["extensions", "node_modules/shitty-extensions/extensions"],
|
||||
"skills": ["skills", "node_modules/shitty-extensions/skills"]
|
||||
}
|
||||
|
|
@ -199,7 +199,7 @@ Filter what a package loads using the object form in settings:
|
|||
|
||||
## Enable and Disable Resources
|
||||
|
||||
Use `pi config` to enable or disable extensions, skills, prompt templates, and themes from installed packages and local directories. Works for both global (`~/.pi/agent`) and project (`.pi/`) scopes.
|
||||
Use `companion config` to enable or disable extensions, skills, prompt templates, and themes from installed packages and local directories. Works for both global (`~/.companion/agent`) and project (`.companion/`) scopes.
|
||||
|
||||
## Scope and Deduplication
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue