@preapexis/piexis 0.2.2 → 0.2.4
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/AGENTS.md +21 -41
- package/README.md +73 -139
- package/extensions/agents.ts +205 -0
- package/extensions/ask-question.ts +54 -95
- package/extensions/recommended-tools.ts +62 -0
- package/extensions/ui.ts +204 -58
- package/lib/agent-config.ts +55 -0
- package/lib/agents.ts +208 -0
- package/lib/question-model.ts +98 -0
- package/lib/question-ui.ts +214 -0
- package/lib/recommended-tools.ts +119 -0
- package/lib/subagent-runner.ts +146 -0
- package/lib/ui-tips.json +41 -0
- package/package.json +5 -13
- package/prompts/init.md +10 -2
- package/prompts/summary.md +7 -6
- package/schemas/agent.schema.json +48 -0
- package/skills/{claude-api/LICENSE.txt → caveman/LICENSE} +2 -2
- package/skills/caveman/LICENSE-MIT +21 -0
- package/skills/caveman/NOTICE +10 -0
- package/skills/caveman/SKILL.md +89 -0
- package/skills/find-skills/SKILL.md +141 -0
- package/skills/ponytail/LICENSE +21 -0
- package/skills/ponytail/NOTICE +9 -0
- package/skills/ponytail/SKILL.md +52 -0
- package/skills-lock.json +6 -0
- package/tests/agents.test.mjs +605 -0
- package/tests/ask-question-pty.test.mjs +16 -0
- package/tests/ask-question.test.mjs +269 -0
- package/tests/fixtures/agents-provider.ts +55 -0
- package/tests/fixtures/ask-question-pty.py +91 -0
- package/tests/fixtures/ask-question-terminal.mjs +69 -0
- package/tests/fixtures/recommended-tools-terminal.mjs +103 -0
- package/tests/init-workflow.test.mjs +31 -0
- package/tests/recommended-tools-pty.test.mjs +16 -0
- package/tests/recommended-tools.test.mjs +423 -0
- package/tests/resources.test.mjs +66 -0
- package/tests/skills-routing.test.mjs +7 -4
- package/tests/ui-tip-reload.test.mjs +70 -0
- package/tests/ui.test.mjs +450 -0
- package/tsconfig.json +1 -0
- package/eval/README.md +0 -72
- package/eval/permission-cases.json +0 -28
- package/eval/permissions.mjs +0 -103
- package/extensions/background-tasks.ts +0 -433
- package/extensions/background-worker.ts +0 -50
- package/extensions/glob.ts +0 -32
- package/extensions/mode.ts +0 -397
- package/lib/bash-approvals.ts +0 -113
- package/lib/bash-policy.ts +0 -164
- package/lib/mode-policy.ts +0 -174
- package/lib/path-policy.ts +0 -182
- package/lib/permission-classifier.ts +0 -128
- package/lib/permission-config.ts +0 -91
- package/lib/permission-denials.ts +0 -32
- package/lib/permission-intent.ts +0 -128
- package/lib/permission-taxonomy.ts +0 -15
- package/lib/task-broker.ts +0 -65
- package/lib/task-checkout.ts +0 -39
- package/lib/task-git.ts +0 -44
- package/lib/task-patch.ts +0 -106
- package/lib/task-permissions.ts +0 -51
- package/lib/task-report.ts +0 -62
- package/lib/task-worktree-policy.ts +0 -56
- package/skills/claude-api/SKILL.md +0 -572
- package/skills/claude-api/csharp/claude-api/README.md +0 -362
- package/skills/claude-api/csharp/claude-api/batches.md +0 -14
- package/skills/claude-api/csharp/claude-api/files-api.md +0 -25
- package/skills/claude-api/csharp/claude-api/streaming.md +0 -28
- package/skills/claude-api/csharp/claude-api/tool-use.md +0 -164
- package/skills/claude-api/curl/examples.md +0 -256
- package/skills/claude-api/curl/managed-agents.md +0 -371
- package/skills/claude-api/go/claude-api/README.md +0 -188
- package/skills/claude-api/go/claude-api/files-api.md +0 -23
- package/skills/claude-api/go/claude-api/streaming.md +0 -43
- package/skills/claude-api/go/claude-api/tool-use.md +0 -220
- package/skills/claude-api/go/managed-agents/README.md +0 -564
- package/skills/claude-api/java/claude-api/README.md +0 -238
- package/skills/claude-api/java/claude-api/files-api.md +0 -27
- package/skills/claude-api/java/claude-api/streaming.md +0 -24
- package/skills/claude-api/java/claude-api/tool-use.md +0 -228
- package/skills/claude-api/java/managed-agents/README.md +0 -443
- package/skills/claude-api/php/claude-api/README.md +0 -174
- package/skills/claude-api/php/claude-api/batches.md +0 -15
- package/skills/claude-api/php/claude-api/files-api.md +0 -13
- package/skills/claude-api/php/claude-api/streaming.md +0 -27
- package/skills/claude-api/php/claude-api/tool-use.md +0 -253
- package/skills/claude-api/php/managed-agents/README.md +0 -443
- package/skills/claude-api/python/claude-api/README.md +0 -565
- package/skills/claude-api/python/claude-api/batches.md +0 -198
- package/skills/claude-api/python/claude-api/files-api.md +0 -170
- package/skills/claude-api/python/claude-api/sdk-upgrade.md +0 -286
- package/skills/claude-api/python/claude-api/streaming.md +0 -179
- package/skills/claude-api/python/claude-api/tool-use.md +0 -627
- package/skills/claude-api/python/managed-agents/README.md +0 -335
- package/skills/claude-api/ruby/claude-api/README.md +0 -134
- package/skills/claude-api/ruby/claude-api/streaming.md +0 -16
- package/skills/claude-api/ruby/claude-api/tool-use.md +0 -41
- package/skills/claude-api/ruby/managed-agents/README.md +0 -394
- package/skills/claude-api/shared/admin-api.md +0 -179
- package/skills/claude-api/shared/agent-design.md +0 -101
- package/skills/claude-api/shared/anthropic-cli.md +0 -269
- package/skills/claude-api/shared/claude-platform-on-aws.md +0 -59
- package/skills/claude-api/shared/cost-optimization.md +0 -233
- package/skills/claude-api/shared/error-codes.md +0 -262
- package/skills/claude-api/shared/live-sources.md +0 -166
- package/skills/claude-api/shared/managed-agents-api-reference.md +0 -455
- package/skills/claude-api/shared/managed-agents-client-patterns.md +0 -220
- package/skills/claude-api/shared/managed-agents-core.md +0 -359
- package/skills/claude-api/shared/managed-agents-environments.md +0 -226
- package/skills/claude-api/shared/managed-agents-events.md +0 -290
- package/skills/claude-api/shared/managed-agents-memory.md +0 -201
- package/skills/claude-api/shared/managed-agents-multiagent.md +0 -260
- package/skills/claude-api/shared/managed-agents-onboarding.md +0 -82
- package/skills/claude-api/shared/managed-agents-outcomes.md +0 -108
- package/skills/claude-api/shared/managed-agents-overview.md +0 -77
- package/skills/claude-api/shared/managed-agents-scheduled-deployments.md +0 -156
- package/skills/claude-api/shared/managed-agents-self-hosted-sandboxes.md +0 -282
- package/skills/claude-api/shared/managed-agents-tools.md +0 -504
- package/skills/claude-api/shared/managed-agents-webhooks.md +0 -143
- package/skills/claude-api/shared/model-migration.md +0 -1872
- package/skills/claude-api/shared/models.md +0 -142
- package/skills/claude-api/shared/platform-availability.md +0 -53
- package/skills/claude-api/shared/prompt-audit.md +0 -223
- package/skills/claude-api/shared/prompt-caching.md +0 -292
- package/skills/claude-api/shared/token-counting.md +0 -56
- package/skills/claude-api/shared/tool-use-concepts.md +0 -526
- package/skills/claude-api/typescript/claude-api/README.md +0 -405
- package/skills/claude-api/typescript/claude-api/batches.md +0 -106
- package/skills/claude-api/typescript/claude-api/files-api.md +0 -98
- package/skills/claude-api/typescript/claude-api/streaming.md +0 -178
- package/skills/claude-api/typescript/claude-api/tool-use.md +0 -586
- package/skills/claude-api/typescript/managed-agents/README.md +0 -359
- package/tests/auto-permissions.test.mjs +0 -315
- package/tests/background-tasks.test.mjs +0 -27
- package/tests/background-worker.test.mjs +0 -60
- package/tests/bash-permissions.test.mjs +0 -276
- package/tests/glob.test.mjs +0 -31
- package/tests/mode.test.mjs +0 -62
- package/tests/permission-evaluation.test.mjs +0 -70
- package/tests/permission-foundation.test.mjs +0 -194
- package/tests/permission-policy.test.mjs +0 -158
- package/tests/runtime/README.md +0 -51
- package/tests/runtime/harness.mjs +0 -190
- package/tests/runtime/permissions.test.mjs +0 -192
- package/tests/runtime/tui.test.mjs +0 -60
- package/tests/task-integration.test.mjs +0 -324
- package/tests/task-permissions.test.mjs +0 -178
- package/tests/task-worktree-policy.test.mjs +0 -53
package/AGENTS.md
CHANGED
|
@@ -1,58 +1,38 @@
|
|
|
1
1
|
# Agents Guide
|
|
2
2
|
|
|
3
|
-
## Project
|
|
3
|
+
## Project and layout
|
|
4
4
|
|
|
5
|
-
Piexis (`@preapexis/piexis`) is a TypeScript Pi package providing
|
|
5
|
+
Piexis (`@preapexis/piexis`) is a TypeScript Pi package providing interactive questions, UI extensions, skills, prompts, and themes. Node.js 22.19+ and a current Pi release are required.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- `extensions/
|
|
10
|
-
- `extensions/
|
|
11
|
-
- `
|
|
12
|
-
- `
|
|
13
|
-
- `
|
|
14
|
-
- `
|
|
15
|
-
- `skills/`: bundled skills with task-specific `SKILL.md` guidance; `prompts/init.md`: bundled `/init` prompt; `themes/orange.json`: bundled theme.
|
|
16
|
-
- `package.json`: Pi resource manifest and npm scripts; `tsconfig.json`: strict TypeScript configuration.
|
|
7
|
+
- `extensions/ask-question.ts`: sequential interactive `AskQuestion` tool; requires the TUI.
|
|
8
|
+
- `extensions/agents.ts`: five agent profiles and sequential subprocess subagents; `lib/agents.ts` owns configuration/routing, and `lib/subagent-runner.ts` owns protocol/cancellation. User/project `agent.json` files configure models and effort, with legacy `agents.json` fallback. Accepted project setup creates a missing `.pi/agent.json` scaffold without overwriting existing configuration.
|
|
9
|
+
- `extensions/ui.ts`: project header, activity footer, Git branch, model, and context usage.
|
|
10
|
+
- `extensions/recommended-tools.ts`: automatic opt-in project setup for Pi's native `grep`, `find`, and `ls` tools.
|
|
11
|
+
- `skills/`: task-specific `SKILL.md` guidance.
|
|
12
|
+
- `prompts/`: bundled `/init`, `/commit`, and `/summary` prompts.
|
|
13
|
+
- `themes/orange.json`: bundled theme.
|
|
14
|
+
- `package.json`: resource manifest and npm scripts; `tsconfig.json`: strict TypeScript configuration.
|
|
17
15
|
|
|
18
16
|
## Development
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
| Command | Purpose / caveat |
|
|
18
|
+
| Command | Purpose |
|
|
23
19
|
| --- | --- |
|
|
24
20
|
| `npm ci --ignore-scripts` | Install locked dependencies without lifecycle scripts. |
|
|
25
21
|
| `npm run check` | Type-check with `tsc --noEmit`. |
|
|
26
|
-
| `npm test` |
|
|
27
|
-
| `
|
|
28
|
-
| `pi -e ./extensions/mode.ts` | Preview the permission extension only, not the bundled prompts, skills, themes, or other extensions. |
|
|
29
|
-
|
|
30
|
-
There are no separate build, lint, or format scripts. No CI configuration is present in this checkout; do not infer CI coverage from the README.
|
|
22
|
+
| `npm test` | Run `node --test tests/*.test.mjs`. |
|
|
23
|
+
| `pi -e ./extensions/ask-question.ts` | Preview only the question extension. |
|
|
31
24
|
|
|
32
|
-
|
|
25
|
+
There are no separate build, lint, or format scripts, and no CI configuration in this checkout.
|
|
33
26
|
|
|
34
|
-
|
|
35
|
-
- The sandbox workers, broker, guards, and test suites from the previous implementation are absent. Although `@anthropic-ai/sandbox-runtime` remains pinned in `package.json`, the current permission implementation does not invoke it. Do not claim OS containment, protected-path enforcement, or workspace-only writes.
|
|
36
|
-
- Plan currently blocks all tools except the read-tool allowlist and `AskQuestion`, including all bash calls and file edits. The README's writable `.pi/plans/*.md` exception and `delete_plan` tool are not implemented in the current source.
|
|
37
|
-
- The current default is Manual (`default`), not Auto. Old Build/YOLO mode names and user-level `readRoots`/`allowedDomains` configuration do not describe the current implementation.
|
|
38
|
-
|
|
39
|
-
## Conventions
|
|
27
|
+
## Conventions and safety
|
|
40
28
|
|
|
41
29
|
- Use ESM and strict TypeScript with NodeNext module resolution and ES2022 targeting. Local imports use explicit `.ts` extensions.
|
|
42
|
-
- Match nearby source style: two-space indentation, double-quoted strings, and semicolons. Extensions export a default registration function receiving `ExtensionAPI
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
|
|
47
|
-
## Security and workflow
|
|
48
|
-
|
|
49
|
-
- Permission-mode changes belong to the user. Do not bypass denied operations or change modes to evade restrictions.
|
|
50
|
-
- The six modes are `default`, `acceptEdits`, `plan`, `auto`, `dontAsk`, and `bypassPermissions`. `Alt+M` cycles the first four, omitting Auto when unavailable; `/plan` enters Plan. `dontAsk` and `bypassPermissions` are launch-only. Mode changes require an idle agent.
|
|
51
|
-
- Preserve Auto's fail-closed behavior on classifier failure or invalid responses. The classifier treats task/action contents as untrusted data and uses Pi's existing authentication; never persist credentials in project settings.
|
|
52
|
-
- Configuration lives under Pi's `CONFIG_DIR_NAME` (normally `.pi/`). Initialization creates missing `settings.json` and `permission-modes.json` without overwriting existing files. `PI_PERMISSION_CLASSIFIER=provider/model` overrides the configured classifier model.
|
|
53
|
-
- Session approvals are in-memory and scoped to a tool. Without permission UI, actions requiring approval are denied; `dontAsk` denies non-pre-approved actions. Bypass skips extension-level permission checks and is not isolation.
|
|
54
|
-
- Keep `AskQuestion` available in every permission mode.
|
|
30
|
+
- Match nearby source style: two-space indentation, double-quoted strings, and semicolons. Extensions export a default registration function receiving `ExtensionAPI`.
|
|
31
|
+
- Preserve interactive cancellation and non-TUI handling. Add or update `node:test`/`node:assert/strict` tests for behavior changes, using disposable fixtures rather than credentials.
|
|
32
|
+
- Preserve unrelated working-tree changes and intentional deletions. Do not commit generated output, secrets, dependency directories, or local configuration. `.pi/` and `.kilo/` are ignored local state, not package resources.
|
|
33
|
+
- Permission modes, approval/classifier logic, plan execution handoffs, and background workers have been removed. Piexis does not enforce tool-access restrictions or provide sandboxing; respect host restrictions and other installed extensions.
|
|
34
|
+
- Do not delete existing user settings, session records, or retained task worktrees as part of routine package changes.
|
|
55
35
|
|
|
56
36
|
## Validation
|
|
57
37
|
|
|
58
|
-
|
|
38
|
+
Run `npm run check` and relevant tests for implementation changes. Report unexecuted checks explicitly; skipped or empty runs do not establish coverage. Review the diff for credentials and unrelated changes before finishing.
|
package/README.md
CHANGED
|
@@ -1,180 +1,125 @@
|
|
|
1
1
|
# PieXis
|
|
2
2
|
|
|
3
|
-
PieXis is a Pi package with
|
|
3
|
+
PieXis is a Pi package with interactive questions, coding skills, prompts, and terminal UI resources. It requires Node.js 22.19+ and a current Pi release.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
> **PieXis permission controls are not a security boundary.** They help prevent accidental or unapproved agent tool actions; they do **not** provide OS-level sandboxing, filesystem isolation, workspace-only filesystem enforcement, protected-path enforcement, network isolation, or network allowlisting. Run Pi in an appropriate container, VM, sandbox, or restricted user account when executing untrusted code or allowing unattended/high-autonomy agents.
|
|
7
|
-
|
|
8
|
-
## Install and use
|
|
5
|
+
## Installation
|
|
9
6
|
|
|
10
7
|
```sh
|
|
11
8
|
pi install npm:@preapexis/piexis
|
|
12
9
|
```
|
|
13
10
|
|
|
14
|
-
|
|
11
|
+
Restart Pi or run `/reload` after installation. The package loads AskQuestion, agent profiles/subagents, the custom header/footer, automatic recommended-tool setup, prompts, skills, and the theme.
|
|
15
12
|
|
|
16
|
-
|
|
13
|
+
## Resources
|
|
17
14
|
|
|
18
|
-
|
|
15
|
+
- **AskQuestion** provides keyboard-driven single/multi selection and text questions in the interactive TUI, with validation, answer review, and cancellation. It requires terminal input and output.
|
|
16
|
+
- **UI** shows project information, agent activity, Git branch, model, and context usage. The startup header shows three random, category-labelled tips from `lib/ui-tips.json`, preferring different categories and staying stable across redraws. Tips cycle without repeats until the list is exhausted within the extension runtime; `/reload` starts a new cycle. Each JSON entry has `category` and `text` fields; edit them to change the recommendations.
|
|
17
|
+
- **Recommended tools** offers to enable native `grep`, `find`, and `ls` for the project at startup; no slash command is needed.
|
|
18
|
+
- **Agents** provides `plan`, `orchestrator`, `debug`, `ask`, and `code` profiles, all callable through the `subagent` tool. Small delegated tasks can automatically use a cheaper model.
|
|
19
|
+
- **Skills** cover implementation, debugging, review, design, refactoring, validation, and document workflows. Bundled **caveman** adds concise chat style; **ponytail** guides the smallest complete coding change. Only their core instructions are included, not upstream hooks or companion skills. Source revisions and licenses live beside each skill.
|
|
20
|
+
- **Prompts** include `/init`, `/commit`, and `/summary`. `/init` adds workflow guidance to `AGENTS.md`: caveman for responses, grilling for clarification questions, and ponytail for building. These are agent instructions, not runtime enforcement.
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
| --- | --- |
|
|
22
|
-
| **Manual** (`default`) | Project-local ordinary reads/searches, a tiny harmless Bash-builtin set, and `AskQuestion` are pre-approved; other actions need approval. **Allow once** applies only to the current call. |
|
|
23
|
-
| **Accept Edits** (`acceptEdits`) | Also pre-approves ordinary project-local `edit` and `write` calls. Bash outside the harmless-builtin set, external paths, and sensitive paths still require approval. |
|
|
24
|
-
| **Plan** (`plan`) | Allows project-local ordinary reads, task status/diff inspection/cancellation, and `AskQuestion`; Bash, external/sensitive path-tool reads, task creation/apply/cleanup, and file mutations are blocked. |
|
|
25
|
-
| **Auto** (`auto`) | Directly permits ordinary project-local reads, `edit`, and `write`. Sensitive paths, protected configuration edits, uncertain recursive searches, and malformed or unsupported paths/tools remain denied. Bash outside the harmless-builtin set and eligible narrow session grants, plus remaining known external actions, receive intent-aware model review. Missing authorization, timeout, error, or invalid review denies the action. |
|
|
26
|
-
| **Don't Ask** (`dontAsk`) | Permits only pre-approved reads/questions and harmless Bash builtins; denies other calls without a dialog. Launch-only. |
|
|
27
|
-
| **Bypass Permissions** (`bypassPermissions`) | Skips **PieXis extension-level permission checks**. It does not enter or escape a sandbox, and does not override OS permissions or other extensions. Task scope/confirmation safeguards remain. Launch-only. |
|
|
22
|
+
- **Theme** provides the bundled orange palette.
|
|
28
23
|
|
|
29
|
-
|
|
24
|
+
Caveman and ponytail ship with this package; no separate installation is needed. Their upstream standalone installation commands are:
|
|
30
25
|
|
|
31
|
-
|
|
26
|
+
```sh
|
|
27
|
+
npx skills add https://github.com/juliusbrussee/caveman --skill caveman
|
|
28
|
+
npx skills add https://github.com/dietrichgebert/ponytail --skill ponytail
|
|
29
|
+
```
|
|
32
30
|
|
|
33
|
-
|
|
31
|
+
Avoid loading standalone copies alongside the bundled skills, which can cause name collisions. In Pi, explicitly invoke the bundled skills with `/skill:caveman` and `/skill:ponytail`.
|
|
34
32
|
|
|
35
|
-
|
|
33
|
+
## Automatic tool setup
|
|
36
34
|
|
|
37
|
-
|
|
35
|
+
On startup in a trusted project with terminal input/output, Piexis offers any pending setup: available, inactive `grep`, `find`, and `ls` tools, or a missing project agent configuration when the agent extension is loaded. Earlier tool approval does not hide the new agent setup; if tools are already configured, the prompt offers only `.pi/agent.json` creation and leaves tool settings unchanged:
|
|
38
36
|
|
|
39
|
-
|
|
37
|
+
- **Enable** saves the project choice and tool additions in `.pi/settings.json`, then activates them in the current session without removing active tools or extensions. It also creates `.pi/agent.json` if neither that file nor legacy `.pi/agents.json` exists. The scaffold uses the current model for `model`, `small_model`, and `subagent_model`, preserves user-level agent overrides, and populates all five `subagent_variant_overrides` with `model` and `effort`. Default effort is `high` for plan/orchestrator/debug, `low` for ask, and `medium` for code. Existing agent configuration is never overwritten. If creation fails or no model is selected, tools remain enabled and a warning explains how to configure agents manually.
|
|
38
|
+
- **Not now** (the default) or Esc changes nothing. The prompt is shown at most once per project per extension runtime; a subsequent startup or reload may offer it again.
|
|
39
|
+
- **Don't ask again** records `"disabled"` only for features offered in that prompt: `piexis.recommendedTools` for tool setup and `piexis.agentSetup` for agent setup. It changes neither tools nor agent files. Approval records `"enabled"`. An existing `agent.json` or legacy `agents.json` completes agent setup; if creation failed or the file was removed, startup offers it again unless `agentSetup` is `"disabled"`. Remove the corresponding disabled preference to allow another offer.
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
User-level settings are never written. Other project settings and existing `piexis` keys are preserved. Modern Pi uses additive `defaultTools` entries such as `["+grep", "+find", "+ls"]`. Older Pi releases without additive support use a plain list of the four default tools plus the approved additions, only when no tool selection is configured.
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
2. Reject malformed inputs and unresolvable paths.
|
|
45
|
-
3. Apply Plan restrictions, bounded Bash analysis, and Auto non-overridable checks.
|
|
46
|
-
4. Match eligible scoped approvals and mode defaults. Auto rejects broad/stale grants; unsupported shell forms cannot match a reusable narrow Bash grant.
|
|
47
|
-
5. Return `require-approval`, or deny in Don't Ask. Model review and approval UI are handled by the extension and fail closed.
|
|
43
|
+
Setup skips non-TUI/non-TTY runs, untrusted projects, and runs with CLI tool-selection overrides (`--tools`, `--exclude-tools`, `--no-tools`, or `--no-builtin-tools`, including their short forms). Explicit `defaultTools` allowlists, including an empty list, are left alone; they can still receive an agent-only setup offer. Additive `-tool` exclusions remain respected. Only Pi's available built-in tools are offered. Malformed or non-regular settings files and settings changed during the prompt are not overwritten; a warning explains why setup was skipped.
|
|
48
44
|
|
|
49
|
-
|
|
45
|
+
The setup extension is `extensions/recommended-tools.ts`; package resource filtering can omit it. Native `find` provides file discovery by glob pattern; no wrapper extension is needed.
|
|
50
46
|
|
|
51
|
-
##
|
|
47
|
+
## Agents and subagents
|
|
52
48
|
|
|
53
|
-
|
|
49
|
+
Use `/agent` to select a profile, `/agent plan` to switch directly, or `pi --agent orchestrator` at startup. **Alt+A** cycles `plan → orchestrator → debug → ask → code` while idle; cycling is blocked while an agent is running. The footer shows the active profile (`agent:code`) and, on wider terminals, the shortcut hint. `/hotkeys` lists the shortcut. `code` is the default. Profile choices follow the active session branch. Profiles add instructions rather than replacing repository guidance or changing the main session's tools:
|
|
54
50
|
|
|
55
|
-
|
|
51
|
+
| Profile | Purpose |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| `plan` | Explore and return a plan; no implementation |
|
|
54
|
+
| `orchestrator` | Delegate focused tasks and combine verified results |
|
|
55
|
+
| `debug` | Establish evidence, diagnose, fix, and verify |
|
|
56
|
+
| `ask` | Answer questions from code/documentation; no changes |
|
|
57
|
+
| `code` | Implement scoped changes and run checks |
|
|
58
|
+
|
|
59
|
+
All five are callable with `subagent({ "agent": "ask", "task": "Locate the configuration loader" })`. The orchestrator chooses when to delegate; delegation is not an automatic pipeline. Each child receives its task, normal Pi resources, and profile instructions, **not** the parent's conversation. Supply necessary context explicitly. Children share the workspace, so calls are sequential; delegation stops at two child levels. A delegated orchestrator can call other subagents at the second level.
|
|
60
|
+
|
|
61
|
+
Optional configuration lives in `~/.pi/agent/agent.json` (or `$PI_CODING_AGENT_DIR/agent.json`) and trusted-project `.pi/agent.json`. Legacy `agents.json` is still read when `agent.json` is absent in that scope; no files are renamed or deleted. Project fields override user fields; per-variant overrides merge by field. Accepting **Enable** during project setup creates the project scaffold only when no project agent configuration exists; user-level files are never written. Defaults use the current model unless user-level configuration specifies another model. New scaffolds set `delegate_exploration` to `false`; edit it to opt in. `/agent-config` creates a missing project config or fills only its missing settings with defaults, preserving every configured value. It uses the active model when it must choose a model. Generated files include `$schema` for editor validation; configuration reloads on each profile switch and delegation. Use exact `provider/model-id` strings from `/model`, not fuzzy aliases:
|
|
56
62
|
|
|
57
63
|
```json
|
|
58
64
|
{
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
"$schema": "https://raw.githubusercontent.com/VarunGaikwad/piexis/main/schemas/agent.schema.json",
|
|
66
|
+
"model": "provider/default-model",
|
|
67
|
+
"small_model": "provider/default-model",
|
|
68
|
+
"subagent_model": "provider/default-model",
|
|
69
|
+
"delegate_exploration": true,
|
|
70
|
+
"subagent_variant_overrides": {
|
|
71
|
+
"plan": { "model": "provider/default-model", "effort": "high" },
|
|
72
|
+
"orchestrator": { "model": "provider/default-model", "effort": "high" },
|
|
73
|
+
"debug": { "model": "provider/default-model", "effort": "high" },
|
|
74
|
+
"ask": { "model": "provider/default-model", "effort": "low" },
|
|
75
|
+
"code": { "model": "provider/default-model", "effort": "medium" }
|
|
76
|
+
}
|
|
67
77
|
}
|
|
68
78
|
```
|
|
69
79
|
|
|
70
|
-
`
|
|
71
|
-
|
|
72
|
-
## Auto review policy and privacy
|
|
73
|
-
|
|
74
|
-
Auto uses **deterministic policy → one model reviewer**, not a multi-model pipeline. Ordinary local reads/edits do not call the reviewer. Review compares the proposed action against the current user request and earlier user constraints, rather than treating ordinary-looking command names as sufficient authorization.
|
|
75
|
-
|
|
76
|
-
| Review category | Rule |
|
|
77
|
-
| --- | --- |
|
|
78
|
-
| Ordinary development | Must serve the current requested task |
|
|
79
|
-
| External filesystem | Intent must cover the external target and operation |
|
|
80
|
-
| Destructive changes | Specific authorization for operation, target, and scope |
|
|
81
|
-
| Credential exploration/exposure | Denied; normal use of an authenticated CLI is distinct |
|
|
82
|
-
| Data egress | Authorization must cover destination, payload, and purpose |
|
|
83
|
-
| Production/shared systems | Explicit target and operation required |
|
|
84
|
-
| Privilege/security weakening | Denied in unattended Auto |
|
|
85
|
-
| Safeguard bypasses | Explicit authorization for the particular bypass |
|
|
86
|
-
| Opaque execution or ambiguity | Denied when effects/authorization cannot be established |
|
|
87
|
-
|
|
88
|
-
The taxonomy lives in `lib/permission-taxonomy.ts`. Shell syntax is boundedly parsed; full program semantics remain model-assessed. These are permission-review policies, not guarantees that every shell effect will be detected. Every model allow must cite the current user message and any supporting user messages using valid IDs. Unknown categories, missing/currently invalid evidence, malformed output, abnormal completion, and provider failure fail closed. The host rejects allows in prohibited categories even if the model returns them. Auto does not add approval dialogs or change modes on denial. Repeated denials stop the run under the limits below.
|
|
89
|
-
|
|
90
|
-
### What is sent
|
|
91
|
-
|
|
92
|
-
For reviewed actions, the configured provider receives:
|
|
93
|
-
- Tool name and Bash command or requested filesystem path.
|
|
94
|
-
- Working directory, workspace boundary, and deterministic path-policy findings.
|
|
95
|
-
- Bounded, provenance-labelled user messages from the active branch.
|
|
96
|
-
- Eligible file/directory approval scopes from that same current request when review is still needed. Invalid or stale Bash grants are not forwarded as authorization.
|
|
97
|
-
- Bounded shell parsing results and risk findings; no script or Git configuration contents.
|
|
98
|
-
- For task creation and worker review, the proposed task/brief, selected model, and delegated path/Bash scope, explicitly marked as untrusted action data—not user authorization.
|
|
99
|
-
|
|
100
|
-
Other than the proposed delegation brief described above, it does **not** receive assistant prose/reasoning, raw tool-output history, worker result summaries, compaction summaries, file contents, edit/write replacement text, environment-variable objects, or Pi authentication credentials. The reviewer has no tool access. User prose, paths, commands, and approval strings can themselves contain secrets: recognition/redaction is best-effort, not a secret-detection guarantee. Do not use Auto when those details must not be disclosed to the selected provider. Recognizably secret-bearing or oversized review payloads are denied locally, without contacting the provider. PieXis does not log review payloads; Pi's normal user-message/session storage still applies.
|
|
101
|
-
|
|
102
|
-
### Provenance and context limits
|
|
103
|
-
|
|
104
|
-
`lib/permission-intent.ts` observes Pi's `input` source and exactly matches delivered user text. It stores only a content digest, timestamp, and source in non-model session metadata, not another prompt copy. Only matched `interactive` (including normal CLI input) and `rpc` inputs count as user authorization. This is observational provenance inside a trusted extension runtime, not cryptographic proof of human identity or protection against malicious extensions.
|
|
105
|
-
|
|
106
|
-
Raw active-branch user entries preserve constraints across resume and compaction. Abandoned branches and generated summaries cannot supply authorization. Unknown/extension-injected messages are excluded; if the current request has no verified provenance, reviewed actions are denied. Older sessions without provenance need a new direct, self-contained request. Expanded/transformed prompts that do not match the observed input are conservatively unverified; submit the request directly instead. Changes to historical user entries invalidate completeness rather than silently dropping constraints. Undelivered queued input pauses reviewed actions; authorization is rechecked after model review so a changed request, branch, or session cannot reuse an in-flight allow.
|
|
80
|
+
**Alt+A** and `/agent` apply the selected profile's `model` and `effort` from `subagent_variant_overrides` to the main session too. Without a profile model override, switching uses the top-level `model` if configured; otherwise it keeps the current model. Missing effort overrides leave the current thinking level alone (subject to Pi's model-capability clamping). `subagent_model` and `small_model` remain delegation-only settings. Invalid configuration or an unavailable model leaves the current profile unchanged and shows a warning.
|
|
107
81
|
|
|
108
|
-
|
|
82
|
+
Replace the example model IDs with available, authenticated models. `model` initializes a new main session; explicit CLI model selections and resumed sessions win at startup. An explicit profile switch subsequently applies the configured settings. `subagent_model` defaults to the current main-session model. A per-variant `model` wins over all automatic routing. New scaffolds explicitly pin each variant to the default subagent model; remove the `model` field from a variant's override to let it follow automatic routing or later `subagent_model` changes. Otherwise, short lookups/summaries in `ask` and clearly mechanical typo/comment/label/symbol edits in `code` use `small_model` when configured. Ambiguous, longer, or complex tasks, including planning, debugging, and orchestration, keep the normal subagent model. This is a conservative text heuristic, not a classifier or a guarantee of task difficulty. Omit `small_model` to disable automatic small-task routing.
|
|
109
83
|
|
|
110
|
-
|
|
84
|
+
Set `delegate_exploration` to `true` to let every profile offload bounded, read-only codebase discovery to the small model. Call `subagent({ "agent": "ask", "purpose": "explore", "task": "Locate configuration loading and summarize the relevant files" })`. Exploration always uses `small_model` at low effort, even if `ask` has a per-variant model override. It is rejected unless the option and `small_model` are configured. Exploration children receive only `read`, `grep`, `find`, and `ls`; they cannot delegate further. The parent retains planning, judgment, edits, and final verification. This is opt-in because child-process overhead can cost more than a trivial direct read.
|
|
111
85
|
|
|
112
|
-
|
|
86
|
+
Effort accepts `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, or `max`. Variant effort overrides win; small tasks otherwise request `low`, and other tasks inherit the parent's thinking level. Pi clamps effort to the chosen model's capabilities. Results/progress show the selected model, **requested** effort, routing reason, output, and usage. Invalid configuration or unavailable child models fail explicitly rather than silently switching providers.
|
|
113
87
|
|
|
114
|
-
|
|
88
|
+
Child agents run in separate Pi processes with ephemeral sessions and the same OS permissions. Their tool selection is a subset of the parent's active tools; `plan`/`ask` children select only `read`, `grep`, `find`, and `ls`, and disable native MCP access. With `delegate_exploration`, a non-exploration `plan` or `ask` child may also receive `subagent` to perform one nested exploration; exploration children never receive it. `plan`/`ask` parents may delegate only to those two profiles. Other children omit `AskQuestion` and return questions to the parent. Main profile instructions and child tool selection are **not sandboxing**. Normal configured extensions and explicitly supplied CLI extensions load in children, with the parent's project-trust decision. Runtime-only provider/tool registrations, CLI `--api-key` overrides, credentials supplied only to an embedded SDK session, and in-memory state in other extensions are not copied to child processes. Use Pi's stored or environment-based authentication for delegation. Other extensions remain responsible for their own restrictions; verify their subprocess behavior before using delegation in a restricted host.
|
|
115
89
|
|
|
116
|
-
|
|
90
|
+
Abort and shutdown terminate active children (including their process group on Unix). Windows termination is best-effort for descendants. Model-facing output is capped at 50,000 characters; tool details retain up to 1 MB. JSON/print mode supports subagents but has no profile picker or child terminal interaction. Avoid loading another extension that registers `subagent`, `/agent`, or `--agent` alongside this one.
|
|
117
91
|
|
|
118
|
-
|
|
92
|
+
## AskQuestion
|
|
119
93
|
|
|
120
|
-
|
|
94
|
+
Existing `{ questions: [{ question, options, multiSelect?, allowOther? }] }` calls remain supported. New optional fields:
|
|
121
95
|
|
|
122
|
-
|
|
123
|
-
-
|
|
124
|
-
-
|
|
125
|
-
-
|
|
96
|
+
- Question `id`, `type` (`single`, `multi`, `text`), and `required` (defaults to true). Explicit text questions may omit `options`; legacy optionless questions require `allowOther: true`.
|
|
97
|
+
- Option `id`, `label`, and optional `description`. Missing IDs become `question-1` / `option-1`, etc.; IDs must be unique within their scope. Labels need not be unique.
|
|
98
|
+
- `defaultSelection`: option ID or array of IDs. `minSelections` / `maxSelections` apply to multi-select answers. Required questions always need an answer.
|
|
99
|
+
- `maxLength`: maximum text length in Unicode code points. Text is not trimmed; whitespace-only required answers are rejected. Text input is single-line, using Pi's native Input component.
|
|
126
100
|
|
|
127
|
-
|
|
101
|
+
Use ↑↓ to navigate, Space to toggle multiple choices, Enter to confirm, and Esc/Ctrl+C to cancel the interaction. For related questions, Tab/Shift+Tab revisits questions without losing drafts; all questions must be confirmed before the final review can be submitted. “Type something else” is available only with `allowOther`; its answer replaces, rather than mixes with, selected options. Selection-count limits do not apply to custom text.
|
|
128
102
|
|
|
129
|
-
|
|
103
|
+
Results have `status`: `answered`, `cancelled`, `aborted`, `requires_interaction`, or `error`. Both model-facing JSON and tool `details` contain the same result. Legacy `answers` and `cancelled` fields remain; each confirmed answer retains `question` and label-based `answer`, with added question `id`, `optionIds`, and `custom`. Optional empty answers are `""` or `[]`, never cancellation. Cancellation returns only already-confirmed answers. `cancelled` remains true for every non-answered outcome; use `status` to distinguish them.
|
|
130
104
|
|
|
131
|
-
|
|
105
|
+
Pi owns stdin, raw mode, cursor state, and focus restoration. Agent abort and session shutdown dismiss the screen; input closure/errors also settle it. Concurrent AskQuestion calls are explicitly rejected with `status: "error"`, in addition to Pi's sequential execution. Other extensions must respect Pi's UI ownership; this extension does not coordinate unrelated prompts. Non-TUI/non-TTY runs return `requires_interaction` without reading input.
|
|
132
106
|
|
|
133
|
-
|
|
107
|
+
## Removed features
|
|
134
108
|
|
|
135
|
-
|
|
109
|
+
PieXis no longer provides permission modes, tool approvals, classifier review, plan-to-execution handoffs, filtered search, or background worktree tasks. Their commands, shortcuts, flags, and configuration initialization have been removed. Tool execution follows Pi and any other installed extensions; PieXis does not provide sandboxing or access restrictions.
|
|
136
110
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
`/task <work>` (or `background_task`) starts a worker from `HEAD` in a disposable **Git worktree**, with at most two running workers. The permission extension must be active. Worktrees isolate Git changes, **not host filesystem, process, credential, or network access**. Foreground uncommitted changes and the full conversation are not copied; a dirty foreground checkout produces a warning.
|
|
140
|
-
|
|
141
|
-
### Delegation and approvals
|
|
142
|
-
|
|
143
|
-
- Status, cancellation, and diff inspection are recognized operations, including in Plan. Creation, application, and cleanup are denied in Plan/Don't Ask. Unknown custom tools remain unknown.
|
|
144
|
-
- Manual/Accept Edits require one-time approval for agent-requested task creation. A direct `/task <work>` command supplies explicit user authorization. Auto reviews creation against verified user intent; direct task commands receive their own in-memory user-request identifier.
|
|
145
|
-
- The proposed brief is untrusted action data. Optional `brief` fields include goal, context, constraints, files, acceptance criteria (`acceptanceCriteria`), decisions, and verification. Task plus brief is limited to 20,000 characters and is never silently truncated. Keep secrets out of descriptions: briefs go to the worker, may go to the classifier, and are stored in local task metadata.
|
|
146
|
-
- Optional `paths` narrows file-tool scope to relative files/directories (default `["."]`, maximum 32 entries). Traversal, external symlink targets, credentials/protected path-tool writes, uncertain recursive searches, and tools outside the worker capability set are denied. There are no recursive task-delegation tools.
|
|
147
|
-
- Every worker tool call goes through the parent broker and shared evaluator. Workers inherit no foreground session grants. Auto additionally reviews worker mutations against both the original user intent and the delegated brief. Manual approvals are one-time; missing UI, unavailable/expired brokers, and classifier failures deny rather than escalate.
|
|
148
|
-
- New user input, mode changes, grant revocation, branch navigation, session replacement, and shutdown invalidate outstanding task authorizations and cancel queued/running workers. Existing worktrees are retained. Worker denial limits inherit the parent's launch settings and stop that worker, not unrelated tasks.
|
|
149
|
-
|
|
150
|
-
### Opt-in command execution
|
|
151
|
-
|
|
152
|
-
Start Pi with `--background-bash` to expose worker Bash for tests/builds/debugging. This is **permission-controlled command execution**, not sandboxing. It uses the same parent approval/classifier pipeline. Bash requires whole-worktree scope; narrower `paths` cannot be combined with this flag. Known literal external/protected targets are rejected, but parsing/model review cannot constrain arbitrary script effects or descendants. Cancellation revokes future approvals and terminates the worker process; it does not promise that all spawned descendants have stopped.
|
|
153
|
-
|
|
154
|
-
Workers load only their explicit guard extension and worker-only tool wrappers, with built-ins disabled, so a missing guard cannot fall back to unguarded tools. Project trust-gated resources and automatic context-file discovery are disabled; needed repository instructions can be read through the broker. Task text is passed as literal prompt data, not CLI options or `@file` arguments. Pi's trusted user-level runtime and authentication are still used.
|
|
155
|
-
|
|
156
|
-
### Inspect, apply, and clean
|
|
157
|
-
|
|
158
|
-
Use `/task status`, `/task review <id>`, `/task diff <id>`, `/task cancel <id>`, `/task apply <id>`, `/task clean <id>`, and `/task interrupted` (or their corresponding tools where available).
|
|
159
|
-
|
|
160
|
-
`task_diff` snapshots actual tracked/untracked/deleted files using a **temporary index and object store**; it does not stage into the real index or write repository objects. Checkout and inspection use raw bytes rather than executing Git hooks or clean/smudge filters; this skips LFS hydration and normal checkout conversions. Submodules/special files and exhausted inspection budgets fail closed: 10,000 files, 4 MiB per file, 128 MiB total file bytes, and 8 MiB Git output. Active workers must stop before inspection. Diff display is bounded to 50,000 characters, and sensitive/configuration/symlink patch bodies are withheld rather than leaked through the inspection tool.
|
|
161
|
-
|
|
162
|
-
Apply always requires a user dialog showing the **actual changed paths**, sensitive/configuration warnings, and observed command results—even in Auto/Bypass. The patch digest and destination findings are checked again after confirmation, followed by Git apply validation. Worker prose cannot establish successful verification: observations come from post-execution tool records, not claimed test results or blocked tool-start events. Successful command completion is not proof of test coverage; verify again in the parent workspace after application. Repeatedly declined or headless agent-requested apply/cleanup actions use the foreground denial budget.
|
|
163
|
-
|
|
164
|
-
Cleanup confirms deletion and validates the PieXis ownership marker, temporary directory, Git worktree, and repository before removal. Completed unapplied changes are retained rather than discarded. Headless apply/cleanup is denied. Trusted Pi/Git executables are assumed. These checks are not protection against arbitrary host code or filesystem races.
|
|
165
|
-
|
|
166
|
-
Metadata lives at `<agent-dir>/piexis/tasks/<project-hash>.json`, not in the repository. Legacy `.pi/piexis-tasks.json` is imported if user-level state is absent; the source is retained. Interrupted worktrees can be reviewed/cleaned, but authorization, process handles, broker tokens, and user-intent snapshots are never restored from metadata. Fast tests use Git fixtures, mocked worker processes, and mocked reviewers. A separate [runtime suite](tests/runtime/README.md) checks actual Pi RPC/JSON flows, worker processes, and TUI permissions through a pseudo-terminal on Linux, using a deterministic local provider. Live-model accuracy, other platforms, and full visual/terminal compatibility remain unvalidated.
|
|
111
|
+
Existing `piexis` settings, legacy configuration files, session records, and retained task worktrees are not deleted automatically. Old classifier, execution-model, and background-model settings are no longer read. Remove obsolete configuration manually if desired, preserving unrelated settings and any work you need. Remove explicit references to deleted extensions from your Pi resource settings or launch arguments.
|
|
167
112
|
|
|
168
113
|
## Select package resources
|
|
169
114
|
|
|
170
|
-
|
|
115
|
+
Use Pi's native resource filtering with `pi config` (or `pi config --local` for a trusted project), or narrow resources in settings:
|
|
171
116
|
|
|
172
117
|
```json
|
|
173
118
|
{
|
|
174
119
|
"packages": [
|
|
175
120
|
{
|
|
176
121
|
"source": "npm:@preapexis/piexis",
|
|
177
|
-
"extensions": ["extensions/
|
|
122
|
+
"extensions": ["extensions/ask-question.ts"],
|
|
178
123
|
"skills": ["skills/code-review", "skills/diagnosing-bugs", "skills/safe-refactor"],
|
|
179
124
|
"themes": []
|
|
180
125
|
}
|
|
@@ -182,25 +127,14 @@ PieXis uses Pi's native package resource filtering; it does not add its own plug
|
|
|
182
127
|
}
|
|
183
128
|
```
|
|
184
129
|
|
|
185
|
-
Omit a resource type to load all resources of that type; use `[]` to load none
|
|
130
|
+
Omit a resource type to load all declared resources of that type; use `[]` to load none. Glob exclusions such as `"!skills/docx/**"` can omit document workflows.
|
|
186
131
|
|
|
187
132
|
## Development
|
|
188
133
|
|
|
189
134
|
```sh
|
|
135
|
+
npm ci --ignore-scripts
|
|
190
136
|
npm run check
|
|
191
137
|
npm test
|
|
192
|
-
npm run test:runtime
|
|
193
|
-
npm run eval:permissions -- --validate
|
|
194
138
|
```
|
|
195
139
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
`npm run test:runtime` launches the resolved peer dependency's packaged Pi CLI with all manifest extensions, disposable repositories and agent directories, and a deterministic loopback provider. It uses no real credentials or paid model calls. Tests cover permission dialogs, six-mode behavior, reviewer failures/timeouts, worker Bash opt-in, patch confirmation, stale approvals, cancellation, and shutdown. The Linux PTY check exercises the bundled UI and mode shortcuts; it requires `script` and `stty` and is explicitly skipped elsewhere. See [runtime validation results and limits](tests/runtime/README.md).
|
|
199
|
-
|
|
200
|
-
### Classifier evaluation
|
|
201
|
-
|
|
202
|
-
[`eval/permission-cases.json`](eval/permission-cases.json) contains 26 synthetic, labeled cases covering all policy categories, paired authorization changes, injection attempts, and worker scope. The offline runner validates the corpus, exports unlabeled requests using the production reviewer prompt, and scores externally collected model responses. It never executes fixture commands or automatically contacts a provider.
|
|
203
|
-
|
|
204
|
-
See [`eval/README.md`](eval/README.md) for the opt-in live-evaluation procedure, response format, coverage map, and remaining manual release checks. Raw false allows, host policy overrides, false denials, invalid responses, and missing cases are reported separately. Scorer unit tests are not evidence of live model accuracy; no live-model result is claimed.
|
|
205
|
-
|
|
206
|
-
There is currently no `tests/mode-sandbox.test.mjs`; consequently `npm run test:sandbox` cannot establish sandbox coverage. Unit tests do not establish containment or protection of host paths/network.
|
|
140
|
+
Tests cover retained extension/resource contracts, agent configuration/routing/profile state, child-process protocol/cancellation, AskQuestion validation/lifecycle, recommended-tool setup/settings preservation, and skill routing. On Unix with Python 3, automated PTY tests drive the real Pi TUI renderer and native selector, checking keyboard interactions, startup choices, cancellation, cursor/raw-mode restoration, and listener cleanup. They use UI adapters rather than a live agent session; unsupported hosts explicitly skip these tests. Tests do not establish OS containment or live-model behavior. The permission evaluation, sandbox, and background-task runtime suites have been removed with those features.
|