Files
云服务部-叶林立andDevin <158243242+devin-ai-integration[bot]@users.noreply.github.com> 0c45b1a438 docs: 拆分 AGENTS.md,根文件只保留全局规则
根 AGENTS.md 从约 78KB 压缩到约 10KB,避免作为常驻规则加载时被截断:
只保留仓库定位、扩展清单、跨扩展硬规则与通用验证命令。各扩展的维护
约定与验证命令移入对应目录的 AGENTS.md(新增 extensions/AGENTS.md 承载
系统提示词与根目录 TS/LSP 约定),上游来源记录统一放进各目录的中文
UPSTREAM.md,并补齐 pi-permission-system 与 pi-rtk-optimizer 的来源记录。

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-20 19:43:22 -07:00
..

pi-ask-user

A locally maintained Pi extension that consolidates the upstream question.ts and questionnaire.ts examples into one model-initiated tool. It intentionally does not include the /qna command.

Tool

The extension registers ask_user_question. The model can present one to eight questions through an interactive Pi UI:

  • select: one to eight stable { value, label, description? } choices, always followed by a free-form choice that the model cannot disable;
  • text: a free-form answer;
  • required: false: lets the user explicitly skip the question;
  • TUI mode: one sequential custom interaction with progress tabs and a final review page;
  • RPC mode: standard Pi select / input dialogs shown one question at a time by compatible clients such as Paseo.

The model should call the tool only when a missing decision, preference, or clarification is needed to continue. It should not repeat questions already answered in the user's direct messages.

TUI controls

  • ↑ / ↓: move through choices;
  • Enter: select, edit, or submit;
  • Tab, Shift+Tab, ←, →: move between questions and review;
  • Esc: leave text entry, or cancel from a question/review page.

The outer component propagates focus to the embedded Editor for IME cursor positioning.

RPC clients use their native dialog controls. Dismissing a dialog or aborting the tool returns cancelled: true; required blank text is requested again, while optional blank text is recorded as an explicit skip.

Result contract

Successful results include readable text and structured details:

{
  "version": 1,
  "cancelled": false,
  "questions": [],
  "answers": [
    {
      "id": "language",
      "question": "Which language should be used?",
      "type": "select",
      "answer": "TypeScript",
      "value": "typescript",
      "label": "TypeScript",
      "custom": false,
      "skipped": false
    }
  ]
}

The tool name and the question / answer fields intentionally match pi-permission-system's integrated AutoReview trusted structured user-interaction envelope. Cancelled results are never treated as authorization evidence.

The tool requires dialog-capable interactive UI. TUI mode uses the custom questionnaire, RPC mode uses Pi's standard extension UI bridge, and JSON/print modes receive a tool error rather than an invented answer.

Development

npm test
npm run check

See UPSTREAM.md for the imported reference snapshot and local differences.