@luxass/pi-questions 0.1.0 → 0.1.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.
package/README.md CHANGED
@@ -10,6 +10,8 @@ pi install npm:@luxass/pi-questions
10
10
 
11
11
  Requires interactive Pi. RPC, JSON, and print modes are not supported. There are no commands or configuration files.
12
12
 
13
+ With Herdr's Pi integration installed and loaded, Herdr marks the agent as blocked while a questionnaire is open. Submission, cancellation, an abort, or an error clears this questionnaire's blocked state. Without the integration, questionnaires work as usual.
14
+
13
15
  ## Use
14
16
 
15
17
  The model can use `ask_questions` without an explicit request. Its instructions tell it to clarify unclear goals, scope, and constraints before implementing a new system or substantial feature. It skips questions you already answered and routine implementation details. You can also ask it to use the tool explicitly.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luxass/pi-questions",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Ask structured questions in Pi with tabs, choices, notes, and Markdown previews.",
5
5
  "keywords": [
6
6
  "pi",
@@ -35,8 +35,8 @@
35
35
  ]
36
36
  },
37
37
  "scripts": {
38
- "lint": "oxlint --deny-warnings .",
39
- "lint:fix": "oxlint --fix --deny-warnings .",
38
+ "lint": "oxlint .",
39
+ "lint:fix": "oxlint --fix .",
40
40
  "fmt": "oxfmt .",
41
41
  "fmt:check": "oxfmt --check .",
42
42
  "typecheck": "tsc -p tsconfig.json"
package/src/index.ts CHANGED
@@ -20,6 +20,7 @@ const TOOL_NAME = "ask_questions";
20
20
  let inlineInUse = false;
21
21
 
22
22
  async function showQuestions(
23
+ pi: ExtensionAPI,
23
24
  params: Questions,
24
25
  ctx: ExtensionContext,
25
26
  signal?: AbortSignal,
@@ -58,6 +59,8 @@ async function showQuestions(
58
59
  let ownsInlineSlot = !inlineInUse;
59
60
  if (ownsInlineSlot) inlineInUse = true;
60
61
  try {
62
+ // Herdr's optional Pi integration owns state reporting and counts overlapping blockers.
63
+ pi.events.emit("herdr:blocked", { active: true, label: "Waiting for answers" });
61
64
  if (ownsInlineSlot) {
62
65
  const result = await mount(false);
63
66
  if (result) return result;
@@ -69,6 +72,7 @@ async function showQuestions(
69
72
  } finally {
70
73
  if (ownsInlineSlot) inlineInUse = false;
71
74
  signal?.removeEventListener("abort", abort);
75
+ pi.events.emit("herdr:blocked", { active: false });
72
76
  }
73
77
  }
74
78
  export default function askQuestions(pi: ExtensionAPI) {
@@ -97,7 +101,7 @@ export default function askQuestions(pi: ExtensionAPI) {
97
101
  openWorldHint: false,
98
102
  },
99
103
  async execute(_id, params, signal, _update, ctx) {
100
- const result = await showQuestions(params, ctx, signal);
104
+ const result = await showQuestions(pi, params, ctx, signal);
101
105
  const prefix =
102
106
  result.message ??
103
107
  (result.cancelled