@pushary/agent-hooks 0.95.4 → 0.95.6
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 +14 -0
- package/data/cursor-plugin/.cursor-plugin/plugin.json +1 -1
- package/data/cursor-plugin/CHANGELOG.md +5 -0
- package/data/cursor-plugin/README.md +1 -1
- package/data/cursor-plugin/scripts/pushary-gate.mjs +5 -2
- package/data/vscode-plugin/.claude-plugin/plugin.json +1 -1
- package/data/vscode-plugin/CHANGELOG.md +5 -0
- package/data/vscode-plugin/README.md +1 -1
- package/data/vscode-plugin/scripts/pushary-gate.mjs +14 -3
- package/dist/bin/pushary-bell-hook.js +20 -20
- package/dist/bin/pushary-bell.js +9 -9
- package/dist/bin/pushary-claude.js +29 -24
- package/dist/bin/pushary-clean.js +20 -20
- package/dist/bin/pushary-codex-bridge.js +10 -10
- package/dist/bin/pushary-codex-hook.js +24 -24
- package/dist/bin/pushary-codex.js +8 -8
- package/dist/bin/pushary-connect.js +8 -8
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +26 -26
- package/dist/bin/pushary-disconnect.js +11 -10
- package/dist/bin/pushary-doctor.js +89 -35
- package/dist/bin/pushary-elicitation-hook.js +20 -20
- package/dist/bin/pushary-gemini-bridge.js +9 -9
- package/dist/bin/pushary-gemini-hook.js +23 -23
- package/dist/bin/pushary-hook.js +27 -27
- package/dist/bin/pushary-login.js +9 -9
- package/dist/bin/pushary-logout.js +6 -6
- package/dist/bin/pushary-mode.js +5 -5
- package/dist/bin/pushary-notification-hook.js +22 -22
- package/dist/bin/pushary-opencode-hook.js +23 -23
- package/dist/bin/pushary-permission-denied-hook.js +25 -25
- package/dist/bin/pushary-permission-hook.js +25 -25
- package/dist/bin/pushary-post-hook.js +22 -22
- package/dist/bin/pushary-prompt-hook.js +22 -22
- package/dist/bin/pushary-session-end-hook.js +22 -22
- package/dist/bin/pushary-session-start-hook.js +25 -25
- package/dist/bin/pushary-setup.js +62 -42
- package/dist/bin/pushary-stats.js +4 -4
- package/dist/bin/pushary-status.js +14 -10
- package/dist/bin/pushary-stop-hook.js +22 -22
- package/dist/bin/pushary-stopfailure-hook.js +22 -22
- package/dist/bin/pushary-suggestions.js +2 -2
- package/dist/bin/pushary-transcript-register.js +18 -18
- package/dist/bin/pushary-transcripts.js +7 -7
- package/dist/bin/pushary-upgrade.js +17 -17
- package/dist/bin/pushary-wait.js +5 -5
- package/dist/bin/pushary.js +1 -1
- package/dist/{chunk-EEJ6EQMI.js → chunk-32WFHA77.js} +1 -1
- package/dist/{chunk-YE37HYN3.js → chunk-32WWVRXN.js} +3 -14
- package/dist/{chunk-GGX5QTBG.js → chunk-3AJIK5AO.js} +4 -1
- package/dist/{chunk-PFRLYYF6.js → chunk-43TFQOAT.js} +1 -1
- package/dist/{chunk-MDDKA4QM.js → chunk-4XFBO3GW.js} +1 -1
- package/dist/{chunk-KT2CGUOE.js → chunk-6II5RBAS.js} +1 -1
- package/dist/{chunk-3N4FT4WQ.js → chunk-6MRPTYYH.js} +1 -1
- package/dist/{chunk-ND52YE7L.js → chunk-7N3D4GN7.js} +4 -4
- package/dist/{chunk-TMOCSYJK.js → chunk-A2M6FGUF.js} +3 -3
- package/dist/{chunk-HPM47TEO.js → chunk-AXECWTTZ.js} +2 -2
- package/dist/{chunk-MZOTKCNZ.js → chunk-BS5XR4J7.js} +4 -4
- package/dist/{chunk-O7ODXFII.js → chunk-C7BFOC35.js} +2 -2
- package/dist/{chunk-TKA2L2BU.js → chunk-CDBTCEKE.js} +5 -5
- package/dist/{chunk-JDNW6FTV.js → chunk-DH4INZW3.js} +1 -1
- package/dist/{chunk-6BNBW3M2.js → chunk-DSCGKZO5.js} +2 -2
- package/dist/{chunk-W5GH5GTX.js → chunk-FBO5WS3D.js} +1 -1
- package/dist/{chunk-U24ERDPE.js → chunk-FHIVWF4B.js} +13 -15
- package/dist/{chunk-HTWQH3VI.js → chunk-FVTFSYKB.js} +1 -1
- package/dist/{chunk-HJYGC7IR.js → chunk-GOPIMNVC.js} +1 -1
- package/dist/{chunk-DLLAWCQB.js → chunk-GOQHN2UH.js} +1 -1
- package/dist/{chunk-LVU3Q43J.js → chunk-HBBQO77U.js} +1 -1
- package/dist/{chunk-CVZP67ST.js → chunk-HHODMHTH.js} +4 -4
- package/dist/{chunk-3OXHYPZG.js → chunk-HKQ6CD32.js} +4 -1
- package/dist/{chunk-TGORRMOU.js → chunk-JZSWA3VT.js} +1 -1
- package/dist/{chunk-MNWDOXX6.js → chunk-KAWLZTRJ.js} +1 -1
- package/dist/{chunk-7W6E3C3I.js → chunk-KNIVXEW4.js} +1 -1
- package/dist/{chunk-D6PRC3YQ.js → chunk-LZQVAEWP.js} +2 -1
- package/dist/{chunk-JAKWHALW.js → chunk-O5RQ7RYJ.js} +90 -18
- package/dist/{chunk-TR6DBXO3.js → chunk-OIZVYUED.js} +1 -1
- package/dist/{chunk-V4G7BQZ6.js → chunk-R4MBUCPQ.js} +1 -1
- package/dist/{chunk-XDHJ4KZJ.js → chunk-RPHXG4HI.js} +2 -2
- package/dist/{chunk-J5KTLGO5.js → chunk-SLVXQOYU.js} +1 -1
- package/dist/{chunk-AGQA72IH.js → chunk-SRFA5BOO.js} +1 -1
- package/dist/{chunk-7VVX6HQG.js → chunk-VZADMT7R.js} +219 -17
- package/dist/{chunk-J6NAWJTQ.js → chunk-WRK6RAA5.js} +47 -4
- package/dist/{chunk-ZKDQ3QRP.js → chunk-WZ63WTAZ.js} +1 -1
- package/dist/{chunk-57NOPUBK.js → chunk-XJ6CXTSB.js} +8 -8
- package/dist/{chunk-4NJURLRP.js → chunk-XKIB2FQY.js} +8 -8
- package/dist/{chunk-2BE7ZVWP.js → chunk-XS33QBJA.js} +15 -3
- package/dist/{chunk-MQO7J2OJ.js → chunk-ZJ6QXXBC.js} +10 -7
- package/dist/{chunk-XIVPHGV4.js → chunk-ZQREURP6.js} +1 -1
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.js +11 -11
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defersToNativeMode
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SRFA5BOO.js";
|
|
4
4
|
import {
|
|
5
5
|
isGatingMoment,
|
|
6
6
|
recordKeylessMoment
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-32WFHA77.js";
|
|
8
8
|
import {
|
|
9
9
|
denyReasonFrom,
|
|
10
10
|
isDeferAnswer
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
reportEvent,
|
|
21
21
|
settleQuestionsForToolUse,
|
|
22
22
|
throttlePass
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-ZJ6QXXBC.js";
|
|
24
24
|
import {
|
|
25
25
|
DECISION_STOP_REASON,
|
|
26
26
|
askUser,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
isLocalQuestionHandoff,
|
|
29
29
|
sendNotification,
|
|
30
30
|
waitForQuestion
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-XS33QBJA.js";
|
|
32
32
|
import {
|
|
33
33
|
UNNAMED_ACTION,
|
|
34
34
|
deriveAction,
|
|
@@ -38,14 +38,10 @@ import {
|
|
|
38
38
|
describeToolCall,
|
|
39
39
|
permissionDeniedAction,
|
|
40
40
|
scopePathFor
|
|
41
|
-
} from "./chunk-
|
|
42
|
-
import {
|
|
43
|
-
PRETOOLUSE_HANDLED_TOOLS,
|
|
44
|
-
PRETOOLUSE_PHONE_ANSWERED_TOOLS
|
|
45
|
-
} from "./chunk-YE37HYN3.js";
|
|
41
|
+
} from "./chunk-HBBQO77U.js";
|
|
46
42
|
import {
|
|
47
43
|
getMachineId
|
|
48
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-C7BFOC35.js";
|
|
49
45
|
import {
|
|
50
46
|
getApiKey,
|
|
51
47
|
getBaseUrl
|
|
@@ -57,12 +53,14 @@ import {
|
|
|
57
53
|
effectiveWaitSeconds,
|
|
58
54
|
hookWaitClamped,
|
|
59
55
|
hookWaitDeadline,
|
|
56
|
+
hookWritePath,
|
|
57
|
+
isPermissionRequestOwnedByPreToolUse,
|
|
60
58
|
isPusharyOwnTool,
|
|
61
59
|
parseAgentQuestionAnswers,
|
|
62
60
|
parseAgentQuestions,
|
|
63
61
|
resolveGate,
|
|
64
62
|
stoppedOutput
|
|
65
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-VZADMT7R.js";
|
|
66
64
|
|
|
67
65
|
// src/decision-episode.ts
|
|
68
66
|
var EPISODE_PATH = "/api/agent/decision-episode";
|
|
@@ -228,6 +226,7 @@ var dispatchModeHandler = async (apiKey, input, toolPolicy, machineId, trainingC
|
|
|
228
226
|
const toolTarget = deriveToolTarget(input.tool_name, input.tool_input);
|
|
229
227
|
const intent = readLastPrompt(sessionId ?? DEFAULT_SESSION) ?? (input.transcript_path ? readLastUserPrompt(input.transcript_path) : void 0);
|
|
230
228
|
const decision = {
|
|
229
|
+
toolPath: hookWritePath(input.tool_name, input.tool_input),
|
|
231
230
|
intent,
|
|
232
231
|
action: deriveAction(input.tool_name, input.tool_input),
|
|
233
232
|
blocker: scopeReason ?? deriveBlocker(toolPolicy.mode),
|
|
@@ -501,10 +500,7 @@ var toPermissionRequestOutput = (hookOutput) => {
|
|
|
501
500
|
return void 0;
|
|
502
501
|
};
|
|
503
502
|
var handlePermissionRequest = async (input) => {
|
|
504
|
-
if (
|
|
505
|
-
const reclaimDeferredExec = !PRETOOLUSE_PHONE_ANSWERED_TOOLS.includes(input.tool_name) && shouldDeferToNativeMode(input.permission_mode, input.tool_name);
|
|
506
|
-
if (!reclaimDeferredExec) return void 0;
|
|
507
|
-
}
|
|
503
|
+
if (isPermissionRequestOwnedByPreToolUse(input.tool_name, input.permission_mode, shouldDeferToNativeMode)) return void 0;
|
|
508
504
|
if (isPusharyOwnTool(input.tool_name)) return void 0;
|
|
509
505
|
let apiKey;
|
|
510
506
|
try {
|
|
@@ -543,6 +539,8 @@ var automodeRetryEnabled = () => {
|
|
|
543
539
|
};
|
|
544
540
|
var reportPermissionDenied = (input) => reportEvent({
|
|
545
541
|
event: "permission_denied",
|
|
542
|
+
occurredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
543
|
+
toolUseId: input.tool_use_id,
|
|
546
544
|
agentType: CLAUDE_CODE_AGENT.type,
|
|
547
545
|
agentName: `${CLAUDE_CODE_AGENT.label} - ${basename(input.cwd ?? process.cwd())}`,
|
|
548
546
|
action: permissionDeniedAction(input.tool_name),
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CLAUDE_HOOK_EVENTS,
|
|
3
3
|
supportedClaudeEvents
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CDBTCEKE.js";
|
|
5
5
|
import {
|
|
6
6
|
guardBinary
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3AJIK5AO.js";
|
|
8
8
|
import {
|
|
9
9
|
isProtectedByScope
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FBO5WS3D.js";
|
|
11
11
|
import {
|
|
12
12
|
HOOK_LOCATOR_BINARY
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-VZADMT7R.js";
|
|
14
14
|
|
|
15
15
|
// src/claude-config.ts
|
|
16
16
|
import { join } from "path";
|
|
@@ -3,6 +3,9 @@ import {
|
|
|
3
3
|
resolveGlobalPackageVersion,
|
|
4
4
|
resolvePackageVersionFromBinary
|
|
5
5
|
} from "./chunk-L4ZCFMWW.js";
|
|
6
|
+
import {
|
|
7
|
+
MANAGED_PROVIDERS
|
|
8
|
+
} from "./chunk-VZADMT7R.js";
|
|
6
9
|
|
|
7
10
|
// src/live-capabilities.ts
|
|
8
11
|
var CLAUDE_BRIDGE_CAPABILITY = "claude-bridge";
|
|
@@ -39,7 +42,7 @@ var resolveControlPolicy = (input) => {
|
|
|
39
42
|
if (input.providerAvailable && input.managerAvailable) return "enabled";
|
|
40
43
|
return input.servicePresent ? "legacy" : "unsupported";
|
|
41
44
|
};
|
|
42
|
-
var detectProviderLiveCapabilities = (providers =
|
|
45
|
+
var detectProviderLiveCapabilities = (providers = MANAGED_PROVIDERS) => {
|
|
43
46
|
const enabled = new Set(providers);
|
|
44
47
|
const geminiBin = enabled.has("gemini") ? resolveBinary("gemini") : void 0;
|
|
45
48
|
return providerLiveCapabilities({
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-2UMNXADU.js";
|
|
4
4
|
import {
|
|
5
5
|
normalizeInstallSource
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VZADMT7R.js";
|
|
7
7
|
|
|
8
8
|
// src/cli/fsx.ts
|
|
9
9
|
import { copyFileSync, existsSync, fsyncSync, mkdirSync, openSync, closeSync, readFileSync, renameSync, unlinkSync, writeFileSync } from "fs";
|
|
@@ -125,7 +125,8 @@ var COMMAND_OPTIONS = {
|
|
|
125
125
|
],
|
|
126
126
|
doctor: [
|
|
127
127
|
["--json", "Emit every check as one object instead of the screen"],
|
|
128
|
-
["--roundtrip", "
|
|
128
|
+
["--roundtrip", "Send a synthetic question and report the returned answer; does not test hooks"],
|
|
129
|
+
["--activation claude_code --activation-target <path>", "Read correlated evidence for one unique scratch file; sends no test question"],
|
|
129
130
|
["--no-push", "Run every check without waking a device"],
|
|
130
131
|
["--bundle", "Write a redacted diagnostics file you can attach to a support thread"]
|
|
131
132
|
],
|
|
@@ -15,7 +15,10 @@ import {
|
|
|
15
15
|
} from "./chunk-EYRGBYZG.js";
|
|
16
16
|
import {
|
|
17
17
|
reportedInstallSource
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-KAWLZTRJ.js";
|
|
19
|
+
import {
|
|
20
|
+
isAnswerSource
|
|
21
|
+
} from "./chunk-VZADMT7R.js";
|
|
19
22
|
|
|
20
23
|
// src/reach.ts
|
|
21
24
|
var reachVerdict = (channels) => {
|
|
@@ -119,7 +122,7 @@ var classifyDelivery = (channels, push) => {
|
|
|
119
122
|
var sendTestNotification = async (apiKey) => {
|
|
120
123
|
const result = await callMcpTool(apiKey, "send_notification", {
|
|
121
124
|
title: "Pushary is connected",
|
|
122
|
-
body: "
|
|
125
|
+
body: "This setup notification reached you. Agent hooks still need a real-agent check.",
|
|
123
126
|
agentName: "Pushary setup"
|
|
124
127
|
}, { timeoutMs: 2e4 });
|
|
125
128
|
const toCount = (value) => typeof value === "number" && Number.isFinite(value) ? value : 0;
|
|
@@ -145,7 +148,7 @@ var describeVerifyOutcome = (outcome) => {
|
|
|
145
148
|
message: "Nothing to deliver to. Agents are configured; approvals will fall back to the terminal.",
|
|
146
149
|
next: [
|
|
147
150
|
"Run pushary connect to add your phone.",
|
|
148
|
-
"Then pushary doctor --roundtrip to test a
|
|
151
|
+
"Then pushary doctor --roundtrip to test a synthetic question and answer."
|
|
149
152
|
]
|
|
150
153
|
};
|
|
151
154
|
case "others-only":
|
|
@@ -174,7 +177,7 @@ var describeVerifyOutcome = (outcome) => {
|
|
|
174
177
|
};
|
|
175
178
|
}
|
|
176
179
|
};
|
|
177
|
-
var ROUND_TRIP_QUESTION = "
|
|
180
|
+
var ROUND_TRIP_QUESTION = "Pushary delivery test. Tap Yes or No to test returning an answer. This does not test your agent hooks.";
|
|
178
181
|
var ROUND_TRIP_TIMEOUT_MS = 55e3;
|
|
179
182
|
var defaultAsk = (apiKey, agentName) => (
|
|
180
183
|
// wait:false so the poll is ours: the blocking form returns on the SITE's
|
|
@@ -195,6 +198,18 @@ var defaultCancel = async (apiKey, correlationId) => {
|
|
|
195
198
|
await callMcpTool(apiKey, "cancel_question", { correlationId }, { timeoutMs: 1e4 }).catch(() => {
|
|
196
199
|
});
|
|
197
200
|
};
|
|
201
|
+
var answeredRoundTrip = (answer, correlationId, latencyMs) => {
|
|
202
|
+
if (answer.value !== "yes" && answer.value !== "no") {
|
|
203
|
+
return { kind: "error", detail: "the server reported an answer without a valid Yes or No value" };
|
|
204
|
+
}
|
|
205
|
+
return {
|
|
206
|
+
kind: "answered",
|
|
207
|
+
value: answer.value,
|
|
208
|
+
latencyMs,
|
|
209
|
+
correlationId,
|
|
210
|
+
...isAnswerSource(answer.answerSource) ? { answerSource: answer.answerSource } : {}
|
|
211
|
+
};
|
|
212
|
+
};
|
|
198
213
|
var verifyRoundTrip = async (apiKey, agentName = "Pushary setup", deps = {}) => {
|
|
199
214
|
const ask = deps.ask ?? defaultAsk;
|
|
200
215
|
const wait = deps.wait ?? defaultWait;
|
|
@@ -207,31 +222,73 @@ var verifyRoundTrip = async (apiKey, agentName = "Pushary setup", deps = {}) =>
|
|
|
207
222
|
} catch (err) {
|
|
208
223
|
return { kind: "error", detail: err instanceof Error ? err.message : "ask failed" };
|
|
209
224
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
225
|
+
let shutdown;
|
|
226
|
+
const stop = (code) => {
|
|
227
|
+
if (shutdown) return;
|
|
228
|
+
shutdown = (async () => {
|
|
229
|
+
let timer;
|
|
230
|
+
try {
|
|
231
|
+
await Promise.race([
|
|
232
|
+
cancel(apiKey, asked.correlationId).catch(() => {
|
|
233
|
+
}),
|
|
234
|
+
new Promise((resolve) => {
|
|
235
|
+
timer = setTimeout(resolve, 4e3);
|
|
236
|
+
})
|
|
237
|
+
]);
|
|
238
|
+
} finally {
|
|
239
|
+
clearTimeout(timer);
|
|
240
|
+
process.stderr.write("Delivery test interrupted. Cleanup was attempted; an unresolved question expires automatically.\n");
|
|
241
|
+
process.exit(code);
|
|
242
|
+
}
|
|
243
|
+
})();
|
|
244
|
+
};
|
|
245
|
+
const onInterrupt = () => stop(130);
|
|
246
|
+
const onTerminate = () => stop(143);
|
|
247
|
+
if (asked.correlationId) {
|
|
248
|
+
process.on("SIGINT", onInterrupt);
|
|
249
|
+
process.on("SIGTERM", onTerminate);
|
|
215
250
|
}
|
|
216
|
-
let
|
|
251
|
+
let answerObserved = false;
|
|
217
252
|
try {
|
|
218
|
-
|
|
253
|
+
if (asked.noDevices || asked.warning) return { kind: "no-recipients" };
|
|
254
|
+
if (asked.mode === "notify_only" || asked.status === "notified") return { kind: "notify-only" };
|
|
255
|
+
if (!asked.correlationId) return { kind: "error", detail: "no correlationId returned" };
|
|
256
|
+
const answer = asked.answered === true ? asked : await wait(apiKey, asked.correlationId);
|
|
257
|
+
if (answer.answered === true) {
|
|
258
|
+
const outcome = answeredRoundTrip(answer, asked.correlationId, now() - started);
|
|
259
|
+
answerObserved = outcome.kind === "answered";
|
|
260
|
+
return outcome;
|
|
261
|
+
}
|
|
262
|
+
return { kind: "unanswered" };
|
|
219
263
|
} catch (err) {
|
|
220
|
-
await cancel(apiKey, asked.correlationId);
|
|
221
264
|
return { kind: "error", detail: err instanceof Error ? err.message : "wait failed" };
|
|
265
|
+
} finally {
|
|
266
|
+
if (shutdown) await shutdown;
|
|
267
|
+
process.off("SIGINT", onInterrupt);
|
|
268
|
+
process.off("SIGTERM", onTerminate);
|
|
269
|
+
if (!answerObserved && asked.correlationId) await cancel(apiKey, asked.correlationId).catch(() => {
|
|
270
|
+
});
|
|
222
271
|
}
|
|
223
|
-
|
|
224
|
-
|
|
272
|
+
};
|
|
273
|
+
var describeAnswerSource = (source) => {
|
|
274
|
+
switch (source) {
|
|
275
|
+
case "mobile_app":
|
|
276
|
+
case "mobile_background":
|
|
277
|
+
return "A phone answered this synthetic test.";
|
|
278
|
+
case "mac_app":
|
|
279
|
+
return "A Mac answered this synthetic test.";
|
|
280
|
+
case "sandbox":
|
|
281
|
+
return "This was a simulated sandbox answer.";
|
|
282
|
+
default:
|
|
283
|
+
return source ? `Answer source: ${source}. This was a synthetic test.` : "The answering surface was not reported. This was a synthetic test.";
|
|
225
284
|
}
|
|
226
|
-
await cancel(apiKey, asked.correlationId);
|
|
227
|
-
return { kind: "unanswered" };
|
|
228
285
|
};
|
|
229
|
-
var
|
|
286
|
+
var describeRoundTripOutcome = (outcome) => {
|
|
230
287
|
switch (outcome.kind) {
|
|
231
288
|
case "answered":
|
|
232
289
|
return {
|
|
233
290
|
ok: true,
|
|
234
|
-
message: `Answered "${outcome.value}" in ${(outcome.latencyMs / 1e3).toFixed(1)}s.
|
|
291
|
+
message: `Answered "${outcome.value}" in ${(outcome.latencyMs / 1e3).toFixed(1)}s. ${describeAnswerSource(outcome.answerSource)}`,
|
|
235
292
|
next: []
|
|
236
293
|
};
|
|
237
294
|
case "unanswered":
|
|
@@ -266,6 +323,20 @@ var describeRoundTrip = (outcome) => {
|
|
|
266
323
|
};
|
|
267
324
|
}
|
|
268
325
|
};
|
|
326
|
+
var describeRoundTrip = (outcome) => {
|
|
327
|
+
const report = describeRoundTripOutcome(outcome);
|
|
328
|
+
return { ...report, next: [...report.next, "Agent hook activation remains unverified. Restart your agent and check one real approval."] };
|
|
329
|
+
};
|
|
330
|
+
var roundTripEvidence = (outcome) => ({
|
|
331
|
+
kind: outcome?.kind ?? "skipped",
|
|
332
|
+
...outcome?.kind === "answered" ? {
|
|
333
|
+
correlationId: outcome.correlationId ?? null,
|
|
334
|
+
answerSource: outcome.answerSource ?? null,
|
|
335
|
+
value: outcome.value,
|
|
336
|
+
latencyMs: outcome.latencyMs
|
|
337
|
+
} : {},
|
|
338
|
+
hookActivation: "unverified"
|
|
339
|
+
});
|
|
269
340
|
|
|
270
341
|
// src/onboarding.ts
|
|
271
342
|
import qrcodeTerminal from "qrcode-terminal";
|
|
@@ -863,6 +934,7 @@ export {
|
|
|
863
934
|
describeReach,
|
|
864
935
|
verifyRoundTrip,
|
|
865
936
|
describeRoundTrip,
|
|
937
|
+
roundTripEvidence,
|
|
866
938
|
fetchChannels,
|
|
867
939
|
connectDevice,
|
|
868
940
|
confirmAppConnection,
|