@pi-archimedes/ask 1.4.1 → 1.5.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-archimedes/ask",
3
- "version": "1.4.1",
3
+ "version": "1.5.0",
4
4
  "type": "module",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -11,7 +11,7 @@
11
11
  ],
12
12
  "main": "./src/index.ts",
13
13
  "dependencies": {
14
- "@pi-archimedes/core": "1.4.1"
14
+ "@pi-archimedes/core": "1.5.0"
15
15
  },
16
16
  "peerDependencies": {
17
17
  "@earendil-works/pi-coding-agent": ">=0.1.0",
package/src/dialog.ts CHANGED
@@ -16,10 +16,10 @@ import {
16
16
  buildSingleSelectionResult,
17
17
  type AskQuestion,
18
18
  type AskSelection,
19
- } from "./selection";
20
- import { getLinearCursorIndexFromEditor } from "./cursor";
21
- import { INLINE_NOTE_WRAP_PADDING, buildWrappedOptionLabelWithInlineNote } from "./note";
22
- import { appendWrappedTextLines } from "./wrap";
19
+ } from "./selection.js";
20
+ import { getLinearCursorIndexFromEditor } from "./cursor.js";
21
+ import { INLINE_NOTE_WRAP_PADDING, buildWrappedOptionLabelWithInlineNote } from "./note.js";
22
+ import { appendWrappedTextLines } from "./wrap.js";
23
23
 
24
24
  interface PreparedQuestion {
25
25
  id: string;
package/src/index.ts CHANGED
@@ -3,9 +3,9 @@ import { Type, type Static } from "typebox";
3
3
  import { getBus, Events } from "@pi-archimedes/core/bus";
4
4
  import { connect } from "node:net";
5
5
  import { randomUUID } from "node:crypto";
6
- import { OTHER_OPTION, type AskQuestion, type AskSelection } from "./selection";
7
- import { askSingleQuestionWithInlineNote } from "./picker";
8
- import { askQuestionsWithTabs } from "./dialog";
6
+ import { OTHER_OPTION, type AskQuestion, type AskSelection } from "./selection.js";
7
+ import { askSingleQuestionWithInlineNote } from "./picker.js";
8
+ import { askQuestionsWithTabs } from "./dialog.js";
9
9
 
10
10
  const OptionItemSchema = Type.Object({
11
11
  label: Type.String({ description: "Display label" }),
@@ -287,10 +287,9 @@ export function registerAsk(pi: ExtensionAPI) {
287
287
  parameters: AskParamsSchema,
288
288
 
289
289
  async execute(_toolCallId, params: AskParams, _signal, _onUpdate, ctx) {
290
- // DEPRECATED: Socket-based headless mode.
291
- // The fork-based subagent child (child.ts) now uses an IPC ask tool (ipc-ask-tool.ts)
292
- // that communicates directly via process.send()/process.on('message').
293
- // This socket-based path is kept for backward compatibility during transition.
290
+ // Headless/subagent path: the child's ask tool connects to the parent's
291
+ // PI_SUBAGENT_SOCKET bridge (created in subagent/spawn.ts:startAskSocketServer)
292
+ // and exchanges ask_request/ask_response JSON lines.
294
293
  if (!ctx.hasUI) {
295
294
  const requestId = randomUUID();
296
295
  const socketPath = process.env.PI_SUBAGENT_SOCKET;
package/src/picker.ts CHANGED
@@ -15,10 +15,10 @@ import {
15
15
  buildSingleSelectionResult,
16
16
  type AskOption,
17
17
  type AskSelection,
18
- } from "./selection";
19
- import { getLinearCursorIndexFromEditor } from "./cursor";
20
- import { INLINE_NOTE_WRAP_PADDING, buildWrappedOptionLabelWithInlineNote } from "./note";
21
- import { appendWrappedTextLines } from "./wrap";
18
+ } from "./selection.js";
19
+ import { getLinearCursorIndexFromEditor } from "./cursor.js";
20
+ import { INLINE_NOTE_WRAP_PADDING, buildWrappedOptionLabelWithInlineNote } from "./note.js";
21
+ import { appendWrappedTextLines } from "./wrap.js";
22
22
 
23
23
  interface SingleQuestionInput {
24
24
  question: string;