@ssk_dev/rpiv-ask-user-question-lean 2.4.0 → 2.4.1

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.
Files changed (3) hide show
  1. package/README.md +23 -21
  2. package/README.zh-CN.md +26 -24
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,49 +1,51 @@
1
1
  # @ssk_dev/rpiv-ask-user-question-lean
2
2
 
3
- > **Lean Pi ask-user-question plugin, same functionality 215 initialization tokens, 83% fewer than the original.**
3
+ > **Lean Pi ask-user-question plugin with identical features: 215 initialization tokens, 83% lighter than original.**
4
4
  > [See my full setup for Pi](https://github.com/kunkun9527/my-lean-pi-setup)
5
5
 
6
6
  [简体中文](README.zh-CN.md)
7
7
 
8
- A token-lean Pi wrapper around [`@juicesharp/rpiv-ask-user-question`](https://github.com/juicesharp/rpiv-mono/tree/main/packages/rpiv-ask-user-question). It preserves structured clarification while reducing model-facing metadata.
8
+ A lightweight Pi wrapper for [`@juicesharp/rpiv-ask-user-question`](https://github.com/juicesharp/rpiv-mono/tree/main/packages/rpiv-ask-user-question). It preserves interactive questionnaire prompts and structured validation while trimming repetitive prompt metadata.
9
9
 
10
- ## What it keeps
10
+ ## Core Features
11
11
 
12
- - The questionnaire UI and RPC fallback.
13
- - Input validation, events, and lifecycle behavior.
14
- - Single-select and multi-select questions, recommendation ordering, and useful previews.
12
+ * Interactive UI: Retains the full questionnaire interface, preview elements, and RPC fallback.
13
+ * Structured validation: Supports single-select and multi-select questions, recommendation ordering, and strict option validation.
14
+ * Compact prompt schema: Strips boilerplate descriptions from the tool definition, cutting prompt overhead without changing runtime behavior.
15
15
 
16
- ## Why it is lean
17
-
18
- The wrapper keeps the upstream `ask_user_question` runtime but shortens its tool description and prompt guidance and removes repeated schema descriptions. The complete questionnaire behavior still comes from the pinned upstream package.
19
-
20
- ## Install
16
+ ## Installation
21
17
 
22
18
  ```bash
23
19
  pi install npm:@ssk_dev/rpiv-ask-user-question-lean
24
20
  ```
25
21
 
26
- Do not load it together with another `rpiv-ask-user-question` wrapper, or the tool may be registered twice.
22
+ Do not load this alongside another `rpiv-ask-user-question` wrapper to avoid registering duplicate tools.
27
23
 
28
- ## Use
24
+ ## Usage
29
25
 
30
- The model sees one tool:
26
+ The model interacts with a single tool:
31
27
 
32
28
  ```text
33
29
  ask_user_question
34
30
  ```
35
31
 
36
- Use it when a required user decision is unclear. Each call can ask 14 structured questions with 24 explicit options per question.
32
+ Use this tool when user clarification or decision-making is required. Each call can ask 1 to 4 structured questions with 2 to 4 clear options per question.
33
+
34
+ ## Context Footprint Benchmark
35
+
36
+ With only this extension enabled, its recurring initialization overhead in the model context is:
37
37
 
38
- ## Measured initialization footprint
38
+ | Model-facing tool | Lean | Upstream `@juicesharp/rpiv-ask-user-question@2.4.0` |
39
+ | --- | ---: | ---: |
40
+ | `ask_user_question` | **215** | **1,258** |
39
41
 
40
- With only this extension enabled, the lean `ask_user_question` tool contributes an estimated **215 tokens** of recurring model-facing initialization context. The pinned upstream `@juicesharp/rpiv-ask-user-question@2.4.0` tool contributes **1,258 tokens** under the same conditions. That is **1,043 fewer tokens (82.9%)**.
42
+ This saves **1,043 tokens (82.9%)** compared to the pinned upstream package.
41
43
 
42
- The measurement used Pi 0.84.4 and `pi-context-view@0.4.3` in a fresh isolated session, excluding Pi built-in tools, skills, context files, messages, and unrelated extensions. Context View estimates text as `ceil(characters / 4)`, so these are reproducible context-footprint estimates rather than exact GPT tokenizer counts. Runtime-only UI and slash commands are not included because they are not sent to the model.
44
+ The benchmark was measured on Pi 0.84.4 with `pi-context-view@0.4.3` in a fresh isolated session, excluding built-in tools, skills, context files, and unrelated extensions. Context View estimates tokens as `ceil(characters / 4)`. Pure runtime UI elements and slash commands are excluded as they are not sent to the model.
43
45
 
44
46
  ## Versions
45
47
 
46
- The upstream runtime is pinned to `@juicesharp/rpiv-ask-user-question@2.4.0`.
48
+ Upstream runtime is pinned to `@juicesharp/rpiv-ask-user-question@2.4.0`.
47
49
 
48
50
  ## Development
49
51
 
@@ -52,8 +54,8 @@ npm ci
52
54
  npm run check
53
55
  ```
54
56
 
55
- The test suite uses a local harness and does not open the real questionnaire UI.
57
+ The test suite runs with a local harness and does not launch the actual interactive questionnaire UI.
56
58
 
57
- ## License and upstream
59
+ ## License
58
60
 
59
61
  MIT. This project wraps the MIT-licensed [`@juicesharp/rpiv-ask-user-question`](https://github.com/juicesharp/rpiv-mono/tree/main/packages/rpiv-ask-user-question).
package/README.zh-CN.md CHANGED
@@ -1,21 +1,17 @@
1
1
  # @ssk_dev/rpiv-ask-user-question-lean
2
2
 
3
- > **Lean Pi ask-user-question 插件,功能相同:215 个初始化 tokens,较原插件减少 83%。**
4
- > **整套配置:** [查看 Pi Lean Setup](https://github.com/kunkun9527/my-lean-pi-setup)
3
+ > **Pi 用户提问交互插件精简版,保留全部功能,仅需 215 初始化 Token,相比原版减少 83%。**
4
+ > **完整配置参考:** [查看 Pi Lean Setup](https://github.com/kunkun9527/my-lean-pi-setup)
5
5
 
6
6
  [English](README.md)
7
7
 
8
- [`@juicesharp/rpiv-ask-user-question`](https://github.com/juicesharp/rpiv-mono/tree/main/packages/rpiv-ask-user-question) 的 token 精简版 Pi 包装层。它保留结构化需求确认能力,同时减少模型可见元数据。
8
+ 基于 [`@juicesharp/rpiv-ask-user-question`](https://github.com/juicesharp/rpiv-mono/tree/main/packages/rpiv-ask-user-question) 的精简封装。在完整保留交互式问卷界面与选项校验的同时,精简工具描述与提示词,大幅减少初始化上下文开销。
9
9
 
10
- ## 保留的能力
10
+ ## 核心特性
11
11
 
12
- - 问卷 UI 和 RPC fallback。
13
- - 输入验证、事件和生命周期行为。
14
- - 单选、多选、推荐项排序和有用的预览。
15
-
16
- ## 为什么更精简
17
-
18
- 包装层保留上游 `ask_user_question` 运行时,但缩短工具描述和提示指引,并删除重复的 schema 描述。完整问卷行为仍由固定版本的上游包提供。
12
+ * 完整交互体验:保留原版问卷交互界面、选项预览以及 RPC 回退机制。
13
+ * 结构化输入验证:支持单选、多选、推荐选项排序与严格的输入校验。
14
+ * 精简 Prompt 描述:精简工具说明中的冗余文本,让模型更轻快地发起澄清提问。
19
15
 
20
16
  ## 安装
21
17
 
@@ -23,37 +19,43 @@
23
19
  pi install npm:@ssk_dev/rpiv-ask-user-question-lean
24
20
  ```
25
21
 
26
- 不要同时加载另一个 `rpiv-ask-user-question` 包装层,否则工具可能被重复注册。
22
+ 请勿与其它 `rpiv-ask-user-question` 包装插件同时加载,以防重复注册工具。
27
23
 
28
- ## 使用
24
+ ## 使用方法
29
25
 
30
- 模型只看到一个工具:
26
+ 模型仅会看到一个工具:
31
27
 
32
28
  ```text
33
29
  ask_user_question
34
30
  ```
35
31
 
36
- 当必要的用户决策不明确时使用它。每次调用可以询问 14 个结构化问题,每个问题提供 24 个明确选项。
32
+ 当遇到不明确的需求或需要用户做选择时使用。每次调用可提出 14 个结构化问题,每个问题提供 24 个明确选项。
33
+
34
+ ## 初始化上下文占用对比
35
+
36
+ 单独启用本插件时,注入到模型初始上下文中的 Token 占用实测如下:
37
37
 
38
- ## 实测初始化上下文占用
38
+ | 模型可见工具 | Lean 精简版 | 原版 `@juicesharp/rpiv-ask-user-question@2.4.0` |
39
+ | --- | ---: | ---: |
40
+ | `ask_user_question` | **215** | **1,258** |
39
41
 
40
- 仅启用本扩展时,lean `ask_user_question` 工具会贡献约 **215 tokens** 的持续模型可见初始化上下文。相同条件下,固定版本的上游 `@juicesharp/rpiv-ask-user-question@2.4.0` 工具贡献 **1,258 tokens**,即减少 **1,043 tokens(82.9%)**。
42
+ 相比固定版本的上游扩展,初始开销减少了 **1,043 tokens(82.9%)**。
41
43
 
42
- 测量使用 Pi 0.84.4 `pi-context-view@0.4.3`,在全新隔离会话中只启用目标扩展,并排除 Pi 内置工具、skills、context files、消息及无关扩展。Context View 按 `ceil(字符数 / 4)` 估算,因此这些是可复现的上下文占用估值,不是 GPT tokenizer 的精确计数。未计入不会发送给模型的纯运行时 UI slash commands。
44
+ 测试环境为 Pi 0.84.4 `pi-context-view@0.4.3` 独立会话,排除了 Pi 内置工具、Skills、上下文文件与无关扩展。Context View 按 `ceil(字符数 / 4)` 估算。未计入不会发送给模型的纯运行时 UI Slash 命令。
43
45
 
44
- ## 版本
46
+ ## 版本说明
45
47
 
46
- 上游运行时固定为 `@juicesharp/rpiv-ask-user-question@2.4.0`。
48
+ 上游运行时锁定为 `@juicesharp/rpiv-ask-user-question@2.4.0`。
47
49
 
48
- ## 开发
50
+ ## 本地开发
49
51
 
50
52
  ```bash
51
53
  npm ci
52
54
  npm run check
53
55
  ```
54
56
 
55
- 测试套件使用本地 harness,不会打开真实问卷 UI。
57
+ 测试套件使用本地 Harness 运行,不会弹出实际的交互问卷 UI。
56
58
 
57
- ## 许可证与上游
59
+ ## 开源协议与致谢
58
60
 
59
- MIT。本项目包装了采用 MIT 许可证的 [`@juicesharp/rpiv-ask-user-question`](https://github.com/juicesharp/rpiv-mono/tree/main/packages/rpiv-ask-user-question)。
61
+ MIT 协议。本项目封装自采用 MIT 协议的 [`@juicesharp/rpiv-ask-user-question`](https://github.com/juicesharp/rpiv-mono/tree/main/packages/rpiv-ask-user-question)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssk_dev/rpiv-ask-user-question-lean",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "type": "module",
5
5
  "description": "Lean Pi ask-user-question plugin, same functionality — 215 initialization tokens, 83% fewer than the original.",
6
6
  "license": "MIT",