@pushary/agent-hooks 1.9.145 → 1.9.148
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 +25 -0
- package/README.md +5 -4
- package/data/SKILL.md +3 -3
- package/data/cursor-plugin/scripts/redaction.mjs +2 -1
- package/data/cursor-plugin/skills/pushary/SKILL.md +2 -2
- package/data/openclaw-plugin/LICENSE +21 -0
- package/data/openclaw-plugin/README.md +113 -0
- package/data/openclaw-plugin/dist/api-key-shape.js +5 -0
- package/data/openclaw-plugin/dist/approval-hook.js +88 -0
- package/data/openclaw-plugin/dist/approval-question.js +66 -0
- package/data/openclaw-plugin/dist/connection.js +101 -0
- package/data/openclaw-plugin/dist/decision-reply.js +6 -0
- package/data/openclaw-plugin/dist/gate-result.js +58 -0
- package/data/openclaw-plugin/dist/gate.js +173 -0
- package/data/openclaw-plugin/dist/hook-budget.js +19 -0
- package/data/openclaw-plugin/dist/host-api.js +1 -0
- package/data/openclaw-plugin/dist/host-version.js +25 -0
- package/data/openclaw-plugin/dist/index.js +32 -0
- package/data/openclaw-plugin/dist/openclaw-paths.js +43 -0
- package/data/openclaw-plugin/dist/openclaw-write-guard.js +93 -0
- package/data/openclaw-plugin/dist/protected-writes.js +217 -0
- package/data/openclaw-plugin/dist/pushary-client.js +103 -0
- package/data/openclaw-plugin/dist/pushary-hosts.js +3 -0
- package/data/openclaw-plugin/dist/redaction.js +53 -0
- package/data/openclaw-plugin/dist/replies.js +65 -0
- package/data/openclaw-plugin/dist/settings.js +103 -0
- package/data/openclaw-plugin/openclaw.plugin.json +32 -0
- package/data/openclaw-plugin/package.json +70 -0
- package/data/vscode-plugin/scripts/redaction.mjs +2 -1
- package/data/vscode-plugin/skills/pushary/SKILL.md +2 -2
- package/dist/{api-KWJQMO6G.js → api-H7H75ARS.js} +11 -11
- package/dist/bin/pushary-audit.js +3 -3
- package/dist/bin/pushary-bell-hook.js +28 -28
- package/dist/bin/pushary-bell.js +11 -11
- package/dist/bin/pushary-claude.js +27 -27
- package/dist/bin/pushary-clean.js +76 -39
- package/dist/bin/pushary-codex-bridge.js +23 -23
- package/dist/bin/pushary-codex-hook.js +35 -35
- package/dist/bin/pushary-codex-session.js +8 -8
- package/dist/bin/pushary-codex.js +16 -16
- package/dist/bin/pushary-connect.js +78 -36
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +44 -43
- package/dist/bin/pushary-disconnect.js +28 -28
- package/dist/bin/pushary-display-hook.js +96 -44
- package/dist/bin/pushary-doctor.js +124 -55
- package/dist/bin/pushary-elicitation-hook.js +28 -28
- package/dist/bin/pushary-gemini-bridge.js +17 -17
- package/dist/bin/pushary-gemini-hook.js +32 -32
- package/dist/bin/pushary-hook.js +35 -35
- package/dist/bin/pushary-login.js +22 -22
- package/dist/bin/pushary-logout.js +33 -31
- package/dist/bin/pushary-mcp.js +12 -12
- package/dist/bin/pushary-mode.js +16 -16
- package/dist/bin/pushary-notification-hook.js +27 -27
- package/dist/bin/pushary-opencode-hook.js +31 -31
- package/dist/bin/pushary-permission-denied-hook.js +35 -35
- package/dist/bin/pushary-permission-hook.js +35 -35
- package/dist/bin/pushary-post-hook.js +28 -28
- package/dist/bin/pushary-prompt-hook.js +27 -27
- package/dist/bin/pushary-session-end-hook.js +27 -27
- package/dist/bin/pushary-session-start-hook.js +37 -36
- package/dist/bin/pushary-setup.js +144 -106
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +38 -36
- package/dist/bin/pushary-stop-hook.js +27 -27
- package/dist/bin/pushary-stopfailure-hook.js +27 -27
- package/dist/bin/pushary-suggestions.js +16 -16
- package/dist/bin/pushary-transcript-register.js +17 -17
- package/dist/bin/pushary-transcripts.js +25 -25
- package/dist/bin/pushary-upgrade.js +42 -41
- package/dist/bin/pushary-wait.js +16 -16
- package/dist/bin/pushary.js +7 -7
- package/dist/{chunk-6IWOMXUF.js → chunk-2VPRLAKF.js} +4 -4
- package/dist/{chunk-GK5X2ZTN.js → chunk-3AAQJ75F.js} +5 -5
- package/dist/{chunk-YNCVSKUW.js → chunk-3OPXQK4D.js} +5 -5
- package/dist/{chunk-ZORBUQFG.js → chunk-3T7RA7WJ.js} +2 -2
- package/dist/{chunk-PXZTCR4M.js → chunk-3WD3BEPB.js} +2 -2
- package/dist/{chunk-VTJ4WZOC.js → chunk-43NHQUCY.js} +24 -3
- package/dist/{chunk-S7HGPKCL.js → chunk-4L2IYNLC.js} +1 -1
- package/dist/{chunk-KFALRZIN.js → chunk-5IG3VPHT.js} +4 -4
- package/dist/{chunk-S3A4PCRR.js → chunk-5ZIYTFPW.js} +10 -10
- package/dist/{chunk-A2H256WR.js → chunk-6HO36P3A.js} +1 -1
- package/dist/{chunk-FCSPMSDC.js → chunk-6RYJ3XCD.js} +200 -59
- package/dist/{chunk-PY6CM4NK.js → chunk-6YX3VB5P.js} +19 -12
- package/dist/{chunk-BYKRAYGD.js → chunk-A3URJPYH.js} +1 -1
- package/dist/{chunk-KS3PNTRT.js → chunk-ABTQG6XU.js} +1 -1
- package/dist/{chunk-72LP4RPC.js → chunk-AQ7L2E2U.js} +98 -47
- package/dist/{chunk-FNAH3YJC.js → chunk-B6RTPP3X.js} +16 -16
- package/dist/{chunk-K2SKUBYY.js → chunk-BP5HLKR6.js} +12 -12
- package/dist/{chunk-4L5WPDTB.js → chunk-BPKB7BI4.js} +1 -1
- package/dist/{chunk-YRJZF5RG.js → chunk-CABBLJD5.js} +3 -3
- package/dist/{chunk-ZBMVOMFG.js → chunk-CAHULQIO.js} +1 -1
- package/dist/chunk-CBIS7IYQ.js +157 -0
- package/dist/{chunk-LJRPWUST.js → chunk-CDQOARIF.js} +3 -3
- package/dist/{chunk-ZSOCJHL7.js → chunk-CIRTRWHM.js} +309 -5
- package/dist/{chunk-NTMKJRQ3.js → chunk-CMTDMZPV.js} +2 -2
- package/dist/{chunk-WOSO4YFQ.js → chunk-CU5SYUMK.js} +3 -6
- package/dist/{chunk-L4OGTRVW.js → chunk-D3QT4S7U.js} +4 -4
- package/dist/{chunk-YU5XE6VC.js → chunk-DHCJDYBT.js} +8 -7
- package/dist/{chunk-2LGDEPVL.js → chunk-DLPI45DF.js} +6 -6
- package/dist/{chunk-ZJZNT2G5.js → chunk-ENRL4WFD.js} +4 -4
- package/dist/{chunk-6UK4K5RS.js → chunk-FQLS37AX.js} +1 -1
- package/dist/{chunk-B4JQIH5M.js → chunk-H6FFNTSR.js} +7 -7
- package/dist/{chunk-JKWUF776.js → chunk-HEOBF5H6.js} +3 -3
- package/dist/{chunk-MNU5N3CQ.js → chunk-JSZ6LKX5.js} +23 -12
- package/dist/{chunk-RO6EVL5C.js → chunk-JUEQUYAT.js} +2 -2
- package/dist/{chunk-GURIOZE7.js → chunk-KP6ERYOA.js} +8 -8
- package/dist/{chunk-QKTF7WS6.js → chunk-KWJJYZ3T.js} +4 -4
- package/dist/{chunk-EPWOARGR.js → chunk-KXNAB76Z.js} +16 -5
- package/dist/chunk-LC53HRZ6.js +36 -0
- package/dist/{chunk-52UXNCZG.js → chunk-M7HJZ7HO.js} +3 -3
- package/dist/{chunk-WMBWKPKJ.js → chunk-MT4GBXLM.js} +10 -74
- package/dist/{chunk-WPBWJMBZ.js → chunk-MUSINFEU.js} +5 -5
- package/dist/{chunk-LD4R2P6N.js → chunk-NHZV2H63.js} +1 -1
- package/dist/{chunk-USFZJAB4.js → chunk-NLED3JGR.js} +1 -1
- package/dist/{chunk-DZIZ3XFL.js → chunk-NRPQUU3D.js} +2 -2
- package/dist/{chunk-LQXUWXQP.js → chunk-O5ARO3JM.js} +33 -10
- package/dist/chunk-OYIN77HO.js +72 -0
- package/dist/{chunk-TJXJGMSP.js → chunk-PH3MVQCQ.js} +21 -11
- package/dist/{chunk-2ELNRGNX.js → chunk-PUTX5BBE.js} +7 -4
- package/dist/{chunk-R34RWVN2.js → chunk-PVBDITRS.js} +14 -5
- package/dist/{chunk-33BYPZ52.js → chunk-Q7GZKNMH.js} +1 -1
- package/dist/{chunk-7LTP2GHO.js → chunk-QSZYHL7Z.js} +2 -2
- package/dist/{chunk-CUR2DCZN.js → chunk-QTQRQZIU.js} +4 -4
- package/dist/{chunk-SQL5YXUH.js → chunk-R2JRRCZK.js} +1 -1
- package/dist/{chunk-4KDRT3OA.js → chunk-RMBY7JGO.js} +1 -1
- package/dist/{chunk-KKPT7ROP.js → chunk-RWTH5RYA.js} +2 -2
- package/dist/chunk-RYDDLS62.js +176 -0
- package/dist/{chunk-Q6P7G4NY.js → chunk-S3MEI2D2.js} +17 -5
- package/dist/{chunk-HOQH5CLZ.js → chunk-T3CMGGNW.js} +1 -1
- package/dist/{chunk-IIN26HL7.js → chunk-T4PX3DRF.js} +1 -1
- package/dist/{chunk-6LZ7MXHD.js → chunk-TXXAQRX4.js} +7 -5
- package/dist/{chunk-YZA3YBHX.js → chunk-UAHBSOO4.js} +2 -2
- package/dist/{chunk-LMU6NG2G.js → chunk-UFGFO7QB.js} +1 -1
- package/dist/{chunk-TRV3ETGY.js → chunk-UJUGFLVF.js} +5 -5
- package/dist/{chunk-IRPIMQ7U.js → chunk-UL2NNDKD.js} +3 -3
- package/dist/{chunk-BWREST4F.js → chunk-VPADWVYD.js} +1 -1
- package/dist/{chunk-5TWW7ZUL.js → chunk-VPMSV35B.js} +5 -5
- package/dist/{chunk-G3VSMI7K.js → chunk-WQEJCDMR.js} +2 -2
- package/dist/{chunk-JZT2LPRM.js → chunk-WQJ5NJ35.js} +1 -1
- package/dist/{chunk-63WX5KZN.js → chunk-X4OEGFOG.js} +3 -3
- package/dist/{chunk-RWLNTZK5.js → chunk-X4OQ5UMH.js} +5 -5
- package/dist/{chunk-MOC2DN42.js → chunk-XSBW6TUH.js} +2 -2
- package/dist/{chunk-WH4ODOCE.js → chunk-XZGQZDFP.js} +6 -6
- package/dist/{chunk-FO3MDD26.js → chunk-YM2T76UM.js} +27 -0
- package/dist/{chunk-WUT3PO33.js → chunk-YOP7LFHW.js} +8 -8
- package/dist/{chunk-KGFB2LEB.js → chunk-YTD7RV6F.js} +3 -3
- package/dist/{chunk-IDLOJIIS.js → chunk-YWSIN7IH.js} +1 -1
- package/dist/{chunk-MKHVLDMN.js → chunk-ZCB5SCYM.js} +2 -2
- package/dist/{chunk-OONMKLUF.js → chunk-ZOATPL53.js} +4 -4
- package/dist/{chunk-Y7INHH5G.js → chunk-ZX2O66NS.js} +3 -3
- package/dist/{codex-app-cards-switch-F7WQ7Y3I.js → codex-app-cards-switch-BCM547E6.js} +11 -11
- package/dist/{codex-card-routing-EVL5L36G.js → codex-card-routing-222EKZJR.js} +2 -2
- package/dist/{codex-desktop-launch-PL6Z2ELZ.js → codex-desktop-launch-6AFOLMZ7.js} +1 -1
- package/dist/{codex-session-launch-7NQEAUDU.js → codex-session-launch-4YJR4ZGN.js} +20 -20
- package/dist/{config-KFFD4VWH.js → config-GWNPGS47.js} +3 -3
- package/dist/{global-upgrade-L3CY6EFF.js → global-upgrade-VRF6OSSU.js} +9 -9
- package/dist/{identity-DPYYIMHL.js → identity-PQIM7R2N.js} +4 -4
- package/dist/{live-capabilities-QJEXK6GH.js → live-capabilities-G3LMKZUB.js} +4 -4
- package/dist/{paths-PEF6C64P.js → paths-TFGIP5PU.js} +7 -3
- package/dist/{reapply-7APCQRRK.js → reapply-3IRAI6JF.js} +30 -29
- package/dist/src/index.js +34 -34
- package/dist/{upgrade-lock-A7OKXMRW.js → upgrade-lock-2G7ANYYO.js} +6 -4
- package/dist/{usage-HSS33762.js → usage-K3EGYCSU.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-D3UFDCTQ.js +0 -87
|
@@ -4,6 +4,8 @@ import {
|
|
|
4
4
|
publicKeyFingerprint
|
|
5
5
|
} from "./chunk-3EGEA4KH.js";
|
|
6
6
|
import {
|
|
7
|
+
PUSHARY_APP_DOWNLOAD_URL,
|
|
8
|
+
SIGN_IN_ON_THE_APP_STEP,
|
|
7
9
|
describeAppRepair,
|
|
8
10
|
describeJustPairedRepair,
|
|
9
11
|
describeReach,
|
|
@@ -12,26 +14,35 @@ import {
|
|
|
12
14
|
reachVerdict,
|
|
13
15
|
reachesYou,
|
|
14
16
|
verifyDelivery
|
|
15
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-6YX3VB5P.js";
|
|
18
|
+
import {
|
|
19
|
+
describeRevokeAttempt,
|
|
20
|
+
keyNoLongerAccepted,
|
|
21
|
+
revokeOwnKey
|
|
22
|
+
} from "./chunk-OYIN77HO.js";
|
|
16
23
|
import {
|
|
17
24
|
humanIsTty,
|
|
18
25
|
writeHuman
|
|
19
26
|
} from "./chunk-QCGNGEGE.js";
|
|
20
27
|
import {
|
|
21
28
|
clipToRow,
|
|
29
|
+
isCI,
|
|
22
30
|
terminalColumns,
|
|
23
31
|
useColor
|
|
24
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-YM2T76UM.js";
|
|
33
|
+
import {
|
|
34
|
+
checkApiKey
|
|
35
|
+
} from "./chunk-CABBLJD5.js";
|
|
25
36
|
import {
|
|
26
37
|
reportedInstallSource
|
|
27
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-XSBW6TUH.js";
|
|
28
39
|
import {
|
|
29
40
|
NPX_LATEST_COMMAND
|
|
30
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-TXXAQRX4.js";
|
|
31
42
|
import {
|
|
32
43
|
NO_PAIRING_COMPUTER,
|
|
33
44
|
PAIR_TTL_SECONDS
|
|
34
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-O5ARO3JM.js";
|
|
35
46
|
|
|
36
47
|
// src/onboarding.ts
|
|
37
48
|
import qrcodeTerminal from "qrcode-terminal";
|
|
@@ -190,6 +201,7 @@ var printQr = (url) => new Promise((resolve, reject) => {
|
|
|
190
201
|
reject(err);
|
|
191
202
|
}
|
|
192
203
|
});
|
|
204
|
+
var canShowPairingQr = () => !isCI();
|
|
193
205
|
var phoneFailure = (detail, repair) => ({
|
|
194
206
|
reachesYou: false,
|
|
195
207
|
outcome: null,
|
|
@@ -252,7 +264,7 @@ var sendAndConfirm = async (apiKey, channels) => {
|
|
|
252
264
|
var printCapabilityDelta = () => {
|
|
253
265
|
console.log(` ${dim("Two ways to get approvals on your phone:")}`);
|
|
254
266
|
console.log();
|
|
255
|
-
console.log(` ${bold("Pushary app")} ${dim("(iOS / Android)")} ${cyan("pushary
|
|
267
|
+
console.log(` ${bold("Pushary app")} ${dim("(iOS / Android)")} ${cyan("pushary pair")}`);
|
|
256
268
|
console.log(` ${dim("\u2022 Answers from the lock screen, and while the app is closed")}`);
|
|
257
269
|
console.log(` ${dim("\u2022 Can start and steer agents remotely")}`);
|
|
258
270
|
console.log();
|
|
@@ -370,6 +382,7 @@ var waitForAppRegistration = async (apiKey) => {
|
|
|
370
382
|
stop(yellow("!"), "This phone has not registered for notifications yet");
|
|
371
383
|
return { kind: "timeout" };
|
|
372
384
|
};
|
|
385
|
+
var APP_NOT_REGISTERED = "app_not_registered";
|
|
373
386
|
var confirmAppConnection = async (apiKey) => {
|
|
374
387
|
const probe = await fetchChannels(apiKey);
|
|
375
388
|
if (probe.kind !== "ok") return describeProbeFailure(probe);
|
|
@@ -384,26 +397,47 @@ var confirmAppConnection = async (apiKey) => {
|
|
|
384
397
|
const repair = describeJustPairedRepair(reachVerdict(channels));
|
|
385
398
|
console.log(` ${yellow("!")} Paired, but this phone has not registered for notifications yet.`);
|
|
386
399
|
for (const line of repair) console.log(` ${dim(line)}`);
|
|
387
|
-
console.log(` ${dim("Then run")} ${cyan("pushary doctor")}${dim(".")}`);
|
|
388
|
-
return phoneFailure(
|
|
400
|
+
console.log(` ${dim("Then run")} ${cyan("pushary doctor --roundtrip")} ${dim("to test delivery. No new pairing is needed.")}`);
|
|
401
|
+
return phoneFailure(APP_NOT_REGISTERED, repair);
|
|
389
402
|
}
|
|
390
403
|
return sendAndConfirm(apiKey, channels);
|
|
391
404
|
};
|
|
405
|
+
var phoneAwaitsNotificationPermission = (result) => result.detail === APP_NOT_REGISTERED;
|
|
406
|
+
var pairingAgainHelps = (result) => !phoneAwaitsNotificationPermission(result);
|
|
392
407
|
var planAppConnect = (channels) => channels.precise && ownedApp(channels) === 0 ? { kind: "unpaired", repair: describeAppRepair(reachVerdict(channels)) ?? [] } : { kind: "send" };
|
|
393
|
-
var
|
|
408
|
+
var checkPhoneWithoutPairing = async (apiKey) => {
|
|
394
409
|
const probe = await fetchChannels(apiKey);
|
|
395
410
|
if (probe.kind !== "ok") return describeProbeFailure(probe);
|
|
396
411
|
const plan = planAppConnect(probe.status);
|
|
397
|
-
if (plan.kind === "send") {
|
|
412
|
+
if (plan.kind === "send" || reachesYou(probe.status)) {
|
|
398
413
|
console.log(` ${check} ${describeExistingConnection(probe.status)}`);
|
|
399
414
|
return sendAndConfirm(apiKey, probe.status);
|
|
400
415
|
}
|
|
401
416
|
console.log(` ${yellow("!")} No Pushary app of yours is connected to this site, and nothing was paired just now.`);
|
|
402
417
|
for (const line of plan.repair) console.log(` ${dim(line)}`);
|
|
403
|
-
console.log(` ${dim("No app yet? Get it at")} ${cyan(
|
|
418
|
+
console.log(` ${dim("No app yet? Get it at")} ${cyan(PUSHARY_APP_DOWNLOAD_URL)}`);
|
|
404
419
|
return phoneFailure("app_not_paired", plan.repair);
|
|
405
420
|
};
|
|
406
|
-
var
|
|
421
|
+
var GET_THE_APP_HEADING = "Connect your phone with the Pushary app";
|
|
422
|
+
var GET_THE_APP_SCAN_LINE = "Scan this with your phone's camera to get the app:";
|
|
423
|
+
var appDownloadLinkLabel = (qrShown) => qrShown ? "or open" : "Get it at";
|
|
424
|
+
var printGetTheApp = async (options) => {
|
|
425
|
+
console.log();
|
|
426
|
+
console.log(` ${bold(GET_THE_APP_HEADING)}`);
|
|
427
|
+
if (options.showQr) {
|
|
428
|
+
console.log(` ${dim(GET_THE_APP_SCAN_LINE)}`);
|
|
429
|
+
await printQr(PUSHARY_APP_DOWNLOAD_URL);
|
|
430
|
+
}
|
|
431
|
+
console.log(` ${dim(appDownloadLinkLabel(options.showQr))} ${cyan(PUSHARY_APP_DOWNLOAD_URL)}`);
|
|
432
|
+
console.log(` ${dim(SIGN_IN_ON_THE_APP_STEP)}`);
|
|
433
|
+
};
|
|
434
|
+
var printSubscribePage = async (apiKey) => {
|
|
435
|
+
const site = await fetchSite(apiKey);
|
|
436
|
+
console.log(` ${dim("Pair your phone for push notifications at")} ${cyan(site?.subscribeUrl ?? PUSHARY_APP_DOWNLOAD_URL)}`);
|
|
437
|
+
console.log(` ${dim("or get the Pushary app at")} ${cyan(PUSHARY_APP_DOWNLOAD_URL)}`);
|
|
438
|
+
};
|
|
439
|
+
var printPhoneInstructions = (apiKey, options) => options.channel === "browser" ? printSubscribePage(apiKey) : printGetTheApp(options);
|
|
440
|
+
var printConnectInstructions = async (apiKey, options) => {
|
|
407
441
|
const probe = await fetchChannels(apiKey);
|
|
408
442
|
if (probe.kind !== "ok") return describeProbeFailure(probe);
|
|
409
443
|
const channels = probe.status;
|
|
@@ -414,10 +448,7 @@ var printConnectInstructions = async (apiKey) => {
|
|
|
414
448
|
if (channels.site !== null && channels.site.otherMembers > 0 && channels.phoneReachable) {
|
|
415
449
|
printSiteOnlyWarning(channels);
|
|
416
450
|
}
|
|
417
|
-
|
|
418
|
-
const target = site?.subscribeUrl ?? "https://pushary.com/download";
|
|
419
|
-
console.log(` ${dim("Pair your phone for push notifications at")} ${cyan(target)}`);
|
|
420
|
-
console.log(` ${dim("or get the Pushary app at")} ${cyan("https://pushary.com/download")}`);
|
|
451
|
+
await printPhoneInstructions(apiKey, options);
|
|
421
452
|
return phoneFailure("no_device");
|
|
422
453
|
};
|
|
423
454
|
var PAIR_POLL_INTERVAL_MS = 2e3;
|
|
@@ -440,17 +471,28 @@ var pairWaitingLabel = (elapsedMs, minutesLeft) => {
|
|
|
440
471
|
const labels = [...due.map((advice) => dim(advice.text)).reverse(), pairCountdownLabel(elapsedMs, minutesLeft)];
|
|
441
472
|
return labels[Math.floor((elapsedMs - newest.afterMs) / PAIR_ADVICE_ROTATION_MS) % labels.length] ?? PAIR_WAITING_LABEL;
|
|
442
473
|
};
|
|
443
|
-
var PAIR_GET_APP_LINE = "No app yet? Get it at pushary.com/download.
|
|
444
|
-
var PAIRING_ESCAPE_APP_URL = "https://pushary.com/download";
|
|
474
|
+
var PAIR_GET_APP_LINE = "No app yet? Get it at pushary.com/download. Pairing keeps waiting.";
|
|
445
475
|
var PAIRING_ESCAPE_KEY_COMMAND = `${NPX_LATEST_COMMAND} setup --key pk_...`;
|
|
446
476
|
var PAIRING_ESCAPE_KEY_PAGE = "pushary.com/dashboard/agent/settings";
|
|
447
477
|
var describePairingEscape = () => [
|
|
448
|
-
`${yellow("!")} No app yet? Get it at ${cyan(
|
|
478
|
+
`${yellow("!")} No app yet? Get it at ${cyan(PUSHARY_APP_DOWNLOAD_URL)}, then run setup again.`,
|
|
449
479
|
"",
|
|
450
480
|
` ${dim("Already have a key? Use it instead:")}`,
|
|
451
481
|
` ${cyan(PAIRING_ESCAPE_KEY_COMMAND)}`,
|
|
452
482
|
` ${dim("Find it at")} ${cyan(PAIRING_ESCAPE_KEY_PAGE)}`
|
|
453
483
|
];
|
|
484
|
+
var PAIRING_CANCELLED_LABEL = "Cancelled";
|
|
485
|
+
var PAIRING_STOPPED_LABEL = "Stopped before your phone approved. The pairing code was cancelled.";
|
|
486
|
+
var PAIRING_KEEP_RUNNING_LINES = [
|
|
487
|
+
"This command has to keep running until your phone approves.",
|
|
488
|
+
"Run the same command again in the background, keep it running, and wait for it to finish."
|
|
489
|
+
];
|
|
490
|
+
var describePairCommandEscape = () => [
|
|
491
|
+
`${yellow("!")} No app yet? Get it at ${cyan(PUSHARY_APP_DOWNLOAD_URL)}, then run ${cyan("pushary pair")} again.`
|
|
492
|
+
];
|
|
493
|
+
var stoppedByTermination = (exitCode) => exitCode === EXIT_TERMINATED;
|
|
494
|
+
var describeCancelledPairingLabel = (exitCode) => stoppedByTermination(exitCode) ? PAIRING_STOPPED_LABEL : PAIRING_CANCELLED_LABEL;
|
|
495
|
+
var describeCancelledPairing = (exitCode, personEscape) => stoppedByTermination(exitCode) ? PAIRING_KEEP_RUNNING_LINES.map((line) => dim(line)) : personEscape;
|
|
454
496
|
var describePairingScreen = (screen) => [
|
|
455
497
|
bold("Connect your phone"),
|
|
456
498
|
"Scan this with your phone's camera or the Pushary app.",
|
|
@@ -481,20 +523,22 @@ var startPairing = async (cliPublicKey, computer) => {
|
|
|
481
523
|
return null;
|
|
482
524
|
}
|
|
483
525
|
};
|
|
484
|
-
var
|
|
526
|
+
var RERUN_NAME = { setup: "setup", pair: "pushary pair" };
|
|
527
|
+
var describePairFailure = (reason, command) => {
|
|
528
|
+
const rerun = RERUN_NAME[command];
|
|
485
529
|
switch (reason) {
|
|
486
530
|
case "no_site":
|
|
487
531
|
return "Couldn't set up your workspace. Try again, or finish setup at pushary.com/dashboard";
|
|
488
532
|
case "blocked":
|
|
489
|
-
return
|
|
533
|
+
return `Finish setting up in the Pushary app, then run ${rerun} again`;
|
|
490
534
|
case "authorize_failed":
|
|
491
|
-
return
|
|
535
|
+
return `The app could not authorize this terminal. Re-run ${rerun} to try again`;
|
|
492
536
|
case "payment_required":
|
|
493
|
-
return
|
|
537
|
+
return `Your Pushary workspace has no active subscription. Subscribe in the Pushary app or at pushary.com, then run ${rerun} again`;
|
|
494
538
|
case "denied":
|
|
495
|
-
return
|
|
539
|
+
return `You denied this computer on your phone. Run ${rerun} again if that was a mistake`;
|
|
496
540
|
default:
|
|
497
|
-
return
|
|
541
|
+
return `Pairing failed. Re-run ${rerun} to try again`;
|
|
498
542
|
}
|
|
499
543
|
};
|
|
500
544
|
var cancelPairing = async (pairId) => {
|
|
@@ -532,7 +576,7 @@ var ackPairing = async (pairId) => {
|
|
|
532
576
|
}
|
|
533
577
|
};
|
|
534
578
|
var pairFailed = (reason) => ({ kind: "failed", reason });
|
|
535
|
-
var pairingEscapeApplies = (outcome) => outcome.reason === "timeout" || outcome.reason === "expired"
|
|
579
|
+
var pairingEscapeApplies = (outcome) => outcome.reason === "timeout" || outcome.reason === "expired";
|
|
536
580
|
var buildPairLinks = (pairId, publicKeyB64, baseUrl = apiBase(), code = null) => {
|
|
537
581
|
const id = encodeURIComponent(pairId);
|
|
538
582
|
const pk = encodeURIComponent(publicKeyB64);
|
|
@@ -551,7 +595,11 @@ var buildPairLinks = (pairId, publicKeyB64, baseUrl = apiBase(), code = null) =>
|
|
|
551
595
|
deepLink: `pushary://pair?pk=${pk}&id=${id}`
|
|
552
596
|
};
|
|
553
597
|
};
|
|
554
|
-
var
|
|
598
|
+
var PAIR_TIMEOUT_MINUTES = Math.ceil(PAIR_TIMEOUT_MS / 6e4);
|
|
599
|
+
var PAIRING_KEEPS_RUNNING_NOTICE = `This keeps running until your phone approves, for up to ${PAIR_TIMEOUT_MINUTES} minutes. Run it in the background and keep it running.`;
|
|
600
|
+
var heldUntilTheSignalExits = () => new Promise(() => {
|
|
601
|
+
});
|
|
602
|
+
var connectViaAppPairing = async (options) => {
|
|
555
603
|
const clock = options.clock ?? SYSTEM_PAIR_CLOCK;
|
|
556
604
|
const keypair = generateKeypair();
|
|
557
605
|
const requestedAt = clock.now();
|
|
@@ -561,48 +609,59 @@ var connectViaAppPairing = async (options = {}) => {
|
|
|
561
609
|
return pairFailed("unreachable");
|
|
562
610
|
}
|
|
563
611
|
const { pairId, code } = started;
|
|
564
|
-
const
|
|
565
|
-
for (const line of describePairingScreen({ universalLink, deepLink })) {
|
|
566
|
-
console.log(` ${line}`);
|
|
567
|
-
}
|
|
568
|
-
await printQr(qrLink);
|
|
569
|
-
console.log(` ${describePairingFingerprint(publicKeyFingerprint(keypair.publicKeyB64))}`);
|
|
570
|
-
const startedAt = clock.now();
|
|
571
|
-
const deadline = requestedAt + PAIR_TIMEOUT_MS;
|
|
572
|
-
const elapsed = () => clock.now() - startedAt;
|
|
573
|
-
const minutesLeft = () => Math.max(0, Math.ceil((deadline - clock.now()) / 6e4));
|
|
574
|
-
const advisesInTheLabel = humanIsTty();
|
|
575
|
-
let adviceWritten = 0;
|
|
576
|
-
const writeAdviceThatFellDue = () => {
|
|
577
|
-
const due = pairAdviceDue(elapsed());
|
|
578
|
-
for (const advice of due.slice(adviceWritten)) writeStatusLine(dim(advice));
|
|
579
|
-
adviceWritten = due.length;
|
|
580
|
-
};
|
|
581
|
-
const stop = startSpinner(() => advisesInTheLabel ? pairWaitingLabel(elapsed(), minutesLeft()) : pairCountdownLabel(elapsed(), minutesLeft()));
|
|
612
|
+
const rerun = RERUN_NAME[options.command];
|
|
582
613
|
let cancelled = false;
|
|
614
|
+
let stopSpinner = null;
|
|
615
|
+
const finishWaitLine = (glyph, label) => {
|
|
616
|
+
if (stopSpinner === null) writeStatusLine(`${glyph} ${label}`);
|
|
617
|
+
else stopSpinner(glyph, label);
|
|
618
|
+
};
|
|
583
619
|
const cancelOnSignal = (exitCode) => () => {
|
|
584
620
|
if (cancelled) return;
|
|
585
621
|
cancelled = true;
|
|
586
|
-
|
|
622
|
+
finishWaitLine(yellow("!"), describeCancelledPairingLabel(exitCode));
|
|
587
623
|
const flushed = options.onCancelled?.(exitCode);
|
|
588
624
|
void Promise.allSettled([Promise.resolve(flushed), cancelPairing(pairId)]).finally(() => process.exit(exitCode));
|
|
589
625
|
};
|
|
626
|
+
const unlessSignalled = (outcome) => cancelled ? heldUntilTheSignalExits() : outcome;
|
|
590
627
|
const onInterrupt = cancelOnSignal(EXIT_ABORTED);
|
|
591
628
|
const onTerminate = cancelOnSignal(EXIT_TERMINATED);
|
|
592
629
|
process.once("SIGINT", onInterrupt);
|
|
593
630
|
process.once("SIGTERM", onTerminate);
|
|
594
|
-
let consecutiveFailures = 0;
|
|
595
631
|
try {
|
|
632
|
+
const { qrLink, universalLink, deepLink } = buildPairLinks(pairId, keypair.publicKeyB64, apiBase(), code);
|
|
633
|
+
if (!humanIsTty()) console.log(` ${PAIRING_KEEPS_RUNNING_NOTICE}`);
|
|
634
|
+
for (const line of describePairingScreen({ universalLink, deepLink })) {
|
|
635
|
+
console.log(` ${line}`);
|
|
636
|
+
}
|
|
637
|
+
await printQr(qrLink);
|
|
638
|
+
if (cancelled) return heldUntilTheSignalExits();
|
|
639
|
+
console.log(` ${describePairingFingerprint(publicKeyFingerprint(keypair.publicKeyB64))}`);
|
|
640
|
+
const startedAt = clock.now();
|
|
641
|
+
const deadline = requestedAt + PAIR_TIMEOUT_MS;
|
|
642
|
+
const elapsed = () => clock.now() - startedAt;
|
|
643
|
+
const minutesLeft = () => Math.max(0, Math.ceil((deadline - clock.now()) / 6e4));
|
|
644
|
+
const advisesInTheLabel = humanIsTty();
|
|
645
|
+
let adviceWritten = 0;
|
|
646
|
+
const writeAdviceThatFellDue = () => {
|
|
647
|
+
const due = pairAdviceDue(elapsed());
|
|
648
|
+
for (const advice of due.slice(adviceWritten)) writeStatusLine(dim(advice));
|
|
649
|
+
adviceWritten = due.length;
|
|
650
|
+
};
|
|
651
|
+
const stop = startSpinner(() => advisesInTheLabel ? pairWaitingLabel(elapsed(), minutesLeft()) : pairCountdownLabel(elapsed(), minutesLeft()));
|
|
652
|
+
stopSpinner = stop;
|
|
653
|
+
let consecutiveFailures = 0;
|
|
596
654
|
while (clock.now() < deadline) {
|
|
597
|
-
if (cancelled) return
|
|
655
|
+
if (cancelled) return heldUntilTheSignalExits();
|
|
598
656
|
if (!advisesInTheLabel) writeAdviceThatFellDue();
|
|
599
657
|
const claim = await claimPairing(pairId);
|
|
658
|
+
if (cancelled) return heldUntilTheSignalExits();
|
|
600
659
|
if (claim === null) {
|
|
601
660
|
consecutiveFailures += 1;
|
|
602
661
|
if (consecutiveFailures >= PAIR_MAX_CONSECUTIVE_FAILURES) {
|
|
603
|
-
stop(yellow("!"),
|
|
662
|
+
stop(yellow("!"), `Can't reach pushary.com to finish pairing. Check your connection, then run ${rerun} again.`);
|
|
604
663
|
await cancelPairing(pairId);
|
|
605
|
-
return pairFailed("unreachable");
|
|
664
|
+
return unlessSignalled(pairFailed("unreachable"));
|
|
606
665
|
}
|
|
607
666
|
await clock.sleep(PAIR_POLL_INTERVAL_MS);
|
|
608
667
|
continue;
|
|
@@ -613,31 +672,32 @@ var connectViaAppPairing = async (options = {}) => {
|
|
|
613
672
|
try {
|
|
614
673
|
apiKey = openSealedKey(claim.sealed, keypair);
|
|
615
674
|
} catch {
|
|
616
|
-
stop(yellow("!"),
|
|
675
|
+
stop(yellow("!"), `Pairing failed to decrypt. Re-run ${rerun} to try again.`);
|
|
617
676
|
await cancelPairing(pairId);
|
|
618
|
-
return pairFailed("decrypt");
|
|
677
|
+
return unlessSignalled(pairFailed("decrypt"));
|
|
619
678
|
}
|
|
620
679
|
await ackPairing(pairId);
|
|
680
|
+
if (cancelled) return heldUntilTheSignalExits();
|
|
621
681
|
stop(check, "App connected");
|
|
622
682
|
return { kind: "paired", apiKey, handle: claim.siteSlug };
|
|
623
683
|
}
|
|
624
684
|
if (claim?.status === "expired") {
|
|
625
|
-
stop(yellow("!"),
|
|
685
|
+
stop(yellow("!"), `Pairing expired. Re-run ${rerun} to try again.`);
|
|
626
686
|
return pairFailed("expired");
|
|
627
687
|
}
|
|
628
688
|
if (claim?.status === "failed") {
|
|
629
|
-
stop(yellow("!"), describePairFailure(claim.reason));
|
|
689
|
+
stop(yellow("!"), describePairFailure(claim.reason, options.command));
|
|
630
690
|
return pairFailed("rejected");
|
|
631
691
|
}
|
|
632
692
|
await clock.sleep(PAIR_POLL_INTERVAL_MS);
|
|
633
693
|
}
|
|
634
694
|
stop(yellow("!"), "Timed out waiting for the app");
|
|
635
695
|
await cancelPairing(pairId);
|
|
636
|
-
return pairFailed("timeout");
|
|
696
|
+
return unlessSignalled(pairFailed("timeout"));
|
|
637
697
|
} catch (err) {
|
|
638
|
-
|
|
698
|
+
finishWaitLine(yellow("!"), `Pairing error ${dim(`(${err instanceof Error ? err.message : "network"})`)}`);
|
|
639
699
|
await cancelPairing(pairId);
|
|
640
|
-
return pairFailed("unreachable");
|
|
700
|
+
return unlessSignalled(pairFailed("unreachable"));
|
|
641
701
|
} finally {
|
|
642
702
|
process.off("SIGINT", onInterrupt);
|
|
643
703
|
process.off("SIGTERM", onTerminate);
|
|
@@ -717,15 +777,96 @@ var waitForYourPhone = async (apiKey, options = {}) => {
|
|
|
717
777
|
for (const line of repair) console.log(` ${dim(line)}`);
|
|
718
778
|
return phoneFailure("no_device", repair);
|
|
719
779
|
};
|
|
780
|
+
var differentPeople = (pairedUserId, accountUserId) => pairedUserId !== null && accountUserId !== null && pairedUserId !== accountUserId;
|
|
781
|
+
var otherSiteKindOf = (pairedUserId, accountUserId) => {
|
|
782
|
+
if (pairedUserId === null || accountUserId === null) return "unknown";
|
|
783
|
+
return differentPeople(pairedUserId, accountUserId) ? "account" : "workspace";
|
|
784
|
+
};
|
|
785
|
+
var pairedAccountMismatch = (paired, account) => {
|
|
786
|
+
if (paired.siteSlug === null || account.siteSlug === null) return null;
|
|
787
|
+
const slugs = { pairedSiteSlug: paired.siteSlug, accountSiteSlug: account.siteSlug };
|
|
788
|
+
if (paired.siteSlug !== account.siteSlug) return { kind: otherSiteKindOf(paired.userId, account.userId), ...slugs };
|
|
789
|
+
return differentPeople(paired.userId, account.userId) ? { kind: "teammate", ...slugs } : null;
|
|
790
|
+
};
|
|
791
|
+
var describePairedAccountMismatch = (mismatch) => {
|
|
792
|
+
const move = `Or move this computer to @${mismatch.pairedSiteSlug}: ${NPX_LATEST_COMMAND} setup --connect app (this replaces its key)`;
|
|
793
|
+
switch (mismatch.kind) {
|
|
794
|
+
case "workspace":
|
|
795
|
+
return {
|
|
796
|
+
headline: `Your phone approved in your @${mismatch.pairedSiteSlug} workspace, but this computer is connected to your @${mismatch.accountSiteSlug} workspace.`,
|
|
797
|
+
repair: [`In the Pushary app, switch to the @${mismatch.accountSiteSlug} workspace.`, move]
|
|
798
|
+
};
|
|
799
|
+
case "account":
|
|
800
|
+
return {
|
|
801
|
+
headline: `Your phone is signed in to a different account (@${mismatch.pairedSiteSlug}). This computer is connected to @${mismatch.accountSiteSlug}.`,
|
|
802
|
+
repair: ["Sign in on the Pushary app with the account this computer uses.", move]
|
|
803
|
+
};
|
|
804
|
+
case "teammate":
|
|
805
|
+
return {
|
|
806
|
+
headline: `Your phone is signed in as another member of @${mismatch.accountSiteSlug}, not as the person this computer belongs to.`,
|
|
807
|
+
repair: ["Sign in on the Pushary app with your own account."]
|
|
808
|
+
};
|
|
809
|
+
case "unknown":
|
|
810
|
+
return {
|
|
811
|
+
headline: `Your phone approved for @${mismatch.pairedSiteSlug}, but this computer is connected to @${mismatch.accountSiteSlug}.`,
|
|
812
|
+
repair: [`In the Pushary app, switch to @${mismatch.accountSiteSlug}, or sign in with the account that has it.`, move]
|
|
813
|
+
};
|
|
814
|
+
}
|
|
815
|
+
};
|
|
816
|
+
var PAIR_COMMAND_RETRY_REPAIR = [`No app yet? Get it at ${PUSHARY_APP_DOWNLOAD_URL}.`];
|
|
817
|
+
var printRepair = (repair) => {
|
|
818
|
+
for (const line of repair) console.log(` ${dim(line)}`);
|
|
819
|
+
};
|
|
820
|
+
var pairingKeyAccount = async (pairingKey, claimed) => {
|
|
821
|
+
const verdict = await checkApiKey(pairingKey);
|
|
822
|
+
return verdict.kind === "ok" ? { siteSlug: verdict.identity.siteSlug, userId: verdict.identity.authorizedUserId } : claimed;
|
|
823
|
+
};
|
|
824
|
+
var discardPairingKey = async (pairingKey) => {
|
|
825
|
+
const attempt = await revokeOwnKey(pairingKey, apiBase());
|
|
826
|
+
if (keyNoLongerAccepted(attempt)) return;
|
|
827
|
+
console.log(` ${yellow("!")} ${describeRevokeAttempt(attempt)}`);
|
|
828
|
+
console.log(` ${dim('This computer keeps its own key. Revoke the extra "Paired agent (mobile)" key at')} ${cyan("pushary.com/dashboard/agent/settings")}${dim(".")}`);
|
|
829
|
+
};
|
|
830
|
+
var pairAppWithThisComputer = async (apiKey, options) => {
|
|
831
|
+
const probe = await fetchChannels(apiKey);
|
|
832
|
+
if (probe.kind !== "ok") return describeProbeFailure(probe);
|
|
833
|
+
if (planAppConnect(probe.status).kind === "send") {
|
|
834
|
+
console.log(` ${check} ${describeExistingConnection(probe.status)}`);
|
|
835
|
+
return sendAndConfirm(apiKey, probe.status);
|
|
836
|
+
}
|
|
837
|
+
const paired = await connectViaAppPairing({ computer: options.computer, command: "pair", onCancelled: options.onCancelled });
|
|
838
|
+
if (paired.kind === "failed") {
|
|
839
|
+
const repair = pairingEscapeApplies(paired) ? PAIR_COMMAND_RETRY_REPAIR : [];
|
|
840
|
+
printRepair(repair);
|
|
841
|
+
return phoneFailure(paired.reason, repair);
|
|
842
|
+
}
|
|
843
|
+
const claimed = { siteSlug: paired.handle ?? null, userId: null };
|
|
844
|
+
const pairedAccount = options.account.siteSlug === null ? claimed : await pairingKeyAccount(paired.apiKey, claimed);
|
|
845
|
+
await discardPairingKey(paired.apiKey);
|
|
846
|
+
const mismatch = pairedAccountMismatch(pairedAccount, options.account);
|
|
847
|
+
if (mismatch !== null) {
|
|
848
|
+
const report = describePairedAccountMismatch(mismatch);
|
|
849
|
+
console.log(` ${yellow("!")} ${report.headline}`);
|
|
850
|
+
printRepair(report.repair);
|
|
851
|
+
return phoneFailure("other_account", report.repair);
|
|
852
|
+
}
|
|
853
|
+
return confirmAppConnection(apiKey);
|
|
854
|
+
};
|
|
720
855
|
|
|
721
856
|
export {
|
|
722
857
|
fetchChannels,
|
|
858
|
+
canShowPairingQr,
|
|
723
859
|
connectDevice,
|
|
724
860
|
confirmAppConnection,
|
|
725
|
-
|
|
861
|
+
phoneAwaitsNotificationPermission,
|
|
862
|
+
pairingAgainHelps,
|
|
863
|
+
checkPhoneWithoutPairing,
|
|
726
864
|
printConnectInstructions,
|
|
727
865
|
describePairingEscape,
|
|
866
|
+
describePairCommandEscape,
|
|
867
|
+
describeCancelledPairing,
|
|
728
868
|
pairingEscapeApplies,
|
|
729
869
|
connectViaAppPairing,
|
|
730
|
-
waitForYourPhone
|
|
870
|
+
waitForYourPhone,
|
|
871
|
+
pairAppWithThisComputer
|
|
731
872
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
APPROVAL_RULES_PATH,
|
|
3
3
|
canChangeApprovalSettings
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-UAHBSOO4.js";
|
|
5
5
|
import {
|
|
6
6
|
callMcpTool
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MUSINFEU.js";
|
|
8
8
|
import {
|
|
9
9
|
absoluteUrl
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-CABBLJD5.js";
|
|
11
11
|
import {
|
|
12
12
|
getBaseUrl
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-VPADWVYD.js";
|
|
14
14
|
import {
|
|
15
15
|
NPX_LATEST_COMMAND
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-TXXAQRX4.js";
|
|
17
17
|
import {
|
|
18
18
|
AGENT_STOP_DEFAULT_SECONDS,
|
|
19
19
|
APPROVAL_MODE_META,
|
|
@@ -21,9 +21,12 @@ import {
|
|
|
21
21
|
classifyConfirmResponse,
|
|
22
22
|
isAnswerSource,
|
|
23
23
|
roundTripAsk
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-O5ARO3JM.js";
|
|
25
25
|
|
|
26
26
|
// src/reach.ts
|
|
27
|
+
var PUSHARY_APP_DOWNLOAD_URL = "https://pushary.com/download";
|
|
28
|
+
var SIGN_IN_ON_THE_APP_STEP = "Sign in with the same account you use here and allow notifications, so your phone registers for approvals.";
|
|
29
|
+
var GET_THE_APP_STEP = `Get the Pushary app at ${PUSHARY_APP_DOWNLOAD_URL}. ${SIGN_IN_ON_THE_APP_STEP}`;
|
|
27
30
|
var reachVerdict = (channels) => {
|
|
28
31
|
const { yours, site } = channels;
|
|
29
32
|
if (yours === null || site === null) {
|
|
@@ -68,7 +71,7 @@ var describeAppRepair = (verdict) => {
|
|
|
68
71
|
case "nobody":
|
|
69
72
|
return [
|
|
70
73
|
"Open the Pushary app, sign in, and allow notifications.",
|
|
71
|
-
`If this terminal was never paired with your phone, run: ${NPX_LATEST_COMMAND}
|
|
74
|
+
`If this terminal was never paired with your phone, run: ${NPX_LATEST_COMMAND} pair`
|
|
72
75
|
];
|
|
73
76
|
case "others":
|
|
74
77
|
return [
|
|
@@ -148,7 +151,7 @@ var describeVerifyOutcome = (outcome) => {
|
|
|
148
151
|
ok: false,
|
|
149
152
|
message: "Nothing to deliver to. Agents are configured; approvals will fall back to the terminal.",
|
|
150
153
|
next: [
|
|
151
|
-
|
|
154
|
+
GET_THE_APP_STEP,
|
|
152
155
|
"Then pushary doctor --roundtrip to test a synthetic question and answer."
|
|
153
156
|
]
|
|
154
157
|
};
|
|
@@ -158,7 +161,7 @@ var describeVerifyOutcome = (outcome) => {
|
|
|
158
161
|
message: `Delivered to ${plural2(outcome.recipients, "device")} on this site, none of them yours.`,
|
|
159
162
|
next: [
|
|
160
163
|
`Approvals for your agent would wake one of your ${plural2(outcome.otherMembers, "teammate")}.`,
|
|
161
|
-
|
|
164
|
+
GET_THE_APP_STEP
|
|
162
165
|
]
|
|
163
166
|
};
|
|
164
167
|
case "unattributable":
|
|
@@ -167,7 +170,8 @@ var describeVerifyOutcome = (outcome) => {
|
|
|
167
170
|
message: `Delivered to ${plural2(outcome.recipients, "device")} on this site, and no way to tell whose.`,
|
|
168
171
|
next: [
|
|
169
172
|
"Browser subscriptions carry no owner, and this site has other members.",
|
|
170
|
-
|
|
173
|
+
GET_THE_APP_STEP,
|
|
174
|
+
"Or run pushary doctor --roundtrip to prove it reaches you."
|
|
171
175
|
]
|
|
172
176
|
};
|
|
173
177
|
case "error":
|
|
@@ -362,8 +366,8 @@ var describeRoundTripOutcome = (outcome, { appPlatforms = [], baseUrl = getBaseU
|
|
|
362
366
|
ok: false,
|
|
363
367
|
message: "Nothing to ask. No phone or browser is connected to this site.",
|
|
364
368
|
next: [
|
|
365
|
-
|
|
366
|
-
"
|
|
369
|
+
GET_THE_APP_STEP,
|
|
370
|
+
"Then run pushary doctor --roundtrip again."
|
|
367
371
|
]
|
|
368
372
|
};
|
|
369
373
|
case "stopped":
|
|
@@ -410,6 +414,9 @@ var roundTripEvidence = (outcome) => ({
|
|
|
410
414
|
});
|
|
411
415
|
|
|
412
416
|
export {
|
|
417
|
+
PUSHARY_APP_DOWNLOAD_URL,
|
|
418
|
+
SIGN_IN_ON_THE_APP_STEP,
|
|
419
|
+
GET_THE_APP_STEP,
|
|
413
420
|
reachVerdict,
|
|
414
421
|
reachesYou,
|
|
415
422
|
describeReach,
|