@pushary/agent-hooks 1.9.58 → 1.9.59
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 +7 -0
- package/dist/{api-WVXBM4MR.js → api-UVJGNZIF.js} +10 -10
- package/dist/bin/pushary-bell-hook.js +27 -27
- package/dist/bin/pushary-bell.js +10 -10
- package/dist/bin/pushary-claude.js +26 -26
- package/dist/bin/pushary-clean.js +33 -33
- package/dist/bin/pushary-codex-bridge.js +21 -21
- package/dist/bin/pushary-codex-hook.js +32 -32
- package/dist/bin/pushary-codex-session.js +8 -8
- package/dist/bin/pushary-codex.js +14 -14
- package/dist/bin/pushary-connect.js +27 -27
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +37 -37
- package/dist/bin/pushary-disconnect.js +26 -26
- package/dist/bin/pushary-doctor.js +38 -38
- package/dist/bin/pushary-elicitation-hook.js +27 -27
- package/dist/bin/pushary-gemini-bridge.js +15 -15
- package/dist/bin/pushary-gemini-hook.js +29 -29
- package/dist/bin/pushary-hook.js +31 -31
- package/dist/bin/pushary-login.js +13 -13
- package/dist/bin/pushary-logout.js +26 -26
- package/dist/bin/pushary-mcp.js +11 -11
- package/dist/bin/pushary-mode.js +13 -13
- package/dist/bin/pushary-notification-hook.js +26 -26
- package/dist/bin/pushary-opencode-hook.js +28 -28
- package/dist/bin/pushary-permission-denied-hook.js +31 -31
- package/dist/bin/pushary-permission-hook.js +30 -30
- package/dist/bin/pushary-post-hook.js +26 -26
- package/dist/bin/pushary-prompt-hook.js +26 -26
- package/dist/bin/pushary-session-end-hook.js +26 -26
- package/dist/bin/pushary-session-start-hook.js +33 -33
- package/dist/bin/pushary-setup.js +42 -42
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +30 -30
- package/dist/bin/pushary-stop-hook.js +26 -26
- package/dist/bin/pushary-stopfailure-hook.js +26 -26
- package/dist/bin/pushary-suggestions.js +13 -13
- package/dist/bin/pushary-transcript-register.js +18 -18
- package/dist/bin/pushary-transcripts.js +7 -7
- package/dist/bin/pushary-upgrade.js +37 -37
- package/dist/bin/pushary-wait.js +13 -13
- package/dist/bin/pushary.js +7 -7
- package/dist/{chunk-CZULJ647.js → chunk-2FVP7WRP.js} +3 -3
- package/dist/{chunk-TN74MUMB.js → chunk-2WMZDKPM.js} +8 -8
- package/dist/{chunk-N3NSWWNU.js → chunk-3N2ZTHZZ.js} +1 -1
- package/dist/{chunk-4LUPZ347.js → chunk-3NROUNIS.js} +2 -2
- package/dist/{chunk-7RZO6VWD.js → chunk-3RKIJM26.js} +2 -2
- package/dist/{chunk-QP3XPS5U.js → chunk-4QF2YLYK.js} +6 -6
- package/dist/{chunk-LVDC3RUE.js → chunk-4XXZUFWN.js} +1 -1
- package/dist/{chunk-JZKEC4XJ.js → chunk-5BNXJTOZ.js} +2 -2
- package/dist/{chunk-ZL3UR6M5.js → chunk-5EFNBL6V.js} +3 -3
- package/dist/{chunk-RF74KBF5.js → chunk-5JWCWALO.js} +9 -9
- package/dist/{chunk-PZOFPAPG.js → chunk-5O6D4J2K.js} +2 -2
- package/dist/{chunk-3KOPY2UQ.js → chunk-5PP4455M.js} +3 -3
- package/dist/{chunk-HUWLEVL2.js → chunk-6ONSTCDJ.js} +5 -5
- package/dist/{chunk-ECJJKDP7.js → chunk-75UYYIFJ.js} +1 -1
- package/dist/{chunk-GZL3KEPC.js → chunk-762CDAJJ.js} +140 -136
- package/dist/{chunk-QDFLBTUP.js → chunk-AS4Z6KS4.js} +1 -1
- package/dist/{chunk-4YNNAF53.js → chunk-AY32RSUC.js} +2 -2
- package/dist/{chunk-I43PY5G3.js → chunk-BKVX53QR.js} +1 -1
- package/dist/{chunk-5SFM6XB4.js → chunk-BMPZ5HVJ.js} +2 -2
- package/dist/{chunk-KIH5BDH5.js → chunk-BRUHVTFB.js} +2 -2
- package/dist/{chunk-ZJNU32VE.js → chunk-CPRA7IEK.js} +155 -37
- package/dist/{chunk-C3IWX6KU.js → chunk-D6CXQIXO.js} +1 -1
- package/dist/{chunk-X6F4BQEE.js → chunk-DK35M4TH.js} +5 -5
- package/dist/{chunk-VLJ5C6IT.js → chunk-DS7X36Z3.js} +4 -4
- package/dist/{chunk-XFUKCBPU.js → chunk-EBQTWH5O.js} +10 -10
- package/dist/{chunk-T2BEIPK2.js → chunk-EHCIQA5D.js} +4 -4
- package/dist/{chunk-UMVVQXAC.js → chunk-IBXHVYN2.js} +2 -2
- package/dist/{chunk-5DZHKNBU.js → chunk-JAKBCKEB.js} +3 -3
- package/dist/{chunk-T2AC5VFQ.js → chunk-JBCMXSBO.js} +5 -5
- package/dist/{chunk-IRZ5FVWG.js → chunk-KAJDKYUM.js} +3 -3
- package/dist/{chunk-CSQJCXPX.js → chunk-KHDD74MK.js} +5 -5
- package/dist/{chunk-K5CAURU5.js → chunk-KQHY6L3X.js} +4 -4
- package/dist/{chunk-XWY4UW62.js → chunk-KQWN7C5C.js} +4 -4
- package/dist/{chunk-KW6EYFZV.js → chunk-KW3DED2A.js} +4 -4
- package/dist/{chunk-MYBCXDIL.js → chunk-KZCYHWDF.js} +2 -2
- package/dist/{chunk-4JJ3T7IE.js → chunk-L3NVHPBU.js} +6 -6
- package/dist/{chunk-VPZ5K72D.js → chunk-LAEW5QQD.js} +1 -1
- package/dist/{chunk-IJ6XKKQW.js → chunk-M46WDK64.js} +1 -1
- package/dist/{chunk-LVWXRXT7.js → chunk-M6MOQBR5.js} +1 -1
- package/dist/{chunk-S54YLXWW.js → chunk-MA37WNVS.js} +3 -3
- package/dist/{chunk-XTZHUIGJ.js → chunk-MMLIQDTG.js} +1 -1
- package/dist/{chunk-CK5BCFQF.js → chunk-MSU3VKGJ.js} +2 -2
- package/dist/{chunk-3WNOO7BM.js → chunk-MYU5D5VH.js} +4 -4
- package/dist/{chunk-WXZN5CS3.js → chunk-OZIXBN3O.js} +2 -2
- package/dist/{chunk-JSQOHMNJ.js → chunk-PVANKDWM.js} +1 -1
- package/dist/{chunk-JYXIARGW.js → chunk-RAMQBSVZ.js} +1 -1
- package/dist/{chunk-S5LX25XE.js → chunk-RQDP2SJY.js} +1 -1
- package/dist/{chunk-ZEHUWE3X.js → chunk-SIU6OWA6.js} +6 -6
- package/dist/{chunk-HRHAZ3GE.js → chunk-T65RIQK2.js} +6 -6
- package/dist/{chunk-XEJV3QSS.js → chunk-TCH5UCPR.js} +3 -3
- package/dist/{chunk-ATUZX4K7.js → chunk-TDOKDCFH.js} +3 -3
- package/dist/{chunk-FAGDOPQI.js → chunk-UFJS4RR7.js} +3 -3
- package/dist/{chunk-WVP6UQG3.js → chunk-US3IT6ZC.js} +3 -3
- package/dist/{chunk-OHD35NPC.js → chunk-UTJ5465F.js} +2 -2
- package/dist/{chunk-M7NX25ZA.js → chunk-UVZK5LIK.js} +1 -1
- package/dist/{chunk-IUOUNRLH.js → chunk-V3PDUDPB.js} +2 -2
- package/dist/{chunk-RGQEULXD.js → chunk-VAJHDTJX.js} +11 -11
- package/dist/{chunk-QTCFEKLJ.js → chunk-W47WL6JY.js} +1 -1
- package/dist/{chunk-DQ565WFA.js → chunk-WW24SG27.js} +5 -5
- package/dist/{chunk-3TJLPABQ.js → chunk-WWAVHLGS.js} +3 -3
- package/dist/{chunk-KSVCCSAO.js → chunk-X4ES7QBT.js} +5 -5
- package/dist/{chunk-XXNT4FGA.js → chunk-XGP5VSQG.js} +1 -1
- package/dist/{chunk-MCHOBQHE.js → chunk-YQVKG5MC.js} +5 -5
- package/dist/{codex-app-cards-switch-TVKXJWXE.js → codex-app-cards-switch-N77RWKCO.js} +11 -11
- package/dist/{codex-desktop-launch-ROTJEEGF.js → codex-desktop-launch-KIX7OMTL.js} +1 -1
- package/dist/{codex-session-launch-VL6ZQA3N.js → codex-session-launch-XV7SIIWP.js} +18 -18
- package/dist/{config-SYLUYZQE.js → config-HH4DYYNX.js} +3 -3
- package/dist/{global-upgrade-IPWV5PTM.js → global-upgrade-YWIVJIUR.js} +9 -9
- package/dist/{identity-ARPAUNGN.js → identity-4J7Y2MW3.js} +4 -4
- package/dist/{live-capabilities-EWTRY2HA.js → live-capabilities-LHZBCI5U.js} +4 -4
- package/dist/{paths-IZTNMJAQ.js → paths-ES3V7BWQ.js} +3 -3
- package/dist/{reapply-ILKOYYKA.js → reapply-KA5SIYWX.js} +26 -26
- package/dist/src/index.js +21 -21
- package/dist/{upgrade-lock-ML73QXIG.js → upgrade-lock-TJPKU5HL.js} +4 -4
- package/dist/{usage-OUV76AIY.js → usage-7ALXBJVJ.js} +3 -3
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-POFBE6ZY.js";
|
|
4
4
|
import {
|
|
5
5
|
autoUpdateState
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-KZCYHWDF.js";
|
|
7
7
|
import {
|
|
8
8
|
readJsonSafe,
|
|
9
9
|
writeJsonAtomic
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "./chunk-QTOLNRET.js";
|
|
18
18
|
import {
|
|
19
19
|
isAutoUpdateResult
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-762CDAJJ.js";
|
|
21
21
|
|
|
22
22
|
// src/auto-update.ts
|
|
23
23
|
import { spawn } from "child_process";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
keyCheckFromResponse
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MA37WNVS.js";
|
|
4
4
|
import {
|
|
5
5
|
installNetworkDefaults
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JAKBCKEB.js";
|
|
7
7
|
import {
|
|
8
8
|
getBaseUrl
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4XXZUFWN.js";
|
|
10
10
|
|
|
11
11
|
// src/retry.ts
|
|
12
12
|
var isRetryable = (err) => {
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
IDLE_PROMPT_NOTIFICATION,
|
|
3
3
|
NOTIFICATION_PUSH_TYPES,
|
|
4
4
|
POSTTOOLUSE_MIRROR_ONLY_TOOLS
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-W47WL6JY.js";
|
|
6
6
|
import {
|
|
7
7
|
repoKeyFor
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-XGP5VSQG.js";
|
|
9
9
|
import {
|
|
10
10
|
cancelQuestion,
|
|
11
11
|
clientErrorKindOf,
|
|
@@ -13,26 +13,26 @@ import {
|
|
|
13
13
|
reportClientError,
|
|
14
14
|
sendNotification,
|
|
15
15
|
waitForAnswer
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-WW24SG27.js";
|
|
17
17
|
import {
|
|
18
18
|
withRetry
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-5EFNBL6V.js";
|
|
20
20
|
import {
|
|
21
21
|
getMachineId
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-M46WDK64.js";
|
|
23
23
|
import {
|
|
24
24
|
reportedInstallSource
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-3RKIJM26.js";
|
|
26
26
|
import {
|
|
27
27
|
canonicalJson
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-KZCYHWDF.js";
|
|
29
29
|
import {
|
|
30
30
|
writeFileAtomic
|
|
31
31
|
} from "./chunk-QENTGE75.js";
|
|
32
32
|
import {
|
|
33
33
|
getApiKey,
|
|
34
34
|
getBaseUrl
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-4XXZUFWN.js";
|
|
36
36
|
import {
|
|
37
37
|
ACTION_BODY_MAX,
|
|
38
38
|
AGENTS,
|
|
@@ -66,7 +66,7 @@ import {
|
|
|
66
66
|
toToolLookup,
|
|
67
67
|
truncateLine,
|
|
68
68
|
unansweredRefusalReason
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-762CDAJJ.js";
|
|
70
70
|
|
|
71
71
|
// ../hook-mapping/src/describe.ts
|
|
72
72
|
import { isAbsolute, relative, resolve } from "path";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pusharyDir
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KZCYHWDF.js";
|
|
4
4
|
import {
|
|
5
5
|
readJsonSafe,
|
|
6
6
|
writeFileAtomic
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
serializeDeclinedAgents,
|
|
14
14
|
withDeclinedAgent,
|
|
15
15
|
withoutDeclinedAgent
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-762CDAJJ.js";
|
|
17
17
|
|
|
18
18
|
// src/declined-agents-file.ts
|
|
19
19
|
import { join } from "path";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
realpath
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-M6MOQBR5.js";
|
|
4
4
|
import {
|
|
5
5
|
findNativeClaudeInstall
|
|
6
6
|
} from "./chunk-VUFHYMSP.js";
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
resolvePackageVersionFromBinary,
|
|
14
14
|
resolvePathBinary,
|
|
15
15
|
resolvePathBinaryAsync
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-US3IT6ZC.js";
|
|
17
17
|
import {
|
|
18
18
|
MANAGED_PROVIDERS
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-762CDAJJ.js";
|
|
20
20
|
|
|
21
21
|
// src/live-capabilities.ts
|
|
22
22
|
import { homedir } from "os";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MCP_BRIDGE_BINARY
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3NROUNIS.js";
|
|
4
4
|
import {
|
|
5
5
|
KEY_FILE_MODE
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-KAJDKYUM.js";
|
|
7
7
|
import {
|
|
8
8
|
NpmInstallError,
|
|
9
9
|
NpmMissingError,
|
|
10
10
|
NpmPermissionError
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-US3IT6ZC.js";
|
|
12
12
|
import {
|
|
13
13
|
readJsonSafe,
|
|
14
14
|
writeFileAtomic,
|
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
} from "./chunk-QENTGE75.js";
|
|
17
17
|
import {
|
|
18
18
|
NPX_LATEST_COMMAND
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-BMPZ5HVJ.js";
|
|
20
20
|
import {
|
|
21
21
|
readSetupAgentFailures
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-762CDAJJ.js";
|
|
23
23
|
|
|
24
24
|
// src/instruction-file.ts
|
|
25
25
|
import { accessSync, constants, existsSync, readFileSync, statSync, writeFileSync, mkdirSync, rmSync } from "fs";
|
|
@@ -1,3 +1,132 @@
|
|
|
1
|
+
// ../contracts/src/json-record.ts
|
|
2
|
+
var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3
|
+
|
|
4
|
+
// ../contracts/src/agent-questions.ts
|
|
5
|
+
var MAX_AGENT_QUESTIONS = 4;
|
|
6
|
+
var MIN_AGENT_QUESTION_OPTIONS = 2;
|
|
7
|
+
var MAX_AGENT_QUESTION_OPTIONS = 4;
|
|
8
|
+
var AGENT_QUESTION_HEADER_MAX = 40;
|
|
9
|
+
var AGENT_QUESTION_OPTION_MAX = 100;
|
|
10
|
+
var AGENT_QUESTION_DESCRIPTION_MAX = 500;
|
|
11
|
+
var agentQuestionOptionIn = (raw) => {
|
|
12
|
+
if (!isRecord(raw) || typeof raw.label !== "string" || raw.label.length === 0) return [];
|
|
13
|
+
return [{
|
|
14
|
+
label: raw.label,
|
|
15
|
+
...typeof raw.description === "string" ? { description: raw.description } : {}
|
|
16
|
+
}];
|
|
17
|
+
};
|
|
18
|
+
var agentQuestionFieldsIn = (raw) => {
|
|
19
|
+
if (!isRecord(raw) || typeof raw.question !== "string") return void 0;
|
|
20
|
+
return {
|
|
21
|
+
question: raw.question,
|
|
22
|
+
...typeof raw.header === "string" ? { header: raw.header } : {},
|
|
23
|
+
multiSelect: raw.multiSelect === true,
|
|
24
|
+
...typeof raw.allowOther === "boolean" ? { allowOther: raw.allowOther } : {},
|
|
25
|
+
options: Array.isArray(raw.options) ? raw.options.flatMap(agentQuestionOptionIn) : []
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
var parseAgentQuestion = (raw) => {
|
|
29
|
+
const question = agentQuestionFieldsIn(raw);
|
|
30
|
+
return question && question.options.length >= MIN_AGENT_QUESTION_OPTIONS ? question : void 0;
|
|
31
|
+
};
|
|
32
|
+
var parseAgentQuestions = (toolInput) => {
|
|
33
|
+
const questions = toolInput.questions;
|
|
34
|
+
if (!Array.isArray(questions) || questions.length === 0) return void 0;
|
|
35
|
+
if (questions.length > MAX_AGENT_QUESTIONS) return void 0;
|
|
36
|
+
const parsed = [];
|
|
37
|
+
for (const raw of questions) {
|
|
38
|
+
const one = parseAgentQuestion(raw);
|
|
39
|
+
if (!one || parsed.some((question) => question.question === one.question)) return void 0;
|
|
40
|
+
parsed.push(one);
|
|
41
|
+
}
|
|
42
|
+
return parsed;
|
|
43
|
+
};
|
|
44
|
+
var isTypedAnswerQuestion = (question) => question.options.length === 0;
|
|
45
|
+
var typingCanAnswer = (question) => question.multiSelect === false && question.allowOther !== false;
|
|
46
|
+
var optionCountCanBeAnswered = (question, optionCount) => optionCount === 0 ? typingCanAnswer(question) : optionCount >= MIN_AGENT_QUESTION_OPTIONS && optionCount <= MAX_AGENT_QUESTION_OPTIONS;
|
|
47
|
+
var isAgentQuestionSet = (value) => {
|
|
48
|
+
if (!Array.isArray(value) || value.length === 0 || value.length > 4) return false;
|
|
49
|
+
const questions = /* @__PURE__ */ new Set();
|
|
50
|
+
for (const item of value) {
|
|
51
|
+
if (!isRecord(item)) return false;
|
|
52
|
+
const question = item;
|
|
53
|
+
if (typeof question.question !== "string" || question.question.length === 0 || questions.has(question.question) || question.header !== void 0 && typeof question.header !== "string" || typeof question.multiSelect !== "boolean" || question.allowOther !== void 0 && typeof question.allowOther !== "boolean" || !Array.isArray(question.options) || !optionCountCanBeAnswered(question, question.options.length)) return false;
|
|
54
|
+
const labels = /* @__PURE__ */ new Set();
|
|
55
|
+
for (const option of question.options) {
|
|
56
|
+
if (!option || typeof option !== "object" || Array.isArray(option)) return false;
|
|
57
|
+
const record3 = option;
|
|
58
|
+
const label = record3.label;
|
|
59
|
+
if (typeof label !== "string" || label.length === 0 || labels.has(label) || record3.description !== void 0 && typeof record3.description !== "string") return false;
|
|
60
|
+
labels.add(label);
|
|
61
|
+
}
|
|
62
|
+
questions.add(question.question);
|
|
63
|
+
}
|
|
64
|
+
return true;
|
|
65
|
+
};
|
|
66
|
+
var parseAgentQuestionAnswers = (questions, value) => {
|
|
67
|
+
let parsed;
|
|
68
|
+
try {
|
|
69
|
+
parsed = JSON.parse(value);
|
|
70
|
+
} catch {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return null;
|
|
74
|
+
const answers = parsed;
|
|
75
|
+
if (Object.keys(answers).length !== questions.length) return null;
|
|
76
|
+
for (const question of questions) {
|
|
77
|
+
const answer = answers[question.question];
|
|
78
|
+
if (typeof answer !== "string" || answer.trim().length === 0) return null;
|
|
79
|
+
const labels = new Set(question.options.map((option) => option.label));
|
|
80
|
+
if (!question.multiSelect) {
|
|
81
|
+
if (question.allowOther === false && !labels.has(answer)) return null;
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
try {
|
|
85
|
+
const selected = JSON.parse(answer);
|
|
86
|
+
if (!Array.isArray(selected)) {
|
|
87
|
+
if (question.allowOther === false) return null;
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (selected.length === 0 || new Set(selected).size !== selected.length || !selected.every((label) => typeof label === "string" && labels.has(label))) return null;
|
|
91
|
+
} catch {
|
|
92
|
+
if (question.allowOther === false) return null;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return answers;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
// ../contracts/src/codex-question.ts
|
|
99
|
+
var CODEX_QUESTION_TOOL = "request_user_input";
|
|
100
|
+
var CODEX_ASYNC_QUESTION_TOOL = "request_user_input_async";
|
|
101
|
+
var CODEX_QUESTION_TOOLS = [CODEX_QUESTION_TOOL, CODEX_ASYNC_QUESTION_TOOL];
|
|
102
|
+
var CODEX_QUESTION_TOOL_NAMES = new Set(CODEX_QUESTION_TOOLS);
|
|
103
|
+
var isCodexQuestionTool = (toolName) => typeof toolName === "string" && CODEX_QUESTION_TOOL_NAMES.has(toolName);
|
|
104
|
+
var noOptionsWhenAbsent = (options) => options ?? [];
|
|
105
|
+
var optionsNamedByLabel = (options) => Array.isArray(options) ? options.map((label) => ({ label })) : options;
|
|
106
|
+
var offersOnlyItsOptions = (raw, options) => raw.isOther === false && Array.isArray(options) && options.length > 0;
|
|
107
|
+
var codexQuestionFields = (raw, toolName) => {
|
|
108
|
+
if (!isRecord(raw) || raw.isSecret === true) return void 0;
|
|
109
|
+
const options = noOptionsWhenAbsent(raw.options);
|
|
110
|
+
if (toolName === CODEX_ASYNC_QUESTION_TOOL) {
|
|
111
|
+
return { question: raw.title, options: optionsNamedByLabel(options), multiSelect: false };
|
|
112
|
+
}
|
|
113
|
+
return { ...raw, options, multiSelect: raw.multiSelect ?? false, ...offersOnlyItsOptions(raw, options) ? { allowOther: false } : {} };
|
|
114
|
+
};
|
|
115
|
+
var agentQuestionsOf = (questions) => questions.flatMap((question) => agentQuestionFieldsIn(question) ?? []);
|
|
116
|
+
var parseCodexQuestions = (toolName, toolInput) => {
|
|
117
|
+
const raw = Array.isArray(toolInput.questions) ? toolInput.questions : [];
|
|
118
|
+
const questions = raw.map((question) => codexQuestionFields(question, toolName));
|
|
119
|
+
return isAgentQuestionSet(questions) ? agentQuestionsOf(questions) : void 0;
|
|
120
|
+
};
|
|
121
|
+
var CODEX_QUESTION_ANSWERED_IN_PUSHARY = "The user already answered this question in Pushary, so it was not shown again";
|
|
122
|
+
var CODEX_QUESTION_CONTINUE = "Continue with this answer and do not ask it again";
|
|
123
|
+
var quotedAnswerPair = ([question, answer]) => `${JSON.stringify(question)}: ${JSON.stringify(answer)}`;
|
|
124
|
+
var codexQuestionAnswerReason = (answers) => {
|
|
125
|
+
const pairs = Object.entries(answers);
|
|
126
|
+
const answered = pairs.length === 1 ? `Their answer: ${JSON.stringify(pairs[0]?.[1] ?? "")}` : `Their answers: ${pairs.map(quotedAnswerPair).join("; ")}`;
|
|
127
|
+
return `${CODEX_QUESTION_ANSWERED_IN_PUSHARY}. ${answered}. ${CODEX_QUESTION_CONTINUE}`;
|
|
128
|
+
};
|
|
129
|
+
|
|
1
130
|
// ../contracts/src/claude-connector.ts
|
|
2
131
|
var CLAUDE_CONNECTOR_URL = "https://pushary.com/api/mcp/mcp";
|
|
3
132
|
var CLAUDE_CONNECTOR_GUIDE = "https://pushary.com/docs/agents/guides/claude-desktop";
|
|
@@ -310,9 +439,6 @@ var normalizeAgentId = (value, accepted) => {
|
|
|
310
439
|
return accepted.find((candidate) => names.includes(candidate)) ?? null;
|
|
311
440
|
};
|
|
312
441
|
|
|
313
|
-
// ../contracts/src/json-record.ts
|
|
314
|
-
var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
315
|
-
|
|
316
442
|
// ../contracts/src/grok.ts
|
|
317
443
|
var GROK_FIELD_ALIASES = {
|
|
318
444
|
sessionId: "session_id",
|
|
@@ -2884,115 +3010,6 @@ var TIMEOUT_ACTION_THAT_REFUSES = "deny";
|
|
|
2884
3010
|
var timeoutActionWithoutLocalPrompt = ({ mode, timeoutAction }) => mode !== "push_only" && timeoutAction === "approve" ? TIMEOUT_ACTION_THAT_REFUSES : timeoutAction;
|
|
2885
3011
|
var TIMEOUT_ACTIONS = ["approve", "deny", "escalate", "wait"];
|
|
2886
3012
|
var isTimeoutAction = (value) => typeof value === "string" && TIMEOUT_ACTIONS.includes(value);
|
|
2887
|
-
var MAX_AGENT_QUESTIONS = 4;
|
|
2888
|
-
var MIN_AGENT_QUESTION_OPTIONS = 2;
|
|
2889
|
-
var MAX_AGENT_QUESTION_OPTIONS = 4;
|
|
2890
|
-
var AGENT_QUESTION_HEADER_MAX = 40;
|
|
2891
|
-
var AGENT_QUESTION_OPTION_MAX = 100;
|
|
2892
|
-
var AGENT_QUESTION_DESCRIPTION_MAX = 500;
|
|
2893
|
-
var agentQuestionOptionIn = (raw) => {
|
|
2894
|
-
if (!isRecord(raw) || typeof raw.label !== "string" || raw.label.length === 0) return [];
|
|
2895
|
-
return [{
|
|
2896
|
-
label: raw.label,
|
|
2897
|
-
...typeof raw.description === "string" ? { description: raw.description } : {}
|
|
2898
|
-
}];
|
|
2899
|
-
};
|
|
2900
|
-
var agentQuestionFieldsIn = (raw) => {
|
|
2901
|
-
if (!isRecord(raw) || typeof raw.question !== "string") return void 0;
|
|
2902
|
-
return {
|
|
2903
|
-
question: raw.question,
|
|
2904
|
-
...typeof raw.header === "string" ? { header: raw.header } : {},
|
|
2905
|
-
multiSelect: raw.multiSelect === true,
|
|
2906
|
-
...typeof raw.allowOther === "boolean" ? { allowOther: raw.allowOther } : {},
|
|
2907
|
-
options: Array.isArray(raw.options) ? raw.options.flatMap(agentQuestionOptionIn) : []
|
|
2908
|
-
};
|
|
2909
|
-
};
|
|
2910
|
-
var parseAgentQuestion = (raw) => {
|
|
2911
|
-
const question = agentQuestionFieldsIn(raw);
|
|
2912
|
-
return question && question.options.length >= MIN_AGENT_QUESTION_OPTIONS ? question : void 0;
|
|
2913
|
-
};
|
|
2914
|
-
var parseAgentQuestions = (toolInput) => {
|
|
2915
|
-
const questions = toolInput.questions;
|
|
2916
|
-
if (!Array.isArray(questions) || questions.length === 0) return void 0;
|
|
2917
|
-
if (questions.length > MAX_AGENT_QUESTIONS) return void 0;
|
|
2918
|
-
const parsed = [];
|
|
2919
|
-
for (const raw of questions) {
|
|
2920
|
-
const one = parseAgentQuestion(raw);
|
|
2921
|
-
if (!one || parsed.some((question) => question.question === one.question)) return void 0;
|
|
2922
|
-
parsed.push(one);
|
|
2923
|
-
}
|
|
2924
|
-
return parsed;
|
|
2925
|
-
};
|
|
2926
|
-
var isTypedAnswerQuestion = (question) => question.options.length === 0;
|
|
2927
|
-
var typingCanAnswer = (question) => question.multiSelect === false && question.allowOther !== false;
|
|
2928
|
-
var optionCountCanBeAnswered = (question, optionCount) => optionCount === 0 ? typingCanAnswer(question) : optionCount >= MIN_AGENT_QUESTION_OPTIONS && optionCount <= MAX_AGENT_QUESTION_OPTIONS;
|
|
2929
|
-
var isAgentQuestionSet = (value) => {
|
|
2930
|
-
if (!Array.isArray(value) || value.length === 0 || value.length > 4) return false;
|
|
2931
|
-
const questions = /* @__PURE__ */ new Set();
|
|
2932
|
-
for (const item of value) {
|
|
2933
|
-
if (!isRecord(item)) return false;
|
|
2934
|
-
const question = item;
|
|
2935
|
-
if (typeof question.question !== "string" || question.question.length === 0 || questions.has(question.question) || question.header !== void 0 && typeof question.header !== "string" || typeof question.multiSelect !== "boolean" || question.allowOther !== void 0 && typeof question.allowOther !== "boolean" || !Array.isArray(question.options) || !optionCountCanBeAnswered(question, question.options.length)) return false;
|
|
2936
|
-
const labels = /* @__PURE__ */ new Set();
|
|
2937
|
-
for (const option of question.options) {
|
|
2938
|
-
if (!option || typeof option !== "object" || Array.isArray(option)) return false;
|
|
2939
|
-
const record3 = option;
|
|
2940
|
-
const label = record3.label;
|
|
2941
|
-
if (typeof label !== "string" || label.length === 0 || labels.has(label) || record3.description !== void 0 && typeof record3.description !== "string") return false;
|
|
2942
|
-
labels.add(label);
|
|
2943
|
-
}
|
|
2944
|
-
questions.add(question.question);
|
|
2945
|
-
}
|
|
2946
|
-
return true;
|
|
2947
|
-
};
|
|
2948
|
-
var parseAgentQuestionAnswers = (questions, value) => {
|
|
2949
|
-
let parsed;
|
|
2950
|
-
try {
|
|
2951
|
-
parsed = JSON.parse(value);
|
|
2952
|
-
} catch {
|
|
2953
|
-
return null;
|
|
2954
|
-
}
|
|
2955
|
-
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return null;
|
|
2956
|
-
const answers = parsed;
|
|
2957
|
-
if (Object.keys(answers).length !== questions.length) return null;
|
|
2958
|
-
for (const question of questions) {
|
|
2959
|
-
const answer = answers[question.question];
|
|
2960
|
-
if (typeof answer !== "string" || answer.trim().length === 0) return null;
|
|
2961
|
-
const labels = new Set(question.options.map((option) => option.label));
|
|
2962
|
-
if (!question.multiSelect) {
|
|
2963
|
-
if (question.allowOther === false && !labels.has(answer)) return null;
|
|
2964
|
-
continue;
|
|
2965
|
-
}
|
|
2966
|
-
try {
|
|
2967
|
-
const selected = JSON.parse(answer);
|
|
2968
|
-
if (!Array.isArray(selected)) {
|
|
2969
|
-
if (question.allowOther === false) return null;
|
|
2970
|
-
continue;
|
|
2971
|
-
}
|
|
2972
|
-
if (selected.length === 0 || new Set(selected).size !== selected.length || !selected.every((label) => typeof label === "string" && labels.has(label))) return null;
|
|
2973
|
-
} catch {
|
|
2974
|
-
if (question.allowOther === false) return null;
|
|
2975
|
-
}
|
|
2976
|
-
}
|
|
2977
|
-
return answers;
|
|
2978
|
-
};
|
|
2979
|
-
var noOptionsWhenAbsent = (options) => options ?? [];
|
|
2980
|
-
var optionsNamedByLabel = (options) => Array.isArray(options) ? options.map((label) => ({ label })) : options;
|
|
2981
|
-
var offersOnlyItsOptions = (raw, options) => raw.isOther === false && Array.isArray(options) && options.length > 0;
|
|
2982
|
-
var codexQuestionFields = (raw, toolName) => {
|
|
2983
|
-
if (!isRecord(raw) || raw.isSecret === true) return void 0;
|
|
2984
|
-
const options = noOptionsWhenAbsent(raw.options);
|
|
2985
|
-
if (toolName === CODEX_ASYNC_QUESTION_TOOL) {
|
|
2986
|
-
return { question: raw.title, options: optionsNamedByLabel(options), multiSelect: false };
|
|
2987
|
-
}
|
|
2988
|
-
return { ...raw, options, multiSelect: raw.multiSelect ?? false, ...offersOnlyItsOptions(raw, options) ? { allowOther: false } : {} };
|
|
2989
|
-
};
|
|
2990
|
-
var agentQuestionsOf = (questions) => questions.flatMap((question) => agentQuestionFieldsIn(question) ?? []);
|
|
2991
|
-
var parseCodexQuestions = (toolName, toolInput) => {
|
|
2992
|
-
const raw = Array.isArray(toolInput.questions) ? toolInput.questions : [];
|
|
2993
|
-
const questions = raw.map((question) => codexQuestionFields(question, toolName));
|
|
2994
|
-
return isAgentQuestionSet(questions) ? agentQuestionsOf(questions) : void 0;
|
|
2995
|
-
};
|
|
2996
3013
|
var typedTextAsAnswers = (questions, text2) => {
|
|
2997
3014
|
const [only, ...others] = questions;
|
|
2998
3015
|
if (!only || others.length > 0 || !isTypedAnswerQuestion(only)) return null;
|
|
@@ -3004,14 +3021,6 @@ var isLoneTypedAnswerQuestion = (questions) => questions.length === 1 && questio
|
|
|
3004
3021
|
var questionsShownAsASet = (questions) => isLoneTypedAnswerQuestion(questions) ? void 0 : questions;
|
|
3005
3022
|
var agentQuestionContext = (header, project) => header ? `${header}: your agent is asking in ${project}` : `Your agent is asking in ${project}`;
|
|
3006
3023
|
var answersToQuestionsAsAsked = (questions, answer) => questionsShownAsASet(questions) ? parseAgentQuestionAnswers(questions, answer) : typedTextAsAnswers(questions, answer);
|
|
3007
|
-
var CODEX_QUESTION_ANSWERED_IN_PUSHARY = "The user already answered this question in Pushary, so it was not shown again";
|
|
3008
|
-
var CODEX_QUESTION_CONTINUE = "Continue with this answer and do not ask it again";
|
|
3009
|
-
var quotedAnswerPair = ([question, answer]) => `${JSON.stringify(question)}: ${JSON.stringify(answer)}`;
|
|
3010
|
-
var codexQuestionAnswerReason = (answers) => {
|
|
3011
|
-
const pairs = Object.entries(answers);
|
|
3012
|
-
const answered = pairs.length === 1 ? `Their answer: ${JSON.stringify(pairs[0]?.[1] ?? "")}` : `Their answers: ${pairs.map(quotedAnswerPair).join("; ")}`;
|
|
3013
|
-
return `${CODEX_QUESTION_ANSWERED_IN_PUSHARY}. ${answered}. ${CODEX_QUESTION_CONTINUE}`;
|
|
3014
|
-
};
|
|
3015
3024
|
var INSTALL_SOURCES = [
|
|
3016
3025
|
/** `npx pushary@latest ...`, the documented one-liner. */
|
|
3017
3026
|
"npx",
|
|
@@ -5644,11 +5653,6 @@ var AGENT_QUESTION_STRATEGY = {
|
|
|
5644
5653
|
};
|
|
5645
5654
|
var UPDATED_INPUT_QUESTION_SOURCES = /* @__PURE__ */ new Set(["claude", "qoder", "codebuddy", "droid"]);
|
|
5646
5655
|
var GROK_NATIVE_DIALOG_TOOLS = /* @__PURE__ */ new Set(["ask_user_question", "exit_plan_mode"]);
|
|
5647
|
-
var CODEX_QUESTION_TOOL = "request_user_input";
|
|
5648
|
-
var CODEX_ASYNC_QUESTION_TOOL = "request_user_input_async";
|
|
5649
|
-
var CODEX_QUESTION_TOOLS = [CODEX_QUESTION_TOOL, CODEX_ASYNC_QUESTION_TOOL];
|
|
5650
|
-
var CODEX_QUESTION_TOOL_NAMES = new Set(CODEX_QUESTION_TOOLS);
|
|
5651
|
-
var isCodexQuestionTool = (toolName) => typeof toolName === "string" && CODEX_QUESTION_TOOL_NAMES.has(toolName);
|
|
5652
5656
|
var isCodexQuestionCall = (source, event, toolName) => source === "codex" && event === "PreToolUse" && isCodexQuestionTool(toolName);
|
|
5653
5657
|
var codexQuestionGoesToPushary = (verdict) => verdict.kind === "gate" && !approvalWaitsAtTheAgentsPrompt(verdict.policy.mode);
|
|
5654
5658
|
function agentQuestionStrategy(source, event, toolName) {
|
|
@@ -6179,6 +6183,17 @@ var hookActivationResult = (report) => {
|
|
|
6179
6183
|
};
|
|
6180
6184
|
|
|
6181
6185
|
export {
|
|
6186
|
+
isRecord,
|
|
6187
|
+
AGENT_QUESTION_HEADER_MAX,
|
|
6188
|
+
AGENT_QUESTION_OPTION_MAX,
|
|
6189
|
+
AGENT_QUESTION_DESCRIPTION_MAX,
|
|
6190
|
+
parseAgentQuestions,
|
|
6191
|
+
isTypedAnswerQuestion,
|
|
6192
|
+
parseAgentQuestionAnswers,
|
|
6193
|
+
CODEX_QUESTION_TOOLS,
|
|
6194
|
+
isCodexQuestionTool,
|
|
6195
|
+
parseCodexQuestions,
|
|
6196
|
+
codexQuestionAnswerReason,
|
|
6182
6197
|
CLAUDE_CONNECTOR_URL,
|
|
6183
6198
|
CLAUDE_CONNECTOR_GUIDE,
|
|
6184
6199
|
COWORK_CONNECTOR_LIMIT,
|
|
@@ -6193,7 +6208,6 @@ export {
|
|
|
6193
6208
|
MANAGED_PROVIDERS,
|
|
6194
6209
|
DISCONNECT_AGENT_IDS,
|
|
6195
6210
|
normalizeAgentId,
|
|
6196
|
-
isRecord,
|
|
6197
6211
|
GROK_UNREADABLE_CALL,
|
|
6198
6212
|
isGrokHookPayload,
|
|
6199
6213
|
isGrokSessionEndStop,
|
|
@@ -6254,18 +6268,10 @@ export {
|
|
|
6254
6268
|
approvalModeWithoutLocalPrompt,
|
|
6255
6269
|
timeoutActionWithoutLocalPrompt,
|
|
6256
6270
|
isTimeoutAction,
|
|
6257
|
-
AGENT_QUESTION_HEADER_MAX,
|
|
6258
|
-
AGENT_QUESTION_OPTION_MAX,
|
|
6259
|
-
AGENT_QUESTION_DESCRIPTION_MAX,
|
|
6260
|
-
parseAgentQuestions,
|
|
6261
|
-
isTypedAnswerQuestion,
|
|
6262
|
-
parseAgentQuestionAnswers,
|
|
6263
|
-
parseCodexQuestions,
|
|
6264
6271
|
plainAskOf,
|
|
6265
6272
|
questionsShownAsASet,
|
|
6266
6273
|
agentQuestionContext,
|
|
6267
6274
|
answersToQuestionsAsAsked,
|
|
6268
|
-
codexQuestionAnswerReason,
|
|
6269
6275
|
normalizeInstallSource,
|
|
6270
6276
|
HOOK_BUDGETS,
|
|
6271
6277
|
HOOK_HOLD_BUDGET_ENV,
|
|
@@ -6309,8 +6315,6 @@ export {
|
|
|
6309
6315
|
shouldDeferToNativeMode,
|
|
6310
6316
|
AGENT_QUESTION_TOOL,
|
|
6311
6317
|
AGENT_QUESTION_STRATEGY,
|
|
6312
|
-
CODEX_QUESTION_TOOLS,
|
|
6313
|
-
isCodexQuestionTool,
|
|
6314
6318
|
codexQuestionGoesToPushary,
|
|
6315
6319
|
agentQuestionStrategy,
|
|
6316
6320
|
questionHandedToTheTerminal,
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
keyPrefix,
|
|
5
5
|
readConfigFileKey,
|
|
6
6
|
readMacAppKeyPrefix
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-KAJDKYUM.js";
|
|
8
8
|
import {
|
|
9
9
|
NPX_LATEST_COMMAND
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-BMPZ5HVJ.js";
|
|
11
11
|
|
|
12
12
|
// src/key-signed-out.ts
|
|
13
13
|
var VERDICT_BY_CHECK = {
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
DISCONNECT_AGENT_IDS,
|
|
3
3
|
SETUP_AGENT_CHOICES,
|
|
4
4
|
isApprovalMode
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-762CDAJJ.js";
|
|
6
6
|
|
|
7
7
|
// src/cli/mode-request.ts
|
|
8
8
|
var parseDuration = (value) => {
|
|
@@ -41,7 +41,7 @@ var COMMAND_LIST = [
|
|
|
41
41
|
module: "pushary-codex-session",
|
|
42
42
|
summary: "Experimental Codex extras that ordinary setup does not turn on",
|
|
43
43
|
detail: [
|
|
44
|
-
"Use --app-cards on|off|status so the Codex app also asks Pushary before it uses an app on this Mac.",
|
|
44
|
+
"Use --app-cards on|off|status so the Codex app also asks Pushary before it uses an app on this Mac, or before its browser opens a site, downloads or uploads.",
|
|
45
45
|
"Use --desktop [app path] to do the same for one launch. Quit Codex first; a running app is not attached.",
|
|
46
46
|
"Use --cwd <directory> to start a managed Codex terminal session in a project."
|
|
47
47
|
],
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
autoUpdateLock
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KZCYHWDF.js";
|
|
4
4
|
import {
|
|
5
5
|
installPackageGlobally,
|
|
6
6
|
npmErrorMessage
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-US3IT6ZC.js";
|
|
8
8
|
import {
|
|
9
9
|
writeJsonAtomic
|
|
10
10
|
} from "./chunk-QENTGE75.js";
|