@pushary/agent-hooks 0.95.1 → 0.95.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +9 -0
- package/data/cowork/SKILL.md +77 -0
- package/dist/bin/pushary-bell-hook.js +17 -16
- package/dist/bin/pushary-bell.js +7 -7
- package/dist/bin/pushary-claude.js +18 -17
- package/dist/bin/pushary-clean.js +16 -15
- package/dist/bin/pushary-codex-bridge.js +9 -9
- package/dist/bin/pushary-codex-hook.js +20 -19
- package/dist/bin/pushary-codex.js +7 -7
- package/dist/bin/pushary-connect.js +8 -8
- package/dist/bin/pushary-cowork.d.ts +1 -0
- package/dist/bin/pushary-cowork.js +37 -0
- package/dist/bin/pushary-daemon.js +22 -21
- package/dist/bin/pushary-disconnect.js +8 -8
- package/dist/bin/pushary-doctor.js +20 -20
- package/dist/bin/pushary-elicitation-hook.js +16 -15
- package/dist/bin/pushary-gemini-bridge.js +9 -9
- package/dist/bin/pushary-gemini-hook.js +19 -18
- package/dist/bin/pushary-hook.js +23 -22
- package/dist/bin/pushary-login.js +11 -10
- package/dist/bin/pushary-logout.js +6 -6
- package/dist/bin/pushary-mode.js +5 -5
- package/dist/bin/pushary-notification-hook.js +18 -17
- package/dist/bin/pushary-opencode-hook.js +19 -18
- package/dist/bin/pushary-permission-denied-hook.js +21 -20
- package/dist/bin/pushary-permission-hook.js +21 -20
- package/dist/bin/pushary-post-hook.js +18 -17
- package/dist/bin/pushary-prompt-hook.js +18 -17
- package/dist/bin/pushary-session-end-hook.js +18 -17
- package/dist/bin/pushary-session-start-hook.js +21 -20
- package/dist/bin/pushary-setup.js +39 -27
- package/dist/bin/pushary-stats.js +4 -4
- package/dist/bin/pushary-status.js +10 -10
- package/dist/bin/pushary-stop-hook.js +18 -17
- package/dist/bin/pushary-stopfailure-hook.js +18 -17
- package/dist/bin/pushary-suggestions.js +2 -2
- package/dist/bin/pushary-transcript-register.js +15 -14
- package/dist/bin/pushary-transcripts.js +6 -6
- package/dist/bin/pushary-upgrade.js +15 -15
- package/dist/bin/pushary-wait.js +5 -5
- package/dist/bin/pushary.js +2 -1
- package/dist/{chunk-77U3ZVV6.js → chunk-2XUPP4WM.js} +1 -1
- package/dist/chunk-3ZUTNTZA.js +133 -0
- package/dist/{chunk-T23EGPRI.js → chunk-4XXUHWIK.js} +1 -1
- package/dist/chunk-5GLPYGKS.js +88 -0
- package/dist/{chunk-VOWZ5VOO.js → chunk-6FAHPGCZ.js} +30 -0
- package/dist/{chunk-WJZUTMMU.js → chunk-76XICHYT.js} +3 -3
- package/dist/{chunk-BWNU4MX4.js → chunk-7LUFYRH4.js} +3 -3
- package/dist/{chunk-C2MV4G4A.js → chunk-A4R6BZCK.js} +1 -1
- package/dist/{chunk-R7NPGCSD.js → chunk-AMZJ3CKW.js} +1 -1
- package/dist/{chunk-IFCS6LXB.js → chunk-CH6DTGQR.js} +3 -3
- package/dist/{chunk-VLKEAYJ4.js → chunk-CKOLDI47.js} +1 -1
- package/dist/{chunk-J55K6YS4.js → chunk-DNVDKHQD.js} +5 -5
- package/dist/{chunk-IZRI4M3C.js → chunk-E3NF5CL2.js} +1 -1
- package/dist/{chunk-RNH2AE52.js → chunk-EPFDN2ZT.js} +1 -1
- package/dist/{chunk-UQSKCQBO.js → chunk-EUAQ4YAN.js} +1 -1
- package/dist/{chunk-IP63LMZM.js → chunk-FQUV5KTM.js} +6 -6
- package/dist/{chunk-YPYPI6BG.js → chunk-G24SEVCI.js} +2 -2
- package/dist/{chunk-MF64S7WO.js → chunk-G4TL4YWH.js} +1 -1
- package/dist/{chunk-Z3Z4VK5F.js → chunk-GKIUEIDX.js} +4 -33
- package/dist/{chunk-JSASMV3H.js → chunk-GUVCYYDK.js} +1 -1
- package/dist/{chunk-SSQ5X6SA.js → chunk-IAEXPTXA.js} +1 -1
- package/dist/{chunk-UFGDCMUD.js → chunk-IPHOUBTU.js} +1 -1
- package/dist/{chunk-PDFVIRPB.js → chunk-JDFB3YKG.js} +1 -1
- package/dist/{chunk-M64I4T7J.js → chunk-M7WWEFG6.js} +1 -1
- package/dist/{chunk-BVBEURWJ.js → chunk-MOY5X6HJ.js} +1 -1
- package/dist/chunk-PUZZELE6.js +37 -0
- package/dist/{chunk-ZOR5OJZJ.js → chunk-QF4RI5CD.js} +1 -1
- package/dist/{chunk-7MGF5Q7G.js → chunk-QUE76J4H.js} +1 -1
- package/dist/{chunk-CU5KI425.js → chunk-RVSEGFPD.js} +2 -2
- package/dist/{chunk-Y24D5ZWS.js → chunk-UOTSWS5N.js} +7 -7
- package/dist/{chunk-CC625NRG.js → chunk-UW4LWAWY.js} +6 -6
- package/dist/{chunk-TTO76NZJ.js → chunk-V27AHID3.js} +1 -1
- package/dist/{chunk-K7ZZGI2Y.js → chunk-VX3BWMC5.js} +1 -1
- package/dist/{chunk-3F4VV5TS.js → chunk-WB2C7VPF.js} +1 -1
- package/dist/{chunk-ZW3KAWTM.js → chunk-WM5XMCID.js} +5 -131
- package/dist/{chunk-T5B3LRYF.js → chunk-X7YWD6IS.js} +1 -1
- package/dist/{chunk-AQ5OAYOH.js → chunk-YJAQRKH5.js} +1 -1
- package/dist/{chunk-43GMYSS4.js → chunk-ZDAT5KMU.js} +12 -0
- package/dist/src/index.js +10 -10
- package/package.json +2 -1
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import {
|
|
2
|
+
parseFlags
|
|
3
|
+
} from "./chunk-GMXKITVA.js";
|
|
4
|
+
import {
|
|
5
|
+
UsageError
|
|
6
|
+
} from "./chunk-7QLSKOSU.js";
|
|
7
|
+
import {
|
|
8
|
+
isValidApiKey
|
|
9
|
+
} from "./chunk-6FAHPGCZ.js";
|
|
10
|
+
|
|
11
|
+
// src/setup/options.ts
|
|
12
|
+
var AGENT_CHOICES = ["claude_code", "codex", "gemini_cli", "hermes", "cursor", "vscode", "opencode", "custom"];
|
|
13
|
+
var CONNECT_MODES = ["app", "browser", "web", "none"];
|
|
14
|
+
var CONNECT_ALIASES = { auto: "app", pwa: "web" };
|
|
15
|
+
var parseConnectMode = (raw) => {
|
|
16
|
+
const value = raw.trim().toLowerCase();
|
|
17
|
+
if (Object.hasOwn(CONNECT_ALIASES, value)) return CONNECT_ALIASES[value];
|
|
18
|
+
if (CONNECT_MODES.includes(value)) return value;
|
|
19
|
+
throw new UsageError(`--connect must be one of: ${CONNECT_MODES.join(", ")} (got ${raw})`);
|
|
20
|
+
};
|
|
21
|
+
var VERIFY_MODES = ["roundtrip", "push", "none"];
|
|
22
|
+
var parseVerifyMode = (raw) => {
|
|
23
|
+
const value = raw.trim().toLowerCase();
|
|
24
|
+
if (VERIFY_MODES.includes(value)) return value;
|
|
25
|
+
throw new UsageError(`--verify must be one of: ${VERIFY_MODES.join(", ")} (got ${raw})`);
|
|
26
|
+
};
|
|
27
|
+
var CONTROL_MODES = ["auto", "on", "off"];
|
|
28
|
+
var parseControlMode = (raw) => {
|
|
29
|
+
const value = raw.trim().toLowerCase();
|
|
30
|
+
if (CONTROL_MODES.includes(value)) return value;
|
|
31
|
+
throw new UsageError(`--control must be one of: ${CONTROL_MODES.join(", ")} (got ${raw})`);
|
|
32
|
+
};
|
|
33
|
+
var effectiveVerify = (options, context) => {
|
|
34
|
+
if (options.verifyExplicit) return options.verify;
|
|
35
|
+
if (options.verify === "roundtrip") return "roundtrip";
|
|
36
|
+
return context.paired ? "roundtrip" : options.verify;
|
|
37
|
+
};
|
|
38
|
+
var SETUP_FLAGS = {
|
|
39
|
+
bools: ["key-stdin", "skip-phone", "yes", "y", "json", "dry-run", "take-over-hooks", "help", "h"],
|
|
40
|
+
values: ["key", "connect", "agents", "verify", "control", "transcripts"]
|
|
41
|
+
};
|
|
42
|
+
var effectiveControlMode = (options, stored, configPresent) => options.controlExplicit ? options.control : stored ?? (configPresent ? null : options.control);
|
|
43
|
+
var isAgentChoice = (value) => AGENT_CHOICES.includes(value);
|
|
44
|
+
var parseAgentSelection = (raw, yes) => {
|
|
45
|
+
if (raw === void 0) {
|
|
46
|
+
return yes ? { kind: "auto" } : { kind: "ask" };
|
|
47
|
+
}
|
|
48
|
+
const value = raw.trim().toLowerCase();
|
|
49
|
+
if (value === "auto") return { kind: "auto" };
|
|
50
|
+
if (value === "none") return { kind: "none" };
|
|
51
|
+
const parts = value.split(",").map((part) => part.trim()).filter((part) => part !== "");
|
|
52
|
+
if (parts.length === 0) throw new UsageError("--agents needs a value");
|
|
53
|
+
const unknown = parts.filter((part) => !isAgentChoice(part));
|
|
54
|
+
if (unknown.length > 0) {
|
|
55
|
+
throw new UsageError(
|
|
56
|
+
`--agents does not know: ${unknown.join(", ")}. Use auto, none, or any of: ${AGENT_CHOICES.join(", ")}`
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
return { kind: "explicit", agents: [...new Set(parts)] };
|
|
60
|
+
};
|
|
61
|
+
var parseSetupOptions = (input) => {
|
|
62
|
+
const flags = parseFlags(input.argv, SETUP_FLAGS);
|
|
63
|
+
const stray = [
|
|
64
|
+
...flags.command !== void 0 && flags.command !== "setup" ? [flags.command] : [],
|
|
65
|
+
...flags.rest
|
|
66
|
+
];
|
|
67
|
+
if (stray.length > 0) {
|
|
68
|
+
throw new UsageError(
|
|
69
|
+
`setup takes no positional arguments (got ${stray.join(", ")}). Did you mean --agents ${stray[0]}?`
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
const yes = flags.bools.has("yes") || flags.bools.has("y");
|
|
73
|
+
const help = flags.bools.has("help") || flags.bools.has("h");
|
|
74
|
+
const agentsFlag = flags.values.get("agents");
|
|
75
|
+
const agents = parseAgentSelection(agentsFlag, yes);
|
|
76
|
+
const connectRaw = flags.values.get("connect");
|
|
77
|
+
const connectMode = connectRaw === void 0 ? "app" : parseConnectMode(connectRaw);
|
|
78
|
+
const verifyRaw = flags.values.get("verify");
|
|
79
|
+
const controlRaw = flags.values.get("control");
|
|
80
|
+
const transcriptsRaw = flags.values.get("transcripts")?.trim().toLowerCase();
|
|
81
|
+
if (transcriptsRaw !== void 0 && transcriptsRaw !== "on" && transcriptsRaw !== "off") {
|
|
82
|
+
throw new UsageError(`--transcripts must be one of: on, off (got ${transcriptsRaw})`);
|
|
83
|
+
}
|
|
84
|
+
const nonInteractive = yes || agentsFlag !== void 0 || flags.bools.has("json") || !input.stdinIsTty;
|
|
85
|
+
const verify = verifyRaw !== void 0 ? parseVerifyMode(verifyRaw) : nonInteractive ? "push" : "roundtrip";
|
|
86
|
+
const key = flags.values.get("key")?.trim() || null;
|
|
87
|
+
const keyStdin = flags.bools.has("key-stdin");
|
|
88
|
+
if (key && keyStdin) {
|
|
89
|
+
throw new UsageError("Pass either --key or --key-stdin, not both");
|
|
90
|
+
}
|
|
91
|
+
if (key && !isValidApiKey(key)) {
|
|
92
|
+
throw new UsageError("--key is not a valid API key. Expected the pk_xxx.xxx shape from pushary.com/dashboard/agent/settings");
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
connectMode,
|
|
96
|
+
connectExplicit: connectRaw !== void 0,
|
|
97
|
+
// `--connect none` and `--skip-phone` are the same instruction, so they
|
|
98
|
+
// resolve to the same field rather than being checked separately at the two
|
|
99
|
+
// call sites that would inevitably drift apart.
|
|
100
|
+
skipPhone: flags.bools.has("skip-phone") || connectMode === "none",
|
|
101
|
+
// Anything that means "there is nobody to answer a prompt". A non-TTY stdin
|
|
102
|
+
// is included because that is the case that used to hang: it is better to
|
|
103
|
+
// take the defaults and say so than to wait forever for a keypress.
|
|
104
|
+
//
|
|
105
|
+
// --json counts. Under it stdout carries exactly one object and every human
|
|
106
|
+
// line is redirected to stderr, so a prompt has nowhere to render: the
|
|
107
|
+
// question goes to stderr while the run blocks on a keypress the caller
|
|
108
|
+
// cannot see it is waiting for, and whatever is reading stdout waits forever
|
|
109
|
+
// for an object that never arrives. Asking for machine-readable output is
|
|
110
|
+
// itself a statement that no human is watching.
|
|
111
|
+
nonInteractive,
|
|
112
|
+
json: flags.bools.has("json"),
|
|
113
|
+
dryRun: flags.bools.has("dry-run"),
|
|
114
|
+
help,
|
|
115
|
+
agents,
|
|
116
|
+
key,
|
|
117
|
+
keyStdin,
|
|
118
|
+
verify,
|
|
119
|
+
verifyExplicit: verifyRaw !== void 0,
|
|
120
|
+
control: controlRaw === void 0 ? "auto" : parseControlMode(controlRaw),
|
|
121
|
+
controlExplicit: controlRaw !== void 0,
|
|
122
|
+
transcripts: transcriptsRaw === void 0 ? null : transcriptsRaw === "on",
|
|
123
|
+
takeOverHooks: flags.bools.has("take-over-hooks")
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export {
|
|
128
|
+
AGENT_CHOICES,
|
|
129
|
+
effectiveVerify,
|
|
130
|
+
SETUP_FLAGS,
|
|
131
|
+
effectiveControlMode,
|
|
132
|
+
parseSetupOptions
|
|
133
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SETUP_FLAGS
|
|
3
|
+
} from "./chunk-3ZUTNTZA.js";
|
|
4
|
+
import {
|
|
5
|
+
parseFlags
|
|
6
|
+
} from "./chunk-GMXKITVA.js";
|
|
7
|
+
import {
|
|
8
|
+
UsageError
|
|
9
|
+
} from "./chunk-7QLSKOSU.js";
|
|
10
|
+
import {
|
|
11
|
+
CLAUDE_CONNECTOR_GUIDE,
|
|
12
|
+
CLAUDE_CONNECTOR_STEPS,
|
|
13
|
+
CLAUDE_CONNECTOR_TEST,
|
|
14
|
+
CLAUDE_CONNECTOR_URL,
|
|
15
|
+
COWORK_CONNECTOR_LIMIT,
|
|
16
|
+
COWORK_STANDING_INSTRUCTIONS
|
|
17
|
+
} from "./chunk-6FAHPGCZ.js";
|
|
18
|
+
|
|
19
|
+
// src/cli/cowork.ts
|
|
20
|
+
import { readFileSync } from "fs";
|
|
21
|
+
var coworkSetup = {
|
|
22
|
+
status: "manual_setup_required",
|
|
23
|
+
connectorUrl: CLAUDE_CONNECTOR_URL,
|
|
24
|
+
guideUrl: CLAUDE_CONNECTOR_GUIDE,
|
|
25
|
+
steps: CLAUDE_CONNECTOR_STEPS,
|
|
26
|
+
testPrompt: CLAUDE_CONNECTOR_TEST,
|
|
27
|
+
instructions: COWORK_STANDING_INSTRUCTIONS,
|
|
28
|
+
capability: COWORK_CONNECTOR_LIMIT
|
|
29
|
+
};
|
|
30
|
+
var renderCoworkSetup = () => [
|
|
31
|
+
"Claude Desktop / Cowork setup",
|
|
32
|
+
"",
|
|
33
|
+
CLAUDE_CONNECTOR_URL,
|
|
34
|
+
"",
|
|
35
|
+
...CLAUDE_CONNECTOR_STEPS.map((step, i) => `${i + 1}. ${step}`),
|
|
36
|
+
"",
|
|
37
|
+
`Test prompt: ${CLAUDE_CONNECTOR_TEST}`,
|
|
38
|
+
"",
|
|
39
|
+
COWORK_CONNECTOR_LIMIT,
|
|
40
|
+
"",
|
|
41
|
+
"Cowork supports plugin hooks on supported versions. This connector setup does not install or verify native permission hooks.",
|
|
42
|
+
"Run pushary cowork --instructions for the standing instructions, or --skill for the uploadable SKILL.md.",
|
|
43
|
+
`Full guide: ${CLAUDE_CONNECTOR_GUIDE}`,
|
|
44
|
+
""
|
|
45
|
+
].join("\n");
|
|
46
|
+
var parseCoworkOptions = (argv) => {
|
|
47
|
+
const flags = parseFlags(argv, { bools: ["json", "open", "instructions", "skill", "help", "h"], values: [] });
|
|
48
|
+
if (flags.command && flags.command !== "cowork" || flags.rest.length > 0) {
|
|
49
|
+
throw new UsageError("cowork takes no positional arguments. Run pushary cowork --help.");
|
|
50
|
+
}
|
|
51
|
+
const formats = ["json", "instructions", "skill"].filter((flag) => flags.bools.has(flag));
|
|
52
|
+
if (formats.length > 1) throw new UsageError("Choose only one of --json, --instructions, or --skill.");
|
|
53
|
+
return { format: formats[0] ?? "guide", open: flags.bools.has("open") };
|
|
54
|
+
};
|
|
55
|
+
var coworkOutput = (format) => {
|
|
56
|
+
if (format === "json") return JSON.stringify(coworkSetup, null, 2) + "\n";
|
|
57
|
+
if (format === "instructions") return COWORK_STANDING_INSTRUCTIONS + "\n";
|
|
58
|
+
if (format === "skill") {
|
|
59
|
+
for (const relative of ["../../data/cowork/SKILL.md", "../data/cowork/SKILL.md"]) {
|
|
60
|
+
try {
|
|
61
|
+
return readFileSync(new URL(relative, import.meta.url), "utf8");
|
|
62
|
+
} catch (error) {
|
|
63
|
+
if (error.code !== "ENOENT") throw error;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
throw new Error("Packaged Cowork skill is missing. Reinstall @pushary/agent-hooks.");
|
|
67
|
+
}
|
|
68
|
+
return renderCoworkSetup();
|
|
69
|
+
};
|
|
70
|
+
var coworkSelection = (argv) => {
|
|
71
|
+
const flags = parseFlags(argv, SETUP_FLAGS);
|
|
72
|
+
const selected = flags.values.get("agents")?.toLowerCase().split(",").map((value) => value.trim()) ?? [];
|
|
73
|
+
const aliases = /* @__PURE__ */ new Set(["cowork", "claude_cowork", "claude_desktop", "claude_chat"]);
|
|
74
|
+
if (!selected.some((value) => aliases.has(value))) return null;
|
|
75
|
+
if (selected.some((value) => !aliases.has(value)) || flags.rest.length > 0 || flags.command && flags.command !== "setup") {
|
|
76
|
+
throw new UsageError("Set up Cowork with pushary cowork, then run setup separately for your CLI agents.");
|
|
77
|
+
}
|
|
78
|
+
if ([...flags.values.keys()].some((key) => key !== "agents") || flags.bools.has("key-stdin") || flags.bools.has("take-over-hooks")) {
|
|
79
|
+
throw new UsageError("Cowork uses connector OAuth. Use pushary cowork; CLI key, control, and hook options do not apply.");
|
|
80
|
+
}
|
|
81
|
+
return { json: flags.bools.has("json") };
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export {
|
|
85
|
+
parseCoworkOptions,
|
|
86
|
+
coworkOutput,
|
|
87
|
+
coworkSelection
|
|
88
|
+
};
|
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
// ../contracts/src/claude-connector.ts
|
|
2
|
+
var CLAUDE_CONNECTOR_URL = "https://pushary.com/api/mcp/mcp";
|
|
3
|
+
var CLAUDE_CONNECTOR_GUIDE = "https://pushary.com/docs/agents/guides/claude-desktop";
|
|
4
|
+
var COWORK_CONNECTOR_LIMIT = "Pushary\u2019s Cowork connector is cooperative: Claude chooses when to ask. It does not intercept Claude\u2019s native permission prompts or start new Cowork tasks.";
|
|
5
|
+
var CLAUDE_CONNECTOR_STEPS = [
|
|
6
|
+
"In Claude, open Customize > Connectors > Add custom connector and paste the Pushary connector URL.",
|
|
7
|
+
"Leave OAuth Client ID and Secret empty. Sign in with the same Pushary account used by your phone and Mac app.",
|
|
8
|
+
"Enable Pushary in the Chat or Cowork conversation. Approve access to its tools if Claude asks.",
|
|
9
|
+
"For proactive Cowork use, install the Pushary Cowork plugin/skill or paste the standing instructions into Settings > Cowork.",
|
|
10
|
+
"Ask Claude to send the test question below, answer it from Pushary, and confirm Claude receives your answer."
|
|
11
|
+
];
|
|
12
|
+
var CLAUDE_CONNECTOR_TEST = "Use Pushary ask_user to ask \u201CDid this setup question reach you?\u201D with type \u201Cconfirm\u201D. Use agentName \u201CClaude Cowork - Setup check\u201D in Cowork or \u201CClaude Chat - Setup check\u201D in Chat. Wait for my answer and tell me which answer you received. Do not run a command or change any files.";
|
|
13
|
+
var COWORK_STANDING_INSTRUCTIONS = `Pushary is connected as a custom connector. Use it proactively to reach me on my phone or Mac notch.
|
|
14
|
+
|
|
15
|
+
- When you need a decision or clarifying answer, call ask_user. Use type "confirm", "select", or "input" as appropriate. Ask once on one channel.
|
|
16
|
+
- Before a risky or irreversible action outside my existing authorization, call ask_user with type "confirm" and wait for approval. Silence is never consent.
|
|
17
|
+
- When a task finishes, call send_notification with context.type "task_complete" and a short summary. For an error you cannot resolve, use context.type "error"; use "info" for other updates.
|
|
18
|
+
- Only keep a reply channel open when a specific unresolved decision is required: call send_notification with context.askQuestion, then poll the returned linkedCorrelationId with wait_for_answer. Do not ask for optional feedback just to keep a finished turn alive.
|
|
19
|
+
- Follow handoffAction when present, otherwise nextAction. If ask_user times out on a live question, poll once with wait_for_answer. If still pending, cancel_question before asking in the current chat. If cancellation returns handoffAction "stop", stop. If cancellation returns false, poll once for 1 second and honor the answer that won the race. Expired, cancelled, missing, and unavailable questions are not new timeouts.
|
|
20
|
+
- Pass agentName as "Claude Cowork - <task name>" on every call, and reuse one opaque sessionId per task so parallel tasks stay separate. Never include credentials in these identifiers.
|
|
21
|
+
- Cancel a question when it is no longer needed. Once this turn ends, reopen Cowork for follow-up work; this connector cannot restart it.
|
|
22
|
+
- If Pushary tools are missing or disabled, report that once and continue within my authorization. Do not claim a notification or approval was delivered.`;
|
|
23
|
+
|
|
1
24
|
// ../contracts/src/index.ts
|
|
2
25
|
var KEY_SCOPES = ["full_access", "agent", "connector", "bound"];
|
|
3
26
|
var normalizeKeyScope = (value) => typeof value === "string" && KEY_SCOPES.includes(value) ? value : null;
|
|
@@ -120,6 +143,7 @@ var effectiveWaitSeconds = (timeoutAction, policySeconds, agent) => timeoutActio
|
|
|
120
143
|
var HOOK_SOURCES = ["claude", "codex", "gemini", "cursor", "vscode", "opencode"];
|
|
121
144
|
var AGENT_LABELS_BY_TYPE = {
|
|
122
145
|
claude_code: "Claude Code",
|
|
146
|
+
claude_chat: "Claude Chat",
|
|
123
147
|
claude_cowork: "Claude Cowork",
|
|
124
148
|
codex: "Codex",
|
|
125
149
|
chatgpt: "ChatGPT",
|
|
@@ -1349,6 +1373,12 @@ var elicitationContentFromAnswers = (ask, answers) => {
|
|
|
1349
1373
|
};
|
|
1350
1374
|
|
|
1351
1375
|
export {
|
|
1376
|
+
CLAUDE_CONNECTOR_URL,
|
|
1377
|
+
CLAUDE_CONNECTOR_GUIDE,
|
|
1378
|
+
COWORK_CONNECTOR_LIMIT,
|
|
1379
|
+
CLAUDE_CONNECTOR_STEPS,
|
|
1380
|
+
CLAUDE_CONNECTOR_TEST,
|
|
1381
|
+
COWORK_STANDING_INSTRUCTIONS,
|
|
1352
1382
|
normalizeKeyScope,
|
|
1353
1383
|
parseAgentQuestions,
|
|
1354
1384
|
parseAgentQuestionAnswers,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CLAUDE_HOOK_EVENTS,
|
|
3
3
|
supportedClaudeEvents
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7LUFYRH4.js";
|
|
5
5
|
import {
|
|
6
6
|
guardBinary
|
|
7
7
|
} from "./chunk-EZIEXHYM.js";
|
|
8
8
|
import {
|
|
9
9
|
isProtectedByScope
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-WB2C7VPF.js";
|
|
11
11
|
import {
|
|
12
12
|
HOOK_LOCATOR_BINARY
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-6FAHPGCZ.js";
|
|
14
14
|
|
|
15
15
|
// src/claude-config.ts
|
|
16
16
|
import { join } from "path";
|
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
POSTTOOLUSE_MIRRORED_TOOLS,
|
|
4
4
|
PRETOOLUSE_GATED_TOOLS,
|
|
5
5
|
PRETOOLUSE_PHONE_ANSWERED_TOOLS
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-V27AHID3.js";
|
|
7
7
|
import {
|
|
8
8
|
isProtectedByScope
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-WB2C7VPF.js";
|
|
10
10
|
import {
|
|
11
11
|
HOOK_BUDGETS,
|
|
12
12
|
HOOK_LOCATOR_BINARY
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-6FAHPGCZ.js";
|
|
14
14
|
|
|
15
15
|
// src/gemini-config.ts
|
|
16
16
|
var GEMINI_HOOK_BINARY = "pushary-gemini-hook";
|
|
@@ -2,15 +2,15 @@ import {
|
|
|
2
2
|
CLAUDE_HOOK_EVENTS,
|
|
3
3
|
GEMINI_HOOK_EVENTS,
|
|
4
4
|
hasGeminiHooks
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-7LUFYRH4.js";
|
|
6
6
|
import {
|
|
7
7
|
CODEX_HOOK_EVENTS,
|
|
8
8
|
hasCodexHooks
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-WB2C7VPF.js";
|
|
10
10
|
import {
|
|
11
11
|
CURSOR_GATE_EVENTS,
|
|
12
12
|
HOOK_LOCATOR_BINARY
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-6FAHPGCZ.js";
|
|
14
14
|
|
|
15
15
|
// src/diagnostics/wiring.ts
|
|
16
16
|
var record = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
@@ -34,20 +34,20 @@ import {
|
|
|
34
34
|
summarizeStop,
|
|
35
35
|
taskTitleFrom,
|
|
36
36
|
toolResultErrorText
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-CKOLDI47.js";
|
|
38
38
|
import {
|
|
39
39
|
NOTIFICATION_PUSH_TYPES,
|
|
40
40
|
POSTTOOLUSE_MIRROR_ONLY_TOOLS
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-V27AHID3.js";
|
|
42
42
|
import {
|
|
43
43
|
getMachineId
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-IAEXPTXA.js";
|
|
45
45
|
import {
|
|
46
46
|
withRetry
|
|
47
47
|
} from "./chunk-EYRGBYZG.js";
|
|
48
48
|
import {
|
|
49
49
|
reportedInstallSource
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-X7YWD6IS.js";
|
|
51
51
|
import {
|
|
52
52
|
getApiKey,
|
|
53
53
|
getBaseUrl
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
pendingCommandEvents,
|
|
64
64
|
resolveAutoResolveOrigin,
|
|
65
65
|
resolvePolicy
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-6FAHPGCZ.js";
|
|
67
67
|
|
|
68
68
|
// src/policy.ts
|
|
69
69
|
import { createHash } from "crypto";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
detectClaudeVersion
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-G4TL4YWH.js";
|
|
4
4
|
import {
|
|
5
5
|
addClaudeMcpServer,
|
|
6
6
|
addPusharyHooks,
|
|
7
7
|
addPusharyToolPermissions
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-76XICHYT.js";
|
|
9
9
|
import {
|
|
10
10
|
claudeWired,
|
|
11
11
|
codexWired,
|
|
12
12
|
geminiWired
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-CH6DTGQR.js";
|
|
14
14
|
import {
|
|
15
15
|
CLAUDE_HOOK_EVENTS,
|
|
16
16
|
GEMINI_HOOK_BINARY,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
needsReregistration,
|
|
22
22
|
registrationSignatures,
|
|
23
23
|
supportedClaudeEvents
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-7LUFYRH4.js";
|
|
25
25
|
import {
|
|
26
26
|
guardBinary
|
|
27
27
|
} from "./chunk-EZIEXHYM.js";
|
|
@@ -40,14 +40,14 @@ import {
|
|
|
40
40
|
codexHooksJson,
|
|
41
41
|
hasCodexHooks,
|
|
42
42
|
vscodePluginMcp
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-WB2C7VPF.js";
|
|
44
44
|
import {
|
|
45
45
|
readJsonSafe,
|
|
46
46
|
writeJsonAtomic
|
|
47
47
|
} from "./chunk-4LL6LG5X.js";
|
|
48
48
|
import {
|
|
49
49
|
HOOK_LOCATOR_BINARY
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-6FAHPGCZ.js";
|
|
51
51
|
|
|
52
52
|
// src/reapply.ts
|
|
53
53
|
import { join } from "path";
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
canOpenBrowser,
|
|
3
|
+
openInBrowser
|
|
4
|
+
} from "./chunk-PUZZELE6.js";
|
|
1
5
|
import {
|
|
2
6
|
generateKeypair,
|
|
3
7
|
openSealedKey,
|
|
@@ -10,39 +14,6 @@ import {
|
|
|
10
14
|
// src/cli/login-ui.ts
|
|
11
15
|
import { hostname } from "os";
|
|
12
16
|
|
|
13
|
-
// src/cli/browser.ts
|
|
14
|
-
import { spawn } from "child_process";
|
|
15
|
-
var command = () => {
|
|
16
|
-
if (process.platform === "darwin") return { bin: "open", args: [] };
|
|
17
|
-
if (process.platform === "win32") return { bin: "cmd", args: ["/c", "start", ""] };
|
|
18
|
-
if (process.platform === "linux") return { bin: "xdg-open", args: [] };
|
|
19
|
-
return null;
|
|
20
|
-
};
|
|
21
|
-
var canOpenBrowser = () => {
|
|
22
|
-
if (process.env.PUSHARY_NO_BROWSER === "1") return false;
|
|
23
|
-
if (process.env.CI) return false;
|
|
24
|
-
if (process.env.SSH_TTY) return false;
|
|
25
|
-
if (process.platform === "linux" && !process.env.DISPLAY && !process.env.WAYLAND_DISPLAY) return false;
|
|
26
|
-
return command() !== null;
|
|
27
|
-
};
|
|
28
|
-
var openInBrowser = (url) => {
|
|
29
|
-
const resolved = command();
|
|
30
|
-
if (!resolved) return false;
|
|
31
|
-
try {
|
|
32
|
-
const child = spawn(resolved.bin, [...resolved.args, url], {
|
|
33
|
-
stdio: "ignore",
|
|
34
|
-
detached: true,
|
|
35
|
-
windowsHide: true
|
|
36
|
-
});
|
|
37
|
-
child.unref();
|
|
38
|
-
child.on("error", () => {
|
|
39
|
-
});
|
|
40
|
-
return true;
|
|
41
|
-
} catch {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
|
|
46
17
|
// src/cli/login.ts
|
|
47
18
|
var START_PATH = "/api/cli/auth/start";
|
|
48
19
|
var CLAIM_PATH = "/api/cli/auth/claim";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
isValidApiKey,
|
|
15
15
|
normalizeKeyScope
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-6FAHPGCZ.js";
|
|
17
17
|
|
|
18
18
|
// src/session.ts
|
|
19
19
|
var samePusharyAccount = (left, right) => left.kind === "ok" && right.kind === "ok" && left.identity.workspaceId !== "" && left.identity.workspaceId === right.identity.workspaceId && left.identity.siteId === right.identity.siteId;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// src/cli/browser.ts
|
|
2
|
+
import { spawn } from "child_process";
|
|
3
|
+
var command = () => {
|
|
4
|
+
if (process.platform === "darwin") return { bin: "open", args: [] };
|
|
5
|
+
if (process.platform === "win32") return { bin: "cmd", args: ["/c", "start", ""] };
|
|
6
|
+
if (process.platform === "linux") return { bin: "xdg-open", args: [] };
|
|
7
|
+
return null;
|
|
8
|
+
};
|
|
9
|
+
var canOpenBrowser = () => {
|
|
10
|
+
if (process.env.PUSHARY_NO_BROWSER === "1") return false;
|
|
11
|
+
if (process.env.CI) return false;
|
|
12
|
+
if (process.env.SSH_TTY) return false;
|
|
13
|
+
if (process.platform === "linux" && !process.env.DISPLAY && !process.env.WAYLAND_DISPLAY) return false;
|
|
14
|
+
return command() !== null;
|
|
15
|
+
};
|
|
16
|
+
var openInBrowser = (url) => {
|
|
17
|
+
const resolved = command();
|
|
18
|
+
if (!resolved) return false;
|
|
19
|
+
try {
|
|
20
|
+
const child = spawn(resolved.bin, [...resolved.args, url], {
|
|
21
|
+
stdio: "ignore",
|
|
22
|
+
detached: true,
|
|
23
|
+
windowsHide: true
|
|
24
|
+
});
|
|
25
|
+
child.unref();
|
|
26
|
+
child.on("error", () => {
|
|
27
|
+
});
|
|
28
|
+
return true;
|
|
29
|
+
} catch {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
canOpenBrowser,
|
|
36
|
+
openInBrowser
|
|
37
|
+
};
|