@pushary/agent-hooks 0.63.0 → 0.63.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,31 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.63.2
4
+
5
+ ### Setup reports what happened, not only that it worked
6
+
7
+ The setup event fired only when at least one agent had been configured, so a run
8
+ that configured nothing, failed, or stopped partway reported nothing at all. The
9
+ only visible runs were the ones that already worked.
10
+
11
+ It now fires once per run whatever the outcome, and carries the connect mode and
12
+ its result, how many agents failed, which were skipped, whether the run was
13
+ non-interactive, and where a run stopped if it did.
14
+
15
+ This is the same event that already powers your activity feed, sent with your own
16
+ API key to your own workspace. No repo path, hostname or agent content is
17
+ included, and nothing is sent before you have a key.
18
+
19
+
20
+ ## 0.63.1
21
+
22
+ ### `pushary status --bogus` printed a stack trace
23
+
24
+ An unknown flag on `status` threw where nothing was catching it, so Node printed
25
+ a raw stack trace and exited `1` instead of the clean usage error and exit `2`
26
+ every other command gives. Other commands were unaffected.
27
+
28
+
3
29
  ## 0.63.0
4
30
 
5
31
  ### Machines
@@ -203,6 +203,35 @@ var installSkillViaSkillsCli = (agent) => {
203
203
  }
204
204
  };
205
205
 
206
+ // src/setup/telemetry.ts
207
+ var currentStep = "start";
208
+ var emitted = false;
209
+ var reportSetupOutcome = async (outcome) => {
210
+ if (emitted) return;
211
+ emitted = true;
212
+ try {
213
+ await reportEvent(
214
+ {
215
+ event: "agent_setup_completed",
216
+ agentType: "setup",
217
+ agents: outcome.completed,
218
+ connectMode: outcome.options.connectMode,
219
+ connectOutcome: outcome.connectOutcome,
220
+ failedAgents: outcome.failed.length,
221
+ skippedAgents: outcome.skipped,
222
+ nonInteractive: outcome.options.nonInteractive,
223
+ keyCheck: outcome.keyCheck,
224
+ exitCode: outcome.exitCode,
225
+ // Where the run stopped. On a completed run this is the closing step, so
226
+ // the interesting values are the ones that are not.
227
+ abandonedAt: outcome.exitCode === 0 ? null : currentStep
228
+ },
229
+ { maxAttempts: 1, timeoutMs: 2e3 }
230
+ );
231
+ } catch {
232
+ }
233
+ };
234
+
206
235
  // src/setup/options.ts
207
236
  var AGENT_CHOICES = ["claude_code", "codex", "gemini_cli", "hermes", "cursor", "custom"];
208
237
  var SETUP_FLAGS = {
@@ -1198,15 +1227,6 @@ var main = async () => {
1198
1227
  if (completed.includes("claude_code")) {
1199
1228
  await offerClaudeAlias(options);
1200
1229
  }
1201
- if (completed.length > 0) {
1202
- try {
1203
- await reportEvent(
1204
- { event: "agent_setup_completed", agentType: "setup", agents: completed },
1205
- { maxAttempts: 1, timeoutMs: 2e3 }
1206
- );
1207
- } catch {
1208
- }
1209
- }
1210
1230
  }
1211
1231
  const skipPhone = options.skipPhone;
1212
1232
  let phone = null;
@@ -1271,6 +1291,18 @@ var main = async () => {
1271
1291
  for (const line of renderCommandSurface()) console.log(` ${dim(line)}`);
1272
1292
  console.log();
1273
1293
  const exitCode = closing.exitCode;
1294
+ await reportSetupOutcome({
1295
+ options,
1296
+ completed,
1297
+ skipped,
1298
+ failed,
1299
+ // 'answered' is deliberately unreachable here: it means a human tapped, and
1300
+ // setup no longer sends a question. It stays in the type for doctor
1301
+ // --roundtrip, which does.
1302
+ connectOutcome: phone === null ? "skipped" : phone.reachesYou ? "delivered" : "unreachable",
1303
+ keyCheck: keyCheck?.kind ?? "skipped",
1304
+ exitCode
1305
+ });
1274
1306
  emitJson(options, {
1275
1307
  ok: closing.ok,
1276
1308
  configured: completed,
@@ -183,7 +183,13 @@ var statusJson = (facts, report) => ({
183
183
  exitOnHelpFlag("status");
184
184
  var { bold, dim, green, red, yellow } = createIo();
185
185
  var args = process.argv.slice(2);
186
- rejectUnknownFlags(args.filter((a) => a !== "status"), ["--json", "--devices"]);
186
+ try {
187
+ rejectUnknownFlags(args.filter((a) => a !== "status"), ["--json", "--devices"]);
188
+ } catch (err) {
189
+ process.stderr.write(` ! ${err instanceof Error ? err.message : String(err)}
190
+ `);
191
+ process.exit(EXIT.USAGE);
192
+ }
187
193
  var json = args.includes("--json");
188
194
  var devices = args.includes("--devices");
189
195
  var main = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushary/agent-hooks",
3
- "version": "0.63.0",
3
+ "version": "0.63.2",
4
4
  "description": "Permission hooks for AI coding agents: route tool approvals through Pushary push notifications",
5
5
  "keywords": [
6
6
  "pushary",