@pushary/agent-hooks 0.89.1 → 0.89.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.89.2
4
+
5
+ ### Multi-question prompts keep their real answer shape
6
+
7
+ Claude still sends each question separately so older clients can answer it, but
8
+ each card now carries its canonical metadata too. Current notch, phone, web and
9
+ Slack surfaces keep descriptions, write-in answers and every multi-select value
10
+ instead of collapsing a multi-select to one top-level option.
11
+
3
12
  ## 0.89.0
4
13
 
5
14
  ### Hermes approvals go to the phone, and setup wires it
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  handlePreToolUse
4
- } from "../chunk-VI27GQKE.js";
4
+ } from "../chunk-HEQVIIBN.js";
5
5
  import "../chunk-ATBKJNWS.js";
6
6
  import "../chunk-VZKXBFUA.js";
7
7
  import {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  handlePermissionDenied
4
- } from "../chunk-VI27GQKE.js";
4
+ } from "../chunk-HEQVIIBN.js";
5
5
  import "../chunk-ATBKJNWS.js";
6
6
  import "../chunk-VZKXBFUA.js";
7
7
  import {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  handlePermissionRequest
4
- } from "../chunk-VI27GQKE.js";
4
+ } from "../chunk-HEQVIIBN.js";
5
5
  import "../chunk-ATBKJNWS.js";
6
6
  import "../chunk-VZKXBFUA.js";
7
7
  import {
@@ -316,12 +316,12 @@ var withLabels = (question) => ({
316
316
  ...question,
317
317
  labels: question.options.map((option) => option.label)
318
318
  });
319
+ var withoutLabels = ({ labels: _, ...question }) => question;
319
320
  var parseQuestions = (toolInput) => parseAgentQuestions(toolInput)?.map(withLabels);
320
321
  var questionContext = (question, index, total, project) => {
321
322
  const subject = question.header ? `${question.header}: your agent is asking in ${project}` : `Your agent is asking in ${project}`;
322
323
  return total > 1 ? `${subject} (${index + 1} of ${total})` : subject;
323
324
  };
324
- var encodeAnswer = (question, value) => question.multiSelect ? JSON.stringify([value]) : value;
325
325
  var askAsOneCard = async (apiKey, input, parsed, projectName, deadline) => {
326
326
  const only = parsed[0];
327
327
  let result;
@@ -330,7 +330,7 @@ var askAsOneCard = async (apiKey, input, parsed, projectName, deadline) => {
330
330
  question: only.question,
331
331
  type: "select",
332
332
  options: [...only.labels],
333
- questions: parsed.map(({ labels: _, ...question }) => question),
333
+ questions: parsed.map(withoutLabels),
334
334
  context: questionContext(only, 0, 1, projectName),
335
335
  agentName: `Claude Code - ${projectName}`,
336
336
  sessionId: input.session_id,
@@ -363,6 +363,7 @@ var askQuestionByQuestion = async (apiKey, input, parsed, projectName, deadline)
363
363
  question: question.question,
364
364
  type: "select",
365
365
  options: [...question.labels],
366
+ questions: [withoutLabels(question)],
366
367
  context: questionContext(question, index, parsed.length, projectName),
367
368
  agentName: `Claude Code - ${projectName}`,
368
369
  sessionId: input.session_id,
@@ -382,12 +383,16 @@ var askQuestionByQuestion = async (apiKey, input, parsed, projectName, deadline)
382
383
  return void 0;
383
384
  }
384
385
  const answer = await pollForAnswer(apiKey, result.correlationId, deadline);
385
- const value = answer.answered ? (answer.value ?? "").trim() : "";
386
+ const legacyValue = answer.answered ? answer.value?.trim() : void 0;
387
+ const values = legacyValue ? parseAgentQuestionAnswers([question], legacyValue) ?? parseAgentQuestionAnswers([question], JSON.stringify({
388
+ [question.question]: question.multiSelect ? JSON.stringify([legacyValue]) : legacyValue
389
+ })) : null;
390
+ const value = values?.[question.question];
386
391
  if (!value || isDeferAnswer(answer.value)) {
387
392
  savePendingQuestion(input.session_id || DEFAULT_SESSION, result.correlationId);
388
393
  return void 0;
389
394
  }
390
- answers[question.question] = encodeAnswer(question, value);
395
+ answers[question.question] = value;
391
396
  }
392
397
  return answers;
393
398
  };
package/dist/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  handlePreToolUse
3
- } from "../chunk-VI27GQKE.js";
3
+ } from "../chunk-HEQVIIBN.js";
4
4
  import "../chunk-ATBKJNWS.js";
5
5
  import "../chunk-VZKXBFUA.js";
6
6
  import "../chunk-YHG74UFF.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushary/agent-hooks",
3
- "version": "0.89.1",
3
+ "version": "0.89.2",
4
4
  "description": "Permission hooks for AI coding agents: route tool approvals through Pushary push notifications",
5
5
  "keywords": [
6
6
  "pushary",