{"_id":"@alpino13/pi-ask","name":"@alpino13/pi-ask","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@alpino13/pi-ask","version":"0.1.0","description":"Pi package for interactive multi-question clarification flows, with a model-callable ask_questions tool and tabbed questionnaire UI.","keywords":["pi-package","pi","skill","extension","questionnaire","clarification"],"type":"module","license":"MIT","repository":{"type":"git","url":"git+https://github.com/AlvaroRausell/pi-ask.git"},"homepage":"https://github.com/AlvaroRausell/pi-ask#readme","bugs":{"url":"https://github.com/AlvaroRausell/pi-ask/issues"},"peerDependencies":{"@mariozechner/pi-ai":"*","@mariozechner/pi-coding-agent":"*","@mariozechner/pi-tui":"*","@sinclair/typebox":"*"},"pi":{"extensions":["./extensions"],"skills":["./skills"]},"gitHead":"0b3f1bd25eec50367885d656801bdea74d4aa990","_id":"@alpino13/pi-ask@0.1.0","_nodeVersion":"25.2.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-VnaIr49QlYL06UHXC7/PEXpcRiBgewJ7hWs+Gf5Tc233Sh8TjD4ZQMCrCJm2iufrhx4p8Jy+NoBN3T5Vc6byjA==","shasum":"ec408c1faf40a970a63eabfd7b6273200568949c","tarball":"https://registry.npmjs.org/@alpino13/pi-ask/-/pi-ask-0.1.0.tgz","fileCount":5,"unpackedSize":45085,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBaizyIvKGSzHdCegMTTU4Bh2o+Ht4VWTNCJGStBPemVAiEA3OTiwYOc/Q99UH9I3f7cnYP9+cnPS/i/b9GZ38ThYmc="}]},"_npmUser":{"name":"alpino13","email":"alvaro.rausellg@gmail.com"},"directories":{},"maintainers":[{"name":"alpino13","email":"alvaro.rausellg@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-ask_0.1.0_1776625381982_0.6168366111161867"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-19T19:03:01.915Z","0.1.0":"2026-04-19T19:03:02.114Z","modified":"2026-04-19T19:03:02.337Z"},"maintainers":[{"name":"alpino13","email":"alvaro.rausellg@gmail.com"}],"description":"Pi package for interactive multi-question clarification flows, with a model-callable ask_questions tool and tabbed questionnaire UI.","homepage":"https://github.com/AlvaroRausell/pi-ask#readme","keywords":["pi-package","pi","skill","extension","questionnaire","clarification"],"repository":{"type":"git","url":"git+https://github.com/AlvaroRausell/pi-ask.git"},"bugs":{"url":"https://github.com/AlvaroRausell/pi-ask/issues"},"license":"MIT","readme":"# pi-ask\n\n`pi-ask` is a Pi package for interactive multi-question clarification flows in Pi.\n\nIt adds:\n\n- a marketplace-installable skill for multi-question clarification workflows\n- an `ask_questions` tool that models can call directly\n- an `/ask` command for manual invocation\n- an interactive tabbed questionnaire UI inside Pi\n\n## Install\n\nFrom npm (recommended):\n\n```bash\npi install npm:@alpino13/pi-ask\n```\n\nFrom the GitHub repo:\n\n```bash\npi install git:github.com/AlvaroRausell/pi-ask\n```\n\nFrom a local clone:\n\n```bash\ngit clone https://github.com/AlvaroRausell/pi-ask.git\ncd pi-ask\npi install .\n```\n\nAfter installing, the `ask` skill, `ask_questions` tool, and `/ask` command will be available in your next Pi session.\n\n## Recommended flow\n\nThe primary flow is: the model calls `ask_questions` directly.\n\nThat means when the assistant has several clarification questions, it can open the interactive questionnaire immediately instead of asking the user to manually run `/ask`.\n\n`/ask` still exists as a manual fallback and for testing.\n\n## What it does\n\nWhen a model produces a message like:\n\n```text\n1. Which framework should I use?\n2. Do you want TypeScript?\n3. Should I optimize for speed or readability?\n```\n\nrun:\n\n```bash\n/ask 1. Which framework should I use?\n2. Do you want TypeScript?\n3. Should I optimize for speed or readability?\n```\n\nYou can also run `/ask` immediately after the assistant asks those questions; it will use the latest assistant message as input.\n\nThe ask flow will:\n\n1. send the raw text to a smaller LLM\n2. convert it into structured questions + options\n3. open a tabbed UI, one tab per question plus a final `Submit` tab\n4. show progress like `2/3 answered`\n5. load a natural-language answer bundle into the editor\n\nThe package currently keeps answers in the editor only. It does not auto-send them back to the main model.\n\n## Configuring the smaller LLM\n\nRecommended model:\n\n```bash\nopenai/gpt-4.1-mini\n```\n\nResolution order:\n\n1. `PI_ASK_MODEL`\n2. `/ask-settings` saved configuration\n3. current active Pi model\n\nCommands:\n\n```bash\n/ask-model      # show which model will be used\n/ask-settings   # save a default /ask model\n```\n\nEnvironment override:\n\n```bash\nexport PI_ASK_MODEL=\"openai/gpt-4.1-mini\"\n```\n\n## Commands and tool\n\n- `ask_questions` — primary model-facing tool\n- `/ask` — manual command for running the questionnaire flow from text or the latest assistant message\n- `/ask-model` — shows which small model will be used\n- `/ask-settings` — saves the default small model configuration\n\n## Current questionnaire behavior\n\n- tab labels use `1 2 3 ...` with type icons (`≡` multi, `☑` checkbox)\n- final dedicated `Submit` tab\n- auto-jumps to `Submit` after the last answer\n- three question types:\n  - **single** — pick one option (default, numbered list with `>`)\n  - **checkbox** — yes/no toggle (radio-style `[●] / [○]` for Yes/No)\n  - **multi-select** — pick multiple options (checkbox-style `[■] / [□]`, Space to toggle, Enter to confirm)\n- freeform fallback via `Write my own answer` (single-select only)\n- simple fallback parsing if the small model does not return valid JSON\n- simple `A or B` option inference\n- automatic type inference from question phrasing:\n  - \"all that apply\", \"which of\", \"select all\" → multi-select\n  - \"do you want\", \"should I\", \"would you like\" → checkbox\n  - everything else → single\n- multi-select answers display as comma-separated labels in the submit tab and summary\n\n## Planned future enhancements\n\n- priority ranking\n- stronger validation and parsing\n- custom option entry in multi-select mode\n- conditional question flow (show q3 only if q2 is yes)\n\n## Files\n\n- `skills/ask/SKILL.md` — skill instructions for the main model\n- `extensions/pi-ask/index.ts` — `/ask`, `/ask-model`, `/ask-settings`, `ask_questions`, and the interactive UI\n\n## Publishing\n\n```bash\npi install npm:@alpino13/pi-ask\n```\n","readmeFilename":"README.md","_rev":"1-fde7145f405ab50252425a829ee971f1"}