chore: prepare package for automated releases
This commit is contained in:
@@ -1,90 +1,45 @@
|
||||
# pi-ask
|
||||
# @eko24ive/pi-ask
|
||||
|
||||
`pi-ask` is a **pi.dev extension** that adds an interactive `ask_user` clarification tool.
|
||||
`@eko24ive/pi-ask` is a **pi package** that adds an interactive `ask_user` clarification tool.
|
||||
|
||||
It lets an agent pause, ask structured questions in a terminal UI, and continue with normalized answers instead of guessing.
|
||||
|
||||
## Project layout
|
||||
|
||||
- `src/` — TypeScript extension implementation
|
||||
- `tests/` — behavior-focused tests
|
||||
- `docs/` — small docs set for contract and architecture
|
||||
|
||||
## Getting started
|
||||
|
||||
### Requirements
|
||||
|
||||
- Node.js `22.19.0`
|
||||
- pnpm `10.33.0`
|
||||
|
||||
The repo also includes `.nvmrc` and `.node-version` pinned to the same Node.js version.
|
||||
|
||||
### Load the extension in pi
|
||||
|
||||
Run pi with the extension entrypoint:
|
||||
## Install
|
||||
|
||||
```bash
|
||||
pi -e ./src/index.ts
|
||||
pi install npm:@eko24ive/pi-ask
|
||||
```
|
||||
|
||||
Load it dynamically with the `-e` flag.
|
||||
|
||||
### Install dependencies
|
||||
You can also install from git:
|
||||
|
||||
```bash
|
||||
pnpm install
|
||||
pi install git:github.com/eko24ive/pi-ask
|
||||
```
|
||||
|
||||
### Run tests
|
||||
## Use
|
||||
|
||||
```bash
|
||||
pnpm test
|
||||
```
|
||||
|
||||
### Commit workflow
|
||||
|
||||
This repo uses `lefthook` together with Commitizen and conventional commitlint.
|
||||
|
||||
Recommended flow:
|
||||
|
||||
```bash
|
||||
pnpm commit
|
||||
```
|
||||
|
||||
That opens the Commitizen prompt using `cz-conventional-changelog`.
|
||||
The git hooks also validate commit messages through `commitlint`.
|
||||
|
||||
### Biome / typecheck
|
||||
|
||||
```bash
|
||||
pnpm format
|
||||
pnpm lint
|
||||
pnpm check
|
||||
pnpm typecheck
|
||||
```
|
||||
|
||||
### Zed
|
||||
|
||||
This repo includes project-local Zed settings at:
|
||||
|
||||
- `.zed/settings.json`
|
||||
|
||||
They are set up to:
|
||||
|
||||
- format TypeScript, JSON, and JSONC files with `pnpm exec biome format --stdin-file-path {buffer_path}`
|
||||
- format on save
|
||||
- keep newline / trailing whitespace behavior aligned with the repo settings
|
||||
|
||||
Note: some Zed settings such as global extension auto-install and autosave are not valid in project-local `.zed/settings.json`, so they are intentionally not included here.
|
||||
|
||||
## Tool
|
||||
|
||||
The extension registers one tool: `ask_user`.
|
||||
After installation, the package registers one tool: `ask_user`.
|
||||
|
||||
Use it when the agent needs structured clarification before proceeding.
|
||||
Use `type: "preview"` when an option needs a dedicated preview pane.
|
||||
|
||||
### Input shape
|
||||
### Example agent instruction
|
||||
|
||||
```text
|
||||
When requirements are ambiguous or user preferences materially affect implementation,
|
||||
call `ask_user` instead of guessing.
|
||||
|
||||
Ask 1-3 concise questions.
|
||||
Use short tab labels.
|
||||
Prefer 2-4 options per question.
|
||||
Include descriptions for each option.
|
||||
Use `type: "single"` unless multiple options can genuinely apply.
|
||||
Use `type: "multi"` only when the user may need to select several answers.
|
||||
Use `type: "preview"` when an option needs a preview panel.
|
||||
After answers are returned, continue the task using those answers explicitly.
|
||||
```
|
||||
|
||||
## Tool input
|
||||
|
||||
`ask_user` accepts:
|
||||
|
||||
@@ -97,7 +52,7 @@ Use `type: "preview"` when an option needs a dedicated preview pane.
|
||||
label?: string,
|
||||
prompt: string,
|
||||
type?: "single" | "multi" | "preview",
|
||||
required?: boolean, // metadata only; submit is never blocked
|
||||
required?: boolean,
|
||||
options: [
|
||||
{
|
||||
value: string,
|
||||
@@ -181,8 +136,8 @@ The returned `details.answers[questionId]` object may include:
|
||||
labels: string[]
|
||||
indices: number[]
|
||||
customText?: string
|
||||
note?: string // question-level note
|
||||
optionNotes?: Record<string, string> // selected options only
|
||||
note?: string
|
||||
optionNotes?: Record<string, string>
|
||||
}
|
||||
```
|
||||
|
||||
@@ -197,32 +152,53 @@ Behavior:
|
||||
- while editing a note or free-form answer, `Up` / `Down` save the draft and move navigation instead of being trapped by the editor
|
||||
- `Space` toggles the active option on single-select questions too, but does not auto-advance
|
||||
|
||||
## Example agent instruction
|
||||
## Local development
|
||||
|
||||
You can give the agent an instruction like this to encourage proper `ask_user` usage:
|
||||
### Requirements
|
||||
|
||||
```text
|
||||
When requirements are ambiguous or user preferences materially affect implementation,
|
||||
call `ask_user` instead of guessing.
|
||||
- Node.js `22.19.0`
|
||||
- pnpm `10.33.0`
|
||||
|
||||
Ask 1-3 concise questions.
|
||||
Use short tab labels.
|
||||
Prefer 2-4 options per question.
|
||||
Include descriptions for each option.
|
||||
Use `type: "single"` unless multiple options can genuinely apply.
|
||||
Use `type: "multi"` only when the user may need to select several answers.
|
||||
Use `type: "preview"` when an option needs a preview panel.
|
||||
After answers are returned, continue the task using those answers explicitly.
|
||||
The repo also includes `.nvmrc` and `.node-version` pinned to the same Node.js version.
|
||||
|
||||
### Run locally in pi
|
||||
|
||||
```bash
|
||||
pi -e ./src/index.ts
|
||||
```
|
||||
|
||||
### Example request to the agent
|
||||
### Install dependencies
|
||||
|
||||
```text
|
||||
Before implementing, clarify my preferences with `ask_user` if needed.
|
||||
For example, ask about framework choice, styling approach, and testing strictness.
|
||||
Do not guess if those choices would change the implementation.
|
||||
```bash
|
||||
pnpm install
|
||||
```
|
||||
|
||||
### Development commands
|
||||
|
||||
```bash
|
||||
pnpm format
|
||||
pnpm lint
|
||||
pnpm check
|
||||
pnpm typecheck
|
||||
pnpm test
|
||||
```
|
||||
|
||||
### Commit workflow
|
||||
|
||||
This repo uses `lefthook`, Commitizen, conventional commitlint, and semantic-release.
|
||||
|
||||
Recommended flow:
|
||||
|
||||
```bash
|
||||
pnpm commit
|
||||
```
|
||||
|
||||
## Project layout
|
||||
|
||||
- `src/` — TypeScript extension implementation
|
||||
- `tests/` — behavior-focused tests
|
||||
- `docs/` — small docs set for contract and architecture
|
||||
|
||||
## Documentation
|
||||
|
||||
Docs stay intentionally small:
|
||||
@@ -230,9 +206,3 @@ Docs stay intentionally small:
|
||||
- `docs/README.md` — index
|
||||
- `docs/contract.md` — external behavior
|
||||
- `docs/architecture.md` — module boundaries and invariants
|
||||
|
||||
Implementation detail should stay in the code and tests.
|
||||
|
||||
## Status
|
||||
|
||||
Implemented in TypeScript with behavior-focused test coverage.
|
||||
|
||||
Reference in New Issue
Block a user