@pushary/agent-hooks 1.9.34 → 1.9.36
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 +11 -0
- package/README.md +1 -1
- package/dist/bin/pushary-bell-hook.js +25 -25
- package/dist/bin/pushary-bell.js +9 -9
- package/dist/bin/pushary-claude.js +24 -24
- package/dist/bin/pushary-clean.js +52 -45
- package/dist/bin/pushary-codex-bridge.js +17 -17
- package/dist/bin/pushary-codex-hook.js +30 -30
- package/dist/bin/pushary-codex.js +12 -12
- package/dist/bin/pushary-connect.js +24 -24
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +32 -32
- package/dist/bin/pushary-disconnect.js +31 -28
- package/dist/bin/pushary-doctor.js +35 -34
- package/dist/bin/pushary-elicitation-hook.js +25 -25
- package/dist/bin/pushary-gemini-bridge.js +13 -13
- package/dist/bin/pushary-gemini-hook.js +27 -27
- package/dist/bin/pushary-hook.js +34 -30
- package/dist/bin/pushary-login.js +12 -12
- package/dist/bin/pushary-logout.js +24 -24
- package/dist/bin/pushary-mcp.js +9 -9
- package/dist/bin/pushary-mode.js +12 -12
- package/dist/bin/pushary-notification-hook.js +24 -24
- package/dist/bin/pushary-opencode-hook.js +26 -26
- package/dist/bin/pushary-permission-denied-hook.js +29 -29
- package/dist/bin/pushary-permission-hook.js +28 -28
- package/dist/bin/pushary-post-hook.js +24 -24
- package/dist/bin/pushary-prompt-hook.js +24 -24
- package/dist/bin/pushary-session-end-hook.js +24 -24
- package/dist/bin/pushary-session-start-hook.js +28 -28
- package/dist/bin/pushary-setup.js +90 -59
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +26 -26
- package/dist/bin/pushary-stop-hook.js +24 -24
- package/dist/bin/pushary-stopfailure-hook.js +24 -24
- package/dist/bin/pushary-suggestions.js +12 -12
- package/dist/bin/pushary-transcript-register.js +17 -17
- package/dist/bin/pushary-transcripts.js +7 -7
- package/dist/bin/pushary-upgrade.js +30 -30
- package/dist/bin/pushary-wait.js +12 -12
- package/dist/bin/pushary.js +6 -6
- package/dist/{chunk-4TFD3WAA.js → chunk-26AEFJSK.js} +2 -2
- package/dist/{chunk-7FQL5NWJ.js → chunk-2DZBIELP.js} +135 -23
- package/dist/{chunk-DCBSD22V.js → chunk-42FTY5II.js} +3 -3
- package/dist/{chunk-PEEJP4HN.js → chunk-4E4PZQFE.js} +4 -4
- package/dist/{chunk-6OGDGQTT.js → chunk-4NMDFPK7.js} +5 -5
- package/dist/{chunk-3FOPVVNO.js → chunk-556JCOMK.js} +80 -5
- package/dist/{chunk-FQQSW7MD.js → chunk-55XIK7YS.js} +1 -1
- package/dist/{chunk-36ZCFJUI.js → chunk-5ML6E3L7.js} +1 -1
- package/dist/{chunk-NMQLY4PE.js → chunk-5S2P2CK6.js} +2 -2
- package/dist/{chunk-SMRMWDFE.js → chunk-6LKIK7V2.js} +43 -17
- package/dist/{chunk-U7CN5HG2.js → chunk-7GQILLZD.js} +5 -5
- package/dist/{chunk-B5RLJ6QD.js → chunk-7MOFAAZ3.js} +9 -5
- package/dist/{chunk-H52HBSOD.js → chunk-BS64ZHTB.js} +3 -3
- package/dist/{chunk-A455TSHF.js → chunk-CHNSFTD5.js} +2 -2
- package/dist/{chunk-WFPXKCN4.js → chunk-CHWJ7ZXI.js} +5 -5
- package/dist/{chunk-22YSHBTI.js → chunk-CRZ4CP7C.js} +3 -3
- package/dist/{chunk-WMB3OCI4.js → chunk-CRZKFEEO.js} +2 -2
- package/dist/{chunk-NKAMF2YJ.js → chunk-DC6KHRVH.js} +1 -1
- package/dist/{chunk-ULJFIF5N.js → chunk-EGTVN6YV.js} +1 -1
- package/dist/{chunk-A5FFSXZE.js → chunk-EH635XAR.js} +2 -2
- package/dist/{chunk-57FFQR46.js → chunk-EQXMVKKD.js} +1 -1
- package/dist/{chunk-EJWSE7S7.js → chunk-ETGGQWBR.js} +4 -4
- package/dist/{chunk-WPSI4246.js → chunk-F5W7B7YT.js} +1 -1
- package/dist/{chunk-OZMGO4WF.js → chunk-FBKGGIFB.js} +5 -5
- package/dist/{chunk-7IVV4LLF.js → chunk-GNESC5EF.js} +3 -3
- package/dist/{chunk-YABMIGR3.js → chunk-GTEF64CJ.js} +1 -1
- package/dist/{chunk-CK3W7Q5S.js → chunk-H3MOTS2C.js} +1 -1
- package/dist/{chunk-7UGGCTTW.js → chunk-HCKBZYBW.js} +2 -2
- package/dist/{chunk-HJNCVY5F.js → chunk-IPYCRJGM.js} +7 -7
- package/dist/{chunk-VTAC5FBZ.js → chunk-J36W6ARB.js} +1 -1
- package/dist/{chunk-GC3SUMYD.js → chunk-JAA7YJJZ.js} +4 -4
- package/dist/{chunk-FDNMQEU6.js → chunk-JWURAYXK.js} +2 -2
- package/dist/{chunk-UPRNSD2T.js → chunk-K5X25GUV.js} +4 -4
- package/dist/{chunk-UDECNZYI.js → chunk-KCUTE3EB.js} +2 -2
- package/dist/{chunk-CPYOJRDN.js → chunk-L25KSDIB.js} +8 -8
- package/dist/{chunk-45OXG3VR.js → chunk-LL256PHP.js} +1 -1
- package/dist/{chunk-Z6HDYK2A.js → chunk-MBBPLF5T.js} +2 -2
- package/dist/{chunk-XLXG6MA5.js → chunk-ML42WKI7.js} +3 -3
- package/dist/{chunk-FYQG2UTK.js → chunk-MNXHKEXB.js} +2 -2
- package/dist/{chunk-IRU7DKJW.js → chunk-NE5OPCD5.js} +7 -3
- package/dist/{chunk-3LS3GFJW.js → chunk-PRKH662J.js} +1 -1
- package/dist/{chunk-E2OZZZKP.js → chunk-QHL3Y6D2.js} +2 -2
- package/dist/{chunk-SMSX4TCC.js → chunk-QPUTCMAK.js} +1 -1
- package/dist/{chunk-HVUBWLER.js → chunk-RNRCOOQZ.js} +11 -11
- package/dist/{chunk-LOYSI2CZ.js → chunk-RYXSY3RH.js} +5 -5
- package/dist/{chunk-7S7H7V5V.js → chunk-SHLLDMPM.js} +97 -40
- package/dist/{chunk-V4ZIG66K.js → chunk-TRNSODJ6.js} +1 -1
- package/dist/{chunk-DQKEGNTI.js → chunk-U2PUHT4W.js} +1 -1
- package/dist/{chunk-HQKYWUBF.js → chunk-UDHT3W7I.js} +2 -2
- package/dist/{chunk-QJ3ENGBT.js → chunk-ULDOQF4Q.js} +3 -3
- package/dist/{chunk-EGTRIM74.js → chunk-VRALPR4B.js} +4 -4
- package/dist/{chunk-4PIAOJAW.js → chunk-X4BPD5RD.js} +1 -1
- package/dist/{chunk-FPYBX36E.js → chunk-Y5FCB66K.js} +5 -5
- package/dist/{chunk-YRDNKY77.js → chunk-YRAPCLOB.js} +6 -6
- package/dist/{global-upgrade-IZCB4WIE.js → global-upgrade-EF6RZBPU.js} +6 -6
- package/dist/{paths-4WAA57P5.js → paths-F645XTFZ.js} +2 -2
- package/dist/{reapply-GJ73ZHDD.js → reapply-HJOTWJAN.js} +20 -20
- package/dist/src/index.js +19 -19
- package/dist/{upgrade-lock-J5PIKSYV.js → upgrade-lock-APUN7YKQ.js} +3 -3
- package/package.json +1 -1
|
@@ -241,6 +241,20 @@ var AGENTS = {
|
|
|
241
241
|
enforcementDetail: "Shell commands, file writes, edits and MCP calls through native PreToolUse hooks in ~/.gemini/config/hooks.json, answered allow or deny.",
|
|
242
242
|
capabilityNote: 'Antigravity CLI ignores a hook\'s allow unless it runs in always-proceed mode, so connecting it sets `toolPermission: "always-proceed"` when you never chose a mode, and disconnecting puts it back. Pushary is then the only gate: it answers allow or deny and never ask, and a call it cannot decide, one nobody answers, or one made after Pushary was removed is blocked with a reason.'
|
|
243
243
|
},
|
|
244
|
+
grok: {
|
|
245
|
+
...defaults,
|
|
246
|
+
label: "Grok Build",
|
|
247
|
+
hookSource: "grok",
|
|
248
|
+
bridged: true,
|
|
249
|
+
policyAgent: "grok",
|
|
250
|
+
repoAware: true,
|
|
251
|
+
disconnectable: true,
|
|
252
|
+
enforcement: "enforced",
|
|
253
|
+
connectVia: "Native hooks + MCP",
|
|
254
|
+
setupCommand: PUSHARY_SETUP_COMMAND,
|
|
255
|
+
enforcementDetail: "Shell, edits and MCP calls through native PreToolUse hooks. Grok's own permission checks still apply after a phone approval.",
|
|
256
|
+
capabilityNote: "Grok fails open if it kills a hook or cannot run it. Setup leaves Grok's permission mode unchanged. Native question and plan dialogs stay in Grok; proactive phone questions use Pushary MCP."
|
|
257
|
+
},
|
|
244
258
|
windsurf: {
|
|
245
259
|
...defaults,
|
|
246
260
|
label: "Windsurf",
|
|
@@ -296,6 +310,59 @@ var normalizeAgentId = (value, accepted) => {
|
|
|
296
310
|
return accepted.find((candidate) => names.includes(candidate)) ?? null;
|
|
297
311
|
};
|
|
298
312
|
|
|
313
|
+
// ../contracts/src/json-record.ts
|
|
314
|
+
var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
315
|
+
|
|
316
|
+
// ../contracts/src/grok.ts
|
|
317
|
+
var GROK_FIELD_ALIASES = {
|
|
318
|
+
sessionId: "session_id",
|
|
319
|
+
transcriptPath: "transcript_path",
|
|
320
|
+
permissionMode: "permission_mode",
|
|
321
|
+
toolName: "tool_name",
|
|
322
|
+
toolInput: "tool_input",
|
|
323
|
+
toolUseId: "tool_use_id",
|
|
324
|
+
toolResult: "tool_response",
|
|
325
|
+
notificationType: "notification_type",
|
|
326
|
+
lastAssistantMessage: "last_assistant_message",
|
|
327
|
+
stopHookActive: "stop_hook_active",
|
|
328
|
+
subagentId: "agent_id",
|
|
329
|
+
subagentType: "agent_type",
|
|
330
|
+
modelId: "model",
|
|
331
|
+
errorDetails: "error_details",
|
|
332
|
+
durationMs: "duration_ms"
|
|
333
|
+
};
|
|
334
|
+
var grokToolResult = (value) => {
|
|
335
|
+
if (!isRecord(value)) return value;
|
|
336
|
+
const { is_error, ...result } = value;
|
|
337
|
+
if (is_error === true) return { ...result, error: "Grok reported an MCP tool error." };
|
|
338
|
+
if (value.type === "Bash" && typeof value.exit_code === "number" && value.exit_code !== 0) {
|
|
339
|
+
return { ...result, error: `Command exited with code ${value.exit_code}.` };
|
|
340
|
+
}
|
|
341
|
+
if (value.type === "SearchReplace" && value.EditsApplied === void 0) return { ...result, error: "Grok could not apply the edit." };
|
|
342
|
+
if (value.type === "ApplyPatch" && value.Success === void 0) return { ...result, error: "Grok could not apply the patch." };
|
|
343
|
+
return is_error === false ? result : value;
|
|
344
|
+
};
|
|
345
|
+
var GROK_UNREADABLE_CALL = "Pushary could not read the complete Grok tool call. Nothing was approved; retry the call.";
|
|
346
|
+
var isGrokHookPayload = (value) => isRecord(value) && typeof value.hookEventName === "string" && typeof value.sessionId === "string";
|
|
347
|
+
var isGrokSessionEndStop = (event, reason) => event === "Stop" && (reason === "channel_closed" || reason === "shutdown");
|
|
348
|
+
var grokHookInput = (event, payload) => {
|
|
349
|
+
const shaped = { ...payload };
|
|
350
|
+
for (const [native, canonical] of Object.entries(GROK_FIELD_ALIASES)) {
|
|
351
|
+
if (payload[native] !== void 0) shaped[canonical] = payload[native];
|
|
352
|
+
}
|
|
353
|
+
const name = typeof payload.hook_event_name === "string" && payload.hook_event_name.length > 0 ? payload.hook_event_name : event;
|
|
354
|
+
if (name) shaped.hook_event_name = name;
|
|
355
|
+
const tool = shaped.tool_name;
|
|
356
|
+
if (typeof tool === "string" && !tool.startsWith("mcp__") && /^[^_].*__.+$/.test(tool)) {
|
|
357
|
+
shaped.tool_name = `mcp__${tool}`;
|
|
358
|
+
}
|
|
359
|
+
if (shaped.tool_response !== void 0) shaped.tool_response = grokToolResult(shaped.tool_response);
|
|
360
|
+
if (payload.toolInputTruncated === true || name === "PreToolUse" && shaped.tool_input === void 0) shaped.tool_input = null;
|
|
361
|
+
if (name === "PostToolUseFailure") shaped.tool_response = { error: payload.error };
|
|
362
|
+
if (name === "StopCancelled") shaped.error = payload.reason ?? "cancelled";
|
|
363
|
+
return shaped;
|
|
364
|
+
};
|
|
365
|
+
|
|
299
366
|
// ../contracts/src/shell-tools.ts
|
|
300
367
|
var SHELL_TOOL = "Bash";
|
|
301
368
|
var POWERSHELL_TOOL = "PowerShell";
|
|
@@ -312,8 +379,10 @@ var POSIX_SHELL_TOOLS = new Set(
|
|
|
312
379
|
var toolNameForAPosixReading = (toolName) => shellDialectOf(toolName) === "posix" ? SHELL_TOOL : toolName;
|
|
313
380
|
|
|
314
381
|
// ../contracts/src/agent-wiring.ts
|
|
315
|
-
var COMPATIBLE_AGENT_TYPES = ["qwen_code", "codebuddy", "qoder", "droid", "devin", "antigravity_cli"];
|
|
382
|
+
var COMPATIBLE_AGENT_TYPES = ["qwen_code", "codebuddy", "qoder", "droid", "devin", "antigravity_cli", "grok"];
|
|
316
383
|
var isCompatibleAgentType = (value) => typeof value === "string" && COMPATIBLE_AGENT_TYPES.includes(value);
|
|
384
|
+
var homeJson = (...path) => ({ root: "home", path, format: "json" });
|
|
385
|
+
var homeFile = (...path) => ({ root: "home", path });
|
|
317
386
|
var CANONICAL_PATH_KEYS = ["file_path", "path", "notebook_path"];
|
|
318
387
|
var CANONICAL_COMMAND_KEYS = ["command"];
|
|
319
388
|
var SHELL_TOOLS = /* @__PURE__ */ new Set([SHELL_TOOL, POWERSHELL_TOOL]);
|
|
@@ -406,7 +475,7 @@ var renderPreToolUseVerdict = (profile, verdict) => {
|
|
|
406
475
|
var homePath = (segments) => `~/${segments.join("/")}`;
|
|
407
476
|
var pusharyMissingReason = (profile) => {
|
|
408
477
|
const settingBack = profile.soleGate ? ` and remove ${profile.soleGate.key} from ${homePath(profile.soleGate.file)}` : "";
|
|
409
|
-
return `Pushary is not installed on this computer any more, so nothing can approve this call and it did not run. Reinstall Pushary, or remove the pushary hook from ${homePath(profile.configFile)}${settingBack}.`;
|
|
478
|
+
return `Pushary is not installed on this computer any more, so nothing can approve this call and it did not run. Reinstall Pushary, or remove the pushary hook from ${homePath(defaultHomeSegments(profile.configFile))}${settingBack}.`;
|
|
410
479
|
};
|
|
411
480
|
var refusalOutput = (profile, reason) => JSON.stringify(renderPreToolUseVerdict(profile, {
|
|
412
481
|
hookSpecificOutput: { permissionDecision: "deny", permissionDecisionReason: reason }
|
|
@@ -445,7 +514,10 @@ var fromAntigravity = (event, payload) => {
|
|
|
445
514
|
...error ? { tool_response: { error } } : {}
|
|
446
515
|
};
|
|
447
516
|
};
|
|
448
|
-
var claudeShapedHookInput = (dialect, event, payload) =>
|
|
517
|
+
var claudeShapedHookInput = (dialect, event, payload) => {
|
|
518
|
+
if (dialect === "grok") return grokHookInput(event, payload);
|
|
519
|
+
return dialect === "antigravity" ? fromAntigravity(event, payload) : payload;
|
|
520
|
+
};
|
|
449
521
|
var CLAUDE_SHAPED_EVENTS = [
|
|
450
522
|
"PreToolUse",
|
|
451
523
|
"PostToolUse",
|
|
@@ -470,7 +542,7 @@ var QWEN_CODE = {
|
|
|
470
542
|
source: "qwen",
|
|
471
543
|
label: "Qwen Code",
|
|
472
544
|
binary: "qwen",
|
|
473
|
-
configFile:
|
|
545
|
+
configFile: homeJson(".qwen", "settings.json"),
|
|
474
546
|
hooksKeyPath: ["hooks"],
|
|
475
547
|
toolAliases: {
|
|
476
548
|
run_shell_command: "Bash",
|
|
@@ -492,8 +564,8 @@ var QWEN_CODE = {
|
|
|
492
564
|
wire: "permission_decision",
|
|
493
565
|
payload: "claude",
|
|
494
566
|
nonToolEntries: "nested",
|
|
495
|
-
mcp: { shape: "gemini_http", file:
|
|
496
|
-
instructions: { file:
|
|
567
|
+
mcp: { shape: "gemini_http", file: homeJson(".qwen", "settings.json"), container: "mcpServers", trusted: true },
|
|
568
|
+
instructions: { file: homeFile(".qwen", "QWEN.md"), label: "Qwen Code" },
|
|
497
569
|
permissionRuleFile: null,
|
|
498
570
|
configDirIsShared: false,
|
|
499
571
|
soleGate: null,
|
|
@@ -504,7 +576,7 @@ var CODEBUDDY = {
|
|
|
504
576
|
source: "codebuddy",
|
|
505
577
|
label: "CodeBuddy",
|
|
506
578
|
binary: "codebuddy",
|
|
507
|
-
configFile:
|
|
579
|
+
configFile: homeJson(".codebuddy", "settings.json"),
|
|
508
580
|
hooksKeyPath: ["hooks"],
|
|
509
581
|
toolAliases: {},
|
|
510
582
|
inputKeyAliases: {},
|
|
@@ -516,9 +588,9 @@ var CODEBUDDY = {
|
|
|
516
588
|
wire: "permission_decision",
|
|
517
589
|
payload: "claude",
|
|
518
590
|
nonToolEntries: "nested",
|
|
519
|
-
mcp: { shape: "claude_http", file:
|
|
520
|
-
instructions: { file:
|
|
521
|
-
permissionRuleFile:
|
|
591
|
+
mcp: { shape: "claude_http", file: homeJson(".codebuddy", ".mcp.json"), container: "mcpServers", trusted: false },
|
|
592
|
+
instructions: { file: homeFile(".codebuddy", "CODEBUDDY.md"), label: "CodeBuddy" },
|
|
593
|
+
permissionRuleFile: homeJson(".codebuddy", "settings.json"),
|
|
522
594
|
configDirIsShared: false,
|
|
523
595
|
soleGate: null,
|
|
524
596
|
taskControl: null
|
|
@@ -528,7 +600,7 @@ var QODER = {
|
|
|
528
600
|
source: "qoder",
|
|
529
601
|
label: "Qoder",
|
|
530
602
|
binary: "qoder",
|
|
531
|
-
configFile:
|
|
603
|
+
configFile: homeJson(".qoder", "settings.json"),
|
|
532
604
|
hooksKeyPath: ["hooks"],
|
|
533
605
|
toolAliases: {},
|
|
534
606
|
inputKeyAliases: {},
|
|
@@ -540,7 +612,7 @@ var QODER = {
|
|
|
540
612
|
wire: "permission_decision",
|
|
541
613
|
payload: "claude",
|
|
542
614
|
nonToolEntries: "nested",
|
|
543
|
-
mcp: { shape: "claude_http", file:
|
|
615
|
+
mcp: { shape: "claude_http", file: homeJson(".qoder", "settings.json"), container: "mcpServers", trusted: true },
|
|
544
616
|
instructions: null,
|
|
545
617
|
permissionRuleFile: null,
|
|
546
618
|
configDirIsShared: false,
|
|
@@ -552,7 +624,7 @@ var DROID = {
|
|
|
552
624
|
source: "droid",
|
|
553
625
|
label: "Droid",
|
|
554
626
|
binary: "droid",
|
|
555
|
-
configFile:
|
|
627
|
+
configFile: homeJson(".factory", "hooks.json"),
|
|
556
628
|
hooksKeyPath: [],
|
|
557
629
|
toolAliases: {
|
|
558
630
|
Execute: "Bash",
|
|
@@ -581,7 +653,7 @@ var DEVIN = {
|
|
|
581
653
|
source: "devin",
|
|
582
654
|
label: "Devin CLI",
|
|
583
655
|
binary: "devin",
|
|
584
|
-
configFile:
|
|
656
|
+
configFile: homeJson(".config", "devin", "config.json"),
|
|
585
657
|
hooksKeyPath: ["hooks"],
|
|
586
658
|
toolAliases: {
|
|
587
659
|
exec: "Bash",
|
|
@@ -624,7 +696,7 @@ var ANTIGRAVITY_CLI = {
|
|
|
624
696
|
source: "antigravity",
|
|
625
697
|
label: "Antigravity CLI",
|
|
626
698
|
binary: "agy",
|
|
627
|
-
configFile:
|
|
699
|
+
configFile: homeJson(".gemini", "config", "hooks.json"),
|
|
628
700
|
hooksKeyPath: ["pushary"],
|
|
629
701
|
toolAliases: {
|
|
630
702
|
run_command: "Bash",
|
|
@@ -648,7 +720,7 @@ var ANTIGRAVITY_CLI = {
|
|
|
648
720
|
wire: "allow_deny_decision",
|
|
649
721
|
payload: "antigravity",
|
|
650
722
|
nonToolEntries: "handler",
|
|
651
|
-
mcp: { shape: "antigravity_http", file:
|
|
723
|
+
mcp: { shape: "antigravity_http", file: homeJson(".gemini", "config", "mcp_config.json"), container: "mcpServers", trusted: false },
|
|
652
724
|
instructions: null,
|
|
653
725
|
permissionRuleFile: null,
|
|
654
726
|
configDirIsShared: true,
|
|
@@ -661,13 +733,48 @@ var ANTIGRAVITY_CLI = {
|
|
|
661
733
|
},
|
|
662
734
|
taskControl: ANTIGRAVITY_TASK_CONTROL
|
|
663
735
|
};
|
|
664
|
-
var
|
|
736
|
+
var GROK = {
|
|
737
|
+
agentType: "grok",
|
|
738
|
+
source: "grok",
|
|
739
|
+
label: "Grok Build",
|
|
740
|
+
binary: "grok",
|
|
741
|
+
configFile: { root: "grok_home", path: ["hooks", "pushary.json"], format: "json" },
|
|
742
|
+
hooksKeyPath: ["hooks"],
|
|
743
|
+
toolAliases: {
|
|
744
|
+
run_terminal_command: "Bash",
|
|
745
|
+
search_replace: "Edit",
|
|
746
|
+
apply_patch: "Edit",
|
|
747
|
+
read_file: "Read",
|
|
748
|
+
web_search: "WebSearch",
|
|
749
|
+
web_fetch: "WebFetch",
|
|
750
|
+
spawn_subagent: "Task",
|
|
751
|
+
task_output: "BashOutput",
|
|
752
|
+
kill_task: "KillShell"
|
|
753
|
+
},
|
|
754
|
+
inputKeyAliases: {},
|
|
755
|
+
extraMatchers: [".*"],
|
|
756
|
+
pathInputKeys: [],
|
|
757
|
+
shellCommandKeys: [],
|
|
758
|
+
shellContextKeys: ["cwd"],
|
|
759
|
+
events: ["PreToolUse", "PostToolUse", "PostToolUseFailure", "Stop", "StopCancelled", "StopFailure", "UserPromptSubmit", "Notification", "SessionStart", "SessionEnd", "SubagentStart", "SubagentStop", "PreCompact", "PostCompact"],
|
|
760
|
+
wire: "permission_decision",
|
|
761
|
+
payload: "grok",
|
|
762
|
+
nonToolEntries: "nested",
|
|
763
|
+
mcp: { shape: "grok_http", file: { root: "grok_home", path: ["config.toml"], format: "toml" }, container: "mcp_servers", trusted: false },
|
|
764
|
+
instructions: { file: { root: "grok_home", path: ["rules", "pushary.md"] }, label: "Grok Build" },
|
|
765
|
+
permissionRuleFile: null,
|
|
766
|
+
configDirIsShared: false,
|
|
767
|
+
soleGate: null,
|
|
768
|
+
taskControl: null
|
|
769
|
+
};
|
|
770
|
+
var HOOK_COMPATIBLE_PROFILES = Object.freeze([QWEN_CODE, CODEBUDDY, QODER, DROID, DEVIN, ANTIGRAVITY_CLI, GROK]);
|
|
665
771
|
var hookCompatibleProfile = (agentType) => HOOK_COMPATIBLE_PROFILES.find((profile) => profile.agentType === agentType);
|
|
666
772
|
var hookCompatibleProfileBySource = (source) => HOOK_COMPATIBLE_PROFILES.find((profile) => profile.source === source);
|
|
773
|
+
var defaultHomeSegments = (file) => file.root === "home" ? file.path : [".grok", ...file.path];
|
|
667
774
|
var compatibleTargetFiles = (profile) => {
|
|
668
775
|
const seen = /* @__PURE__ */ new Map();
|
|
669
776
|
for (const file of [profile.configFile, profile.mcp?.file, profile.permissionRuleFile, profile.instructions?.file]) {
|
|
670
|
-
if (file) seen.set(file.join("/")
|
|
777
|
+
if (file) seen.set(`${file.root}/${file.path.join("/")}`, file);
|
|
671
778
|
}
|
|
672
779
|
return [...seen.values()];
|
|
673
780
|
};
|
|
@@ -736,9 +843,6 @@ var redactSecrets = (text) => applyRedactionRules(SECRET_REDACTION_RULES, text);
|
|
|
736
843
|
var redactSecretsFromContent = (text) => applyRedactionRules(CUT_OFF_TEXT_REDACTION_RULES, text);
|
|
737
844
|
var redactSecretsDeep = (text) => redactSecrets(text).replace(HIGH_ENTROPY_RULE.pattern, HIGH_ENTROPY_RULE.replacement);
|
|
738
845
|
|
|
739
|
-
// ../contracts/src/json-record.ts
|
|
740
|
-
var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
741
|
-
|
|
742
846
|
// ../contracts/src/shell-analysis.ts
|
|
743
847
|
var SHELL_WORD_SEPARATOR = /[ \t\n]/;
|
|
744
848
|
var ARITHMETIC_EVALUATING_EXPANSION = /\$[#+=~^]*(?:[A-Za-z_][A-Za-z0-9_]*|[0-9]+|[-?$!@*#])?\[/;
|
|
@@ -2537,7 +2641,8 @@ var HOOK_BUDGETS = {
|
|
|
2537
2641
|
qoder: { budgetSeconds: 600, guardSeconds: 10 },
|
|
2538
2642
|
droid: { budgetSeconds: 600, guardSeconds: 10 },
|
|
2539
2643
|
devin: { budgetSeconds: 600, guardSeconds: 10 },
|
|
2540
|
-
antigravity: { budgetSeconds: 600, guardSeconds: 10 }
|
|
2644
|
+
antigravity: { budgetSeconds: 600, guardSeconds: 10 },
|
|
2645
|
+
grok: { budgetSeconds: 600, guardSeconds: 10 }
|
|
2541
2646
|
};
|
|
2542
2647
|
var hookMaxWaitSeconds = (agent) => Math.max(HOOK_BUDGETS[agent].budgetSeconds - HOOK_BUDGETS[agent].guardSeconds, 1);
|
|
2543
2648
|
var HOOK_HOLD_BUDGET_FLAG = "--hold-budget";
|
|
@@ -5121,7 +5226,9 @@ var shouldDeferToNativeMode = (permissionMode, toolName, options = {}) => {
|
|
|
5121
5226
|
var AGENT_QUESTION_TOOL = "AskUserQuestion";
|
|
5122
5227
|
var AGENT_QUESTION_STRATEGY = { native: "native_dialog", updatedInput: "updated_input", none: "not_a_question" };
|
|
5123
5228
|
var UPDATED_INPUT_QUESTION_SOURCES = /* @__PURE__ */ new Set(["claude", "qoder", "codebuddy", "droid"]);
|
|
5229
|
+
var GROK_NATIVE_DIALOG_TOOLS = /* @__PURE__ */ new Set(["ask_user_question", "exit_plan_mode"]);
|
|
5124
5230
|
function agentQuestionStrategy(source, event, toolName) {
|
|
5231
|
+
if (source === "grok" && GROK_NATIVE_DIALOG_TOOLS.has(toolName)) return AGENT_QUESTION_STRATEGY.native;
|
|
5125
5232
|
if (toolName !== AGENT_QUESTION_TOOL) return AGENT_QUESTION_STRATEGY.none;
|
|
5126
5233
|
if (source !== null && event === "PreToolUse" && UPDATED_INPUT_QUESTION_SOURCES.has(source)) return AGENT_QUESTION_STRATEGY.updatedInput;
|
|
5127
5234
|
return AGENT_QUESTION_STRATEGY.native;
|
|
@@ -5400,6 +5507,8 @@ var pendingCommandEvents = (source) => {
|
|
|
5400
5507
|
// so there is nothing for this to print.
|
|
5401
5508
|
case "opencode":
|
|
5402
5509
|
return [];
|
|
5510
|
+
case "grok":
|
|
5511
|
+
return ["PostToolUse"];
|
|
5403
5512
|
case "qwen":
|
|
5404
5513
|
case "codebuddy":
|
|
5405
5514
|
case "qoder":
|
|
@@ -5788,6 +5897,10 @@ export {
|
|
|
5788
5897
|
MANAGED_PROVIDERS,
|
|
5789
5898
|
DISCONNECT_AGENT_IDS,
|
|
5790
5899
|
normalizeAgentId,
|
|
5900
|
+
isRecord,
|
|
5901
|
+
GROK_UNREADABLE_CALL,
|
|
5902
|
+
isGrokHookPayload,
|
|
5903
|
+
isGrokSessionEndStop,
|
|
5791
5904
|
isCompatibleAgentType,
|
|
5792
5905
|
PHONE_ANSWERED_TOOLS,
|
|
5793
5906
|
canonicalToolName,
|
|
@@ -5809,7 +5922,6 @@ export {
|
|
|
5809
5922
|
redactSecrets,
|
|
5810
5923
|
redactSecretsFromContent,
|
|
5811
5924
|
redactSecretsDeep,
|
|
5812
|
-
isRecord,
|
|
5813
5925
|
degradedLine,
|
|
5814
5926
|
hookWritePath,
|
|
5815
5927
|
MAX_HOOK_ACTIVATION_EVIDENCE_ROWS,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveInstallSourceFor
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5S2P2CK6.js";
|
|
4
4
|
import {
|
|
5
5
|
backupFile,
|
|
6
6
|
readJsonSafe,
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
} from "./chunk-AQFEP65J.js";
|
|
10
10
|
import {
|
|
11
11
|
configFilePath
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-PRKH662J.js";
|
|
13
13
|
import {
|
|
14
14
|
API_KEY_PREFIX_PATTERN,
|
|
15
15
|
isRecord
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-2DZBIELP.js";
|
|
17
17
|
|
|
18
18
|
// src/shell-alias.ts
|
|
19
19
|
import { homedir } from "os";
|
|
@@ -2,25 +2,25 @@ import {
|
|
|
2
2
|
SIGNED_OUT_ON_MAC_MESSAGE,
|
|
3
3
|
describeSignedOutKey,
|
|
4
4
|
readSignedOutDiagnosis
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-JWURAYXK.js";
|
|
6
6
|
import {
|
|
7
7
|
createIo
|
|
8
8
|
} from "./chunk-FO3MDD26.js";
|
|
9
9
|
import {
|
|
10
10
|
readKeySource
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-42FTY5II.js";
|
|
12
12
|
import {
|
|
13
13
|
absoluteUrl,
|
|
14
14
|
checkApiKey,
|
|
15
15
|
describeKeyCheck,
|
|
16
16
|
keyCheckFromResponse
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-GNESC5EF.js";
|
|
18
18
|
import {
|
|
19
19
|
EXIT
|
|
20
20
|
} from "./chunk-KZERVKTD.js";
|
|
21
21
|
import {
|
|
22
22
|
getBaseUrl
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-PRKH662J.js";
|
|
24
24
|
|
|
25
25
|
// src/cli/report-key.ts
|
|
26
26
|
var { dim, yellow } = createIo();
|
|
@@ -2,23 +2,23 @@ import {
|
|
|
2
2
|
CLAUDE_HOOK_EVENTS,
|
|
3
3
|
GEMINI_HOOK_EVENTS,
|
|
4
4
|
hasGeminiHooks
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ULDOQF4Q.js";
|
|
6
6
|
import {
|
|
7
7
|
AGENT_CHOICES
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-EQXMVKKD.js";
|
|
9
9
|
import {
|
|
10
10
|
BELL_HOOK_BINARY
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-5ML6E3L7.js";
|
|
12
12
|
import {
|
|
13
13
|
CODEX_HOOK_EVENTS,
|
|
14
14
|
hasCodexHooks,
|
|
15
15
|
holdBudgetOf
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-K5X25GUV.js";
|
|
17
17
|
import {
|
|
18
18
|
CURSOR_GATE_EVENTS,
|
|
19
19
|
HOOK_LOCATOR_BINARY,
|
|
20
20
|
hookCommandHoldBudget
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-2DZBIELP.js";
|
|
22
22
|
|
|
23
23
|
// src/diagnostics/bridge.ts
|
|
24
24
|
import { execFileSync } from "child_process";
|
|
@@ -14,19 +14,19 @@ import {
|
|
|
14
14
|
} from "./chunk-FO3MDD26.js";
|
|
15
15
|
import {
|
|
16
16
|
callMcpTool
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-BS64ZHTB.js";
|
|
18
18
|
import {
|
|
19
19
|
reportedInstallSource
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-5S2P2CK6.js";
|
|
21
21
|
import {
|
|
22
22
|
NPX_LATEST_COMMAND
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-LL256PHP.js";
|
|
24
24
|
import {
|
|
25
25
|
NO_PAIRING_COMPUTER,
|
|
26
26
|
PAIR_TTL_SECONDS,
|
|
27
27
|
classifyConfirmResponse,
|
|
28
28
|
isAnswerSource
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-2DZBIELP.js";
|
|
30
30
|
|
|
31
31
|
// src/reach.ts
|
|
32
32
|
var reachVerdict = (channels) => {
|
|
@@ -950,6 +950,80 @@ var connectViaAppPairing = async (options = {}) => {
|
|
|
950
950
|
process.off("SIGTERM", onTerminate);
|
|
951
951
|
}
|
|
952
952
|
};
|
|
953
|
+
var PHONE_WAIT_TIMEOUT_MS = 10 * 6e4;
|
|
954
|
+
var PHONE_WAIT_SKIP_LINE = "Press Enter to skip. Setup finishes without the phone check.";
|
|
955
|
+
var describePhoneWait = (skipOffered) => [
|
|
956
|
+
bold("Connect your phone"),
|
|
957
|
+
"Open the Pushary app on your phone and allow notifications.",
|
|
958
|
+
dim("Sign in with the same account you use here. No app yet? Get it at pushary.com/download"),
|
|
959
|
+
...skipOffered ? [dim(PHONE_WAIT_SKIP_LINE)] : []
|
|
960
|
+
];
|
|
961
|
+
var watchSkip = (listener) => {
|
|
962
|
+
let skipped = false;
|
|
963
|
+
let wake = () => {
|
|
964
|
+
};
|
|
965
|
+
const woken = new Promise((resolve) => {
|
|
966
|
+
wake = resolve;
|
|
967
|
+
});
|
|
968
|
+
const stop = listener?.(() => {
|
|
969
|
+
skipped = true;
|
|
970
|
+
wake();
|
|
971
|
+
}) ?? (() => {
|
|
972
|
+
});
|
|
973
|
+
return { skipped: () => skipped, woken, stop };
|
|
974
|
+
};
|
|
975
|
+
var PHONE_WAIT_REPAIR_LINE = `Open the Pushary app, sign in with the same account, and allow notifications. Then run ${NPX_LATEST_COMMAND} doctor.`;
|
|
976
|
+
var phoneWaitRepair = (verdict) => verdict.kind === "nobody" ? [PHONE_WAIT_REPAIR_LINE] : describeAppRepair(verdict) ?? [];
|
|
977
|
+
var pollForYourPhone = async (apiKey, firstSeen, options) => {
|
|
978
|
+
const clock = options.clock ?? SYSTEM_PAIR_CLOCK;
|
|
979
|
+
const deadline = clock.now() + PHONE_WAIT_TIMEOUT_MS;
|
|
980
|
+
const skip = watchSkip(options.skip);
|
|
981
|
+
const minutesLeft = () => Math.max(0, Math.ceil((deadline - clock.now()) / 6e4));
|
|
982
|
+
const stop = startSpinner(() => `Waiting for your phone ${dim(`(${minutesLeft()}m left)`)}`);
|
|
983
|
+
let lastSeen = firstSeen;
|
|
984
|
+
try {
|
|
985
|
+
while (clock.now() < deadline && !skip.skipped()) {
|
|
986
|
+
const probe = await fetchChannels(apiKey);
|
|
987
|
+
if (probe.kind === "unauthorized") {
|
|
988
|
+
stop(yellow("!"), "The server stopped accepting this key");
|
|
989
|
+
return { kind: "unauthorized" };
|
|
990
|
+
}
|
|
991
|
+
if (probe.kind === "locked") {
|
|
992
|
+
stop(yellow("!"), "This workspace has no active plan");
|
|
993
|
+
return { kind: "locked" };
|
|
994
|
+
}
|
|
995
|
+
if (probe.kind === "ok") {
|
|
996
|
+
lastSeen = probe.status;
|
|
997
|
+
if (reachesYou(probe.status)) {
|
|
998
|
+
stop(check, "Phone connected");
|
|
999
|
+
return { kind: "connected", channels: probe.status };
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
await Promise.race([clock.sleep(CONNECT_POLL_INTERVAL_MS), skip.woken]);
|
|
1003
|
+
}
|
|
1004
|
+
stop(yellow("!"), skip.skipped() ? "Skipped the phone check" : "No phone connected yet");
|
|
1005
|
+
return { kind: "not_yet", lastSeen };
|
|
1006
|
+
} finally {
|
|
1007
|
+
skip.stop();
|
|
1008
|
+
}
|
|
1009
|
+
};
|
|
1010
|
+
var waitForYourPhone = async (apiKey, options = {}) => {
|
|
1011
|
+
const probe = await fetchChannels(apiKey);
|
|
1012
|
+
if (probe.kind !== "ok") return describeProbeFailure(probe);
|
|
1013
|
+
if (reachesYou(probe.status)) {
|
|
1014
|
+
console.log(` ${check} ${describeExistingConnection(probe.status)}`);
|
|
1015
|
+
return sendAndConfirm(apiKey, probe.status);
|
|
1016
|
+
}
|
|
1017
|
+
console.log();
|
|
1018
|
+
for (const line of describePhoneWait(options.skip !== void 0)) console.log(` ${line}`);
|
|
1019
|
+
console.log();
|
|
1020
|
+
const waited = await pollForYourPhone(apiKey, probe.status, options);
|
|
1021
|
+
if (waited.kind === "connected") return sendAndConfirm(apiKey, waited.channels);
|
|
1022
|
+
if (waited.kind === "unauthorized" || waited.kind === "locked") return describeProbeFailure(waited);
|
|
1023
|
+
const repair = phoneWaitRepair(reachVerdict(waited.lastSeen));
|
|
1024
|
+
for (const line of repair) console.log(` ${dim(line)}`);
|
|
1025
|
+
return phoneFailure("no_device", repair);
|
|
1026
|
+
};
|
|
953
1027
|
|
|
954
1028
|
export {
|
|
955
1029
|
reachVerdict,
|
|
@@ -965,5 +1039,6 @@ export {
|
|
|
965
1039
|
printConnectInstructions,
|
|
966
1040
|
BROWSER_CONNECT_COMMAND,
|
|
967
1041
|
pairingEscapeApplies,
|
|
968
|
-
connectViaAppPairing
|
|
1042
|
+
connectViaAppPairing,
|
|
1043
|
+
waitForYourPhone
|
|
969
1044
|
};
|